From 2df69cbda5a25a3c4f3989952aaad7d534971e4e Mon Sep 17 00:00:00 2001 From: pouillot Date: Sat, 14 Apr 2012 09:54:25 +0000 Subject: [PATCH] Re #307 Fixed GCC warning about a possible crash when calling help menu when no keyboard shortcut is defined git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@4699 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: 7b555242b91228ecefcb7608115272d515f0fa49 Former-commit-id: b50e9d0d75457d763c7a639c7c06feccd0f34573 --- src/libs/tgfclient/guihelp.cpp | 72 +++++++++++++++++----------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/src/libs/tgfclient/guihelp.cpp b/src/libs/tgfclient/guihelp.cpp index bad241ea2..79ce1937f 100644 --- a/src/libs/tgfclient/guihelp.cpp +++ b/src/libs/tgfclient/guihelp.cpp @@ -92,44 +92,44 @@ GfuiHelpScreen(void *targetScreen, void *returnScreen) tGfuiScreen *pscrTgt = (tGfuiScreen*)targetScreen; tGfuiKey *curKey = pscrTgt->userKeys; - do { + while (curKey) + { + curKey = curKey->next; + // Decide if this key goes on the left of right column. bool bLeft; - if (curKey) { - curKey = curKey->next; - switch(curKey->key) { - case GFUIK_BACKSPACE: - case GFUIK_F1: - case GFUIK_F2: - case GFUIK_F3: - case GFUIK_F4: - case GFUIK_F5: - case GFUIK_F6: - case GFUIK_F7: - case GFUIK_F8: - case GFUIK_F9: - case GFUIK_F10: - case GFUIK_F11: - case GFUIK_F12: - case GFUIK_LEFT: - case GFUIK_UP: - case GFUIK_RIGHT: - case GFUIK_DOWN: - case GFUIK_PAGEUP: - case GFUIK_PAGEDOWN: - case GFUIK_HOME: - case GFUIK_END: - case GFUIK_INSERT: - case GFUIK_DELETE: - case GFUIK_CLEAR: - case GFUIK_PAUSE: - bLeft = true; - break; + switch(curKey->key) { + case GFUIK_BACKSPACE: + case GFUIK_F1: + case GFUIK_F2: + case GFUIK_F3: + case GFUIK_F4: + case GFUIK_F5: + case GFUIK_F6: + case GFUIK_F7: + case GFUIK_F8: + case GFUIK_F9: + case GFUIK_F10: + case GFUIK_F11: + case GFUIK_F12: + case GFUIK_LEFT: + case GFUIK_UP: + case GFUIK_RIGHT: + case GFUIK_DOWN: + case GFUIK_PAGEUP: + case GFUIK_PAGEDOWN: + case GFUIK_HOME: + case GFUIK_END: + case GFUIK_INSERT: + case GFUIK_DELETE: + case GFUIK_CLEAR: + case GFUIK_PAUSE: + bLeft = true; + break; - default: - bLeft = curKey->modifier != GFUIM_NONE; - break; - } + default: + bLeft = curKey->modifier != GFUIM_NONE; + break; } // Determine control coordinates, whether left or right column. @@ -157,7 +157,7 @@ GfuiHelpScreen(void *targetScreen, void *returnScreen) if (curKey == pscrTgt->userKeys) curKey = (tGfuiKey*)NULL; - } while (curKey); + } // Create Back button.