add werror flags when making a debug build using llvm (#4344)
* add werror flags when making a debug build using llvm this would get bugs like https://github.com/Cockatrice/Cockatrice/pull/4337 get signalled earlier to us * fix error: 'Servatrice_DatabaseInterface::registerUser' hides overloaded virtual function * remove unused field * mac machines have 3 cores see https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources * typo
This commit is contained in:
parent
b858e36183
commit
da9222929b
6 changed files with 9 additions and 7 deletions
2
.github/workflows/ci-builds.yml
vendored
2
.github/workflows/ci-builds.yml
vendored
|
@ -271,6 +271,8 @@ jobs:
|
||||||
|
|
||||||
- name: Build on Xcode ${{matrix.xcode}}
|
- name: Build on Xcode ${{matrix.xcode}}
|
||||||
shell: bash
|
shell: bash
|
||||||
|
env:
|
||||||
|
CMAKE_BUILD_PARALLEL_LEVEL: 3 # mac machines actually have 3 cores
|
||||||
run: .ci/compile.sh ${{matrix.type}} --server
|
run: .ci/compile.sh ${{matrix.type}} --server
|
||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
|
|
|
@ -134,7 +134,11 @@ ELSEIF (CMAKE_COMPILER_IS_GNUCXX)
|
||||||
ELSE()
|
ELSE()
|
||||||
# other: osx/llvm, bsd/llvm
|
# other: osx/llvm, bsd/llvm
|
||||||
set(CMAKE_CXX_FLAGS_RELEASE "-O2")
|
set(CMAKE_CXX_FLAGS_RELEASE "-O2")
|
||||||
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0")
|
if(WARNING_AS_ERROR)
|
||||||
|
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -Wall -Wextra -Werror")
|
||||||
|
else()
|
||||||
|
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -Wall -Wextra")
|
||||||
|
endif()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
# GNU systems need to define the Mersenne exponent for the RNG to compile w/o warning
|
# GNU systems need to define the Mersenne exponent for the RNG to compile w/o warning
|
||||||
|
|
|
@ -17,7 +17,6 @@ private:
|
||||||
QString password;
|
QString password;
|
||||||
bool savePassword;
|
bool savePassword;
|
||||||
QString site;
|
QString site;
|
||||||
bool isCustom;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
UserConnection_Information();
|
UserConnection_Information();
|
||||||
|
|
|
@ -201,14 +201,13 @@ bool Servatrice_DatabaseInterface::registerUser(const QString &userName,
|
||||||
const QString &password,
|
const QString &password,
|
||||||
const QString &emailAddress,
|
const QString &emailAddress,
|
||||||
const QString &country,
|
const QString &country,
|
||||||
QString &token,
|
|
||||||
bool active)
|
bool active)
|
||||||
{
|
{
|
||||||
if (!checkSql())
|
if (!checkSql())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
QString passwordSha512 = PasswordHasher::computeHash(password, PasswordHasher::generateRandomSalt());
|
QString passwordSha512 = PasswordHasher::computeHash(password, PasswordHasher::generateRandomSalt());
|
||||||
token = active ? QString() : PasswordHasher::generateActivationToken();
|
QString token = active ? QString() : PasswordHasher::generateActivationToken();
|
||||||
|
|
||||||
QSqlQuery *query =
|
QSqlQuery *query =
|
||||||
prepareQuery("insert into {prefix}_users "
|
prepareQuery("insert into {prefix}_users "
|
||||||
|
|
|
@ -99,7 +99,6 @@ public:
|
||||||
const QString &password,
|
const QString &password,
|
||||||
const QString &emailAddress,
|
const QString &emailAddress,
|
||||||
const QString &country,
|
const QString &country,
|
||||||
QString &token,
|
|
||||||
bool active = false);
|
bool active = false);
|
||||||
bool activateUser(const QString &userName, const QString &token);
|
bool activateUser(const QString &userName, const QString &token);
|
||||||
void updateUsersClientID(const QString &userName, const QString &userClientID);
|
void updateUsersClientID(const QString &userName, const QString &userClientID);
|
||||||
|
|
|
@ -1099,9 +1099,8 @@ Response::ResponseCode AbstractServerSocketInterface::cmdRegisterAccount(const C
|
||||||
return Response::RespPasswordTooShort;
|
return Response::RespPasswordTooShort;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString token;
|
|
||||||
bool requireEmailActivation = settingsCache->value("registration/requireemailactivation", true).toBool();
|
bool requireEmailActivation = settingsCache->value("registration/requireemailactivation", true).toBool();
|
||||||
bool regSucceeded = sqlInterface->registerUser(userName, realName, gender, password, emailAddress, country, token,
|
bool regSucceeded = sqlInterface->registerUser(userName, realName, gender, password, emailAddress, country,
|
||||||
!requireEmailActivation);
|
!requireEmailActivation);
|
||||||
|
|
||||||
if (regSucceeded) {
|
if (regSucceeded) {
|
||||||
|
|
Loading…
Reference in a new issue