mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-22 05:20:05 +00:00
Fix a few compiler warnings and formatting for DB startup message (#272)
Note that the warning in TableData.cpp only seems to occur on clang (deprecated-declarations) Database account/player count message: Before: [INFO] Database in operation : Found 1 account(s) and 2 player(s)s After: [INFO] Database in operation: Found 1 account and 2 players
This commit is contained in:
parent
aeac57ebf7
commit
fa8c1e73d1
@ -610,7 +610,7 @@ static void loadDrops(json& dropData) {
|
|||||||
|
|
||||||
if (rankScores.size() != 5 || rankScores.size() != rankRewards.size()) {
|
if (rankScores.size() != 5 || rankScores.size() != rankRewards.size()) {
|
||||||
char buff[255];
|
char buff[255];
|
||||||
sprintf(buff, "Race in EP %d doesn't have exactly 5 score/reward pairs", raceEPID);
|
snprintf(buff, 255, "Race in EP %d doesn't have exactly 5 score/reward pairs", raceEPID);
|
||||||
throw TableException(std::string(buff));
|
throw TableException(std::string(buff));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -267,17 +267,17 @@ void Database::open() {
|
|||||||
checkMetaTable();
|
checkMetaTable();
|
||||||
createTables();
|
createTables();
|
||||||
|
|
||||||
std::cout << "[INFO] Database in operation ";
|
std::cout << "[INFO] Database in operation";
|
||||||
int accounts = getTableSize("Accounts");
|
int accounts = getTableSize("Accounts");
|
||||||
int players = getTableSize("Players");
|
int players = getTableSize("Players");
|
||||||
std::string message = "";
|
std::string message = "";
|
||||||
if (accounts > 0) {
|
if (accounts > 0) {
|
||||||
message += ": Found " + std::to_string(accounts) + " account(s)";
|
message += ": Found " + std::to_string(accounts) + " account";
|
||||||
if (accounts > 1)
|
if (accounts > 1)
|
||||||
message += "s";
|
message += "s";
|
||||||
}
|
}
|
||||||
if (players > 0) {
|
if (players > 0) {
|
||||||
message += " and " + std::to_string(players) + " player(s)";
|
message += " and " + std::to_string(players) + " player";
|
||||||
if (players > 1)
|
if (players > 1)
|
||||||
message += "s";
|
message += "s";
|
||||||
}
|
}
|
||||||
|
8
vendor/bcrypt/bcrypt.c
vendored
8
vendor/bcrypt/bcrypt.c
vendored
@ -22,9 +22,13 @@
|
|||||||
#endif
|
#endif
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#ifdef _WIN32 || _WIN64
|
#if defined(_WIN32) || defined(_WIN64)
|
||||||
// On windows we need to generate random bytes differently.
|
// On windows we need to generate random bytes differently.
|
||||||
|
#if defined(_WIN32) && !defined(_WIN64)
|
||||||
|
typedef __int32 ssize_t;
|
||||||
|
#elif defined(_WIN32) && defined(_WIN64)
|
||||||
typedef __int64 ssize_t;
|
typedef __int64 ssize_t;
|
||||||
|
#endif
|
||||||
#define BCRYPT_HASHSIZE 60
|
#define BCRYPT_HASHSIZE 60
|
||||||
|
|
||||||
#include "bcrypt.h"
|
#include "bcrypt.h"
|
||||||
@ -117,7 +121,7 @@ int bcrypt_gensalt(int factor, char salt[BCRYPT_HASHSIZE])
|
|||||||
char *aux;
|
char *aux;
|
||||||
|
|
||||||
// Note: Windows does not have /dev/urandom sadly.
|
// Note: Windows does not have /dev/urandom sadly.
|
||||||
#ifdef _WIN32 || _WIN64
|
#if defined(_WIN32) || defined(_WIN64)
|
||||||
HCRYPTPROV p;
|
HCRYPTPROV p;
|
||||||
ULONG i;
|
ULONG i;
|
||||||
|
|
||||||
|
2
vendor/bcrypt/crypt_blowfish.c
vendored
2
vendor/bcrypt/crypt_blowfish.c
vendored
@ -51,7 +51,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Just to make sure the prototypes match the actual definitions */
|
/* Just to make sure the prototypes match the actual definitions */
|
||||||
#ifdef _WIN32 || _WIN64
|
#if defined(_WIN32) || defined(_WIN64)
|
||||||
#include "crypt_blowfish.h"
|
#include "crypt_blowfish.h"
|
||||||
#else
|
#else
|
||||||
#include "crypt_blowfish.h"
|
#include "crypt_blowfish.h"
|
||||||
|
4
vendor/bcrypt/wrapper.c
vendored
4
vendor/bcrypt/wrapper.c
vendored
@ -41,7 +41,7 @@
|
|||||||
#define __SKIP_GNU
|
#define __SKIP_GNU
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _WIN32 | _WIN64
|
#if defined(_WIN32) || defined(_WIN64)
|
||||||
#include "ow-crypt.h"
|
#include "ow-crypt.h"
|
||||||
|
|
||||||
#include "crypt_blowfish.h"
|
#include "crypt_blowfish.h"
|
||||||
@ -251,7 +251,7 @@ char *__crypt_gensalt_ra(const char *prefix, unsigned long count,
|
|||||||
input, size, output, sizeof(output));
|
input, size, output, sizeof(output));
|
||||||
|
|
||||||
if (retval) {
|
if (retval) {
|
||||||
#ifdef _WIN32 | _WIN64
|
#if defined(_WIN32) || defined(_WIN64)
|
||||||
retval = _strdup(retval);
|
retval = _strdup(retval);
|
||||||
#else
|
#else
|
||||||
retval = strdup(retval);
|
retval = strdup(retval);
|
||||||
|
Loading…
Reference in New Issue
Block a user