From 1124e3de3493905bd579cfb3c8f7a3ee9e63b8f6 Mon Sep 17 00:00:00 2001 From: Petter Reinholdtsen Date: Sun, 13 Oct 2013 22:56:48 +0200 Subject: [PATCH] Remove useless tests that have constant value because the variables are unsigned. --- rhizome_fetch.c | 2 +- rhizome_store.c | 2 +- tfw_createfile.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rhizome_fetch.c b/rhizome_fetch.c index 20a51f26..f4ec6f18 100644 --- a/rhizome_fetch.c +++ b/rhizome_fetch.c @@ -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); diff --git a/rhizome_store.c b/rhizome_store.c index 5e761852..c52a84cd 100644 --- a/rhizome_store.c +++ b/rhizome_store.c @@ -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; diff --git a/tfw_createfile.c b/tfw_createfile.c index 3ca1b75d..fad4ec8f 100644 --- a/tfw_createfile.c +++ b/tfw_createfile.c @@ -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))