{"thread":{"id":"39651","subject":"[PATCH] pull.c: fix some sparse warnings","startedAt":"2015-06-16T23:18:57Z","lastAt":"2015-06-17T10:32:56Z","messageCount":2,"participants":["Ramsay Jones","Paul Tan"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"263980","messageId":"5580AEE1.6090300@ramsay1.demon.co.uk","threadId":"39651","inReplyTo":null,"subject":"[PATCH] pull.c: fix some sparse warnings","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2015-06-16T23:18:57Z","receivedAt":"2015-06-16T23:18:57Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nCommit 191241e5 (\"pull: pass git-fetch's options to git-fetch\",\n14-06-2015) uses the OPT_PASSTHRU macro to add some command line\n'struct option' initialisations to the pull_options array. This\ncauses sparse to complain, thus:\n\n      SP builtin/pull.c\n  builtin/pull.c:160:9: warning: Using plain integer as NULL pointer\n  builtin/pull.c:163:9: warning: Using plain integer as NULL pointer\n  builtin/pull.c:170:9: warning: Using plain integer as NULL pointer\n  builtin/pull.c:173:9: warning: Using plain integer as NULL pointer\n  builtin/pull.c:182:9: warning: Using plain integer as NULL pointer\n  builtin/pull.c:188:9: warning: Using plain integer as NULL pointer\n  builtin/pull.c:191:9: warning: Using plain integer as NULL pointer\n\nThis is caused by using '0' in the macro which is used to initialise\na pointer field of the 'struct option'. In order to suppress the\nwarnings, we simply pass 'NULL', rather than '0', to the OPT_PASSTHRU\nmacro.\n\nSigned-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n---\n\nHi Paul,\n\nIf you need to re-roll your patches on the 'pt/pull-builtin' branch,\ncould you please squash this into the patch which corresponds to\ncommit 191241e5.\n\nThanks!\n\nATB,\nRamsay Jones\n\n builtin/pull.c | 14 +++++++-------\n 1 file changed, 7 insertions(+), 7 deletions(-)\n\ndiff --git a/builtin/pull.c b/builtin/pull.c\nindex d690aee..8bbe838 100644\n--- a/builtin/pull.c\n+++ b/builtin/pull.c\n@@ -157,20 +157,20 @@ static struct option pull_options[] = {\n \n \t/* Options passed to git-fetch */\n \tOPT_GROUP(N_(\"Options related to fetching\")),\n-\tOPT_PASSTHRU(0, \"all\", &opt_all, 0,\n+\tOPT_PASSTHRU(0, \"all\", &opt_all, NULL,\n \t\tN_(\"fetch from all remotes\"),\n \t\tPARSE_OPT_NOARG),\n-\tOPT_PASSTHRU('a', \"append\", &opt_append, 0,\n+\tOPT_PASSTHRU('a', \"append\", &opt_append, NULL,\n \t\tN_(\"append to .git/FETCH_HEAD instead of overwriting\"),\n \t\tPARSE_OPT_NOARG),\n \tOPT_PASSTHRU(0, \"upload-pack\", &opt_upload_pack, N_(\"path\"),\n \t\tN_(\"path to upload pack on remote end\"),\n \t\t0),\n \tOPT__FORCE(&opt_force, N_(\"force overwrite of local branch\")),\n-\tOPT_PASSTHRU('t', \"tags\", &opt_tags, 0,\n+\tOPT_PASSTHRU('t', \"tags\", &opt_tags, NULL,\n \t\tN_(\"fetch all tags and associated objects\"),\n \t\tPARSE_OPT_NOARG),\n-\tOPT_PASSTHRU('p', \"prune\", &opt_prune, 0,\n+\tOPT_PASSTHRU('p', \"prune\", &opt_prune, NULL,\n \t\tN_(\"prune remote-tracking branches no longer on remote\"),\n \t\tPARSE_OPT_NOARG),\n \tOPT_PASSTHRU(0, \"recurse-submodules\", &opt_recurse_submodules,\n@@ -179,16 +179,16 @@ static struct option pull_options[] = {\n \t\tPARSE_OPT_OPTARG),\n \tOPT_BOOL(0, \"dry-run\", &opt_dry_run,\n \t\tN_(\"dry run\")),\n-\tOPT_PASSTHRU('k', \"keep\", &opt_keep, 0,\n+\tOPT_PASSTHRU('k', \"keep\", &opt_keep, NULL,\n \t\tN_(\"keep downloaded pack\"),\n \t\tPARSE_OPT_NOARG),\n \tOPT_PASSTHRU(0, \"depth\", &opt_depth, N_(\"depth\"),\n \t\tN_(\"deepen history of shallow clone\"),\n \t\t0),\n-\tOPT_PASSTHRU(0, \"unshallow\", &opt_unshallow, 0,\n+\tOPT_PASSTHRU(0, \"unshallow\", &opt_unshallow, NULL,\n \t\tN_(\"convert to a complete repository\"),\n \t\tPARSE_OPT_NONEG | PARSE_OPT_NOARG),\n-\tOPT_PASSTHRU(0, \"update-shallow\", &opt_update_shallow, 0,\n+\tOPT_PASSTHRU(0, \"update-shallow\", &opt_update_shallow, NULL,\n \t\tN_(\"accept refs that update .git/shallow\"),\n \t\tPARSE_OPT_NOARG),\n \tOPT_PASSTHRU(0, \"refmap\", &opt_refmap, N_(\"refmap\"),\n-- \n2.4.0\n"},{"id":"264001","messageId":"CACRoPnRWkjvLLNSdMOia6-ncWxhoGU9qUf01pRa8fquSxM=2Bg@mail.gmail.com","threadId":"39651","inReplyTo":"5580AEE1.6090300@ramsay1.demon.co.uk","subject":"Re: [PATCH] pull.c: fix some sparse warnings","fromName":"Paul Tan","fromEmail":"pyokagan@gmail.com","sentAt":"2015-06-17T10:32:56Z","receivedAt":"2015-06-17T10:32:56Z","isPatch":true,"sender":{"key":"pyokagan@gmail.com","avatar":"https://avatars.githubusercontent.com/u/109479?v=4"},"body":"On Wed, Jun 17, 2015 at 7:18 AM, Ramsay Jones\n<ramsay@ramsay1.demon.co.uk> wrote:\n> Hi Paul,\n>\n> If you need to re-roll your patches on the 'pt/pull-builtin' branch,\n> could you please squash this into the patch which corresponds to\n> commit 191241e5.\n\nThanks. I must have been half-asleep because the block of code just\nabove uses NULL instead of 0. ><\n\nRegards,\nPaul\n"}]}