diff --git a/common/database.cpp b/common/database.cpp index 4e785d3bf..28ee7ba5b 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -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; iparent_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]); diff --git a/zone/tasks.cpp b/zone/tasks.cpp index 4ba3c2ce0..025b37cfc 100644 --- a/zone/tasks.cpp +++ b/zone/tasks.cpp @@ -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; diff --git a/zone/tradeskills.cpp b/zone/tradeskills.cpp index e72bd147b..aa793c4ce 100644 --- a/zone/tradeskills.cpp +++ b/zone/tradeskills.cpp @@ -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); diff --git a/zone/trading.cpp b/zone/trading.cpp index f6b800fe2..5be04335d 100644 --- a/zone/trading.cpp +++ b/zone/trading.cpp @@ -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); diff --git a/zone/waypoints.cpp b/zone/waypoints.cpp index d6acff6e5..d64d43a0b 100644 --- a/zone/waypoints.cpp +++ b/zone/waypoints.cpp @@ -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)