diff minijss/jssplr.c @ 1403:6aa0897265e8

Modernization cleanups.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 30 Oct 2017 18:15:11 +0200
parents 848a88ce7a57
children 3b71aa1ef915
line wrap: on
line diff
--- a/minijss/jssplr.c	Mon Oct 30 18:12:38 2017 +0200
+++ b/minijss/jssplr.c	Mon Oct 30 18:15:11 2017 +0200
@@ -299,7 +299,6 @@
 
 void jmpClearPlayer(JSSPlayer * mp)
 {
-    int i;
     assert(mp != NULL);
     JSS_LOCK(mp);
 
@@ -312,7 +311,7 @@
     mp->lastPatLoopRow    = 0;
 
     // Initialize channel data
-    for (i = 0; i < jsetNChannels; i++)
+    for (int i = 0; i < jsetNChannels; i++)
         jmpClearChannel(&mp->channels[i]);
 
     JSS_UNLOCK(mp);
@@ -431,17 +430,16 @@
 
 static void jmpClearChannels(JSSPlayer * mp)
 {
-    int i;
     assert(mp != NULL);
     JSS_LOCK(mp);
     assert(mp->device != NULL);
     assert(mp->module != NULL);
 
-    for (i = 0; i < mp->module->nchannels; i++)
+    for (int i = 0; i < mp->module->nchannels; i++)
         jvmStop(mp->device, i);
 
     // Initialize channel data
-    for (i = 0; i < jsetNChannels; i++)
+    for (int i = 0; i < jsetNChannels; i++)
         jmpClearChannel(&mp->channels[i]);
 
     JSS_UNLOCK(mp);
@@ -1391,7 +1389,6 @@
 void jmpExec(void *pDEV, void *pMP)
 {
     JSSPlayer *mp;
-    int channel;
 
     // Check some things via assert()
     mp = (JSSPlayer *) pMP;
@@ -1408,7 +1405,7 @@
     mp->jumpFlag = FALSE;
     mp->breakFlag = FALSE;
 
-    for (channel = 0; channel < jsetNChannels; channel++)
+    for (int channel = 0; channel < jsetNChannels; channel++)
         mp->channels[channel].newDataFlags = 0;
 
 //fprintf(stderr, "1: tick=%d, order=%d, iPattern=%d, row=%d\n", mp->tick, mp->order, mp->npattern, mp->row);
@@ -1483,7 +1480,7 @@
                 goto out;
 
             // TICK #0: Process new row
-            for (channel = 0; channel < mp->module->nchannels; channel++)
+            for (int channel = 0; channel < mp->module->nchannels; channel++)
                 jmpProcessNewRow(mp, channel);
         } // patternDelay
     } // tick
@@ -1494,7 +1491,7 @@
             (JMPGETMODFLAGS(mp, jmdfFT2Replay) && mp->patternDelay <= 0))
         {
             // TICK n: Process the effects
-            for (channel = 0; channel < mp->module->nchannels; channel++)
+            for (int channel = 0; channel < mp->module->nchannels; channel++)
                 jmpProcessEffects(mp, channel);
         }
     }
@@ -1504,7 +1501,7 @@
         goto out;
 
     // Update player data to audio device/mixer
-    for (channel = 0; channel < mp->module->nchannels; channel++)
+    for (int channel = 0; channel < mp->module->nchannels; channel++)
     {
         JSSPlayerChannel *chn = &mp->channels[channel];