changeset 1127:e22d4ceb6414

Cosmetics pass, remove excess and trailing whitespace.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 04 Mar 2015 06:11:37 +0200
parents 0888764d01cd
children 0194c8a26aa8
files minijss/jloadjss.c minijss/jloadxm.c minijss/jmix_c_in.c minijss/jmixtmpl_c.h minijss/jssmix.c minijss/jssmix.h minijss/jssmod.c minijss/jssmod.h minijss/jssplr.c minijss/jssplr.h
diffstat 10 files changed, 95 insertions(+), 95 deletions(-) [+]
line wrap: on
line diff
--- a/minijss/jloadjss.c	Wed Mar 04 06:08:22 2015 +0200
+++ b/minijss/jloadjss.c	Wed Mar 04 06:11:37 2015 +0200
@@ -239,22 +239,22 @@
     else
         note->note = tmp - 1;
     JSFOREACHNOTE2
-    
+
     JSFOREACHNOTE1
     JSGETBYTE(&tmp);
     note->instrument = (tmp > 0) ? tmp - 1 : jsetNotSet;
     JSFOREACHNOTE2
-    
+
     JSFOREACHNOTE1
     JSGETBYTE(&tmp);
     note->volume = (tmp > 0) ? tmp - 1 : jsetNotSet;
     JSFOREACHNOTE2
-    
+
     JSFOREACHNOTE1
     JSGETBYTE(&tmp);
     note->effect = (tmp > 0) ? tmp - 1 : jsetNotSet;
     JSFOREACHNOTE2
-    
+
     JSFOREACHNOTE1
     JSGETBYTE(&tmp);
     note->param = (tmp == 0 && note->effect == jsetNotSet) ? jsetNotSet : tmp;
--- a/minijss/jloadxm.c	Wed Mar 04 06:08:22 2015 +0200
+++ b/minijss/jloadxm.c	Wed Mar 04 06:11:37 2015 +0200
@@ -223,13 +223,13 @@
         d->points[i].frame = s->points[i].frame;
         d->points[i].value = s->points[i].value;
     }
-    
+
     // Convert other values
     d->npoints = s->npoints;
     d->sustain = s->sustain;
     d->loopS   = s->loopS;
     d->loopE   = s->loopE;
-    
+
     // Check if the envelope is used
     if (s->flags & 0x01)
     {
@@ -363,7 +363,7 @@
         inst->loopS = xmS.loopS;
         inst->loopE = (xmS.loopS + xmS.loopL);
     }
