develooper Front page | perl.perl6.internals | Postings from January 2008

Strange casts in packfile/pf_items.c

From:
NotFound
Date:
January 22, 2008 11:51
Subject:
Strange casts in packfile/pf_items.c
Hello

I'm trying to clean some warnings in parrot C source files and found
this casts in packfile/pf_items.c:

fetch_buf_le_8(u.buf, (unsigned char *) b);

fetch_buf_be_8(u.buf, (unsigned char *) b);

But the function definitions are (in src/byteorder.c):

void
fetch_buf_le_8(ARGOUT(unsigned char *rb), ARGIN(const unsigned char *b))

void
fetch_buf_be_8(ARGOUT(unsigned char *rb), ARGIN(const unsigned char *b))

And 'b' in both calls is already const unsigned char *.

Deleting the casts avoids the warnings,

There is some obscure reason for those casts, or remains from an old situation?

-- 
Salu2



Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About