git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] git: fix gcc4 warnings

From
MKMika Kukkonen <mikukkon@miku.homelinux.net>
Date
Jul 3, 2005, 20:32 UTC
Message-ID
<20050703203233.GA19220@miku.homelinux.net>
Here is a few trivial fixes to git about things that gcc4 complains about.
Signed-off-by: Mika Kukkonen <mikukkon@iki.fi>
diffstat:
 git/send-pack.c |    2 +-
 git/sha1_file.c |    4 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)
Index: git/send-pack.c
===================================================================
--- git.orig/send-pack.c
+++ git/send-pack.c
@@ -93,7 +93,7 @@ static void rev_list(int fd, struct ref 
 	exec_rev_list(refs);
 }
 
-static int pack_objects(int fd, struct ref *refs)
+static void pack_objects(int fd, struct ref *refs)
 {
 	pid_t rev_list_pid;
 
Index: git/sha1_file.c
===================================================================
--- git.orig/sha1_file.c
+++ git/sha1_file.c
@@ -384,8 +384,8 @@ struct packed_git *add_packed_git(char *
 {
 	struct stat st;
 	struct packed_git *p;
-	unsigned long idx_size;
-	void *idx_map;
+	unsigned long idx_size = 0;
+	void *idx_map = NULL;

 	if (check_packed_git_idx(path, &idx_size, &idx_map))
 		return NULL;
@@ -857,7 +857,7 @@ static void *unpack_non_delta_entry(unsi
 {
 	int st;
 	z_stream stream;
-	char *buffer;
+	unsigned char *buffer;
 
 	buffer = xmalloc(size + 1);
 	buffer[size] = 0;
@@ -949,7 +949,7 @@ int nth_packed_object_sha1(const struct 
 int find_pack_entry_one(const unsigned char *sha1,
 			struct pack_entry *e, struct packed_git *p)
 {
-	int *level1_ofs = p->index_base;
+	unsigned int *level1_ofs = p->index_base;
 	int hi = ntohl(level1_ofs[*sha1]);
 	int lo = ((*sha1 == 0x0) ? 0 : ntohl(level1_ofs[*sha1 - 1]));
 	void *index = p->index_base + 256;
Message 1 of 1 in “git: fix gcc4 warnings”
  1. git: fix gcc4 warningsMika Kukkonen, Jul 3, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.