summaryrefslogtreecommitdiff
path: root/tests/mem_nr.l
diff options
context:
space:
mode:
Diffstat (limited to 'tests/mem_nr.l')
-rw-r--r--tests/mem_nr.l8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/mem_nr.l b/tests/mem_nr.l
index c7a6ce0..f25848f 100644
--- a/tests/mem_nr.l
+++ b/tests/mem_nr.l
@@ -91,12 +91,12 @@ void * yyalloc(yy_size_t n)
int i;
total_mem += n;
- p = (void*)malloc(n);
+ p = malloc(n);
if( nptrs >= arrsz){
/* increase array size by 1 */
arrsz++;
- ptrs = (struct memsz*)realloc( ptrs, arrsz * sizeof(struct memsz));
+ ptrs = realloc(ptrs, arrsz * sizeof(struct memsz));
ptrs[nptrs].p = 0;
ptrs[nptrs].sz = 0;
}
@@ -121,7 +121,7 @@ void * yyrealloc(void* p, yy_size_t n)
if ( ptrs[i].p == p){
total_mem -= ptrs[i].sz;
total_mem += n;
- ptrs[i].p = (void*)realloc(p,n);
+ ptrs[i].p = realloc(p,n);
ptrs[i].sz = n;
printf("yyflex_realloc(%#10lx,%8ld) total=%8ld return=%8lx\n",
@@ -161,7 +161,7 @@ int
main ()
{
arrsz = 1;
- ptrs = (struct memsz*)calloc(1,sizeof(struct memsz));
+ ptrs = calloc(1, sizeof(struct memsz));
nptrs = 0;
yyin = stdin;