Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

vcs-svn: fix signedness warnings

Stop mixing off_t and size_t.

Signed-off-by: David Barr <davidbarr@google.com>
  • Loading branch information...
commit adfbffec3da792819095f2d3694b783506b4b30d 1 parent 61e5525
@barrbrain authored
View
4 vcs-svn/fast_export.c
@@ -259,7 +259,7 @@ static int parse_ls_response(const char *response, uint32_t *mode,
}
/* Mode. */
- if (response_end - response < strlen("100644") ||
+ if (response_end - response < (signed) strlen("100644") ||
response[strlen("100644")] != ' ')
die("invalid ls response: missing mode: %s", response);
*mode = 0;
@@ -272,7 +272,7 @@ static int parse_ls_response(const char *response, uint32_t *mode,
}
/* ' blob ' or ' tree ' */
- if (response_end - response < strlen(" blob ") ||
+ if (response_end - response < (signed) strlen(" blob ") ||
(response[1] != 'b' && response[1] != 't'))
die("unexpected ls response: not a tree or blob: %s", response);
response += strlen(" blob ");
View
2  vcs-svn/sliding_window.c
@@ -54,7 +54,7 @@ int move_window(struct sliding_view *view, off_t off, size_t width)
return -1;
if (off < view->off || off + width < view->off + view->width)
return error("invalid delta: window slides left");
- if (view->max_off >= 0 && view->max_off < off + width)
+ if (view->max_off >= 0 && view->max_off < off + (off_t) width)
return error("delta preimage ends early");
file_offset = view->off + view->buf.len;
View
2  vcs-svn/svndiff.c
@@ -78,7 +78,7 @@ static int read_chunk(struct line_buffer *delta, off_t *delta_len,
struct strbuf *buf, size_t len)
{
strbuf_reset(buf);
- if (len > *delta_len ||
+ if ((off_t) len > *delta_len ||
buffer_read_binary(delta, buf, len) != len)
return error_short_read(delta);
*delta_len -= buf->len;
View
4 vcs-svn/svndump.c
@@ -40,8 +40,8 @@
static struct line_buffer input = LINE_BUFFER_INIT;
static struct {
- uint32_t action, propLength, srcRev, type;
- off_t text_length;
+ uint32_t action, srcRev, type;
+ off_t propLength, text_length;
struct strbuf src, dst;
uint32_t text_delta, prop_delta;
} node_ctx;
Please sign in to comment.
Something went wrong with that request. Please try again.