Fixed two warnings (comparison of signed and unsigned values).

Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13967 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2005-08-17 18:07:50 +00:00
parent cc5b91374f
commit a4f1e9491d
+6 -12
View File
@@ -817,9 +817,8 @@ void close_outfile(__G) /* GRR: change to return PK-style warning level */
fclose(G.outfile); /* close "data" file... */ fclose(G.outfile); /* close "data" file... */
G.outfile = fopen(G.filename, FOPR); /* ...and reopen for reading */ G.outfile = fopen(G.filename, FOPR); /* ...and reopen for reading */
if (!linktarget || fread(linktarget, 1, ucsize, G.outfile) != if (!linktarget
(int)ucsize) || fread(linktarget, 1, ucsize, G.outfile) != (size_t)ucsize) {
{
Info(slide, 0x201, ((char *)slide, Info(slide, 0x201, ((char *)slide,
"warning: symbolic link (%s) failed\n", FnFilter1(G.filename))); "warning: symbolic link (%s) failed\n", FnFilter1(G.filename)));
if (linktarget) if (linktarget)
@@ -1174,9 +1173,8 @@ static void setBeOSexfield( const char *path, uch *extra_field )
uch *attrbuff = NULL; uch *attrbuff = NULL;
int retval; int retval;
if( extra_field == NULL ) { if (extra_field == NULL)
return; return;
}
/* Collect the data from the extra field buffer. */ /* Collect the data from the extra field buffer. */
id = makeword( ptr ); ptr += 2; /* we don't use this... */ id = makeword( ptr ); ptr += 2; /* we don't use this... */
@@ -1198,7 +1196,7 @@ static void setBeOSexfield( const char *path, uch *extra_field )
EB_BEOS_HLEN)); EB_BEOS_HLEN));
return; return;
} }
if( full_size < ( size - EB_BEOS_HLEN ) ) { if (full_size < (uint32)(size - EB_BEOS_HLEN)) {
/* possible old archive? will this screw up on valid archives? */ /* possible old archive? will this screw up on valid archives? */
Info(slide, 0x201, ((char *)slide, Info(slide, 0x201, ((char *)slide,
"Skipping attributes: BeOS extra field is %d bytes, " "Skipping attributes: BeOS extra field is %d bytes, "
@@ -1220,8 +1218,7 @@ static void setBeOSexfield( const char *path, uch *extra_field )
return; return;
} }
retval = memextract( __G__ attrbuff, full_size, retval = memextract(__G__ attrbuff, full_size, ptr, size - EB_BEOS_HLEN);
ptr, size - EB_BEOS_HLEN );
if (retval != PK_OK) { if (retval != PK_OK) {
/* error uncompressing attributes */ /* error uncompressing attributes */
Info(slide, 0x201, ((char *)slide, Info(slide, 0x201, ((char *)slide,
@@ -1245,13 +1242,10 @@ static void setBeOSexfield( const char *path, uch *extra_field )
} }
/* Clean up, if necessary */ /* Clean up, if necessary */
if( attrbuff != ptr ) { if (attrbuff != ptr)
free(attrbuff); free(attrbuff);
} }
return;
}
#ifdef BEOS_USE_PRINTEXFIELD #ifdef BEOS_USE_PRINTEXFIELD
static void printBeOSexfield( int isdir, uch *extra_field ) static void printBeOSexfield( int isdir, uch *extra_field )
{ {