Remove useless tests that have constant value because the variables are unsigned.

This commit is contained in:
Petter Reinholdtsen 2013-10-13 22:56:48 +02:00
parent fde6dc210f
commit 1124e3de34
3 changed files with 3 additions and 3 deletions

View File

@ -1135,7 +1135,7 @@ static int pipe_journal(struct rhizome_fetch_slot *slot){
uint64_t length = slot->previous->fileLength - slot->manifest->journalTail - slot->write_state.file_offset;
// of course there might not be any overlap
if (start>=0 && start < slot->previous->fileLength && length>0){
if (start < slot->previous->fileLength && length>0){
if (config.debug.rhizome)
DEBUGF("Copying %"PRId64" bytes from previous journal", length);
rhizome_journal_pipe(&slot->write_state, &slot->previous->filehash, start, length);

View File

@ -821,7 +821,7 @@ int rhizome_read_buffered(struct rhizome_read *read, struct rhizome_read_buffer
// if we can supply either the beginning or end of the data from cache, do that first.
uint64_t ofs=read->offset - buffer->offset;
if (ofs>=0 && ofs<=buffer->len){
if (ofs<=buffer->len){
int size=len;
if (size > buffer->len - ofs)
size = buffer->len - ofs;

View File

@ -56,7 +56,7 @@ int main(int argc, char **argv)
for (i = 1; i < argc; ++i) {
const char *arg = argv[i];
if (str_startswith(arg, "--size=", &arg)) {
if (!str_to_uint64_scaled(arg, 10, &size, NULL) || size < 0)
if (!str_to_uint64_scaled(arg, 10, &size, NULL))
fatal("illegal --size= argument: %s", arg);
}
else if (str_startswith(arg, "--label=", &arg))