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

[PATCH 5/9] Convert various things to size_t

From
Martin Koegler <martin.koegler@chello.at>
Date
Aug 12, 2017, 08:47 UTC
Message-ID
<1502527643-21944-5-git-send-email-martin@mail.zuhause>
In-Reply-To
<1502527643-21944-1-git-send-email-martin@mail.zuhause>
From: Martin Koegler <martin.koegler@chello.at>
---
 bisect.c                | 2 +-
 blame.c                 | 2 +-
 builtin/fmt-merge-msg.c | 2 +-
 builtin/mktag.c         | 2 +-
 dir.c                   | 4 ++--
 dir.h                   | 2 +-
 6 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/bisect.c b/bisect.c
index 2549eaf..0580c82 100644
--- a/bisect.c
+++ b/bisect.c
@@ -131,7 +131,7 @@ static void show_list(const char *debug, int counted, int nr,
 		struct commit *commit = p->item;
 		unsigned flags = commit->object.flags;
 		enum object_type type;
-		unsigned long size;
+		size_t size;
 		char *buf = read_sha1_file(commit->object.sha1, &type, &size);
 		const char *subject_start;
 		int subject_len;
diff --git a/blame.c b/blame.c
index 739a280..f628b42 100644
--- a/blame.c
+++ b/blame.c
@@ -1621,7 +1621,7 @@ static const char *get_next_line(const char *start, const char *end)
 static int prepare_lines(struct blame_scoreboard *sb)
 {
 	const char *buf = sb->final_buf;
-	unsigned long len = sb->final_buf_size;
+	size_t len = sb->final_buf_size;
 	const char *end = buf + len;
 	const char *p;
 	int *lineno;
diff --git a/builtin/fmt-merge-msg.c b/builtin/fmt-merge-msg.c
index 61ab796..3faf100 100644
--- a/builtin/fmt-merge-msg.c
+++ b/builtin/fmt-merge-msg.c
@@ -464,7 +464,7 @@ static void fmt_merge_msg_title(struct strbuf *out,
 static void fmt_tag_signature(struct strbuf *tagbuf,
 			      struct strbuf *sig,
 			      const char *buf,
-			      unsigned long len)
+			      size_t len)
 {
 	const char *tag_body = strstr(buf, "\n\n");
 	if (tag_body) {
diff --git a/builtin/mktag.c b/builtin/mktag.c
index 0663106..ff919a7 100644
--- a/builtin/mktag.c
+++ b/builtin/mktag.c
@@ -34,7 +34,7 @@ static int verify_object(const unsigned char *sha1, const char *expected_type)
 	return ret;
 }
 
-static int verify_tag(char *buffer, unsigned long size)
+static int verify_tag(char *buffer, size_t size)
 {
 	int typelen;
 	char type[20];
diff --git a/dir.c b/dir.c
index f161c26..0c7c767 100644
--- a/dir.c
+++ b/dir.c
@@ -180,7 +180,7 @@ static size_t common_prefix_len(const struct pathspec *pathspec)
  */
 char *common_prefix(const struct pathspec *pathspec)
 {
-	unsigned long len = common_prefix_len(pathspec);
+	size_t len = common_prefix_len(pathspec);
 
 	return len ? xmemdupz(pathspec->items[0].match, len) : NULL;
 }
@@ -2673,7 +2673,7 @@ static void load_sha1_stat(struct sha1_stat *sha1_stat,
 	sha1_stat->valid = 1;
 }
 
-struct untracked_cache *read_untracked_extension(const void *data, unsigned long sz)
+struct untracked_cache *read_untracked_extension(const void *data, size_t sz)
 {
 	struct untracked_cache *uc;
 	struct read_data rd;
diff --git a/dir.h b/dir.h
index e371705..709c72c 100644
--- a/dir.h
+++ b/dir.h
@@ -349,7 +349,7 @@ void untracked_cache_remove_from_index(struct index_state *, const char *);
 void untracked_cache_add_to_index(struct index_state *, const char *);
 
 void free_untracked_cache(struct untracked_cache *);
-struct untracked_cache *read_untracked_extension(const void *data, unsigned long sz);
+struct untracked_cache *read_untracked_extension(const void *data, size_t sz);
 void write_untracked_extension(struct strbuf *out, struct untracked_cache *untracked);
 void add_untracked_cache(struct index_state *istate);
 void remove_untracked_cache(struct index_state *istate);
-- 
2.1.4
Previous: Martin KoeglerNext: Martin Ågren
Message 7 of 27 in “Convert pack-objects to size_t”
  1. 1/9 Convert pack-objects to size_tMartin Koegler, Aug 12, 2017
  2. 4/9 Convert archive functions to size_tMartin Koegler, Aug 12, 2017
  3. 3/9 Convert unpack-objects to size_tMartin Koegler, Aug 12, 2017
  4. Martin ÅgrenAug 12, 2017
  5. Martin KoeglerAug 13, 2017
  6. 8/9 Convert tree-walk to size_tMartin Koegler, Aug 12, 2017
  7. 5/9 Convert various things to size_tMartin Koegler, Aug 12, 2017
  8. Martin ÅgrenAug 12, 2017
  9. Martin KoeglerAug 13, 2017
  10. 7/9 Convert ref-filter to size_tMartin Koegler, Aug 12, 2017
  11. 9/9 Convert xdiff-interface to size_tMartin Koegler, Aug 12, 2017
  12. 6/9 Use size_t for config parsingMartin Koegler, Aug 12, 2017
  13. 2/9 Convert index-pack to size_tMartin Koegler, Aug 12, 2017
  14. Ramsay JonesAug 12, 2017
  15. Torsten BögershausenAug 12, 2017
  16. Martin KoeglerAug 13, 2017
  17. Ramsay JonesAug 12, 2017
  18. Martin KoeglerAug 13, 2017
  19. Ramsay JonesAug 13, 2017
  20. Junio C HamanoAug 13, 2017
  21. Junio C HamanoAug 14, 2017
  22. Ramsay JonesAug 14, 2017
  23. Junio C HamanoAug 14, 2017
  24. Torsten BögershausenAug 14, 2017
  25. Ramsay JonesAug 15, 2017
  26. Martin KoeglerAug 16, 2017
  27. Torsten BögershausenAug 17, 2017

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.