Re: [PATCH 4/5] Make 'diff_populate_filespec()' use the new 'strbuf_readlink()'

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linus Torvalds
Date: Thursday, December 18, 2008 - 9:55 am

On Thu, 18 Dec 2008, Mark Burton wrote:

Gaah. My bad. It should work fine ("unsigned long" is physically the same 
type as "size_t" in your case), but on 32-bit x86, size_t is generally 
"unsigned int" - which is the same physical type there (both int and long 
are 32-bit) but causes a valid warning.

I think we should just make the "size" member "size_t". I use "unsigned 
long" out of much too long habit, since we traditionally avoided "size_t" 
in the kernel due to it just being another unnecessary architecture- 
specific detail.

So the proper patch is probably just the following. Sorry about that,

		Linus
---
 diffcore.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/diffcore.h b/diffcore.h
index 5b63458..16a73e6 100644
--- a/diffcore.h
+++ b/diffcore.h
@@ -30,7 +30,7 @@ struct diff_filespec {
 	void *data;
 	void *cnt_data;
 	const char *funcname_pattern_ident;
-	unsigned long size;
+	size_t size;
 	int count;               /* Reference count */
 	int xfrm_flags;		 /* for use by the xfrm */
 	int rename_used;         /* Count of rename users */
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/5] Be careful about lstat()-vs-readlink(), Linus Torvalds, (Wed Dec 17, 11:42 am)
[PATCH 1/5] Add generic 'strbuf_readlink()' helper function, Linus Torvalds, (Wed Dec 17, 11:42 am)
[PATCH 3/5] Make 'index_path()' use 'strbuf_readlink()', Linus Torvalds, (Wed Dec 17, 11:43 am)
Re: [PATCH 4/5] Make 'diff_populate_filespec()' use the ne ..., Linus Torvalds, (Thu Dec 18, 9:55 am)
Re: [PATCH 4/5] Make 'diff_populate_filespec()' use the ne ..., Olivier Galibert, (Thu Dec 18, 10:56 am)
[PATCH] diff.c: fix pointer type warning, René Scharfe, (Fri Dec 19, 3:10 pm)
Re: [PATCH] diff.c: fix pointer type warning, Junio C Hamano, (Fri Dec 19, 4:09 pm)
[PATCH] strbuf_readlink semantics update., Pierre Habouzit, (Tue Dec 23, 3:05 am)
Re: [PATCH] strbuf_readlink semantics update., Pierre Habouzit, (Tue Dec 23, 3:21 am)
Re: [PATCH] strbuf_readlink semantics update., Linus Torvalds, (Tue Dec 23, 11:16 am)
Re: [PATCH] strbuf_readlink semantics update., Pierre Habouzit, (Wed Dec 24, 3:11 am)
Re: [PATCH] strbuf_readlink semantics update., René Scharfe, (Wed Dec 24, 8:20 am)
Re: [PATCH] strbuf_readlink semantics update., Junio C Hamano, (Thu Dec 25, 12:23 am)
Re: [PATCH] strbuf_readlink semantics update., Pierre Habouzit, (Sun Jan 4, 5:21 am)