Mercurial > mm7
changeset 1409:c9e3b93ec570
Highlighted locations with "using uninitialized variable" warning.
author | Nomad |
---|---|
date | Fri, 26 Jul 2013 21:16:51 +0200 |
parents | 204cce84300b |
children | 38df78aba732 |
files | AudioPlayer.cpp CastSpellInfo.cpp DecalBuilder.cpp GUIWindow.cpp LightmapBuilder.cpp Player.cpp Render.cpp SpriteObject.cpp Texture.cpp UI/UIShops.cpp mm7_2.cpp mm7_4.cpp mm7_5.cpp |
diffstat | 13 files changed, 57 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/AudioPlayer.cpp Fri Jul 26 18:11:36 2013 +0600 +++ b/AudioPlayer.cpp Fri Jul 26 21:16:51 2013 +0200 @@ -1923,6 +1923,7 @@ bEAXSupported = 0; b3DSoundInitialized = 0; ReadWindowsRegistryString("3DSoundProvider", p3DSoundProvider, 128u, "NONE"); + __debugbreak(); // audioplayer.cpp(1926): warning C4700: uninitialized local variable 'v5' used CheckA3DSupport(v5); while ( AIL_enumerate_3D_providers(&v14, (HPROVIDER *)&hWnd, &Str1) ) {
--- a/CastSpellInfo.cpp Fri Jul 26 18:11:36 2013 +0600 +++ b/CastSpellInfo.cpp Fri Jul 26 21:16:51 2013 +0200 @@ -1955,6 +1955,8 @@ { v730 = 0; } + + __debugbreak(); // castspellinfo.cpp(1962): warning C4700: uninitialized local variable 'v271' used if ( rand() % 100 < 10 * v2 || (rand() % 100 < 80 && (v731 == 3 || v731 == 4 )) || v245->GetValue() < 450 || @@ -1966,6 +1968,7 @@ { v295 = rand() % 10;// pItemsTable->field_116D8[pItemsTable->pItems[_this->uItemID].uEquipType]; v245->uEnchantmentType = 0; + __debugbreak(); // castspellinfo.cpp(1971): warning C4700: uninitialized local variable 'v294' used for ( kk = pItemsTable->pEnchantments[0].to_item[pItemsTable->pItems[v245->uItemID].uEquipType + 1]; ; kk += pItemsTable->pEnchantments[v294->uEnchantmentType].to_item[pItemsTable->pItems[v245->uItemID].uEquipType + 1] )
--- a/DecalBuilder.cpp Fri Jul 26 18:11:36 2013 +0600 +++ b/DecalBuilder.cpp Fri Jul 26 21:16:51 2013 +0200 @@ -401,6 +401,7 @@ { v40 = (int)&a8; v39 = v12->pVertices; + __debugbreak(); // warning C4700: uninitialized local variable 'v31' used pGame->pIndoorCameraD3D->_436CDC_mess_with_lightmap__clipflag_2(v32, *v31, v12->pVertices, &a8b); v40 = (int)v31; v39 = v12->pVertices;
--- a/GUIWindow.cpp Fri Jul 26 18:11:36 2013 +0600 +++ b/GUIWindow.cpp Fri Jul 26 21:16:51 2013 +0200 @@ -468,7 +468,8 @@ else if ( v18 & 0x40 ) max_beacons = 3; - + + __debugbreak(); // warning C4700: uninitialized local variable 'v19' used for (int i =0; i< max_beacons; ++i) CreateButton(pLloydsBeaconsPreviewXs[v19], pLloydsBeaconsPreviewYs[v19], 92, 68, 1, 180, UIMSG_InstallBeacon, i, 0, "", 0);
--- a/LightmapBuilder.cpp Fri Jul 26 18:11:36 2013 +0600 +++ b/LightmapBuilder.cpp Fri Jul 26 21:16:51 2013 +0200 @@ -741,6 +741,7 @@ v5 = (char *)&a1->flt_2C; do { + __debugbreak(); // warning C4700: uninitialized local variable 'v7' used if ( *(float *)v5 < 0.0 || (v6 = *(float *)v5, /*UNDEF(v7),*/ v8 = 1.0 < v6, v9 = 0, v10 = 1.0 == v6, LOWORD(result) = v7, v6 <= 1.0) ) { @@ -749,6 +750,7 @@ v14 = 0.0 < v12; v15 = 0; v16 = 0.0 == v12; + __debugbreak(); // warning C4700: uninitialized local variable 'v13' used LOWORD(result) = v13; if ( v12 >= 0.0 ) v11 = *(float *)v5; @@ -880,6 +882,7 @@ a1.Normalize(); if ( uLightType & 4 ) { + __debugbreak(); // warning C4700: uninitialized local variable 'v18' used v22[1] = v18; uLightType = dword_4D86D8; v22[0] = v18; @@ -1473,6 +1476,7 @@ v25 = 1.0; } v9->field_10 = v25; + __debugbreak(); // warning C4700: uninitialized local variable 'v27' used if ( v9->field_14 < 0.0 || (v26 = v9->field_14, //UNDEF(v27), @@ -1487,6 +1491,7 @@ v34 = 0.0 < v32; v35 = 0; v36 = 0.0 == v32; + __debugbreak(); // warning C4700: uninitialized local variable 'v33' used BYTE1(result) = HIBYTE(v33); if ( v32 >= 0.0 ) v31 = v9->field_14;
--- a/Player.cpp Fri Jul 26 18:11:36 2013 +0600 +++ b/Player.cpp Fri Jul 26 21:16:51 2013 +0200 @@ -2868,6 +2868,7 @@ { if ( HasItemEquipped((ITEM_EQUIP_TYPE)v14) ) { + __debugbreak(); // player.cpp(2871): warning C4700: uninitialized local variable 'v15' used if ( v15 == EQUIP_ARMOUR ) v46[v4++] = LOBYTE(v5->pEquipment.uArmor) - 1; if ( (!v15 || v15 == 1) && GetEquippedItemEquipType((ITEM_EQUIP_TYPE)v15) == 4 ) @@ -2883,6 +2884,7 @@ { if ( HasItemEquipped((ITEM_EQUIP_TYPE)v16) ) { + __debugbreak(); // player.cpp(2886): warning C4700: uninitialized local variable 'v17' used if ( v17 == 2 ) v46[v4++] = LOBYTE(v5->pEquipment.uBow) - 1; if ( (!v17 || v17 == 1) @@ -3687,7 +3689,7 @@ Player *v21; // ecx@75 int v22; // eax@76 int v23; // edx@76 - int v24; // eax@79 + //int v24; // eax@79 int v25; // ecx@80 int v26; // edi@80 Player *v27; // ecx@84 @@ -4385,16 +4387,15 @@ v23 = this->pOwnItems[this->pEquipment.uMainHand].uItemID; if ( v6->pEquipment.uShield || pItemsTable->pItems[v23].uSkillType != 4 ) { - v24 = v23; v26 = pItemsTable->pItems[v23].uDamageRoll; v25 = pItemsTable->pItems[v23].uDamageDice; } else { - v25 = pItemsTable->pItems[v24].uDamageRoll; - v26 = pItemsTable->pItems[v24].uDamageDice + 1; + v25 = pItemsTable->pItems[v23].uDamageRoll; + v26 = pItemsTable->pItems[v23].uDamageDice + 1; } - v5 = pItemsTable->pItems[v24].uDamageMod + v25 * v26; + v5 = pItemsTable->pItems[v23].uDamageMod + v25 * v26; } } } @@ -5248,6 +5249,7 @@ assert(false && "Unknown attribute!"); + return 0; } //----- (00490109) -------------------------------------------------------- @@ -5329,10 +5331,9 @@ case 0x15u: case 0x18u: return SEX_FEMALE; - - default: - assert(false); - } + } + assert(false); + return SEX_MALE; } //----- (00490188) -------------------------------------------------------- @@ -5580,6 +5581,8 @@ ++counter; } } + + assert(false); } @@ -8632,6 +8635,9 @@ return false; } } + + assert(false); + return false; } // 5B65C4: using guessed type int dword_5B65C4; // 5B65CC: using guessed type int dword_5B65CC; @@ -8745,6 +8751,7 @@ result = Player_has_item(v5, *pPlayers, 0); if ( !result ) break; + __debugbreak(); // player.cpp(8748): warning C4700: uninitialized local variable 'v6' used result = v6->pEquipment.uArmor; if ( !result ) break; @@ -8759,6 +8766,8 @@ goto LABEL_6; } result = Player_has_item(604u, ::pPlayers[a1], 0); + __debugbreak(); // player.cpp(8764): warning C4700: uninitialized local variable 'v2' used + __debugbreak(); // player.cpp(8764): warning C4700: uninitialized local variable 'v3' used if ( !result || (result = v2->pEquipment.uArmor) == 0 || (result *= 9, *(int *)&v2->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * result + 5] != v3) )
--- a/Render.cpp Fri Jul 26 18:11:36 2013 +0600 +++ b/Render.cpp Fri Jul 26 21:16:51 2013 +0200 @@ -572,6 +572,7 @@ pTile->field_32 = 0; pTile->field_59 = 1; pTile->terrain_grid_x = (char)v97; + __debugbreak(); // warning C4700: uninitialized local variable 'v93' used pTile->field_34 = *(_WORD *)(v93 + 2); pTile->terrain_grid_z = v89; v22 = pTerrainNormalIndices[2 * (v97 + 128 * v89) + 1]; @@ -595,6 +596,7 @@ //--pOutdoorCamera->uNumPolygons; //goto LABEL_162; //} + __debugbreak(); // warning C4700: uninitialized local variable 'v102' used memcpy(&array_50AC10[0], v102, 0x30u); array_50AC10[0]._rhw = 1.0 / (v102->vWorldViewPosition.x + 0.0000001000000011686097); array_50AC10[0].u = 0.0; @@ -603,6 +605,7 @@ array_50AC10[1]._rhw = 1.0 / (pVertices->vWorldViewPosition.x + 0.0000001000000011686097); array_50AC10[1].u = 0.0; array_50AC10[1].v = 1.0; + __debugbreak(); // warning C4700: uninitialized local variable 'pVertices2' used memcpy(&array_50AC10[2], pVertices2, sizeof(array_50AC10[2])); array_50AC10[2]._rhw = 1.0 / (pVertices2->vWorldViewPosition.x + 0.0000001000000011686097); array_50AC10[2].u = 1.0; @@ -2356,6 +2359,7 @@ if ( v9 == v10 ) { ddsd2.dwFlags = 0x1007u; + __debugbreak(); // warning C4700: uninitialized local variable 'v11' used ddsd2.ddsCaps.dwCaps = v11; goto LABEL_12; } @@ -3076,7 +3080,9 @@ Dst = 124; if ( !pRenderer->LockSurface_DDraw4(pRenderer->pBackBuffer4, (DDSURFACEDESC2 *)&Dst, DDLOCK_WAIT) ) return; + __debugbreak(); // warning C4700: uninitialized local variable 'v20' used v42 = v20; + __debugbreak(); // warning C4700: uninitialized local variable 'v19' used v6 = v19 >> 1; v3 = 0; } @@ -4794,6 +4800,7 @@ pFrontBuffer = (IDirectDrawSurface *)v1->pFrontBuffer2; ppBackBuffer = (IDirectDrawSurface **)&v1->pBackBuffer2; } + __debugbreak(); // warning C4700: uninitialized local variable 'v6' used v9 = (int)v6; v10 = pFrontBuffer; // BUG @@ -5457,6 +5464,7 @@ { d3d_vertex_buffer[i].specular = 0; } + __debugbreak(); // warning C4700: uninitialized local variable 'v20' used d3d_vertex_buffer[i].specular = v20; d3d_vertex_buffer[i].texcoord.x = array_50AC10[i].u; d3d_vertex_buffer[i].texcoord.y = array_50AC10[i].v;
--- a/SpriteObject.cpp Fri Jul 26 18:11:36 2013 +0600 +++ b/SpriteObject.cpp Fri Jul 26 21:16:51 2013 +0200 @@ -199,6 +199,9 @@ uNumSpriteObjects = v6 + 1; return v6; } + + assert(false); + return 0; } //----- (00471C03) --------------------------------------------------------
--- a/Texture.cpp Fri Jul 26 18:11:36 2013 +0600 +++ b/Texture.cpp Fri Jul 26 21:16:51 2013 +0200 @@ -1680,6 +1680,7 @@ { *strchr(&Buf, 10) = 0; memcpy(&v21, txt_file_frametable_parser(&Buf, &v20), 0x7Cu); + __debugbreak(); // warning C4700: uninitialized local variable 'Str1' used if ( v21 && *Str1 != 47 ) { if ( v21 < 2 ) @@ -1707,6 +1708,7 @@ if ( v21 && *Str1 != 47 ) { strcpy(v2->pTextures[v2->sNumTextures].pTextureName, Str1); + __debugbreak(); // warning C4700: uninitialized local variable 'Str' used v2->pTextures[v2->sNumTextures].uAnimTime = atoi(Str); v9 = 2; for ( v2->pTextures[v2->sNumTextures].uFlags = 0; v9 < v21; ++v9 )
--- a/UI/UIShops.cpp Fri Jul 26 18:11:36 2013 +0600 +++ b/UI/UIShops.cpp Fri Jul 26 21:16:51 2013 +0200 @@ -668,6 +668,8 @@ short text_color; int pActiveButton; + __debugbreak(); // uishops.cpp(952): warning C4700: uninitialized local variable 'v33' used + __debugbreak(); // uishops.cpp(981): warning C4700: uninitialized local variable 'v98' used memcpy(&dialog_window, window_SpeakInHouse, sizeof(dialog_window)); dialog_window.uFrameX = 483; dialog_window.uFrameWidth = 148; @@ -949,6 +951,7 @@ || (v32 = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&pItemCount), v11 = 0, !v32) || (!(pPlayers[uActiveCharacter]->pOwnItems[v32-1].uAttributes& 2)) ) return; + __debugbreak(); // warning C4700: uninitialized local variable 'v33' used v116 = &pPlayers[uActiveCharacter]->pInventoryItemList[v33 - 1]; v35 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(&pPlayers[uActiveCharacter]->pInventoryItemList[v32 - 1], BildingType_ArmorShop, window_SpeakInHouse->par1C, 5); v15 = (char *)pMerchantsRepairPhrases[v35]; @@ -977,6 +980,7 @@ { --pItemCount; v97 = uActiveCharacter - 1; + __debugbreak(); // warning C4700: uninitialized local variable 'v98' used v99 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(&pParty->SpecialItemsInShops[window_SpeakInHouse->par1C][v95-1], BildingType_ArmorShop, window_SpeakInHouse->par1C, 2); v100 = BuilDialogueString((char *)pMerchantsBuyPhrases[v99], uActiveCharacter - 1, v98, (char *)window_SpeakInHouse->par1C, 2, 0); v103 = pFontArrus->CalcTextHeight(v100, &dialog_window, 0, 0);
--- a/mm7_2.cpp Fri Jul 26 18:11:36 2013 +0600 +++ b/mm7_2.cpp Fri Jul 26 21:16:51 2013 +0200 @@ -572,6 +572,7 @@ v4 /= 2; goto LABEL_24; } + __debugbreak(); // warning C4700: uninitialized local variable 'v27' used if ( uDialogueType == 88 ) num_monsters = 2 * v4; else @@ -2339,6 +2340,7 @@ LOWORD(v7) = v5 & 0xE0; v12 = v7 + v11; LOWORD(v7) = v8 & 0xE0; + __debugbreak(); // warning C4700: uninitialized local variable 'v10' used return (PID_TYPE(v8) + PID_TYPE(v5) + PID_TYPE(a3a) + PID_TYPE(v6)) | (v7 + v12) | ((v8 & 0x1C00) + (v5 & 0x1C00) + v9 @@ -2993,9 +2995,9 @@ case 0x80: return 3; // Master case 0x40: return 2; // Expert case 0x00: return 1; // Normal - default: - assert(false); - } + } + assert(false); + return 0; } //----- (0045828B) --------------------------------------------------------
--- a/mm7_4.cpp Fri Jul 26 18:11:36 2013 +0600 +++ b/mm7_4.cpp Fri Jul 26 21:16:51 2013 +0200 @@ -3258,14 +3258,17 @@ v11 += 37; } while ( v9 < 4 ); + __debugbreak(); // warning C4700: uninitialized local variable 'v29' used if ( v29 == v14 ) { v25 = pClassNames[v10 + 1]; } else { + __debugbreak(); // warning C4700: uninitialized local variable 'v30' used if ( v30 == v14 )//crash { + __debugbreak(); // warning C4700: uninitialized local variable 'v31' used if ( v31 == v14 ) { sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[634], pClassNames[v10 + 2], pClassNames[v10 + 3]);//Вы должны достичь звания %s или %s для обучения этому уровню навыка.
--- a/mm7_5.cpp Fri Jul 26 18:11:36 2013 +0600 +++ b/mm7_5.cpp Fri Jul 26 21:16:51 2013 +0200 @@ -2198,6 +2198,7 @@ default: if ( uMessageParam != 5 ) { + __debugbreak(); // warning C4700: uninitialized local variable 'v200' used sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[35], v200); GameUI_SetFooterString(pTmpBuf.data()); continue; @@ -5530,4 +5531,5 @@ break; } assert(false); + return 0; } \ No newline at end of file