diff options
author | Manoj Srivastava <srivasta@debian.org> | 2016-07-31 15:00:12 -0700 |
---|---|---|
committer | Manoj Srivastava <srivasta@debian.org> | 2016-07-31 15:00:12 -0700 |
commit | dc20a68ba953b2a5da0311f3ce9f9217f9ad60b3 (patch) | |
tree | e45fdd69828a8668029d07f8601442cbb9258559 /tests/mem_r.l | |
parent | e68e1da425634fda40095a7b3196d4175f782987 (diff) | |
parent | 487177cbb85bc4e88e468c71b27569054b8df090 (diff) |
Merge branch 'upstream'
Signed-off-by: Manoj Srivastava <srivasta@debian.org>
# Conflicts:
# src/buf.c
# src/flex.skl
# src/skel.c
Diffstat (limited to 'tests/mem_r.l')
-rw-r--r-- | tests/mem_r.l | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/mem_r.l b/tests/mem_r.l index cbfe08c..33b9888 100644 --- a/tests/mem_r.l +++ b/tests/mem_r.l @@ -93,12 +93,12 @@ void * yyalloc(yy_size_t n , void* yyscanner) 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; } @@ -125,7 +125,7 @@ void * yyrealloc(void* p, yy_size_t n , void* yyscanner) 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", @@ -168,7 +168,7 @@ main () { yyscan_t scanner; arrsz = 1; - ptrs = (struct memsz*)calloc(1,sizeof(struct memsz)); + ptrs = calloc(1, sizeof(struct memsz)); nptrs = 0; yylex_init(&scanner); |