change underlying type of clock_t to be uniform and match ABI
authorRich Felker <dalias@aerifal.cx>
Fri, 24 May 2013 00:38:51 +0000 (20:38 -0400)
committerRich Felker <dalias@aerifal.cx>
Fri, 24 May 2013 00:38:51 +0000 (20:38 -0400)
previously we were using an unsigned type on 32-bit systems so that
subtraction would be well-defined when it wrapped, but since wrapping
is non-conforming anyway (when clock() overflows, it has to return -1)
the only use of unsigned would be to buy a little bit more time before
overflow. this does not seem worth having the type vary per-arch
(which leads to more arch-specific bugs) or disagree with the ABI musl
(mostly) follows.

arch/arm/bits/alltypes.h.sh
arch/i386/bits/alltypes.h.sh
arch/microblaze/bits/alltypes.h.sh
arch/mips/bits/alltypes.h.sh
arch/powerpc/bits/alltypes.h.sh

index c1db1a0c907a255d15cfaa64c5530cb8cc8ec80c..62e0327c751229bc38195926066844a852f20c19 100755 (executable)
@@ -104,7 +104,7 @@ TYPEDEF unsigned long long fsfilcnt_t;
 
 TYPEDEF void * timer_t;
 TYPEDEF int clockid_t;
-TYPEDEF unsigned long clock_t;
+TYPEDEF long clock_t;
 
 TYPEDEF struct { unsigned long __bits[128/sizeof(long)]; } sigset_t;
 TYPEDEF struct __siginfo siginfo_t;
index aec7373176ea3b74667ca3169315aa64d7474c3d..76c50ec1a43e138729de9dfccb8d3c6faf049d14 100755 (executable)
@@ -117,7 +117,7 @@ TYPEDEF unsigned long long fsfilcnt_t;
 
 TYPEDEF void * timer_t;
 TYPEDEF int clockid_t;
-TYPEDEF unsigned long clock_t;
+TYPEDEF long clock_t;
 
 TYPEDEF struct { unsigned long __bits[128/sizeof(long)]; } sigset_t;
 TYPEDEF struct __siginfo siginfo_t;
index 23f12d8e1a1c6e9a2ac6bdd507a95c6494ee67e3..268321a1b13edd535b664c2255340a84ac91f01f 100755 (executable)
@@ -104,7 +104,7 @@ TYPEDEF unsigned long long fsfilcnt_t;
 
 TYPEDEF void * timer_t;
 TYPEDEF int clockid_t;
-TYPEDEF unsigned long clock_t;
+TYPEDEF long clock_t;
 
 TYPEDEF struct { unsigned long __bits[128/sizeof(long)]; } sigset_t;
 TYPEDEF struct __siginfo siginfo_t;
index 23f12d8e1a1c6e9a2ac6bdd507a95c6494ee67e3..268321a1b13edd535b664c2255340a84ac91f01f 100755 (executable)
@@ -104,7 +104,7 @@ TYPEDEF unsigned long long fsfilcnt_t;
 
 TYPEDEF void * timer_t;
 TYPEDEF int clockid_t;
-TYPEDEF unsigned long clock_t;
+TYPEDEF long clock_t;
 
 TYPEDEF struct { unsigned long __bits[128/sizeof(long)]; } sigset_t;
 TYPEDEF struct __siginfo siginfo_t;
index 7d3cdc363077dc5d23c3899b83891a72d1941127..5fe05e27d1b1494913d118b91c231dd1bd9e80c8 100755 (executable)
@@ -104,7 +104,7 @@ TYPEDEF unsigned long long fsfilcnt_t;
 
 TYPEDEF void * timer_t;
 TYPEDEF int clockid_t;
-TYPEDEF unsigned long clock_t;
+TYPEDEF long clock_t;
 
 TYPEDEF struct { unsigned long __bits[128/sizeof(long)]; } sigset_t;
 TYPEDEF struct __siginfo siginfo_t;