summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: dc14841)
raw | patch | inline | side by side (parent: dc14841)
author | Mika Kukkonen <mikukkon@miku.homelinux.net> | |
Tue, 21 Jun 2005 20:04:33 +0000 (23:04 +0300) | ||
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | |
Tue, 21 Jun 2005 20:30:55 +0000 (13:30 -0700) |
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>
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>
mkdelta.c | patch | blob | history | |
pull.c | patch | blob | history | |
sha1_file.c | patch | blob | history | |
ssh-push.c | patch | blob | history | |
tar-tree.c | patch | blob | history |
diff --git a/mkdelta.c b/mkdelta.c
index 1c10f1f143ea5fe202a6cf7eb3058e579ecc28c2..6470a94e527abad37cf49eccac0df1587321630b 100644 (file)
--- a/mkdelta.c
+++ b/mkdelta.c
return 0;
}
-static void *create_object(char *buf, unsigned long len, char *hdr, int hdrlen,
- unsigned long *retsize)
+static void *create_object(unsigned char *buf, unsigned long len,
+ char *hdr, int hdrlen, unsigned long *retsize)
{
- char *compressed;
+ unsigned char *compressed;
unsigned long size;
z_stream stream;
stream.avail_out = size;
/* First header.. */
- stream.next_in = hdr;
+ stream.next_in = (unsigned char *)hdr;
stream.avail_in = hdrlen;
while (deflate(&stream, 0) == Z_OK)
/* nothing */;
return compressed;
}
-static int restore_original_object(char *buf, unsigned long len,
+static int restore_original_object(unsigned char *buf, unsigned long len,
char *type, unsigned char *sha1)
{
char hdr[50];
return ret;
}
-static void *create_delta_object(char *buf, unsigned long len,
+static void *create_delta_object(unsigned char *buf, unsigned long len,
unsigned char *sha1_ref, unsigned long *size)
{
char hdr[50];
index 395ca45328d1f17c795839d3cbfd405852933f5a..e70fc02f3bf5b6c626a138d6d76d819fab76f0c8 100644 (file)
--- a/pull.c
+++ b/pull.c
return 0;
if (get_delta) {
- char delta_sha1[20];
+ unsigned char delta_sha1[20];
status = sha1_delta_base(sha1, delta_sha1);
if (0 < status)
status = make_sure_we_have_it(what, delta_sha1);
diff --git a/sha1_file.c b/sha1_file.c
index e648c068b558fbdbbdc866c8829af3641e2c5b60..6d6073da85d297b4b0a59c0548720b21fc23129d 100644 (file)
--- a/sha1_file.c
+++ b/sha1_file.c
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;
* 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
diff --git a/ssh-push.c b/ssh-push.c
index 18c0b65d5b18271bc29a0be62f75ee524e51b0e1..12fb9fccbf3e39b4e141ebc0d2d371df395785cf 100644 (file)
--- a/ssh-push.c
+++ b/ssh-push.c
int serve_object(int fd_in, int fd_out) {
ssize_t size;
int posn = 0;
- char sha1[20];
+ unsigned char sha1[20];
unsigned long objsize;
void *buf;
signed char remote;
diff --git a/tar-tree.c b/tar-tree.c
index 4c47fc2bec1e6305d122865e2da318bc795ab8ef..673ac66ed6fd37eeeaa8580b2e43f0e2cee91a16 100644 (file)
--- a/tar-tree.c
+++ b/tar-tree.c
if (!archive_time)
archive_time = time(NULL);
if (basedir)
- write_header("0", TYPEFLAG_DIR, NULL, NULL, basedir, 040755,
- NULL, 0);
+ write_header((unsigned char *)"0", TYPEFLAG_DIR, NULL, NULL,
+ basedir, 040755, NULL, 0);
traverse_tree(buffer, size, NULL);
free(buffer);
write_trailer();