Mercurial > mm7
diff 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 |
line wrap: on
line diff
--- a/mm7_2.cpp Mon May 12 00:13:39 2014 +0200 +++ b/mm7_2.cpp Mon May 12 01:50:32 2014 +0200 @@ -578,7 +578,7 @@ pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_CANCELLED); pKeyActionMap->ResetKeys(); - activeLevelDecoration = NULL; + activeLevelDecoration = nullptr; current_npc_text = 0; if ( pDialogueNPCCount == 0) return 0; @@ -1239,9 +1239,7 @@ int decode_step; // int item_counter; - if ( pHostileTXT_Raw ) - free(pHostileTXT_Raw); - pHostileTXT_Raw = NULL; + free(pHostileTXT_Raw); pHostileTXT_Raw = (char *)pEvents_LOD->LoadRaw("hostile.txt", 0); strtok(pHostileTXT_Raw, "\r"); for ( i=0; i < 89; ++i ) @@ -1274,11 +1272,8 @@ } while ((decode_step < 92) && !break_loop ); } - if ( pHostileTXT_Raw) - { - free(pHostileTXT_Raw); - pHostileTXT_Raw = NULL; - } + free(pHostileTXT_Raw); + pHostileTXT_Raw = nullptr; }