Mercurial > hg > dmlib
diff minijss/jssmod.c @ 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 | 698ee83bac98 |
children | e466d10dae6d |
line wrap: on
line diff
--- 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; }