Fix 32bit builds
authorRobin Gareus <robin@gareus.org>
Thu, 19 Apr 2018 13:36:01 +0000 (15:36 +0200)
committerRobin Gareus <robin@gareus.org>
Thu, 19 Apr 2018 13:36:30 +0000 (15:36 +0200)
Unsigned long is 32bit on 32bit systems, besides sampleoffset and start
variables are signed int64_t.

resulting in a compiler error:
integer constant is too large for 'unsigned long' type.

libs/ptformat/ptfformat.cc

index 89f3062da10860ea2261ce01ede77fe1ef7d1ea2..6fc4b115e5a1c8c33e753336b1235a6aac8ef8d6 100644 (file)
@@ -1760,9 +1760,9 @@ nocustom:
                        j+=startbytes;
 
                        if (offsetbytes == 5)
-                               sampleoffset -= 1000000000000ul;
+                               sampleoffset -= 1000000000000;
                        if (startbytes == 5)
-                               start -= 1000000000000ul;
+                               start -= 1000000000000;
 
                        std::string filename = string(name);
                        wav_t f = {
@@ -1873,8 +1873,8 @@ nocustom:
                                        }
                                        m+=8;
                                        findex3 = ptfunxored[m] | (ptfunxored[m+1] << 8);
-                                       sampleoffset -= 1000000000000ul;
-                                       start -= 1000000000000ul;
+                                       sampleoffset -= 1000000000000;
+                                       start -= 1000000000000;
 
                                        /*
                                        // Find wav with correct findex
@@ -2031,9 +2031,9 @@ nocustom:
                        j+=startbytes;
 
                        if (offsetbytes == 5)
-                               sampleoffset -= 1000000000000ul;
+                               sampleoffset -= 1000000000000;
                        if (startbytes == 5)
-                               start -= 1000000000000ul;
+                               start -= 1000000000000;
 
                        std::string filename = string(name);
                        wav_t f = {