summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 02481ae)
raw | patch | inline | side by side (parent: 02481ae)
author | Brian Gerst <bgerst@didntduck.org> | |
Wed, 18 May 2005 12:14:09 +0000 (08:14 -0400) | ||
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | |
Wed, 18 May 2005 15:44:23 +0000 (08:44 -0700) |
- Raw hashes should be unsigned char.
- String functions want signed char.
- Hash and compress functions want unsigned char.
Signed-off By: Brian Gerst <bgerst@didntduck.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
- String functions want signed char.
- Hash and compress functions want unsigned char.
Signed-off By: Brian Gerst <bgerst@didntduck.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
cache.h | patch | blob | history | |
diff-cache.c | patch | blob | history | |
diff-files.c | patch | blob | history | |
http-pull.c | patch | blob | history | |
ls-tree.c | patch | blob | history | |
read-cache.c | patch | blob | history | |
rpush.c | patch | blob | history | |
sha1_file.c | patch | blob | history | |
strbuf.h | patch | blob | history | |
tar-tree.c | patch | blob | history |
index 041ec0b2b0a7faa341b4c65fe9a939abcbf1a3c1..858ea7ff0c9b7f8ae585f99ce980ddad9d7e82d6 100644 (file)
--- a/cache.h
+++ b/cache.h
extern void * map_sha1_file(const unsigned char *sha1, unsigned long *size);
extern void * unpack_sha1_file(void *map, unsigned long mapsize, char *type, unsigned long *size);
extern void * read_sha1_file(const unsigned char *sha1, char *type, unsigned long *size);
-extern int write_sha1_file(char *buf, unsigned long len, const char *type, unsigned char *return_sha1);
+extern int write_sha1_file(void *buf, unsigned long len, const char *type, unsigned char *return_sha1);
extern int check_sha1_signature(unsigned char *sha1, void *buf, unsigned long size, const char *type);
extern int cache_name_compare(const char *name1, int len1, const char *name2, int len2);
extern void *read_object_with_reference(const unsigned char *sha1,
- const unsigned char *required_type,
+ const char *required_type,
unsigned long *size,
unsigned char *sha1_ret);
diff --git a/diff-cache.c b/diff-cache.c
index eb3c2c183a2f786b864b7e867aa54dd2747dddb8..4cfbcdb9ed34ca8790ce3ddbefc7c9548def740f 100644 (file)
--- a/diff-cache.c
+++ b/diff-cache.c
{
unsigned int mode, oldmode;
unsigned char *sha1;
- unsigned char old_sha1_hex[60];
+ char old_sha1_hex[60];
if (get_stat_data(new, &sha1, &mode) < 0) {
if (report_missing)
diff --git a/diff-files.c b/diff-files.c
index 54dd8bf1766ee37f366406b0c05acd66923733a2..d556b968842a334526a59eb7153db135ca6cb44a 100644 (file)
--- a/diff-files.c
+++ b/diff-files.c
}
static void show_modified(int oldmode, int mode,
- const char *old_sha1, const char *sha1,
+ const unsigned char *old_sha1, const unsigned char *sha1,
char *path)
{
char old_sha1_hex[41];
int main(int argc, char **argv)
{
- static const char null_sha1[20] = { 0, };
+ static const unsigned char null_sha1[20] = { 0, };
int entries = read_cache();
int i;
diff --git a/http-pull.c b/http-pull.c
index 024457a9895ab10c4ef18aa6e232d12fdaab4da9..cc62f85f48fd5fa1e2e09039846845c495fd084a 100644 (file)
--- a/http-pull.c
+++ b/http-pull.c
static size_t fwrite_sha1_file(void *ptr, size_t eltsize, size_t nmemb,
void *data) {
- char expn[4096];
+ unsigned char expn[4096];
size_t size = eltsize * nmemb;
int posn = 0;
do {
{
char *hex = sha1_to_hex(sha1);
char *filename = sha1_file_name(sha1);
- char real_sha1[20];
+ unsigned char real_sha1[20];
char *url;
char *posn;
diff --git a/ls-tree.c b/ls-tree.c
index 4231c4b234d8c8a5a35adb3d15ad9cd1f7dcf51a..a69eac87a8db3da6d13ecf28d70609e20941f00c 100644 (file)
--- a/ls-tree.c
+++ b/ls-tree.c
}
static void list_recursive(void *buffer,
- const unsigned char *type,
+ const char *type,
unsigned long size,
struct path_prefix *prefix)
{
diff --git a/read-cache.c b/read-cache.c
index 01e84b758b8f742ee852e08fcc20a14e3509821c..14ed4fdf65047d2e553ff914a0c07ea112f96bcd 100644 (file)
--- a/read-cache.c
+++ b/read-cache.c
}
#define WRITE_BUFFER_SIZE 8192
-static char write_buffer[WRITE_BUFFER_SIZE];
+static unsigned char write_buffer[WRITE_BUFFER_SIZE];
static unsigned long write_buffer_len;
static int ce_write(SHA_CTX *context, int fd, void *data, unsigned int len)
index 26518846704ecf63ad00390599b251aa1b32713e..3f2c898c8f5cf5ba62d689a13c646936b8372ee7 100644 (file)
--- a/rpush.c
+++ b/rpush.c
void service(int fd_in, int fd_out) {
ssize_t size;
int posn;
- char sha1[20];
+ char unsigned sha1[20];
unsigned long objsize;
void *buf;
do {
diff --git a/sha1_file.c b/sha1_file.c
index 942b673dc3c7fa9f057c5c452e3a1b73eaeb8707..83bc38c91fcfb8c6633be2ed1ee987fc41556e95 100644 (file)
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -313,13 +313,13 @@ void * unpack_sha1_file(void *map, unsigned long mapsize, char *type, unsigned l
int ret, bytes;
z_stream stream;
char buffer[8192];
- char *buf;
+ unsigned char *buf;
/* Get the data stream */
memset(&stream, 0, sizeof(stream));
stream.next_in = map;
stream.avail_in = mapsize;
- stream.next_out = buffer;
+ stream.next_out = (unsigned char *)buffer;
stream.avail_out = sizeof(buffer);
inflateInit(&stream);
@@ -359,7 +359,7 @@ void * read_sha1_file(const unsigned char *sha1, char *type, unsigned long *size
}
void *read_object_with_reference(const unsigned char *sha1,
- const unsigned char *required_type,
+ const char *required_type,
unsigned long *size,
unsigned char *actual_sha1_return)
{
}
}
-int write_sha1_file(char *buf, unsigned long len, const char *type, unsigned char *returnsha1)
+int write_sha1_file(void *buf, unsigned long len, const char *type, unsigned char *returnsha1)
{
int size;
- char *compressed;
+ unsigned char *compressed;
z_stream stream;
unsigned char sha1[20];
SHA_CTX c;
char *filename;
static char tmpfile[PATH_MAX];
- char hdr[50];
+ unsigned char hdr[50];
int fd, hdrlen, ret;
/* Generate the header */
- hdrlen = sprintf(hdr, "%s %lu", type, len)+1;
+ hdrlen = sprintf((char *)hdr, "%s %lu", type, len)+1;
/* Sha1.. */
SHA1_Init(&c);
int local;
z_stream stream;
unsigned char real_sha1[20];
- char buf[4096];
- char discard[4096];
+ unsigned char buf[4096];
+ unsigned char discard[4096];
int ret;
SHA_CTX c;
diff --git a/strbuf.h b/strbuf.h
index da678e506fcb6219f73d07982b057192cb30beb3..74cc012c2c62d05cb773c6dd4776af0fdc237dfb 100644 (file)
--- a/strbuf.h
+++ b/strbuf.h
int alloc;
int len;
int eof;
- unsigned char *buf;
+ char *buf;
};
extern void strbuf_init(struct strbuf *);
diff --git a/tar-tree.c b/tar-tree.c
index d313c80565824824f2e954510d5bbbc65b8e116b..f6df3722a8916ea15b691602d943e49a3c3d7381 100644 (file)
--- a/tar-tree.c
+++ b/tar-tree.c
append_char(p, '\n');
}
-static void write_header(const char *, char, const char *, struct path_prefix *,
+static void write_header(const unsigned char *, char, const char *, struct path_prefix *,
const char *, unsigned int, void *, unsigned long);
/* stores a pax extended header directly in the block buffer */
free(buffer);
}
-static void write_global_extended_header(const char *sha1)
+static void write_global_extended_header(const unsigned char *sha1)
{
char *p;
unsigned int size;
}
/* stores a ustar header directly in the block buffer */
-static void write_header(const char *sha1, char typeflag, const char *basepath,
+static void write_header(const unsigned char *sha1, char typeflag, const char *basepath,
struct path_prefix *prefix, const char *path,
unsigned int mode, void *buffer, unsigned long size)
{