changeset 2262:037ad3678c0f

Fixing warnings in items.cpp
author Grumpy7
date Sat, 08 Mar 2014 17:29:36 +0100
parents 236d8d7c7295
children 3d644efae786
files Items.cpp
diffstat 1 files changed, 11 insertions(+), 65 deletions(-) [+]
line wrap: on
line diff
--- a/Items.cpp	Sat Mar 08 16:04:44 2014 +0100
+++ b/Items.cpp	Sat Mar 08 17:29:36 2014 +0100
@@ -373,13 +373,8 @@
   materialMap["special"] = MATERIAL_SPECIAL;
 
 	int i,j;
-	char* test_string;
-	unsigned char c;
-	bool break_loop;
-	unsigned int temp_str_len;
-	char* tmp_pos;
-	int decode_step;
-	int item_counter;
+  char* test_string;
+  int item_counter;
 
 	pMapStats = new MapStats;
 	pMapStats->Initialize();
@@ -455,9 +450,9 @@
     Assert(tokens.size() >= 17, "Invalid number of tokens");
     pSpecialEnchantments[i].pBonusStatement=RemoveQuotes(tokens[0]);
     pSpecialEnchantments[i].pNameAdd= RemoveQuotes(tokens[1]);
-    for (int i = 0; i < 12; i++)
+    for (int j = 0; j < 12; j++)
     {
-      pSpecialEnchantments[i].to_item_apply[i]=atoi(tokens[i+2]);
+      pSpecialEnchantments[i].to_item_apply[j]=atoi(tokens[j+2]);
     }
     int res;
     res=atoi(tokens[14]);
@@ -476,7 +471,7 @@
 	memset(&pSpecialEnchantmentsSumm, 0, 96);
 	for(i=0;i<12;++i)
 		{
-		for (j=0;j<=pSpecialEnchantments_count;++j)
+		for (unsigned int j=0;j<=pSpecialEnchantments_count;++j)
 			pSpecialEnchantmentsSumm[i]+=pSpecialEnchantments[j].to_item_apply[i];
 		}
 
@@ -1043,62 +1038,28 @@
 
     ItemsTable *v5; // edi@1
     int v6; // ebx@3
-    int *v7; // ecx@33
+    //int *v7; // ecx@33
     //int v8; // eax@34
     //int v9; // eax@39
     int current_chance; // ebx@43
     int tmp_chance; // ecx@47
-    unsigned int *v12; // edx@48
-    unsigned int v13; // eax@49
-    signed int v14; // ebx@52
-    int v15; // eax@53
-    signed int v16; // eax@55
     int v17; // ebx@57
     int v18; // edx@62
-    signed int v19; // ebx@70
-    unsigned __int8 v20; // al@81
-    int v21; // eax@84
-    int v22; // ebx@85
-    int v23; // eax@86
-    int v24; // ebx@86
-    int special_chance; // edx@86
-    int v26; // edx@89
+    unsigned int special_chance; // edx@86
+    unsigned int v26; // edx@89
     unsigned int v27; // eax@89
-    int i; // ebx@89
-    unsigned int v29; // ecx@90
-    int v30; // ebx@91
-    int v31; // eax@91
     int v32; // ecx@91
     int v33; // eax@91
-    int v34; // eax@97
-    unsigned __int8 v35; // sf@97
-    unsigned __int8 v36; // of@97
-    int v37; // ebx@98
-    int v38; // edx@99
-    signed int v39; // ebx@101
-    int v40; // ecx@102
-    char v41; // zf@107
-    char v42; // al@108
-    char v43; // al@111
-    int *v44; // edx@118
+    unsigned int v34; // eax@97
     int v45; // eax@120
     int v46; // edx@120
     int j; // eax@121
-    unsigned int v48; // ecx@123
-    int v49; // eax@123
-    int v50; // eax@123
     int val_list[800]; // [sp+Ch] [bp-C88h]@33
     int total_chance; // [sp+C8Ch] [bp-8h]@33
-    int v53; // [sp+C90h] [bp-4h]@1
     int v54; // [sp+C9Ch] [bp+8h]@3
     //int v55; // [sp+CA0h] [bp+Ch]@34
     signed int v56; // [sp+CA0h] [bp+Ch]@55
     int v57; // [sp+CA0h] [bp+Ch]@62
-    int *v58; // [sp+CA0h] [bp+Ch]@102
-    int v59; // [sp+CA0h] [bp+Ch]@123
-    //signed int a2a; // [sp+CA4h] [bp+10h]@33
-    int a2b; // [sp+CA4h] [bp+10h]@101
-    int a2c; // [sp+CA4h] [bp+10h]@120
 
     v5 = this;
     if (!out_item)
@@ -1270,7 +1231,7 @@
     case EQUIP_BOW :    
         if ( !uBonusChanceWpSpecial[v6] )
             return;
-        if ((rand() % 100)>=uBonusChanceWpSpecial[v6])
+        if ((uint)(rand() % 100)>=uBonusChanceWpSpecial[v6])
             return;
         break;
     case      EQUIP_ARMOUR :        
@@ -1327,7 +1288,7 @@
     int spc_sum=0;
     int spc;
     memset(&val_list, 0, 3200);
-    for (int i=0; i<pSpecialEnchantments_count;++i)
+    for (unsigned int i=0; i<pSpecialEnchantments_count;++i)
         {
         int tr_lv= pSpecialEnchantments[i].iTreasureLevel;
         switch ( treasure_level - 1 )
@@ -2034,29 +1995,18 @@
 void GenerateItemsInChest()
     {
     unsigned int v0; // eax@1
-    Chest *v1; // ebx@1
     MapInfo *v2; // esi@1
     ItemGen *v3; // ebx@2
     int v4; // ebp@4
     int v5; // edi@4
     int v6; // esi@4
-    int v7; // eax@4
     signed int v8; // esi@4
     int v9; // edx@4
     int v10; // esi@8
     int v11; // ebp@25
     int v12; // esi@25
-    signed int v13; // ebp@27
     ItemGen *v14; // edi@28
-    signed int v15; // edx@32
-    signed __int64 v16; // qtt@32
-    int v17; // esi@34
     signed int v18; // [sp+10h] [bp-18h]@1
-    int v19; // [sp+14h] [bp-14h]@4
-    MapInfo *v20; // [sp+18h] [bp-10h]@1
-    Chest *v21; // [sp+1Ch] [bp-Ch]@1
-    int v22; // [sp+20h] [bp-8h]@26
-    signed int v23; // [sp+24h] [bp-4h]@2
 
     v18 = rand() % 100;  //main random
     v0 = pMapStats->GetMapInfo(pCurrentMapName);
@@ -2359,10 +2309,6 @@
 {
   int result; // eax@2
   char v5; // zf@3
-  const char *v6; // [sp-Ch] [bp-18h]@88
-  signed int v7; // [sp-8h] [bp-14h]@61
-  int v8; // [sp-4h] [bp-10h]@61
-  signed int v9; // [sp-4h] [bp-10h]@69
 
   result = 0; //BUG   fn is void
   if ( item_id <= 500 )