-    
+
     if (xmS.loopL == 0)
     {
         // Always unset loop, if loop length is zero
@@ -613,7 +613,7 @@
     {
         // Get the pattern header
         off_t remainder, pos = dmftell(inFile);
-        
+
         if (!dmf_read_le32(inFile, &xmP.headSize) ||
             !dmf_read_byte(inFile, &xmP.packing) ||
             !dmf_read_le16(inFile, &xmP.nrows) ||
@@ -621,7 +621,7 @@
             JSSERROR(DMERR_FREAD, DMERR_FREAD,
             "Could not read pattern header data #%d.\n",
             index);
-        
+
 
         // Check the header
         if (xmP.packing != 0)
--- a/minijss/jmix_c_in.c	Wed Mar 04 06:08:22 2015 +0200
+++ b/minijss/jmix_c_in.c	Wed Mar 04 06:11:37 2015 +0200
@@ -12,7 +12,7 @@
 /* Mono / Linear Interpolation
  */
 #define JMIXER_SAMPLE_TYPE Sint16
-#define JMIXER_INIT        
+#define JMIXER_INIT
 #define JMIXER_FUNC \
     const Sint32 vol = (FP_GETH32(tmpVolume) * mixer->globalVol) / 256; \
     memmove(&tl[0], &tl[1], 4 * sizeof(tl[0])); \
--- a/minijss/jmixtmpl_c.h	Wed Mar 04 06:08:22 2015 +0200
+++ b/minijss/jmixtmpl_c.h	Wed Mar 04 06:11:37 2015 +0200
@@ -38,7 +38,7 @@
             strideLength++;
         }
     }
-    
+
     while (strideLength < mixLength && JMIXER_ENDCOND)
     {
         JMIXER_FUNC
--- a/minijss/jssmix.c	Wed Mar 04 06:08:22 2015 +0200
+++ b/minijss/jssmix.c	Wed Mar 04 06:11:37 2015 +0200
@@ -70,7 +70,7 @@
 static int jvmFindMixRoutine(int outFormat, int outChannels, int mixerID)
 {
     int i;
-    
+
     for (i = 0; i < jvmNMixRoutines; i++)
     {
         if (jvmMixRoutines[i].outFormat == outFormat &&
@@ -78,7 +78,7 @@
             (mixerID == JMIX_AUTO || jvmMixRoutines[i].mixerID == mixerID))
             return i;
     }
-    
+
     return -1;
 }
 
@@ -102,13 +102,13 @@
         JSSERROR(DMERR_INVALID_ARGS, NULL,
         "Invalid number of channels %d\n", outChannels);
     }
-    
+
     if (outFreq < 4000)
     {
         JSSERROR(DMERR_INVALID_ARGS, NULL,
         "Invalid mixing frequency %d\n", outFreq);
     }
-    
+
     /* Select mixing routines:
      * Here we try to choose the most fitting mixing routines
      * from the compiled in routines, unless caller is forcing
@@ -134,7 +134,7 @@
         outFormat, outChannels, outFreq);
         return NULL;
     }
-    
+
     // Allocate a mixer device structure
     mixer = dmMalloc0(sizeof(JSSMixer));
     if (mixer == NULL)
@@ -150,11 +150,11 @@
     mixer->outFormat = outFormat;
     mixer->outFreq = outFreq;
     mixer->outChannels = outChannels;
-    
+
     mixer->jvmMixChannel_FW = jvmMixRoutines[mixerIdx].jvmMixChannel_FW;
     mixer->jvmMixChannel_BW = jvmMixRoutines[mixerIdx].jvmMixChannel_BW;
     mixer->jvmPostProcess = jvmMixRoutines[mixerIdx].jvmPostProcess;
-    
+
     // Allocate addBuffer
     mixer->addBufSize = outChannels * outFreq * 2;
     mixer->addBuffer = dmMalloc(mixer->addBufSize * sizeof(JMIXER_ADDBUF_TYPE));
@@ -163,7 +163,7 @@
         JSSERROR(DMERR_MALLOC, NULL,
         "Could not allocate mixing addition buffer.\n");
     }
-    
+
     return mixer;
 }
 
@@ -190,7 +190,7 @@
 {
     int sampSize = 1;
     assert(mixer);
-    
+
     switch (mixer->outChannels)
     {
         case JSS_AUDIO_STEREO:
@@ -202,7 +202,7 @@
             "outChannels=%d not stereo or mono!\n", mixer->outChannels);
             break;
     }
-    
+
     switch (mixer->outFormat)
     {
         case JSS_AUDIO_U16: sampSize *= sizeof(Uint16); break;
@@ -213,7 +213,7 @@
             JSSERROR(DMERR_INVALID_ARGS, -1,
             "outFormat=%d is not supported!\n", mixer->outFormat);
     }
-    
+
     return sampSize;
 }
 
@@ -221,9 +221,9 @@
 int jvmGetSampleRes(JSSMixer *mixer)
 {
     int sampRes = 0;
-    
+
     assert(mixer);
-    
+
     switch (mixer->outFormat)
     {
         case JSS_AUDIO_U16: case JSS_AUDIO_S16: sampRes = 16; break;
@@ -232,7 +232,7 @@
             JSSERROR(DMERR_INVALID_ARGS, -1,
             "outFormat=%d is not supported!\n", mixer->outFormat);
     }
-    
+
     return sampRes;
 }
 
@@ -241,12 +241,12 @@
 {
     int mixDone = mixLength, mixResult;
     JMIXER_ADDBUF_TYPE *ab = addBuffer;
-    
+
     if (!chn->chPlaying || chn->chMute)
         return;
 
     DBG("%s(%p, %d)\n", __FUNCTION__, chn, mixLength);
-    
+
     while (mixDone > 0)
     {
         if (chn->chDirection)
@@ -325,7 +325,7 @@
                 }
             }
         }
-        
+
         // Call the mixing innerloop functions
         if (chn->chDirection)
         {
@@ -360,7 +360,7 @@
                     ab, mixDone, zero);
             }
         }
-        
+
         mixDone -= mixResult;
         ab += mixResult * mixer->outChannels;
     }
@@ -386,7 +386,7 @@
 
     // Clear mixer->addBuffer
     memset(mixer->addBuffer, 0, mixLength * mixer->outChannels * sizeof(JMIXER_ADDBUF_TYPE));
-    
+
     ab = mixer->addBuffer;
     mixLeft = mixLength;
     while (mixLeft > 0)
@@ -423,7 +423,7 @@
                     jvmAdvanceChannel(mixer, chn, blockLength);
             }
 */
-        
+
         ab += blockLength * mixer->outChannels;
         mixLeft -= blockLength;
         mixer->cbCounter -= blockLength;
@@ -473,12 +473,12 @@
     assert(mixer);
 
     JSS_LOCK(mixer);
-    
+
     mixer->cbFreq = cbFreq;
     mixer->cbCounter = 0;
 
 //fprintf(stderr, "set(outFreq = %d, cbFreq = %d) = %d\n", mixer->outFreq, cbFreq, mixer->cbFreq);
-    
+
     JSS_UNLOCK(mixer);
     return DMERR_OK;
 }
