* Various VC6-related fixes and tweaks. [Ai4rei]

- Fixed a typo in VC6 project files, that prevented login-server from compiling (bugreport:4061, since r12727).
- Fixed usage of 'long long' in Sql_P_BindSqlDataType preventing SQL VC6 projects from compiling (bugreport:1741, since r10779).
- Fixed usage of 'long long' in strtoull preventing VC6 projects from compiling (bugreport:4059, follow up to r14245).
- Made strtoull default to base 10 and actually process base 8, to match the normal behavior of this function (bugreport:4059, follow up to r14245).
- Fixed functions in db.c not being returned as pointer, causing warnings on VC6.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14466 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
ai4rei 2010-11-19 21:25:30 +00:00
parent f3217a0ad7
commit 68fda95c60
7 changed files with 35 additions and 23 deletions

View File

@ -1,5 +1,12 @@
Date Added Date Added
2010/11/19
* Various VC6-related fixes and tweaks. [Ai4rei]
- Fixed a typo in VC6 project files, that prevented login-server from compiling (bugreport:4061, since r12727).
- Fixed usage of 'long long' in Sql_P_BindSqlDataType preventing SQL VC6 projects from compiling (bugreport:1741, since r10779).
- Fixed usage of 'long long' in strtoull preventing VC6 projects from compiling (bugreport:4059, follow up to r14245).
- Made strtoull default to base 10 and actually process base 8, to match the normal behavior of this function (bugreport:4059, follow up to r14245).
- Fixed functions in db.c not being returned as pointer, causing warnings on VC6.
2010/11/16 2010/11/16
* Added a missing argument to a warning containing a format specifier. [Paradox924X] * Added a missing argument to a warning containing a format specifier. [Paradox924X]
2010/11/15 2010/11/15

View File

