Squelch some compiler warnings.

Cast an ssize_t value to unsigned int before subtracting it from an
unsigned int.  The value is already known to be >= 0 and <= the value
from which we're subtracting it, and that latter value is an unsigned
int, so it's guaranteed to fit into an unsigned int.  (ssize_t can be
bigger than unsigned int.)

Change-Id: I5c4d3c7fa4bf241c9ea72661beca89bc30495a3b
Reviewed-on: https://code.wireshark.org/review/21114
Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
Guy Harris 2017-04-15 12:37:34 -07:00
parent 3743186bcf
commit 237d23dc73
1 changed files with 3 additions and 3 deletions

View File

@ -823,7 +823,7 @@ main(int argc, char *argv[])
ret = FORMAT_ERROR;
goto clean_exit;
}
bytes_left -= bytes;
bytes_left -= (unsigned int)bytes;
}
}
@ -904,7 +904,7 @@ raw_pipe_read(struct wtap_pkthdr *phdr, guchar * pd, int *err, gchar **err_info,
*err_info = NULL;
return FALSE;
}
bytes_needed -= bytes_read;
bytes_needed -= (unsigned int)bytes_read;
*data_offset += bytes_read;
ptr += bytes_read;
}
@ -950,7 +950,7 @@ raw_pipe_read(struct wtap_pkthdr *phdr, guchar * pd, int *err, gchar **err_info,
*err_info = NULL;
return FALSE;
}
bytes_needed -= bytes_read;
bytes_needed -= (unsigned int)bytes_read;
*data_offset += bytes_read;
ptr += bytes_read;
}