@@ -505,7 +505,7 @@
 void jvmReset(JSSMixer * mixer, const int channel)
 {
     JSSChannel *c;
-    
+
     JSS_LOCK(mixer);
     c = &mixer->channels[channel];
 
@@ -521,10 +521,10 @@
           const Sint32 loopE, const int flags)
 {
     JSSChannel *c;
-    
+
     JSS_LOCK(mixer);
     c = &mixer->channels[channel];
-    
+
     FP_SETHL(c->chSize, size, 0);
     FP_SETHL(c->chLoopS, loopS, 0);
     FP_SETHL(c->chLoopE, loopE, 0);
@@ -532,7 +532,7 @@
     c->chFlags     = flags;
     c->chDirection = TRUE;
     c->chPos.dw    = c->chDeltaO.dw = 0;
-    
+
     JSS_UNLOCK(mixer);
 }
 
@@ -542,7 +542,7 @@
     JSS_LOCK(mixer);
 
     mixer->channels[channel].chFreq = freq;
-    
+
     if (mixer->outFreq > 0)
     {
         DMFixedPoint a, b;
@@ -588,7 +588,7 @@
     JSS_LOCK(mixer);
     FP_SETHL(mixer->channels[channel].chVolume, start, 0);
 
-    tmp = mixer->channels[channel].chVolumeD = 
+    tmp = mixer->channels[channel].chVolumeD =
         len > 0 ? ((mixer->outFreq * len) / 1000) : mixer->cbFreq;
 
     FP_SETHL(a, (end - start), 0);
@@ -649,7 +649,7 @@
 
     FP_SETHL(mixer->channels[channel].chPanning, start, 0);
 
-    tmp = mixer->channels[channel].chPanningD = 
+    tmp = mixer->channels[channel].chPanningD =
         len > 0 ? ((mixer->outFreq * len) / 1000) : mixer->cbFreq;
 
     FP_SETHL(a, (end - start), 0);
--- a/minijss/jssmix.h	Wed Mar 04 06:08:22 2015 +0200
+++ b/minijss/jssmix.h	Wed Mar 04 06:11:37 2015 +0200
@@ -70,7 +70,7 @@
                     outFreq,
                     globalVol;
     JSSChannel      channels[jsetNChannels];
-    
+
     int             addBufSize;
     JMIXER_ADDBUF_TYPE *addBuffer;
 
--- a/minijss/jssmod.c	Wed Mar 04 06:08:22 2015 +0200
+++ b/minijss/jssmod.c	Wed Mar 04 06:11:37 2015 +0200
@@ -38,11 +38,11 @@
 {
     size_t count = len;
     Sint8 t, value = 0;
-    
+
     while (count--)
     {
         t = *data;
-        
+
         if (ops & jsampFlipSign)
             t ^= 0x80;
 
@@ -52,7 +52,7 @@
             value = t;
             t = n;
         }
-        
+
         *(data++) = t;
     }
 
@@ -84,17 +84,17 @@
             *bp1++ = t >> 8;
             *bp2++ = t & 0xff;
         }
-        
+
         memcpy(data, tmpBuf, bufSize);
         dmFree(tmpBuf);
-        
+
         return jssEncodeSample8((Uint8 *) data, bufSize, ops);
     }
     else
     {
         Sint16 t, p, value = 0, *sdata = (Sint16 *) data;
         size_t count = len;
-        
+
         while (count--)
         {
             if (ops & jsampSwapEndianess)
@@ -104,17 +104,17 @@
             }
             else
                 t = *sdata;
-            
+
             if (ops & jsampDelta)
             {
                 int n = t - value;
                 value = t;
                 t = n;
             }
-            
+
             if (ops & jsampFlipSign)
                 t ^= 0x8000;
-            
+
             *(sdata++) = t;
         }
     }
