Re: [PATCH 4/5] Make 'diff_populate_filespec()' use the new 'strbuf_readlink()'
- From
Linus Torvalds <torvalds@linux-foundation.org>
- Date
- Dec 18, 2008, 16:55 UTC
- Message-ID
- <alpine.LFD.2.00.0812180851120.14014@localhost.localdomain>
- In-Reply-To
- <20081218121118.3635c53c@crow>
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 */