shithub: sox

Download patch

ref: 221db683821e9767847dff63503f7835037444c7
parent: 081fad1eb8cbad7388b758b738d77edea4d82f5e
author: robs <robs>
date: Tue Feb 6 03:17:26 EST 2007

Okay, plan B; 1st steps towards 64-bit cleanliness

--- a/src/8svx.c
+++ b/src/8svx.c
@@ -295,7 +295,7 @@
         /* append all channel pieces to channel 0 */
         /* close temp files */
         for (i = 1; i < ft->signal.channels; i++) {
-                if (fseeko(p->ch[i], 0L, 0))
+                if (fseeko(p->ch[i], 0, 0))
                 {
                         st_fail_errno (ft,errno,"Can't rewind channel output file %d",i);
                         return(ST_EOF);
@@ -312,7 +312,7 @@
             st_writeb(ft, '\0');
 
         /* fixup file sizes in header */
-        if (st_seeki(ft, 0L, 0) != 0)
+        if (st_seeki(ft, 0, 0) != 0)
         {
                 st_fail_errno(ft,errno,"can't rewind output file to rewrite 8SVX header");
                 return(ST_EOF);
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,6 +1,6 @@
 ## Process this file with automake to produce Makefile.in
 
-AM_CFLAGS = @SNDFILE_CFLAGS@ @SAMPLERATE_CFLAGS@ -m32
+AM_CFLAGS = @SNDFILE_CFLAGS@ @SAMPLERATE_CFLAGS@
 AM_LDFLAGS = @SNDFILE_LIBS@ @SAMPLERATE_LIBS@
 
 # Pass flags from --enable-silent-libtool
--- a/src/aiff.c
+++ b/src/aiff.c
@@ -93,7 +93,7 @@
         unsigned short nmarks = 0;
         unsigned short sustainLoopBegin = 0, sustainLoopEnd = 0,
                        releaseLoopBegin = 0, releaseLoopEnd = 0;
-        st_size_t seekto = 0L, ssndsize = 0L;
+        st_size_t seekto = 0, ssndsize = 0;
         char *author;
         char *copyright;
         char *nametext;
@@ -682,7 +682,7 @@
            At 48 kHz, 16 bits stereo, this gives ~3 hours of music.
            Sorry, the AIFF format does not provide for an "infinite"
            number of samples. */
-        return(aiffwriteheader(ft, 0x7f000000L / (ft->signal.size*ft->signal.channels)));
+        return(aiffwriteheader(ft, 0x7f000000 / (ft->signal.size*ft->signal.channels)));
 }
 
 static st_size_t st_aiffwrite(ft_t ft, const st_sample_t *buf, st_size_t len)
@@ -718,7 +718,7 @@
             st_fail_errno(ft,ST_EOF,"Non-seekable file.");
             return(ST_EOF);
         }
-        if (st_seeki(ft, 0L, SEEK_SET) != 0)
+        if (st_seeki(ft, 0, SEEK_SET) != 0)
         {
                 st_fail_errno(ft,errno,"can't rewind output file to rewrite AIFF header");
                 return(ST_EOF);
@@ -735,7 +735,7 @@
         int i;
         int padded_comment_size = 0;
         int comment_size = 0;
-        st_size_t comment_chunk_size = 0L;
+        st_size_t comment_chunk_size = 0;
 
         /* MARK and INST chunks */
         if (ft->instr.nloops) {
@@ -772,7 +772,7 @@
           padded_comment_size = ((comment_size % 2) == 0) ?
                                 comment_size : comment_size + 1;
           /* one comment, timestamp, marker ID and text count */
-          comment_chunk_size = (2L + 4 + 2 + 2 + padded_comment_size);
+          comment_chunk_size = (2 + 4 + 2 + 2 + padded_comment_size);
           hsize += 8 /* COMT hdr */ + comment_chunk_size; 
         }
 
@@ -792,7 +792,7 @@
 
           /* time stamp of comment, Unix knows of time from 1/1/1970,
              Apple knows time from 1/1/1904 */
-          st_writedw(ft, ((int32_t) time(NULL)) + 2082844800L);
+          st_writedw(ft, ((int32_t) time(NULL)) + 2082844800);
 
           /* A marker ID of 0 indicates the comment is not associated
              with a marker */
@@ -895,7 +895,7 @@
            At 48 kHz, 16 bits stereo, this gives ~3 hours of music.
            Sorry, the AIFC format does not provide for an "infinite"
            number of samples. */
-        return(aifcwriteheader(ft, 0x7f000000L / (ft->signal.size*ft->signal.channels)));
+        return(aifcwriteheader(ft, 0x7f000000 / (ft->signal.size*ft->signal.channels)));
 }
 
 static int st_aifcstopwrite(ft_t ft)
@@ -923,7 +923,7 @@
             st_fail_errno(ft,ST_EOF,"Non-seekable file.");
             return(ST_EOF);
         }