@@ -130,17 +130,17 @@
 {
     size_t count = len;
     Sint8 t, value = 0;
-    
+
     while (count--)
     {
         t = *data;
-        
+
         if (ops & jsampDelta)
             t = value = t + value;
-        
+
         if (ops & jsampFlipSign)
             t ^= 0x80;
-        
+
         *(data++) = t;
     }
     return TRUE;
@@ -156,14 +156,14 @@
         size_t count, bufSize = len * sizeof(Uint16);
         Uint8 *bp1, *bp2;
         Sint16 *tmpBuf, *sdata;
-        
+
         if (!jssDecodeSample8((Uint8 *) data, bufSize, ops))
             return FALSE;
-        
+
         tmpBuf = dmMalloc(bufSize);
         if (tmpBuf == NULL) return FALSE;
         memcpy(tmpBuf, data, bufSize);
-        
+
         sdata = (Sint16 *) data;
         bp1 = (Uint8 *) tmpBuf;
         bp2 = bp1 + len;
@@ -172,7 +172,7 @@
         {
             *sdata++ = (*bp1++ << 8) | (*bp2++ & 0xff);
         }
-        
+
         dmFree(tmpBuf);
     }
     else
@@ -188,13 +188,13 @@
             }
             else
                 t = *sdata;
-            
+
             if (ops & jsampDelta)
                 t = value = t + value;
-            
+
             if (ops & jsampFlipSign)
                 t ^= 0x8000;
-            
+
             *(sdata++) = t;
         }
     }
@@ -213,12 +213,12 @@
     *dst = out = dmMalloc(sizeof(Sint16) * len);
     if (out == NULL)
         return DMERR_MALLOC;
-    
+
     while (count--)
     {
         *(out++) = (*(in++) * 256) - 32768;
     }
-    
+
     return DMERR_OK;
 }
 
@@ -255,7 +255,7 @@
             inst->data = data;
         }
     }
-    
+
     return DMERR_OK;
 }
 
@@ -299,7 +299,7 @@
 
     if (module == NULL)
         return DMERR_NULLPTR;
-    
+
     // Free strings
 #ifndef JSS_LIGHT
     dmFree(module->moduleName);
@@ -360,7 +360,7 @@
 #ifdef JSS_SUP_THREADS
     dmDestroyMutex(module->mutex);
 #endif
-    
+
     // Free the module structure
     memset(module, 0, sizeof(JSSModule));
     dmFree(module);
@@ -447,6 +447,6 @@
     {
         res->sNumForNotes[i] = jsetNotSet;
     }
-    
+
     return res;
 }
--- a/minijss/jssmod.h	Wed Mar 04 06:08:22 2015 +0200
+++ b/minijss/jssmod.h	Wed Mar 04 06:11:37 2015 +0200
@@ -185,7 +185,7 @@
     PATMODE_RAW_VERT,
     PATMODE_COMP_VERT,
     PATMODE_RAW_ELEM,
-    PATMODE_LAST    
+    PATMODE_LAST
 };
 
 /* JSSMOD typedefs
@@ -210,16 +210,16 @@
     /*
     - After this, norders long orders table will follow, of type:
       Sint16 orderList[norders];
-    
+
     - Pattern data, format depends on patMode.
-    
+
     - Extended instruments (*)
-    
+
     - Sample instrument headers (*)
-    
+
     - Sample data (format depends) (*)
-    
-    (*) Items are optional and may have been omitted. Fields in the 
+
+    (*) Items are optional and may have been omitted. Fields in the
         module and other headers are used to indicate if these items exist.
     */
 } JSSMODHeader;
--- a/minijss/jssplr.c	Wed Mar 04 06:08:22 2015 +0200
+++ b/minijss/jssplr.c	Wed Mar 04 06:11:37 2015 +0200
@@ -55,24 +55,24 @@
             mnote = (note % 12) * 8,
             moctave = note / 12,
             period1, period2;
-        
+
         period1 = jmpNoteToAmigaPeriod(mnote, mfinetune);
-        
+
         if (finetune < 0)
         {
             mfinetune--;
             finetune = -finetune;
         } else
             mfinetune++;
