large number of my_ulong_long explicit conversions

This commit is contained in:
Arthur Dene Ice 2014-05-11 00:28:49 -07:00
parent bf354fb5ec
commit 26d531f704
8 changed files with 22 additions and 22 deletions

View File

@ -462,7 +462,7 @@ bool Database::DeleteCharacter(char *name)
safe_delete_array(query);
query = nullptr;
}
matches = mysql_num_rows(result);
matches = (int)mysql_num_rows(result);
if(matches == 1)
{
row = mysql_fetch_row(result);
@ -1019,7 +1019,7 @@ bool Database::LoadVariables_result(MYSQL_RES* result) {
LockMutex lock(&Mvarcache);
if (mysql_num_rows(result) > 0) {
if (!varcache_array) {
varcache_max = mysql_num_rows(result);
varcache_max = (uint32)mysql_num_rows(result);
varcache_array = new VarCache_Struct*[varcache_max];
for (i=0; i<varcache_max; i++)
varcache_array[i] = 0;

View File

@ -109,7 +109,7 @@ bool DBcore::RunQuery(const char* query, uint32 querylen, char* errbuf, MYSQL_RE
else if (result)
*result = 0;
if (affected_rows)
*affected_rows = mysql_affected_rows(&mysql);
*affected_rows = (uint32)mysql_affected_rows(&mysql);
if (last_insert_id)
*last_insert_id = mysql_insert_id(&mysql);
if (result) {

View File

@ -151,7 +151,7 @@ bool PersistentTimer::Load(Database *db) {
safe_delete_array(query);
bool res = false;
qcount = mysql_num_rows(result);
qcount = (uint32)mysql_num_rows(result);
if(qcount == 1 && (row = mysql_fetch_row(result)) ) {
start_time = strtoul(row[0], nullptr, 10);
timer_time = strtoul(row[1], nullptr, 10);
@ -337,7 +337,7 @@ bool PTimerList::Load(Database *db) {
bool enabled;
PersistentTimer *cur;
qcount = mysql_num_rows(result);
qcount = (uint32)mysql_num_rows(result);
while((row = mysql_fetch_row(result)) ) {
type = atoi(row[0]);
start_time = strtoul(row[1], nullptr, 10);

View File

@ -2584,7 +2584,7 @@ DBnpcspells_Struct* ZoneDatabase::GetNPCSpells(uint32 iDBSpellsID) {
npc_spells_cache[iDBSpellsID]->parent_list = tmpparent_list;
npc_spells_cache[iDBSpellsID]->attack_proc = tmpattack_proc;
npc_spells_cache[iDBSpellsID]->proc_chance = tmpproc_chance;
npc_spells_cache[iDBSpellsID]->numentries = mysql_num_rows(result);
npc_spells_cache[iDBSpellsID]->numentries = (uint32)mysql_num_rows(result);
int j = 0;
while ((row = mysql_fetch_row(result))) {
int spell_id = atoi(row[0]);
@ -2698,7 +2698,7 @@ DBnpcspellseffects_Struct* ZoneDatabase::GetNPCSpellsEffects(uint32 iDBSpellsEff
npc_spellseffects_cache[iDBSpellsEffectsID] = (DBnpcspellseffects_Struct*) new uchar[tmpSize];
memset(npc_spellseffects_cache[iDBSpellsEffectsID], 0, tmpSize);
npc_spellseffects_cache[iDBSpellsEffectsID]->parent_list = tmpparent_list;
npc_spellseffects_cache[iDBSpellsEffectsID]->numentries = mysql_num_rows(result);
npc_spellseffects_cache[iDBSpellsEffectsID]->numentries = (uint32)mysql_num_rows(result);
int j = 0;
while ((row = mysql_fetch_row(result))) {
int spell_effect_id = atoi(row[0]);

View File

@ -3316,7 +3316,7 @@ bool TaskGoalListManager::LoadLists() {
if(database.RunQuery(query,MakeAnyLenString(&query,CountQuery),errbuf,&result)) {
NumberOfLists = mysql_num_rows(result);
NumberOfLists = (int)mysql_num_rows(result);
_log(TASKS__GLOBALLOAD, "Database returned a count of %i lists", NumberOfLists);
TaskGoalLists = new TaskGoalList_Struct[NumberOfLists];
@ -3354,7 +3354,7 @@ bool TaskGoalListManager::LoadLists() {
// at the start of this method and getting to here. It should not be possible for
// an INSERT to cause a problem, as the SELECT is used with a LIMIT
if(mysql_num_rows(result) < Size)
TaskGoalLists[ListIndex].Size = mysql_num_rows(result);
TaskGoalLists[ListIndex].Size = (int)mysql_num_rows(result);
int EntryIndex = 0;

View File

@ -444,7 +444,7 @@ void Object::HandleAutoCombine(Client* user, const RecipeAutoCombine_Struct* rac
}
safe_delete_array(query);
qcount = mysql_num_rows(result);
qcount = (uint8)mysql_num_rows(result);
if(qcount < 1) {
LogFile->write(EQEMuLog::Error, "Error in HandleAutoCombine: no components returned");
user->QueuePacket(outapp);
@ -664,7 +664,7 @@ void Client::TradeskillSearchResults(const char *query, unsigned long qlen, unsi
uint8 qcount = 0;
qcount = mysql_num_rows(result);
qcount = (uint8)mysql_num_rows(result);
if(qcount < 1) {
//search gave no results... not an error
return;
@ -734,7 +734,7 @@ void Client::SendTradeskillDetails(uint32 recipe_id) {
}
safe_delete_array(query);
qcount = mysql_num_rows(result);
qcount = (uint8)mysql_num_rows(result);
if(qcount < 1) {
LogFile->write(EQEMuLog::Error, "Error in SendTradeskillDetails: no components returned");
return;
@ -1237,7 +1237,7 @@ bool ZoneDatabase::GetTradeRecipe(const ItemInst* container, uint8 c_type, uint3
}
safe_delete_array(query);
qcount = mysql_num_rows(result);
qcount = (uint32)mysql_num_rows(result);
if(qcount > 1) {
//multiple recipes, partial match... do an extra query to get it exact.
//this happens when combining components for a smaller recipe
@ -1275,7 +1275,7 @@ bool ZoneDatabase::GetTradeRecipe(const ItemInst* container, uint8 c_type, uint3
}
safe_delete_array(query);
qcount = mysql_num_rows(result);
qcount = (uint32)mysql_num_rows(result);
}
if(qcount < 1)
@ -1399,7 +1399,7 @@ bool ZoneDatabase::GetTradeRecipe(uint32 recipe_id, uint8 c_type, uint32 some_id
}
safe_delete_array(query);
qcount = mysql_num_rows(result);
qcount = (uint32)mysql_num_rows(result);
if(qcount != 1) {
//just not found i guess..
return(false);
@ -1435,7 +1435,7 @@ bool ZoneDatabase::GetTradeRecipe(uint32 recipe_id, uint8 c_type, uint32 some_id
}
safe_delete_array(query);
qcount = mysql_num_rows(result);
qcount = (uint32)mysql_num_rows(result);
if(qcount < 1) {
LogFile->write(EQEMuLog::Error, "Error in GetTradeRecept success: no success items returned");
return(false);
@ -1457,7 +1457,7 @@ bool ZoneDatabase::GetTradeRecipe(uint32 recipe_id, uint8 c_type, uint32 some_id
spec->onfail.clear();
if (RunQuery(query, qlen, errbuf, &result)) {
qcount = mysql_num_rows(result);
qcount = (uint32)mysql_num_rows(result);
uint8 r;
for(r = 0; r < qcount; r++) {
row = mysql_fetch_row(result);
@ -1474,7 +1474,7 @@ bool ZoneDatabase::GetTradeRecipe(uint32 recipe_id, uint8 c_type, uint32 some_id
spec->salvage.clear();
// Don't bother with the query if TS is nofail
if (!spec->nofail && RunQuery(query, qlen, errbuf, &result)) {
qcount = mysql_num_rows(result);
qcount = (uint32)mysql_num_rows(result);
uint8 r;
for(r = 0; r < qcount; r++) {
row = mysql_fetch_row(result);
@ -1528,7 +1528,7 @@ void Client::LearnRecipe(uint32 recipeID)
return;
}
qcount = mysql_num_rows(result);
qcount = (uint32)mysql_num_rows(result);
if (qcount != 1) {
LogFile->write(EQEMuLog::Normal, "Client::LearnRecipe - RecipeID: %d had %d occurences.", recipeID, qcount);
mysql_free_result(result);

View File

@ -1588,7 +1588,7 @@ void Client::SendBazaarResults(uint32 TraderID, uint32 Class_, uint32 Race, uint
mysql_free_result(Result);
return;
}
Size = mysql_num_rows(Result) * sizeof(BazaarSearchResults_Struct);
Size = (int)(mysql_num_rows(Result) * sizeof(BazaarSearchResults_Struct));
uchar *buffer = new uchar[Size];
uchar *bufptr = buffer;
memset(buffer, 0, Size);

View File

@ -1132,7 +1132,7 @@ void ZoneDatabase::AssignGrid(Client *client, float x, float y, uint32 grid)
// how much it's allowed to be off by
#define _GASSIGN_TOLERANCE 1.0
if(!(matches = mysql_num_rows(result))) // try a fuzzy match if that didn't find it
if(!(matches = (int)mysql_num_rows(result))) // try a fuzzy match if that didn't find it
{
mysql_free_result(result);
if(!RunQuery(
@ -1152,7 +1152,7 @@ void ZoneDatabase::AssignGrid(Client *client, float x, float y, uint32 grid)
}
safe_delete_array(query);
fuzzy = 1;
if(!(matches = mysql_num_rows(result)))
if(!(matches = (int)mysql_num_rows(result)))
mysql_free_result(result);
}
if(matches)