diff options
author | rlar <rlar> | 2016-03-16 19:46:14 +0100 |
---|---|---|
committer | Will Estes <westes575@gmail.com> | 2016-03-18 14:49:23 -0400 |
commit | ed59d3e0664b938f7f4854692349b9d59839fad6 (patch) | |
tree | 58009bb252a6ff222aa7609f3bdda374d724116c /tests | |
parent | c2429b5a4a6a0e7030c36f75e16ec68923f32cc6 (diff) |
warning: conversion to 'long unsigned int' from 'int' may change the sign of the result [-Wsign-conversion]
Diffstat (limited to 'tests')
-rw-r--r-- | tests/mem_nr.l | 2 | ||||
-rw-r--r-- | tests/mem_r.l | 2 | ||||
-rw-r--r-- | tests/pthread.l | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/tests/mem_nr.l b/tests/mem_nr.l index 816bc03..0c75dbd 100644 --- a/tests/mem_nr.l +++ b/tests/mem_nr.l @@ -96,7 +96,7 @@ void * yyalloc(yy_size_t n) if( nptrs >= arrsz){ /* increase array size by 1 */ arrsz++; - ptrs = realloc(ptrs, arrsz * sizeof(struct memsz)); + ptrs = realloc(ptrs, (size_t) arrsz * sizeof(struct memsz)); ptrs[nptrs].p = 0; ptrs[nptrs].sz = 0; } diff --git a/tests/mem_r.l b/tests/mem_r.l index 7270d38..4b24294 100644 --- a/tests/mem_r.l +++ b/tests/mem_r.l @@ -98,7 +98,7 @@ void * yyalloc(yy_size_t n , void* yyscanner) if( nptrs >= arrsz){ /* increase array size by 1 */ arrsz++; - ptrs = realloc(ptrs, arrsz * sizeof(struct memsz)); + ptrs = realloc(ptrs, (size_t) arrsz * sizeof(struct memsz)); ptrs[nptrs].p = 0; ptrs[nptrs].sz = 0; } diff --git a/tests/pthread.l b/tests/pthread.l index b2ca8c1..7d0dc7f 100644 --- a/tests/pthread.l +++ b/tests/pthread.l @@ -165,7 +165,7 @@ int main (int ARGC, char *ARGV[]) } /* Allocate and initialize the locks. One for each filename in ARGV. */ - file_locks = malloc((ARGC-1) * sizeof(pthread_mutex_t)); + file_locks = malloc((size_t) (ARGC-1) * sizeof(pthread_mutex_t)); for( i = 0; i < ARGC-1; i++) pthread_mutex_init( &file_locks[i], NULL ); |