lkml.org 
[lkml]   [2009]   [Apr]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 20/56] inflate: Remove void casts
    Will Newton wrote:
    > On Wed, Apr 8, 2009 at 2:54 PM, Jack Stone <jwjstone@fastmail.fm> wrote:
    >
    >> lib/inflate.c | 5 ++---
    >> 1 files changed, 2 insertions(+), 3 deletions(-)
    >>
    >> diff --git a/lib/inflate.c b/lib/inflate.c
    >> index 1a8e8a9..1eb0cd8 100644
    >> --- a/lib/inflate.c
    >> +++ b/lib/inflate.c
    >> @@ -249,7 +249,7 @@ static void *malloc(int size)
    >>
    >> malloc_ptr = (malloc_ptr + 3) & ~3; /* Align */
    >>
    >> - p = (void *)malloc_ptr;
    >> + p = malloc_ptr;
    >> malloc_ptr += size;
    >>
    >
    > Won't this cause a "assignment makes pointer from integer without a
    > cast" warning?
    I don't think so. The cast had no effect as both malloc_ptr and p are
    declared as void *. The later += size
    does pointer arithmetic.

    Thanks,

    Jack


    \
     
     \ /
      Last update: 2009-04-08 16:19    [W:3.000 / U:0.896 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site