changeset 1345:172a42eb290b

Cleanups.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 22 Aug 2017 21:35:22 +0300
parents 276e36618b90
children 3f0fb57d58aa
files tools/dumpmod.c
diffstat 1 files changed, 17 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/tools/dumpmod.c	Tue Aug 22 21:05:55 2017 +0300
+++ b/tools/dumpmod.c	Tue Aug 22 21:35:22 2017 +0300
@@ -22,13 +22,13 @@
 
 static const DMOptArg optList[] =
 {
-    { 0, '?', "help", "Show this help and exit", OPT_NONE },
-    { 1, 'p', "patterns", "View patterns", OPT_NONE },
-    { 2, 'i', "instruments", "View instruments", OPT_NONE },
-    { 5, 'e', "extinstruments", "View extended instruments", OPT_NONE },
-    { 3, 'g', "general", "General information", OPT_NONE },
-    { 4, 'v', "verbose", "Be more verbose", OPT_NONE },
-    { 6, 'd', "dump", "Dump mode", OPT_NONE },
+    { 0, '?', "help",            "Show this help and exit", OPT_NONE },
+    { 1, 'p', "patterns",        "View patterns", OPT_NONE },
+    { 2, 'i', "instruments",     "View instruments", OPT_NONE },
+    { 3, 'e', "extinstruments",  "View extended instruments", OPT_NONE },
+    { 4, 'g', "general",         "General information", OPT_NONE },
+    { 5, 'v', "verbose",         "Be more verbose", OPT_NONE },
+    { 6, 'd', "dump",            "Dump mode", OPT_NONE },
 };
 
 const int optListN = sizeof(optList) / sizeof(optList[0]);
@@ -65,11 +65,11 @@
             break;
 
         case 4:
-            dmVerbosity++;
+            optViewExtInstruments = TRUE;
             break;
 
         case 5:
-            optViewExtInstruments = TRUE;
+            dmVerbosity++;
             break;
 
         case 6:
@@ -90,8 +90,9 @@
     // Was not option argument
     if (!optFilename)
         optFilename = currArg;
-    else {
-        dmErrorMsg("Gay error '%s'!\n", currArg);
+    else
+    {
+        dmErrorMsg("Oh noes, we can only hand one file and '%s' looks like a second one!\n", currArg);
         return FALSE;
     }
 
@@ -133,7 +134,7 @@
 
 /* Print a given pattern
  */
-void printPattern(FILE *f, JSSPattern *p)
+void printPattern(FILE *f, const JSSPattern *p)
 {
     int i, j;
     char c;
@@ -209,7 +210,7 @@
 /*
  * Print given extended instrument
  */
-void printEnvelope(FILE *f, JSSEnvelope *e, const char *name)
+void printEnvelope(FILE *f, const JSSEnvelope *e, const char *name)
 {
     int i;
 
@@ -242,7 +243,7 @@
 }
 
 
-void printExtInstrument(FILE *f, JSSExtInstrument *inst)
+void printExtInstrument(FILE *f, const JSSExtInstrument *inst)
 {
 #ifndef JSS_LIGHT
     if (inst->desc && !optDump)
@@ -287,7 +288,7 @@
 }
 
 
-void printInstrument(FILE *f, JSSInstrument *inst)
+void printInstrument(FILE *f, const JSSInstrument *inst)
 {
     if (dmVerbosity >= 1)
     {
@@ -350,7 +351,7 @@
 }
 
 
-void printGeneralInfo(FILE *f, JSSModule *m)
+void printGeneralInfo(FILE *f, const JSSModule *m)
 {
     int i;
 
@@ -516,6 +517,5 @@
     jssFreeModule(mod);
     jssClose();
 
-    exit(0);
     return 0;
 }