{"thread":{"id":"37444","subject":"[PATCH] builtin/commit.c: fix type warnings from gcc and sparse","startedAt":"2014-08-29T16:36:21Z","lastAt":"2014-08-29T22:17:33Z","messageCount":3,"participants":["Ramsay Jones","Jeff King","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"248550","messageId":"5400AC05.9060900@ramsay1.demon.co.uk","threadId":"37444","inReplyTo":null,"subject":"[PATCH] builtin/commit.c: fix type warnings from gcc and sparse","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2014-08-29T16:36:21Z","receivedAt":"2014-08-29T16:36:21Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nOn 32-bit platforms (only), gcc and sparse both issue warnings\nabout the type of the pointer expression passed as the third\nargument to find_commit_header().  In order to suppress the\nwarnings, we simply change the type of the 'len' variable to\nsize_t.\n\nSigned-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n---\n\nHi Jeff,\n\nIf you need to re-roll your 'jk/commit-author-parsing' series, could\nyou please squash this into the equivalent of commit 95b5989\n(\"determine_author_info(): reuse parsing functions\", 27-08-2014).\n\nThanks!\n\nATB,\nRamsay Jones\n\n builtin/commit.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex a9bef73..7cb9981 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -583,7 +583,7 @@ static void determine_author_info(struct strbuf *author_ident)\n \n \tif (author_message) {\n \t\tstruct ident_split ident;\n-\t\tunsigned long len;\n+\t\tsize_t len;\n \t\tconst char *a;\n \n \t\ta = find_commit_header(author_message_buffer, \"author\", &len);\n-- \n2.1.0\n"},{"id":"248572","messageId":"20140829184435.GA29456@peff.net","threadId":"37444","inReplyTo":"5400AC05.9060900@ramsay1.demon.co.uk","subject":"Re: [PATCH] builtin/commit.c: fix type warnings from gcc and sparse","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2014-08-29T18:44:35Z","receivedAt":"2014-08-29T18:44:35Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Aug 29, 2014 at 05:36:21PM +0100, Ramsay Jones wrote:\n\n> On 32-bit platforms (only), gcc and sparse both issue warnings\n> about the type of the pointer expression passed as the third\n> argument to find_commit_header().  In order to suppress the\n> warnings, we simply change the type of the 'len' variable to\n> size_t.\n> \n> Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n\nThanks, this looks good to me. I think I just switched between size_t\nand \"unsigned long\" during the development and forgot to tweak this\nspot.\n\n> If you need to re-roll your 'jk/commit-author-parsing' series, could\n> you please squash this into the equivalent of commit 95b5989\n> (\"determine_author_info(): reuse parsing functions\", 27-08-2014).\n\nI don't think I have any other reason to re-roll at this point. I'm\nhappy to have this on top, or it can be squashed into the second from\nthe top (95b5989) if we want to keep the history cleaner.\n\nI'm also happy to re-roll just for this, but my impression is that is\nnot really any easier on Junio than just squashing a patch in.\n\n-Peff\n"},{"id":"248597","messageId":"xmqq7g1r3pqa.fsf@gitster.dls.corp.google.com","threadId":"37444","inReplyTo":"20140829184435.GA29456@peff.net","subject":"Re: [PATCH] builtin/commit.c: fix type warnings from gcc and sparse","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-08-29T22:17:33Z","receivedAt":"2014-08-29T22:17:33Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> On Fri, Aug 29, 2014 at 05:36:21PM +0100, Ramsay Jones wrote:\n>\n>> On 32-bit platforms (only), gcc and sparse both issue warnings\n>> about the type of the pointer expression passed as the third\n>> argument to find_commit_header().  In order to suppress the\n>> warnings, we simply change the type of the 'len' variable to\n>> size_t.\n>> \n>> Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n>\n> Thanks, this looks good to me. I think I just switched between size_t\n> and \"unsigned long\" during the development and forgot to tweak this\n> spot.\n>\n>> If you need to re-roll your 'jk/commit-author-parsing' series, could\n>> you please squash this into the equivalent of commit 95b5989\n>> (\"determine_author_info(): reuse parsing functions\", 27-08-2014).\n>\n> I don't think I have any other reason to re-roll at this point. I'm\n> happy to have this on top, or it can be squashed into the second from\n> the top (95b5989) if we want to keep the history cleaner.\n>\n> I'm also happy to re-roll just for this, but my impression is that is\n> not really any easier on Junio than just squashing a patch in.\n\nThanks for being very considerate ;-)  Have squashed it in with\n\"rebase -i\" while preparing for the mid-day pushout.\n"}]}