-        if (st_seeki(ft, 0L, SEEK_SET) != 0)
+        if (st_seeki(ft, 0, SEEK_SET) != 0)
         {
                 st_fail_errno(ft,errno,"can't rewind output file to rewrite AIFC header");
                 return(ST_EOF);
@@ -964,7 +964,7 @@
         /* FVER chunk */
         st_writes(ft, "FVER");
         st_writedw(ft, 4); /* FVER chunk size */
-        st_writedw(ft, 0xa2805140L); /* version_date(May23,1990,2:40pm) */
+        st_writedw(ft, 0xa2805140); /* version_date(May23,1990,2:40pm) */
 
         /* COMM chunk -- describes encoding (and #frames) */
         st_writes(ft, "COMM");
@@ -1050,7 +1050,7 @@
  * NaN's, and denormalized numbers.
  */
 
-#define FloatToUnsigned(f) ((uint32_t)(((int32_t)(f - 2147483648.0)) + 2147483647L) + 1)
+#define FloatToUnsigned(f) ((uint32_t)(((int32_t)(f - 2147483648.0)) + 2147483647) + 1)
 
 static void ConvertToIeeeExtended(double num, char *bytes)
 {
@@ -1139,7 +1139,7 @@
  * NaN's, and denormalized numbers.
  */
 
-#define UnsignedToFloat(u)         (((double)((int32_t)(u - 2147483647L - 1))) + 2147483648.0)
+#define UnsignedToFloat(u)         (((double)((int32_t)(u - 2147483647 - 1))) + 2147483648.0)
 
 /****************************************************************
  * Extended precision IEEE floating-point conversion routine.
--- a/src/au.c
+++ b/src/au.c
@@ -368,7 +368,7 @@
         /* Attempt to update header */
         if (ft->seekable)
         {
-          if (st_seeki(ft, 0L, 0) != 0)
+          if (st_seeki(ft, 0, 0) != 0)
           {
                 st_fail_errno(ft,errno,"Can't rewind output file to rewrite Sun header.");
                 return(ST_EOF);
--- a/src/avr.c
+++ b/src/avr.c
@@ -267,11 +267,11 @@
       return rc;
 
   /* Fix size */
-  st_seeki(ft, 26L, SEEK_SET);
+  st_seeki(ft, 26, SEEK_SET);
   st_writedw (ft, size);
 
   /* Fix lend */
-  st_seeki(ft, 34L, SEEK_SET);
+  st_seeki(ft, 34, SEEK_SET);
   st_writedw (ft, size);
 
   return(ST_SUCCESS);
--- a/src/cdr.c
+++ b/src/cdr.c
@@ -48,7 +48,7 @@
         if (rc)
             return rc;
 
-        ft->signal.rate = 44100L;
+        ft->signal.rate = 44100;
         ft->signal.size = ST_SIZE_16BIT;
         ft->signal.encoding = ST_ENCODING_SIGN2;
         ft->signal.channels = 2;
@@ -99,7 +99,7 @@
 
         cdr->samples = 0;
 
-        ft->signal.rate = 44100L;
+        ft->signal.rate = 44100;
         ft->signal.size = ST_SIZE_16BIT;
         ft->signal.encoding = ST_ENCODING_SIGN2;
         ft->signal.channels = 2;
--- a/src/cvsd.c
+++ b/src/cvsd.c
@@ -550,7 +550,7 @@
             st_warn("File not seekable");
             return (ST_EOF);
         }
-        if (st_seeki(ft, 0L, 0) != 0)
+        if (st_seeki(ft, 0, 0) != 0)
         {
                 st_fail_errno(ft,errno,"Can't rewind output file to rewrite DVMS header.");
                 return(ST_EOF);
--- a/src/dither.c
+++ b/src/dither.c
@@ -73,7 +73,7 @@
 
   *isamp = *osamp = len;
   while (len--) {             /* 16 signed bits of triangular noise */
-    int tri16 = ((rand() % 32768L) + (rand() % 32768L)) - 32767;
+    int tri16 = ((rand() % 32768) + (rand() % 32768)) - 32767;
     double l = *ibuf++ + tri16 * dither->amount;
     *obuf++ = ST_ROUND_CLIP_COUNT(l, effp->clips);
   }
--- a/src/echo.c
+++ b/src/echo.c
@@ -61,7 +61,7 @@
 
 static st_effect_t st_echo_effect;
 
-#define DELAY_BUFSIZ ( 50L * ST_MAXRATE )
+#define DELAY_BUFSIZ ( 50 * ST_MAXRATE )
 #define MAX_ECHOS 7     /* 24 bit x ( 1 + MAX_ECHOS ) = */
                         /* 24 bit x 8 = 32 bit !!!      */
 
@@ -120,7 +120,7 @@
         float sum_in_volume;
         long j;
 
-        echo->maxsamples = 0L;
+        echo->maxsamples = 0;
         if ( echo->in_gain < 0.0 )
         {
                 st_fail("echo: gain-in must be positive!");
--- a/src/g72x.c
+++ b/src/g72x.c
@@ -91,7 +91,7 @@
 {
         int             cnta;
 
-        state_ptr->yl = 34816L;
+        state_ptr->yl = 34816;
         state_ptr->yu = 544;
         state_ptr->dms = 0;
         state_ptr->dml = 0;
@@ -388,7 +388,7 @@
         } else if (sr > 0) {
                 exp = quan(sr, power2, 15);
                 state_ptr->sr[0] = (exp << 6) + ((sr << 6) >> exp);
-        } else if (sr > -32768L) {
+        } else if (sr > -32768) {
                 mag = -sr;
                 exp = quan(mag, power2, 15);
                 state_ptr->sr[0] =  (exp << 6) + ((mag << 6) >> exp) - 0x400;
@@ -453,7 +453,7 @@
         int             im;     /* biased magnitude of i */
         int             imx;    /* biased magnitude of id */
 
-        if (sr <= -32768L)
+        if (sr <= -32768)
                 sr = -1;
         sp = st_13linear2alaw(((sr >> 1) << 3));/* short to A-law compression */
         dx = (st_alaw2linear16(sp) >> 2) - se;  /* 16-bit prediction error */
@@ -495,7 +495,7 @@
         int             im;     /* biased magnitude of i */
         int             imx;    /* biased magnitude of id */
 
-        if (sr <= -32768L)
+        if (sr <= -32768)
                 sr = 0;
         sp = st_14linear2ulaw((sr << 2));/* short to u-law compression */
         dx = (st_ulaw2linear16(sp) >> 2) - se;  /* 16-bit prediction error */
--- a/src/hcom.c
+++ b/src/hcom.c
@@ -185,7 +185,7 @@
                         p->cksum += p->current;
                         p->nrbits = 32;
                 }
-                if(p->current & 0x80000000L) {
+                if(p->current & 0x80000000) {
                         p->dictentry =
                                 p->dictionary[p->dictentry].dict_rightson;
                 } else {
@@ -415,7 +415,7 @@
   dfp = datafork + 4;
   put32_be(&dfp, *dl);
   put32_be(&dfp, p->new_checksum);
-  put32_be(&dfp, 1L);
+  put32_be(&dfp, 1);
   samplerate = 22050 / (int32_t)fr;
   put32_be(&dfp, samplerate);
   put16_be(&dfp, dictsize);
--- a/src/maud.c
+++ b/src/maud.c
@@ -226,7 +226,7 @@
             ft->signal.encoding == ST_ENCODING_SIGN2) 
             ft->signal.encoding = ST_ENCODING_UNSIGNED;
         
-        p->nsamples = 0x7f000000L;
+        p->nsamples = 0x7f000000;
         maudwriteheader(ft);
         p->nsamples = 0;
         return (ST_SUCCESS);
@@ -252,7 +252,7 @@
 
         /* All samples are already written out. */
         
-        if (st_seeki(ft, 0L, 0) != 0) 
+        if (st_seeki(ft, 0, 0) != 0) 
         {
             st_fail_errno(ft,errno,"can't rewind output file to rewrite MAUD header");
             return(ST_EOF);
--- a/src/misc.c
+++ b/src/misc.c
@@ -449,13 +449,13 @@
     } u;
 
     u.f= f;
-    u.dw= (u.dw>>24) | ((u.dw>>8)&0xff00) | ((u.dw<<8)&0xff0000L) | (u.dw<<24);
+    u.dw= (u.dw>>24) | ((u.dw>>8)&0xff00) | ((u.dw<<8)&0xff0000) | (u.dw<<24);
     return u.f;
 }
 
 uint32_t st_swap24(uint24_t udw)
 {
-    return ((udw >> 16) & 0xff) | (udw & 0xff00) | ((udw << 16) & 0xff0000L);
+    return ((udw >> 16) & 0xff) | (udw & 0xff00) | ((udw << 16) & 0xff0000);
 }
 
 double st_swapd(double df)
--- a/src/polyphas.c
+++ b/src/polyphas.c
@@ -164,7 +164,7 @@
   for (k=ct; k>1; ) {
     int tmp;
     unsigned long j;
-    j = (rand()%32768L) + ((rand()%32768L)<<13); /* reasonably big */
+    j = (rand()%32768) + ((rand()%32768)<<13); /* reasonably big */
     j = j % k; /* non-negative! */
     k--;
     if (j != k) {
--- a/src/prc.c
+++ b/src/prc.c
@@ -174,7 +174,7 @@
             return ST_SUCCESS;
         }
 
-        if (st_seeki(ft, 0L, 0) != 0)
+        if (st_seeki(ft, 0, 0) != 0)
         {
                 st_fail_errno(ft,errno,"Can't rewind output file to rewrite Psion header.");
                 return(ST_EOF);
--- a/src/repeat.c
+++ b/src/repeat.c
@@ -100,7 +100,7 @@
         if (repeat->first_drain == 1) {
                 repeat->first_drain = 0;
 
-                fseeko(repeat->fp, 0L, SEEK_END);
+                fseeko(repeat->fp, 0, SEEK_END);
                 repeat->total = ftello(repeat->fp);
 
                 if ((repeat->total % sizeof(st_sample_t)) != 0) {
@@ -111,7 +111,7 @@
                 repeat->total /= sizeof(st_sample_t);
                 repeat->remaining = repeat->total;
 
-                fseeko(repeat->fp, 0L, SEEK_SET);
+                fseeko(repeat->fp, 0, SEEK_SET);
         }
 
         if (repeat->remaining == 0) {
@@ -120,7 +120,7 @@
                         return (ST_EOF);
                 } else {
                         repeat->repeats--;
-                        fseeko(repeat->fp, 0L, SEEK_SET);
+                        fseeko(repeat->fp, 0, SEEK_SET);
                         repeat->remaining = repeat->total;
                 }
         }
@@ -142,7 +142,7 @@
 
                 while (repeat->repeats > 0) {
                         repeat->repeats--;
-                        fseeko(repeat->fp, 0L, SEEK_SET);
+                        fseeko(repeat->fp, 0, SEEK_SET);
 
                         if (repeat->total >= *osamp - done) {
                                 samp = *osamp - done;
--- a/src/resample.c
+++ b/src/resample.c
@@ -527,9 +527,9 @@
       Xp = r->X + (long)time;      /* Ptr to current input sample */
 
       /* Past  inner product: */
-      v = (*prodUD)(r->Imp, Xp, -1L, T, r->dhb, r->Xh); /* needs Np*Nmult in 31 bits */
+      v = (*prodUD)(r->Imp, Xp, -1, T, r->dhb, r->Xh); /* needs Np*Nmult in 31 bits */
       /* Future inner product: */
-      v += (*prodUD)(r->Imp, Xp+1, 1L, (1.0-T), r->dhb, r->Xh); /* prefer even total */
+      v += (*prodUD)(r->Imp, Xp+1, 1, (1.0-T), r->dhb, r->Xh); /* prefer even total */
 
       if (Factor < 1) v *= Factor;
       *Y++ = v;              /* Deposit output */
--- a/src/reverb.c
+++ b/src/reverb.c
@@ -98,7 +98,7 @@
 static st_effect_t st_reverb_effect;
 
 #define REVERB_FADE_THRESH 10
-#define DELAY_BUFSIZ ( 50L * ST_MAXRATE )
+#define DELAY_BUFSIZ ( 50 * ST_MAXRATE )
 #define MAXREVERBS 8
 
 /* Private data for SKEL file */
--- a/src/reverse.c
+++ b/src/reverse.c
@@ -86,7 +86,7 @@
 
         if (reverse->phase == WRITING) {
                 fflush(reverse->fp);
-                fseeko(reverse->fp, 0L, SEEK_END);
+                fseeko(reverse->fp, 0, SEEK_END);
                 reverse->pos = ftello(reverse->fp);
                 if (reverse->pos % sizeof(st_sample_t) != 0)
                 {
--- a/src/skelform.c
+++ b/src/skelform.c
@@ -58,7 +58,7 @@
    * If your format contains a header with format information
    * then you should set it here.
    */
-  ft->signal.rate =  44100L;
+  ft->signal.rate =  44100;
   ft->signal.size = ST_SIZE_BYTE; /* or WORD ... */
   ft->signal.encoding = ST_ENCODING_UNSIGNED; /* or SIGN2 ... */
   ft->signal.channels = 1; /* or 2 or 4 */
@@ -137,7 +137,7 @@
     return ST_EOF;
   }
 
-  if (ft->signal.rate != 44100L)
+  if (ft->signal.rate != 44100)
     st_fail("Output .skel file must have a sample rate of 44100Hz");
 
   if (ft->signal.size == -1) {
--- a/src/smp.c
+++ b/src/smp.c
@@ -254,7 +254,7 @@
 
         /* seek from the current position (the start of sample data) by */
         /* NoOfSamps * sizeof(int16_t) */
-        if (st_seeki(ft, smp->NoOfSamps * 2L, 1) == -1)
+        if (st_seeki(ft, smp->NoOfSamps * 2, 1) == -1)
         {
                 st_fail_errno(ft,errno,"SMP unable to seek to trailer");
                 return(ST_EOF);
--- a/src/sndrtool.c
+++ b/src/sndrtool.c
@@ -167,7 +167,7 @@
             return rc;
 
         /* fixup file sizes in header */
-        if (st_seeki(ft, 0L, 0) != 0){
+        if (st_seeki(ft, 0, 0) != 0){
                 st_fail_errno(ft,errno,"can't rewind output file to rewrite SND header");
                 return ST_EOF;
         }
--- a/src/sphere.c
+++ b/src/sphere.c
@@ -243,7 +243,7 @@
     if (rc)
         return rc;
 
-    if (st_seeki(ft, 0L, 0) != 0)
+    if (st_seeki(ft, 0, 0) != 0)
     {
         st_fail_errno(ft,errno,"Could not rewird output file to rewrite sphere header.");
         return (ST_EOF);
--- a/src/st.h
+++ b/src/st.h
@@ -37,8 +37,8 @@
 typedef int32_t int24_t;     /* But beware of the extra byte. */
 typedef uint32_t uint24_t;   /* ditto */
 
-#define ST_INT_MIN(bits) (1L <<((bits)-1))
-#define ST_INT_MAX(bits) (-1UL>>(33-(bits)))
+#define ST_INT_MIN(bits) (1 <<((bits)-1))
+#define ST_INT_MAX(bits) (-1U>>(33-(bits)))
 #define ST_UINT_MAX(bits) (ST_INT_MIN(bits)|ST_INT_MAX(bits))
 
 #define ST_INT8_MAX  ST_INT_MAX(8)
@@ -87,9 +87,9 @@
 #define ST_SAMPLE_TO_UNSIGNED(bits,d,clips) \
   (uint##bits##_t)( \
     st_macro_temp_sample=d, \
-    st_macro_temp_sample>(st_sample_t)(ST_SAMPLE_MAX-(1UL<<(31-bits)))? \
+    st_macro_temp_sample>(st_sample_t)(ST_SAMPLE_MAX-(1U<<(31-bits)))? \
       ++(clips),ST_UINT_MAX(bits): \
-      ((uint32_t)(st_macro_temp_sample^ST_SAMPLE_NEG)+(1UL<<(31-bits)))>>(32-bits))
+      ((uint32_t)(st_macro_temp_sample^ST_SAMPLE_NEG)+(1U<<(31-bits)))>>(32-bits))
 #define ST_SAMPLE_TO_SIGNED(bits,d,clips) \
   (int##bits##_t)(ST_SAMPLE_TO_UNSIGNED(bits,d,clips)^ST_INT_MIN(bits))
 #define ST_SIGNED_TO_SAMPLE(bits,d)((st_sample_t)(d)<<(32-bits))
@@ -147,18 +147,18 @@
 
 typedef uint32_t st_size_t;
 /* Maximum value size type can hold. (Minimum is 0). */
-#define ST_SIZE_MAX 0xffffffffL
+#define ST_SIZE_MAX 0xffffffff
 
 typedef int32_t st_ssize_t;
 /* Minimum and maximum value signed size type can hold. */
-#define ST_SSIZE_MAX 0x7fffffffL
-#define ST_SSIZE_MIN (-ST_SSIZE_MAX - 1L)
+#define ST_SSIZE_MAX 0x7fffffff
+#define ST_SSIZE_MIN (-ST_SSIZE_MAX - 1)
 
 typedef unsigned st_rate_t;
 /* Warning, this is a MAX value used in the library.  Each format and
  * effect may have its own limitations of rate.
  */
-#define ST_MAXRATE      (50UL * 1024) /* maximum sample rate in library */
+#define ST_MAXRATE      (50U * 1024) /* maximum sample rate in library */
 
 typedef enum {
   ST_ENCODING_UNKNOWN   ,
--- a/src/st_i.h
+++ b/src/st_i.h
@@ -138,7 +138,7 @@
 #define st_swapdw(x) bswap_32(x)
 #else
 #define st_swapw(uw) (((uw >> 8) | (uw << 8)) & 0xffff)
-#define st_swapdw(udw) ((udw >> 24) | ((udw >> 8) & 0xff00) | ((udw << 8) & 0xff0000L) | (udw << 24))
+#define st_swapdw(udw) ((udw >> 24) | ((udw >> 8) & 0xff00) | ((udw << 8) & 0xff0000) | (udw << 24))
 #endif
 float st_swapf(float f);
 uint32_t st_swap24(uint32_t udw);
--- a/src/tx16w.c
+++ b/src/tx16w.c
@@ -97,7 +97,7 @@
     while (st_readb(ft, (unsigned char *)&trash) != ST_EOF)
         num_samp_bytes++; 
     num_samp_bytes -= 32;         /* calculate num samples by sub header size */
-    st_seeki(ft, 0L, 0);           /* rewind file */
+    st_seeki(ft, 0, 0);           /* rewind file */
     sk->rest = num_samp_bytes;    /* set how many sample bytes to read */
 
     /* first 6 bytes are file type ID LM8953 */
--- a/src/voc.c
+++ b/src/voc.c
@@ -332,7 +332,7 @@
         if (v->silent) {
                 /* Fill in silence */
                 for(;v->rest && (done < len); v->rest--, done++)
-                        *buf++ = 0x80000000L;
+                        *buf++ = 0x80000000;
         }
         /* else, not silence, read the block */
         else {
@@ -728,7 +728,7 @@
                                 ft->signal.channels = 2;  /* Stereo */
                         /* Needed number of channels before finishing
                            compute for rate */
-                        ft->signal.rate = (256000000L/(65536L - v->rate))/
+                        ft->signal.rate = (256000000/(65536 - v->rate))/
                             ft->signal.channels;
                         /* An extended block must be followed by a data */
                         /* block to be valid so loop back to top so it  */
@@ -770,7 +770,7 @@
               st_writeb(ft, 4);                /* block length = 4 */
               st_writeb(ft, 0);                /* block length = 4 */
               st_writeb(ft, 0);                /* block length = 4 */
-                  v->rate = 65536L - (256000000.0/(2*(float)ft->signal.rate));
+                  v->rate = 65536 - (256000000.0/(2*(float)ft->signal.rate));
               st_writew(ft,v->rate);    /* Rate code */
               st_writeb(ft, 0);         /* File is not packed */
               st_writeb(ft, 1);         /* samples are in stereo */
--- a/src/wav.c
+++ b/src/wav.c
@@ -1271,7 +1271,7 @@
     uint32_t dwSamplesWritten=0;  /* windows doesnt seem to use this*/
 
     /* data chunk */
-    uint32_t  dwDataLength=0x7ffff000L; /* length of sound data in bytes */
+    uint32_t  dwDataLength=0x7ffff000; /* length of sound data in bytes */
     /* end of variables written to header */
 
     /* internal variables, intermediate values etc */
@@ -1621,7 +1621,7 @@
         if (!ft->seekable)
                 return ST_EOF;
 
-        if (st_seeki(ft, 0L, SEEK_SET) != 0)
+        if (st_seeki(ft, 0, SEEK_SET) != 0)
         {
                 st_fail_errno(ft,ST_EOF,"Can't rewind output file to rewrite .wav header.");
                 return ST_EOF;
--- a/src/wve.c
+++ b/src/wve.c
@@ -162,7 +162,7 @@
             return ST_SUCCESS;
         }
 
-        if (st_seeki(ft, 0L, 0) != 0)
+        if (st_seeki(ft, 0, 0) != 0)
         {
                 st_fail_errno(ft,errno,"Can't rewind output file to rewrite Psion header.");
                 return(ST_EOF);