@ -2229,10 +2229,10 @@ DBComparator db_default_cmp(DBType type)
{ {
DB_COUNTSTAT(db_default_cmp); DB_COUNTSTAT(db_default_cmp);
switch (type) { switch (type) {
case DB_INT: return db_int_cmp; case DB_INT: return &db_int_cmp;
case DB_UINT: return db_uint_cmp; case DB_UINT: return &db_uint_cmp;
case DB_STRING: return db_string_cmp; case DB_STRING: return &db_string_cmp;
case DB_ISTRING: return db_istring_cmp; case DB_ISTRING: return &db_istring_cmp;
default: default:
ShowError("db_default_cmp: Unknown database type %u\n", type); ShowError("db_default_cmp: Unknown database type %u\n", type);
return NULL; return NULL;
@ -2253,10 +2253,10 @@ DBHasher db_default_hash(DBType type)
{ {
DB_COUNTSTAT(db_default_hash); DB_COUNTSTAT(db_default_hash);
switch (type) { switch (type) {
case DB_INT: return db_int_hash; case DB_INT: return &db_int_hash;
case DB_UINT: return db_uint_hash; case DB_UINT: return &db_uint_hash;
case DB_STRING: return db_string_hash; case DB_STRING: return &db_string_hash;
case DB_ISTRING: return db_istring_hash; case DB_ISTRING: return &db_istring_hash;
default: default:
ShowError("db_default_hash: Unknown database type %u\n", type); ShowError("db_default_hash: Unknown database type %u\n", type);
return NULL; return NULL;
@ -2284,12 +2284,12 @@ DBReleaser db_default_release(DBType type, DBOptions options)
options = db_fix_options(type, options); options = db_fix_options(type, options);
if (options&DB_OPT_RELEASE_DATA) { // Release data, what about the key? if (options&DB_OPT_RELEASE_DATA) { // Release data, what about the key?
if (options&(DB_OPT_DUP_KEY|DB_OPT_RELEASE_KEY)) if (options&(DB_OPT_DUP_KEY|DB_OPT_RELEASE_KEY))
return db_release_both; // Release both key and data return &db_release_both; // Release both key and data
return db_release_data; // Only release data return &db_release_data; // Only release data
} }
if (options&(DB_OPT_DUP_KEY|DB_OPT_RELEASE_KEY)) if (options&(DB_OPT_DUP_KEY|DB_OPT_RELEASE_KEY))
return db_release_key; // Only release key return &db_release_key; // Only release key
return db_release_nothing; // Release nothing return &db_release_nothing; // Release nothing
} }
/** /**
@ -2307,10 +2307,10 @@ DBReleaser db_custom_release(DBRelease which)
{ {
DB_COUNTSTAT(db_custom_release); DB_COUNTSTAT(db_custom_release);
switch (which) { switch (which) {
case DB_RELEASE_NOTHING: return db_release_nothing; case DB_RELEASE_NOTHING: return &db_release_nothing;
case DB_RELEASE_KEY: return db_release_key; case DB_RELEASE_KEY: return &db_release_key;
case DB_RELEASE_DATA: return db_release_data; case DB_RELEASE_DATA: return &db_release_data;
case DB_RELEASE_BOTH: return db_release_both; case DB_RELEASE_BOTH: return &db_release_both;
default: default:
ShowError("db_custom_release: Unknown release options %u\n", which); ShowError("db_custom_release: Unknown release options %u\n", which);
return NULL; return NULL;

View File

@ -489,8 +489,8 @@ static int Sql_P_BindSqlDataType(MYSQL_BIND* bind, enum SqlDataType buffer_type,
buffer_len = sizeof(long); buffer_len = sizeof(long);
break; break;
case SQLDT_ULONGLONG: bind->is_unsigned = 1; case SQLDT_ULONGLONG: bind->is_unsigned = 1;
case SQLDT_LONGLONG: bind->buffer_type = Sql_P_SizeToMysqlIntType(sizeof(long long)); case SQLDT_LONGLONG: bind->buffer_type = Sql_P_SizeToMysqlIntType(sizeof(int64));
buffer_len = sizeof(long long); buffer_len = sizeof(int64);
break; break;
// floating point // floating point
case SQLDT_FLOAT: bind->buffer_type = MYSQL_TYPE_FLOAT; case SQLDT_FLOAT: bind->buffer_type = MYSQL_TYPE_FLOAT;

View File

@ -253,9 +253,9 @@ size_t strnlen (const char* string, size_t maxlen)
#endif #endif
#if defined(WIN32) && defined(_MSC_VER) && _MSC_VER <= 1200 #if defined(WIN32) && defined(_MSC_VER) && _MSC_VER <= 1200
unsigned long long strtoull(const char* str, char** endptr, int base) uint64 strtoull(const char* str, char** endptr, int base)
{ {
unsigned long long result; uint64 result;
int count; int count;
int n; int n;
@ -266,8 +266,13 @@ unsigned long long strtoull(const char* str, char** endptr, int base)
else else
if( str[0] == '0' ) if( str[0] == '0' )
base = 8; base = 8;
else
base = 10;
} }
if( base == 8 )
count = sscanf(str, "%I64o%n", &result, &n);
else
if( base == 10 ) if( base == 10 )
count = sscanf(str, "%I64u%n", &result, &n); count = sscanf(str, "%I64u%n", &result, &n);
else else

View File

@ -29,7 +29,7 @@ size_t strnlen (const char* string, size_t maxlen);
#endif #endif
#if defined(WIN32) && defined(_MSC_VER) && _MSC_VER <= 1200 #if defined(WIN32) && defined(_MSC_VER) && _MSC_VER <= 1200
unsigned long long strtoull(const char* str, char** endptr, int base); uint64 strtoull(const char* str, char** endptr, int base);
#endif #endif
int e_mail_check(char* email); int e_mail_check(char* email);

View File

@ -231,7 +231,7 @@ SOURCE=..\src\login\loginlog.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\login\loginlog_sql.h SOURCE=..\src\login\loginlog_sql.c
# End Source File # End Source File
# End Group # End Group
# End Target # End Target

View File

@ -219,7 +219,7 @@ SOURCE=..\src\login\loginlog.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\login\loginlog_txt.h SOURCE=..\src\login\loginlog_txt.c
# End Source File # End Source File
# End Group # End Group
# End Target # End Target