-        
+
         period2 = jmpNoteToAmigaPeriod(mnote, mfinetune);
-        
+
         mfinetune = finetune & 15;
         period1 *= (16 - mfinetune);
         period2 *= mfinetune;
-        
+
         res = ((period1 + period2) * 2) >> moctave;
-        
+
 //fprintf(stderr, "jmpGetAmigaPeriod(%d, %d) = %d\n", note, finetune, res);
     }
     else
@@ -123,7 +123,7 @@
 
     if (!pe->exec)
         return FALSE;
-    
+
     // Find current point, if not last point
     for (point = 0; point < env->npoints - 1; point++)
     {
@@ -170,7 +170,7 @@
         } else
             pe->frame++;
     }
-        
+
     return TRUE;
 }
 
@@ -236,7 +236,7 @@
 JSSPlayer *jmpInit(JSSMixer *pDevice)
 {
     JSSPlayer *mp;
-    
+
     // Allocate a player structure
     mp = dmMalloc0(sizeof(JSSPlayer));
     if (mp == NULL)
@@ -248,7 +248,7 @@
 #ifdef JSS_SUP_THREADS
     mp->mutex = dmCreateMutex();
 #endif
-    
+
     return mp;
 }
 
@@ -314,7 +314,7 @@
     // Initialize channel data
     for (i = 0; i < jsetNChannels; i++)
         jmpClearChannel(&mp->channels[i]);
-    
+
     JSS_UNLOCK(mp);
 }
 
@@ -347,7 +347,7 @@
         jvmRemoveCallback(mp->device);
         mp->isPlaying = FALSE;
     }
-    
+
     JSS_UNLOCK(mp);
 }
 
@@ -380,7 +380,7 @@
 {
     BOOL orderOK;
     int pattern;
-    
+
     pattern = jsetOrderEnd;
     mp->order = jsetNotSet;
     orderOK = FALSE;
@@ -622,7 +622,7 @@
 static void jmpDoTremolo(JSSPlayerChannel *chn, int channel)
 {
     (void) channel;
-    
+
     if (chn->tremolo.depth != 0 && chn->tremolo.speed != 0)
     {
         int delta, tmp = chn->tremolo.pos & 31;
@@ -1297,7 +1297,7 @@
     // ...And finally process the Normal effects
     if (currNote->effect == jsetNotSet)
         return;
-    
+
     param = currNote->param;
     JMPMAKEPARAM(param, paramX, paramY);
     JMPGETEFFECT(effect, currNote->effect);
@@ -1460,7 +1460,7 @@
                     jmpSetNewOrder(mp, mp->order + 1);
                 else
                     mp->isPlaying = FALSE;
-                
+
                 // Check for FT2 quirks
                 if (JMPGETMODFLAGS(mp, jmdfFT2Replay))
                     mp->row = mp->lastPatLoopRow;
@@ -1511,7 +1511,7 @@
 
         // Process extended instruments
         jmpProcessExtInstrument(chn, channel);
-        
+
         // Check NDFlags and update channel data
         int flags = chn->newDataFlags;
         if (!flags)
@@ -1545,7 +1545,7 @@
 
             if (flags & cdfNewPitch)
                 jmpCSetPitch(mp, chn, chn->pitch);
-                
+
             if (flags & (cdfNewFreq | cdfNewPitch))
                 jvmSetFreq(mp->device, channel, chn->freq);
 
--- a/minijss/jssplr.h	Wed Mar 04 06:08:22 2015 +0200
+++ b/minijss/jssplr.h	Wed Mar 04 06:11:37 2015 +0200
@@ -55,7 +55,7 @@
     JSSPlayerEnvelope volumeEnv, panningEnv;
 
     JSSPlayerVData vibrato, tremolo;
-        
+
     BOOL    keyOff;
 
     JSSInstrument  *instrument;           // Instrument
@@ -86,7 +86,7 @@
 
             iPatLoopRow,            // Pattern loop start row
             iPatLoopCount,          // Pattern loop count
-        
+
             iLastPortaParam,        // Last portamento effect parameter
             iLastPortaToNoteParam,  // Last porta-to-note parameter
             iLastPortaToNotePitch,  // Last porta-to-note pitch
@@ -101,7 +101,7 @@
             lastMultiRetrigParamY,
 
             lastSampleOffsetParam,
-            
+
             iSaveNDFlags;           // For notedelay-effect
 } JSSPlayerChannel;