This silences these warnings:
test_main.c: In function `main':
test_main.c:165: warning: passing arg 6 of `mmap' with different width due to p
rototype
pdump.c: In function `main':
pdump.c:55: warning: passing arg 2 of `mmap' as unsigned due to prototype
pdump.c:55: warning: passing arg 6 of `mmap' with different width due to protot
ype
I'm not sure why the off_t cast was needed though.
--Josh
Index: pdump.c
===================================================================
RCS file: /home/perlcvs/parrot/pdump.c,v
retrieving revision 1.7
diff -u -r1.7 pdump.c
- --- pdump.c 30 Dec 2001 19:52:56 -0000 1.7
+++ pdump.c 1 Jan 2002 19:17:00 -0000
@@ -17,7 +17,7 @@
struct stat file_stat;
int fd;
char * packed;
- long packed_size;
+ size_t packed_size;
struct PackFile * pf;
struct Parrot_Interp *interpreter = make_interpreter(0);
@@ -52,7 +52,7 @@
read(fd, (void*)packed, packed_size);
#else
- packed = mmap(0, packed_size, PROT_READ, MAP_SHARED, fd, 0);
+ packed = mmap(0, packed_size, PROT_READ, MAP_SHARED, fd, (off_t)0);
if (!packed) {
printf("Can't mmap, code %i\n", errno);
Index: test_main.c
===================================================================
RCS file: /home/perlcvs/parrot/test_main.c,v
retrieving revision 1.27
diff -u -r1.27 test_main.c
--- test_main.c 1 Jan 2002 17:22:54 -0000 1.27
+++ test_main.c 1 Jan 2002 19:17:00 -0000
@@ -162,7 +162,7 @@
read(fd, (void*)program_code, program_size);
#else
program_code =
- (opcode_t *) mmap(0, program_size, PROT_READ, MAP_SHARED, fd, 0);
+ (opcode_t *) mmap(0, program_size, PROT_READ, MAP_SHARED, fd, (off_t)0);
#endif
if (!program_code) {
@@ -172,7 +172,7 @@
pf = PackFile_new();
if( !PackFile_unpack(interpreter, pf, (char *)program_code,
- program_size) ) {
+ program_size) ) {
printf( "Can't unpack.\n" );
return 1;
}