changeset 1678:bddedc2e0ebb

Cleanups.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 31 May 2018 13:08:09 +0300
parents c2ad6c0e4975
children 7b0c76cd7686
files tools/objlink.c
diffstat 1 files changed, 5 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/tools/objlink.c	Thu May 31 13:04:53 2018 +0300
+++ b/tools/objlink.c	Thu May 31 13:08:09 2018 +0300
@@ -169,8 +169,6 @@
 
 void argShowHelp()
 {
-    int i;
-
     dmPrintBanner(stdout, dmProgName, "[options]");
     dmArgsPrintHelp(stdout, optList, optListN, 0);
 
@@ -181,7 +179,7 @@
     "\n"
     "Available memory models:\n");
 
-    for (i = 0; i < nmemoryModels; i++)
+    for (int i = 0; i < nmemoryModels; i++)
     {
         const DMMemModel *m = &memoryModels[i];
         printf("  %d = %-40s [%s] (%d kB)\n",
@@ -655,7 +653,8 @@
 
     if ((t = strrchr(tmpStr, '/')))
         s = (t + 1);
-    else if ((t = strrchr(tmpStr, '\\')))
+    else
+    if ((t = strrchr(tmpStr, '\\')))
         s = (t + 1);
     else
         s = tmpStr;
@@ -702,19 +701,17 @@
 
 void memPrintEmpty(FILE *f, int n)
 {
-    int i;
-    for (i = 0; i < n; i++)
+    for (int i = 0; i < n; i++)
     fprintf(f, "              |                                          |\n");
 }
 
 void dmDescribeMemory(FILE *f)
 {
-    int i;
     DMMemBlock *prev = NULL;
 
     memPrintLine(f);
 
-    for (i = 0; i < nmemBlocks; i++)
+    for (int i = 0; i < nmemBlocks; i++)
     {
         DMMemBlock *curr = &memBlocks[i];
         char desc[512], *s;
@@ -1012,6 +1009,5 @@
     if (optDescribe)
         dmDescribeMemory(stdout);
 
-    exit(0);
     return 0;
 }