summaryrefslogtreecommitdiff
path: root/sha1_file.c
diff options
context:
space:
mode:
authorMika Kukkonen <mikukkon@miku.homelinux.net>2005-06-21 20:04:33 (GMT)
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-21 20:30:55 (GMT)
commitd565b3412a0242e2c729bd77d18c74ecd57184dc (patch)
tree7fca6cb370ba8a446c51e0368a74d3d94f8bf564 /sha1_file.c
parentdc14841102bb364c2be200e8456146fc8df970b9 (diff)
downloadgit-d565b3412a0242e2c729bd77d18c74ecd57184dc.zip
git-d565b3412a0242e2c729bd77d18c74ecd57184dc.tar.gz
git-d565b3412a0242e2c729bd77d18c74ecd57184dc.tar.bz2
[PATCH] Fix several gcc4 signedness warnings
Here is a patch that fixes several gcc4 warnings about different signedness, all between char and unsigned char. I tried to keep the patch minimal so resertod to casts in three places. Signed-off-by: Mika Kukkonen <mikukkon@iki.fi> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'sha1_file.c')
-rw-r--r--sha1_file.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sha1_file.c b/sha1_file.c
index e648c06..6d6073d 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -332,7 +332,7 @@ int unpack_sha1_header(z_stream *stream, void *map, unsigned long mapsize, void
void *unpack_sha1_rest(z_stream *stream, void *buffer, unsigned long size)
{
int bytes = strlen(buffer) + 1;
- char *buf = xmalloc(1+size);
+ unsigned char *buf = xmalloc(1+size);
memcpy(buf, buffer + bytes, stream->total_out - bytes);
bytes = stream->total_out - bytes;
@@ -472,7 +472,7 @@ int sha1_file_size(const unsigned char *sha1, unsigned long *sizep)
* The initial part of the delta starts at delta_data_head +
* 20. Borrow code from patch-delta to read the result size.
*/
- data = hdr + strlen(hdr) + 1 + 20;
+ data = (unsigned char *)(hdr + strlen(hdr) + 1 + 20);
/* Skip over the source size; we are not interested in
* it and we cannot verify it because we do not want