Thread (27 messages) flat view 27 messages, 7 authors, 2016-08-13

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

From: Linus Torvalds <torvalds@linux-foundation.org>
Date: 2016-06-15 22:45:47
Subsystem: the rest · Maintainer: Linus Torvalds


On Thu, 18 Dec 2008, Mark Burton wrote:
Does it need a cast on some architectures?
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 */
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help