Revision: 3175 Author: eliot Date: 2014-12-10 17:45:10 -0800 (Wed, 10 Dec 2014) Log Message: ----------- Fix 64-bit issues in the SoundCodec plugin. Modified Paths: -------------- trunk/platforms/Cross/plugins/SoundCodecPrims/SoundCodecPrims.h trunk/platforms/Cross/plugins/SoundCodecPrims/sqSoundCodecPluginBasicPrims.c Property Changed: ---------------- trunk/platforms/Cross/plugins/sqPluginsSCCSVersion.h Modified: trunk/platforms/Cross/plugins/SoundCodecPrims/SoundCodecPrims.h =================================================================== --- trunk/platforms/Cross/plugins/SoundCodecPrims/SoundCodecPrims.h 2014-12-11 00:45:48 UTC (rev 3174) +++ trunk/platforms/Cross/plugins/SoundCodecPrims/SoundCodecPrims.h 2014-12-11 01:45:10 UTC (rev 3175) @@ -1,17 +1,17 @@ /* SoundCodec Plugin */ /* prototypes */ void gsmEncode( - int state, int frameCount, - int src, int srcIndex, int srcSize, - int dst, int dstIndex, int dstSize, - int *srcDelta, int *dstDelta); + long state, long frameCount, + long src, long srcIndex, long srcSize, + long dst, long dstIndex, long dstSize, + long *srcDelta, long *dstDelta); void gsmDecode( - int state, int frameCount, - int src, int srcIndex, int srcSize, - int dst, int dstIndex, int dstSize, - int *srcDelta, int *dstDelta); + long state, long frameCount, + long src, long srcIndex, long srcSize, + long dst, long dstIndex, long dstSize, + long *srcDelta, long *dstDelta); -void gsmInitState(int state); +void gsmInitState(long state); -int gsmStateBytes(void); +long gsmStateBytes(void); Modified: trunk/platforms/Cross/plugins/SoundCodecPrims/sqSoundCodecPluginBasicPrims.c =================================================================== --- trunk/platforms/Cross/plugins/SoundCodecPrims/sqSoundCodecPluginBasicPrims.c 2014-12-11 00:45:48 UTC (rev 3174) +++ trunk/platforms/Cross/plugins/SoundCodecPrims/sqSoundCodecPluginBasicPrims.c 2014-12-11 01:45:10 UTC (rev 3175) @@ -13,6 +13,8 @@ #include <stdio.h> #include <string.h> +#include "SoundCodecPrims.h" + /****** begin "gsm.h" *****/ #ifdef __cplusplus @@ -130,11 +132,16 @@ /****** begin "private.h" *****/ typedef short word; /* 16 bit signed int */ -typedef long longword; /* 32 bit signed int */ - typedef unsigned short uword; /* unsigned word */ -typedef unsigned long ulongword; /* unsigned longword */ +#if _LP64 +typedef int longword; /* 32 bit signed int */ +typedef unsigned int ulongword; /* unsigned longword */ +#else +typedef long longword; /* 32 bit signed int */ +typedef unsigned long ulongword; /* unsigned longword */ +#endif + struct gsm_state { word dp0[ 280 ]; @@ -3842,31 +3849,14 @@ /***** Squeak Interface Code Starts Here *****/ -/* prototypes */ -void gsmEncode( - int state, int frameCount, - int src, int srcIndex, int srcSize, - int dst, int dstIndex, int dstSize, - int *srcDelta, int *dstDelta); - -void gsmDecode( - int state, int frameCount, - int src, int srcIndex, int srcSize, - int dst, int dstIndex, int dstSize, - int *srcDelta, int *dstDelta); - -void gsmInitState(int state); - -int gsmStateBytes(void); - /* glue functions */ void gsmEncode( - int state, int frameCount, - int src, int srcIndex, int srcSize, - int dst, int dstIndex, int dstSize, - int *srcDelta, int *dstDelta) { - int maxSrcFrames, maxDstFrames, srcPtr, dstPtr, i; + long state, long frameCount, + long src, long srcIndex, long srcSize, + long dst, long dstIndex, long dstSize, + long *srcDelta, long *dstDelta) { + long maxSrcFrames, maxDstFrames, srcPtr, dstPtr, i; maxSrcFrames = (srcSize + 1 - srcIndex) / 160; maxDstFrames = (dstSize + 1 - dstIndex) / 33; @@ -3885,11 +3875,11 @@ } void gsmDecode( - int state, int frameCount, - int src, int srcIndex, int srcSize, - int dst, int dstIndex, int dstSize, - int *srcDelta, int *dstDelta) { - int maxSrcFrames, maxDstFrames, srcPtr, dstPtr, i; + long state, long frameCount, + long src, long srcIndex, long srcSize, + long dst, long dstIndex, long dstSize, + long *srcDelta, long *dstDelta) { + long maxSrcFrames, maxDstFrames, srcPtr, dstPtr, i; maxSrcFrames = (srcSize + 1 - srcIndex) / 33; maxDstFrames = (dstSize + 1 - dstIndex) / 160; @@ -3907,13 +3897,11 @@ *dstDelta = frameCount * 160; } -void gsmInitState(int state) { +void gsmInitState(long state) { /* Initialize the given GSM state record. */ memset((char *) state, 0, sizeof(struct gsm_state)); ((gsm) state)->nrp = 40; } -int gsmStateBytes(void) { /* Return the size of a GSM state record in bytes. */ - return sizeof(struct gsm_state); -} +long gsmStateBytes(void) { return sizeof(struct gsm_state); } Property changes on: trunk/platforms/Cross/plugins/sqPluginsSCCSVersion.h ___________________________________________________________________ Modified: checkindate - Wed Dec 10 16:46:07 PST 2014 + Wed Dec 10 17:45:29 PST 2014 |
Free forum by Nabble | Edit this page |