static unsigned msb(size_t s)
{
unsigned result = 0;
- unsigned v;
if ((s & 0xff) != s) {
+ unsigned v;
/* The following is a tricky code ought to be equivalent to */
/* "(v = s >> 32) != 0" but suppresses warnings on 32-bit arch's. */
if (sizeof(size_t) > 4 && (v = s >> (sizeof(size_t) > 4 ? 32 : 0)) != 0)
pthread_attr_t attr;
pthread_t thr[100];
int i;
- int code;
printf("Testing %s\n", name);
if (nthreads > 100)
for (i = 0; i < nthreads; ++i)
{
- if ((code = pthread_create(thr + i, &attr, f1, (void *)(long)i)) != 0)
+ int code = pthread_create(thr + i, &attr, f1, (void *)(long)i);
+ if (code != 0)
{
fprintf(stderr, "pthread_create returned %d, thread %d\n", code, i);
abort();
}
for (i = 0; i < nthreads; ++i)
{
- if ((code = pthread_join(thr[i], NULL)) != 0)
+ int code = pthread_join(thr[i], NULL);
+ if (code != 0)
{
fprintf(stderr, "pthread_join returned %d, thread %d\n", code, i);
abort();
HANDLE thr[100];
struct tramp_args args[100];
int i;
- DWORD code;
printf("Testing %s\n", name);
if (nthreads > 100)
}
for (i = 0; i < nthreads; ++i)
{
- if ((code = WaitForSingleObject(thr[i], INFINITE)) != WAIT_OBJECT_0)
+ DWORD code = WaitForSingleObject(thr[i], INFINITE);
+ if (code != WAIT_OBJECT_0)
{
fprintf(stderr, "WaitForSingleObject returned %lu, thread %d\n",
(unsigned long)code, i);