changeset 743:b136ddc4070b

Cosmetics.
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 04 May 2013 02:12:33 +0300
parents aba7dde79a04
children fe5910d6df82
files minijss/jssmod.c minijss/jssmod.h
diffstat 2 files changed, 13 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/minijss/jssmod.c	Mon Apr 22 17:00:01 2013 +0300
+++ b/minijss/jssmod.c	Sat May 04 02:12:33 2013 +0300
@@ -99,7 +99,8 @@
             {
                 p = *sdata;
                 t = ((p >> 8) & 0xff) | ((p & 0xff) << 8);
-            } else
+            }
+            else
                 t = *sdata;
             
             if (ops & jsampDelta)
@@ -182,7 +183,8 @@
             {
                 p = *sdata;
                 t = ((p >> 8) & 0xff) | ((p & 0xff) << 8);
-            } else
+            }
+            else
                 t = *sdata;
             
             if (ops & jsampDelta)
@@ -218,6 +220,7 @@
     return DMERR_OK;
 }
 
+
 /* Converts the given module in preparation for playing it.
  * This involves sample format conversion (8 to 16 bit, etc.)
  *
@@ -304,7 +307,7 @@
     // Free patterns
     for (i = 0; i < module->npatterns; i++)
     {
-        if (module->patterns[i])
+        if (module->patterns[i] != NULL)
         {
             JSSPattern *pat = module->patterns[i];
             dmFree(pat->data);
@@ -325,7 +328,7 @@
     // Free instruments
     for (i = 0; i < module->ninstruments; i++)
     {
-        if (module->instruments[i])
+        if (module->instruments[i] != NULL)
         {
             JSSInstrument *inst = module->instruments[i];
 #ifndef JSS_LIGHT
@@ -340,7 +343,7 @@
     // Free extended instruments
     for (i = 0; i < module->nextInstruments; i++)
     {
-        if (module->extInstruments[i])
+        if (module->extInstruments[i] != NULL)
         {
             JSSExtInstrument *ext = module->extInstruments[i];
 #ifndef JSS_LIGHT
@@ -366,9 +369,9 @@
 
 /* Allocates and initializes a internal pattern structure.
  */
-JSSPattern *jssAllocatePattern(int nrows, int nchannels)
+JSSPattern *jssAllocatePattern(const int nrows, const int nchannels)
 {
-    int i, j;
+    int row, chn;
     JSSPattern *res;
     JSSNote *pnote;
 
@@ -395,9 +398,9 @@
     res->nchannels = nchannels;
 
     pnote = res->data;
-    for (j = 0; j < nrows; j++)
+    for (row = 0; row < nrows; row++)
     {
-        for (i = 0; i < nchannels; i++)
+        for (chn = 0; chn < nchannels; chn++)
         {
             pnote->note = pnote->instrument = pnote->volume =
                 pnote->effect = pnote->param = jsetNotSet;
--- a/minijss/jssmod.h	Mon Apr 22 17:00:01 2013 +0300
+++ b/minijss/jssmod.h	Sat May 04 02:12:33 2013 +0300
@@ -296,7 +296,7 @@
 int                 jssConvertModuleForPlaying(JSSModule *module);
 JSSModule *         jssAllocateModule(void);
 int                 jssFreeModule(JSSModule *);
-JSSPattern *        jssAllocatePattern(int, int);
+JSSPattern *        jssAllocatePattern(const int, const int);
 JSSInstrument *     jssAllocateInstrument(void);
 JSSExtInstrument *  jssAllocateExtInstrument(void);