Mercurial > mm7
comparison mm7_2.cpp @ 2369:bddcaf5d5db2
removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
author | Grumpy7 |
---|---|
date | Mon, 12 May 2014 01:50:32 +0200 |
parents | eb136041adf1 |
children | b4a79e3ef2f0 |
comparison
equal
deleted
inserted
replaced
2368:91b6c0a338ad | 2369:bddcaf5d5db2 |
---|---|
576 { | 576 { |
577 if ( pMessageQueue_50CBD0->uNumMessages ) | 577 if ( pMessageQueue_50CBD0->uNumMessages ) |
578 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | 578 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; |
579 pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_CANCELLED); | 579 pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_CANCELLED); |
580 pKeyActionMap->ResetKeys(); | 580 pKeyActionMap->ResetKeys(); |
581 activeLevelDecoration = NULL; | 581 activeLevelDecoration = nullptr; |
582 current_npc_text = 0; | 582 current_npc_text = 0; |
583 if ( pDialogueNPCCount == 0) | 583 if ( pDialogueNPCCount == 0) |
584 return 0; | 584 return 0; |
585 | 585 |
586 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_SPECIAL && ShopTexture ) | 586 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_SPECIAL && ShopTexture ) |
1237 unsigned int temp_str_len; | 1237 unsigned int temp_str_len; |
1238 char* tmp_pos; | 1238 char* tmp_pos; |
1239 int decode_step; | 1239 int decode_step; |
1240 // int item_counter; | 1240 // int item_counter; |
1241 | 1241 |
1242 if ( pHostileTXT_Raw ) | 1242 free(pHostileTXT_Raw); |
1243 free(pHostileTXT_Raw); | |
1244 pHostileTXT_Raw = NULL; | |
1245 pHostileTXT_Raw = (char *)pEvents_LOD->LoadRaw("hostile.txt", 0); | 1243 pHostileTXT_Raw = (char *)pEvents_LOD->LoadRaw("hostile.txt", 0); |
1246 strtok(pHostileTXT_Raw, "\r"); | 1244 strtok(pHostileTXT_Raw, "\r"); |
1247 for ( i=0; i < 89; ++i ) | 1245 for ( i=0; i < 89; ++i ) |
1248 { | 1246 { |
1249 test_string = strtok(NULL, "\r") + 1; | 1247 test_string = strtok(NULL, "\r") + 1; |
1272 ++decode_step; | 1270 ++decode_step; |
1273 test_string=tmp_pos+1; | 1271 test_string=tmp_pos+1; |
1274 } | 1272 } |
1275 while ((decode_step < 92) && !break_loop ); | 1273 while ((decode_step < 92) && !break_loop ); |
1276 } | 1274 } |
1277 if ( pHostileTXT_Raw) | 1275 free(pHostileTXT_Raw); |
1278 { | 1276 pHostileTXT_Raw = nullptr; |
1279 free(pHostileTXT_Raw); | |
1280 pHostileTXT_Raw = NULL; | |
1281 } | |
1282 } | 1277 } |
1283 | 1278 |
1284 | 1279 |
1285 | 1280 |
1286 //----- (004610AA) -------------------------------------------------------- | 1281 //----- (004610AA) -------------------------------------------------------- |