More warning clean ups (NULL to 0 on int, sprintf flags, typedef on enum)

This commit is contained in:
Arthur Ice 2013-03-03 21:45:46 -08:00
parent 950f00fae6
commit 0c6eee6d81
4 changed files with 912 additions and 912 deletions

View File

@ -3836,7 +3836,7 @@ void Bot::AI_Process() {
if(instweapon)
weapon = instweapon->GetItem();
int weapontype = NULL;
int weapontype = 0; // No weapon type.
bool bIsFist = true;
if(weapon) {
@ -17359,8 +17359,8 @@ bool Bot::RemoveHealRotationTarget( int index ) {
}
void Bot::ClearHealRotationMembers() {
_healRotationMemberPrev = NULL;
_healRotationMemberNext = NULL;
_healRotationMemberPrev = 0; // No previous member
_healRotationMemberNext = 0; // No next member
}
void Bot::ClearHealRotationTargets() {

View File

@ -32,7 +32,7 @@ const int MaxSpellTypes = 16;
const int MaxHealRotationMembers = 6;
const int MaxHealRotationTargets = 3;
typedef enum BotStanceType {
enum BotStanceType {
BotStancePassive,
BotStanceBalanced,
BotStanceEfficient,
@ -42,7 +42,7 @@ typedef enum BotStanceType {
BotStanceBurnAE
};
typedef enum SpellTypeIndex {
enum SpellTypeIndex {
SpellType_NukeIndex,
SpellType_HealIndex,
SpellType_RootIndex,
@ -64,7 +64,7 @@ typedef enum SpellTypeIndex {
class Bot : public NPC {
public:
// Class enums
typedef enum BotfocusType { //focus types
enum BotfocusType { //focus types
BotfocusSpellHaste = 1,
BotfocusSpellDuration,
BotfocusRange,
@ -97,18 +97,18 @@ public:
BotfocusAdditionalHeal,
};
typedef enum BotTradeType { // types of trades a bot can do
enum BotTradeType { // types of trades a bot can do
BotTradeClientNormal,
BotTradeClientNoDropNoTrade
};
typedef enum BotRoleType {
enum BotRoleType {
BotRoleMainAssist,
BotRoleGroupHealer,
BotRoleRaidHealer
};
typedef enum EqExpansions {
enum EqExpansions {
ExpansionNone,
ExpansionEQ,
ExpansionRoK,
@ -237,7 +237,7 @@ public:
bool RemoveHealRotationTarget( Mob* target );
bool RemoveHealRotationTarget( int index);
void NotifyNextHealRotationMember( bool notifyNow = false );
void ClearHealRotationLeader() { _healRotationLeader = NULL; }
void ClearHealRotationLeader() { _healRotationLeader = 0; }
void ClearHealRotationMembers();
void ClearHealRotationTargets();
inline virtual int16 GetMaxStat();

View File

@ -3850,7 +3850,7 @@ void Client::Handle_OP_LDoNInspect(const EQApplicationPacket *app)
void Client::Handle_OP_Dye(const EQApplicationPacket *app)
{
if(app->size!=sizeof(DyeStruct))
printf("Wrong size of DyeStruct, Got: %i, Expected: %i\n",app->size,sizeof(DyeStruct));
printf("Wrong size of DyeStruct, Got: %i, Expected: %lu\n",app->size,sizeof(DyeStruct));
else{
DyeStruct* dye = (DyeStruct*)app->pBuffer;
DyeArmor(dye);
@ -3921,7 +3921,7 @@ void Client::Handle_OP_GuildPublicNote(const EQApplicationPacket *app)
if (app->size < sizeof(GuildUpdate_PublicNote)) {
// client calls for a motd on login even if they arent in a guild
printf("Error: app size of %i < size of OP_GuildPublicNote of %i\n",app->size,sizeof(GuildUpdate_PublicNote));
printf("Error: app size of %i < size of OP_GuildPublicNote of %lu\n",app->size,sizeof(GuildUpdate_PublicNote));
return;
}
GuildUpdate_PublicNote* gpn=(GuildUpdate_PublicNote*)app->pBuffer;
@ -3979,7 +3979,7 @@ void Client::Handle_OP_SetGuildMOTD(const EQApplicationPacket *app)
if (app->size != sizeof(GuildMOTD_Struct)) {
// client calls for a motd on login even if they arent in a guild
printf("Error: app size of %i != size of GuildMOTD_Struct of %i\n",app->size,sizeof(GuildMOTD_Struct));
printf("Error: app size of %i != size of GuildMOTD_Struct of %lu\n",app->size,sizeof(GuildMOTD_Struct));
return;
}
if(!IsInAGuild()) {
@ -6876,7 +6876,7 @@ void Client::Handle_OP_DeleteSpell(const EQApplicationPacket *app)
void Client::Handle_OP_LoadSpellSet(const EQApplicationPacket *app)
{
if(app->size!=sizeof(LoadSpellSet_Struct)) {
printf("Wrong size of LoadSpellSet_Struct! Expected: %i, Got: %i\n",sizeof(LoadSpellSet_Struct),app->size);
printf("Wrong size of LoadSpellSet_Struct! Expected: %lu, Got: %i\n",sizeof(LoadSpellSet_Struct),app->size);
return;
}
int i;
@ -6891,7 +6891,7 @@ void Client::Handle_OP_LoadSpellSet(const EQApplicationPacket *app)
void Client::Handle_OP_PetitionBug(const EQApplicationPacket *app)
{
if(app->size!=sizeof(PetitionBug_Struct))
printf("Wrong size of BugStruct! Expected: %i, Got: %i\n",sizeof(PetitionBug_Struct),app->size);
printf("Wrong size of BugStruct! Expected: %lu, Got: %i\n",sizeof(PetitionBug_Struct),app->size);
else{
Message(0, "Petition Bugs are not supported, please use /bug.");
}
@ -6901,7 +6901,7 @@ void Client::Handle_OP_PetitionBug(const EQApplicationPacket *app)
void Client::Handle_OP_Bug(const EQApplicationPacket *app)
{
if(app->size!=sizeof(BugStruct))
printf("Wrong size of BugStruct got %d expected %d!\n", app->size, sizeof(BugStruct));
printf("Wrong size of BugStruct got %d expected %lu!\n", app->size, sizeof(BugStruct));
else{
BugStruct* bug=(BugStruct*)app->pBuffer;
database.UpdateBug(bug);
@ -8306,7 +8306,7 @@ void Client::Handle_OP_OpenTributeMaster(const EQApplicationPacket *app)
_pkt(TRIBUTE__IN, app);
if(app->size != sizeof(StartTribute_Struct))
printf("Error in OP_OpenTributeMaster. Expected size of: %i, but got: %i\n",sizeof(StartTribute_Struct),app->size);
printf("Error in OP_OpenTributeMaster. Expected size of: %lu, but got: %i\n",sizeof(StartTribute_Struct),app->size);
else {
//Opens the tribute master window
StartTribute_Struct* st = (StartTribute_Struct*)app->pBuffer;
@ -8331,7 +8331,7 @@ void Client::Handle_OP_OpenGuildTributeMaster(const EQApplicationPacket *app)
_pkt(TRIBUTE__IN, app);
if(app->size != sizeof(StartTribute_Struct))
printf("Error in OP_OpenGuildTributeMaster. Expected size of: %i, but got: %i\n",sizeof(StartTribute_Struct),app->size);
printf("Error in OP_OpenGuildTributeMaster. Expected size of: %lu, but got: %i\n",sizeof(StartTribute_Struct),app->size);
else {
//Opens the guild tribute master window
StartTribute_Struct* st = (StartTribute_Struct*)app->pBuffer;
@ -8357,7 +8357,7 @@ void Client::Handle_OP_TributeItem(const EQApplicationPacket *app)
//player donates an item...
if(app->size != sizeof(TributeItem_Struct))
printf("Error in OP_TributeItem. Expected size of: %i, but got: %i\n",sizeof(StartTribute_Struct),app->size);
printf("Error in OP_TributeItem. Expected size of: %lu, but got: %i\n",sizeof(StartTribute_Struct),app->size);
else {
TributeItem_Struct* t = (TributeItem_Struct*)app->pBuffer;
@ -8386,7 +8386,7 @@ void Client::Handle_OP_TributeMoney(const EQApplicationPacket *app)
//player donates money
if(app->size != sizeof(TributeMoney_Struct))
printf("Error in OP_TributeMoney. Expected size of: %i, but got: %i\n",sizeof(StartTribute_Struct),app->size);
printf("Error in OP_TributeMoney. Expected size of: %lu, but got: %i\n",sizeof(StartTribute_Struct),app->size);
else {
TributeMoney_Struct* t = (TributeMoney_Struct*)app->pBuffer;
@ -8534,7 +8534,7 @@ void Client::Handle_OP_Ignore(const EQApplicationPacket *app)
void Client::Handle_OP_FindPersonRequest(const EQApplicationPacket *app)
{
if(app->size != sizeof(FindPersonRequest_Struct))
printf("Error in FindPersonRequest_Struct. Expected size of: %i, but got: %i\n",sizeof(FindPersonRequest_Struct),app->size);
printf("Error in FindPersonRequest_Struct. Expected size of: %lu, but got: %i\n",sizeof(FindPersonRequest_Struct),app->size);
else {
FindPersonRequest_Struct* t = (FindPersonRequest_Struct*)app->pBuffer;

View File

@ -1812,7 +1812,7 @@ void Merc::AI_Process() {
//now off hand
if(GetTarget() && attack_dw_timer.Check() && CanThisClassDualWield()) {
int weapontype = NULL;
int weapontype = 0; // No weapon type
bool bIsFist = true;
if(bIsFist || ((weapontype != ItemType2HS) && (weapontype != ItemType2HPierce) && (weapontype != ItemType2HB))) {