summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5be507f)
raw | patch | inline | side by side (parent: 5be507f)
author | René Scharfe <rene.scharfe@lsrfire.ath.cx> | |
Sun, 21 Oct 2007 09:23:49 +0000 (11:23 +0200) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Mon, 22 Oct 2007 04:00:40 +0000 (00:00 -0400) |
Fix size_t vs. unsigned long pointer mismatch warnings introduced
with the addition of strbuf_detach().
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
with the addition of strbuf_detach().
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
builtin-apply.c | patch | blob | history | |
builtin-archive.c | patch | blob | history | |
diff.c | patch | blob | history | |
entry.c | patch | blob | history |
diff --git a/builtin-apply.c b/builtin-apply.c
index 05c6bc3592e98958a4629ab856be33adc9ace33c..8411b38c7963852bffeb6dea1494399e8c9daa02 100644 (file)
--- a/builtin-apply.c
+++ b/builtin-apply.c
unsigned int is_rename:1;
struct fragment *fragments;
char *result;
- unsigned long resultsize;
+ size_t resultsize;
char old_sha1_prefix[41];
char new_sha1_prefix[41];
struct patch *next;
diff --git a/builtin-archive.c b/builtin-archive.c
index 04385dea05110053db72e30a77e6d4a10bc7875b..6f29c2f40a01b3c60eaa9ecfa1ca4d63fe90c8eb 100644 (file)
--- a/builtin-archive.c
+++ b/builtin-archive.c
buffer = read_sha1_file(sha1, type, sizep);
if (buffer && S_ISREG(mode)) {
struct strbuf buf;
+ size_t size = 0;
strbuf_init(&buf, 0);
strbuf_attach(&buf, buffer, *sizep, *sizep + 1);
convert_to_working_tree(path, buf.buf, buf.len, &buf);
convert_to_archive(path, buf.buf, buf.len, &buf, commit);
- buffer = strbuf_detach(&buf, sizep);
+ buffer = strbuf_detach(&buf, &size);
+ *sizep = size;
}
return buffer;
index 6648e015213913e693b4450230a5a0896a21f7a0..dfb8595b7086c71b3be0ece408d65a7285f42e9f 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -1512,6 +1512,7 @@ static int reuse_worktree_file(const char *name, const unsigned char *sha1, int
static int populate_from_stdin(struct diff_filespec *s)
{
struct strbuf buf;
+ size_t size = 0;
strbuf_init(&buf, 0);
if (strbuf_read(&buf, 0, 0) < 0)
strerror(errno));
s->should_munmap = 0;
- s->data = strbuf_detach(&buf, &s->size);
+ s->data = strbuf_detach(&buf, &size);
+ s->size = size;
s->should_free = 1;
return 0;
}
*/
strbuf_init(&buf, 0);
if (convert_to_git(s->path, s->data, s->size, &buf)) {
+ size_t size = 0;
munmap(s->data, s->size);
s->should_munmap = 0;
- s->data = strbuf_detach(&buf, &s->size);
+ s->data = strbuf_detach(&buf, &size);
+ s->size = size;
s->should_free = 1;
}
}
index 98f5f6d4ecfc0dabae9a920bdf3beadbf20abcaf..cfadc6a292033d349f6b1efff75d2c4f9f2525fe 100644 (file)
--- a/entry.c
+++ b/entry.c
@@ -119,8 +119,10 @@ static int write_entry(struct cache_entry *ce, char *path, const struct checkout
*/
strbuf_init(&buf, 0);
if (convert_to_working_tree(ce->name, new, size, &buf)) {
+ size_t newsize = 0;
free(new);
- new = strbuf_detach(&buf, &size);
+ new = strbuf_detach(&buf, &newsize);
+ size = newsize;
}
if (to_tempfile) {