{"thread":{"id":"24176","subject":"[PATCH 1/4] msvc: Fix some \"expr evaluates to function\" compiler warnings","startedAt":"2010-06-23T19:40:19Z","lastAt":"2010-06-29T16:50:55Z","messageCount":4,"participants":["Ramsay Jones","Johan Herland","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":4},"messages":[{"id":"144098","messageId":"4C226323.5080709@ramsay1.demon.co.uk","threadId":"24176","inReplyTo":null,"subject":"[PATCH 1/4] msvc: Fix some \"expr evaluates to function\" compiler warnings","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2010-06-23T19:40:19Z","receivedAt":"2010-06-23T19:40:19Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nIn particular, the following warning is issued while compiling\nnotes.c:\n\n    notes.c(927) : warning C4550: expression evaluates to a \\\nfunction which is missing an argument list\n\nalong with identical warnings on lines 928, 1016 and 1017.\n\nIn order to suppress the warning, we change the definition of\ncombine_notes_fn, so that the symbol type is an (explicit)\n\"pointer to function ...\".  As a result, several other\ndeclarations need some minor fix-up to take account of the\nnew typedef.\n\nSigned-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n---\n builtin.h       |    4 ++--\n builtin/notes.c |    2 +-\n notes.h         |    4 ++--\n 3 files changed, 5 insertions(+), 5 deletions(-)\n\ndiff --git a/builtin.h b/builtin.h\nindex b614d12..1054c6e 100644\n--- a/builtin.h\n+++ b/builtin.h\n@@ -23,13 +23,13 @@ struct notes_rewrite_cfg {\n \tstruct notes_tree **trees;\n \tconst char *cmd;\n \tint enabled;\n-\tcombine_notes_fn *combine;\n+\tcombine_notes_fn combine;\n \tstruct string_list *refs;\n \tint refs_from_env;\n \tint mode_from_env;\n };\n \n-combine_notes_fn *parse_combine_notes_fn(const char *v);\n+combine_notes_fn parse_combine_notes_fn(const char *v);\n struct notes_rewrite_cfg *init_copy_notes_for_rewrite(const char *cmd);\n int copy_note_for_rewrite(struct notes_rewrite_cfg *c,\n \t\t\t  const unsigned char *from_obj, const unsigned char *to_obj);\ndiff --git a/builtin/notes.c b/builtin/notes.c\nindex 648033c..f1f53a8 100644\n--- a/builtin/notes.c\n+++ b/builtin/notes.c\n@@ -313,7 +313,7 @@ int commit_notes(struct notes_tree *t, const char *msg)\n \treturn 0;\n }\n \n-combine_notes_fn *parse_combine_notes_fn(const char *v)\n+combine_notes_fn parse_combine_notes_fn(const char *v)\n {\n \tif (!strcasecmp(v, \"overwrite\"))\n \t\treturn combine_notes_overwrite;\ndiff --git a/notes.h b/notes.h\nindex cc2dff2..65fc3a6 100644\n--- a/notes.h\n+++ b/notes.h\n@@ -18,7 +18,7 @@\n  * combine_notes_concatenate(), which appends the contents of the new note to\n  * the contents of the existing note.\n  */\n-typedef int combine_notes_fn(unsigned char *cur_sha1, const unsigned char *new_sha1);\n+typedef int (*combine_notes_fn)(unsigned char *cur_sha1, const unsigned char *new_sha1);\n \n /* Common notes combinators */\n int combine_notes_concatenate(unsigned char *cur_sha1, const unsigned char *new_sha1);\n@@ -38,7 +38,7 @@ extern struct notes_tree {\n \tstruct int_node *root;\n \tstruct non_note *first_non_note, *prev_non_note;\n \tchar *ref;\n-\tcombine_notes_fn *combine_notes;\n+\tcombine_notes_fn combine_notes;\n \tint initialized;\n \tint dirty;\n } default_notes_tree;\n-- \n1.7.1\n"},{"id":"144127","messageId":"201006241201.08212.johan@herland.net","threadId":"24176","inReplyTo":"4C226323.5080709@ramsay1.demon.co.uk","subject":"Re: [PATCH 1/4] msvc: Fix some \"expr evaluates to function\" compiler warnings","fromName":"Johan Herland","fromEmail":"johan@herland.net","sentAt":"2010-06-24T10:01:07Z","receivedAt":"2010-06-24T10:01:07Z","isPatch":true,"sender":{"key":"johan@herland.net","avatar":"https://avatars.githubusercontent.com/u/547031?v=4"},"body":"On Wednesday 23 June 2010, Ramsay Jones wrote:\n> In particular, the following warning is issued while compiling\n> notes.c:\n> \n>     notes.c(927) : warning C4550: expression evaluates to a \\\n> function which is missing an argument list\n> \n> along with identical warnings on lines 928, 1016 and 1017.\n> \n> In order to suppress the warning, we change the definition of\n> combine_notes_fn, so that the symbol type is an (explicit)\n> \"pointer to function ...\".  As a result, several other\n> declarations need some minor fix-up to take account of the\n> new typedef.\n> \n> Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n\nAcked-by: Johan Herland <johan@herland.net>\n\n\nThanks,\n\n...Johan\n\n-- \nJohan Herland, <johan@herland.net>\nwww.herland.net\n"},{"id":"144322","messageId":"4C25080A.107@ramsay1.demon.co.uk","threadId":"24176","inReplyTo":"201006241201.08212.johan@herland.net","subject":"Re: [PATCH 1/4] msvc: Fix some \"expr evaluates to function\" compiler warnings","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2010-06-25T19:48:26Z","receivedAt":"2010-06-25T19:48:26Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"Johan Herland wrote:\n> On Wednesday 23 June 2010, Ramsay Jones wrote:\n>> In particular, the following warning is issued while compiling\n>> notes.c:\n>>\n>>     notes.c(927) : warning C4550: expression evaluates to a \\\n>> function which is missing an argument list\n>>\n>> along with identical warnings on lines 928, 1016 and 1017.\n>>\n>> In order to suppress the warning, we change the definition of\n>> combine_notes_fn, so that the symbol type is an (explicit)\n>> \"pointer to function ...\".  As a result, several other\n>> declarations need some minor fix-up to take account of the\n>> new typedef.\n>>\n>> Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n> \n> Acked-by: Johan Herland <johan@herland.net>\n\nThanks!\n\nATB,\nRamsay Jones\n"},{"id":"144476","messageId":"7vlj9xaikw.fsf@alter.siamese.dyndns.org","threadId":"24176","inReplyTo":"4C226323.5080709@ramsay1.demon.co.uk","subject":"Re: [PATCH 1/4] msvc: Fix some \"expr evaluates to function\" compiler warnings","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-06-29T16:50:55Z","receivedAt":"2010-06-29T16:50:55Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:\n\n> In particular, the following warning is issued while compiling\n> notes.c:\n>\n>     notes.c(927) : warning C4550: expression evaluates to a \\\n> function which is missing an argument list\n>\n> along with identical warnings on lines 928, 1016 and 1017.\n>\n> In order to suppress the warning, we change the definition of\n> combine_notes_fn, so that the symbol type is an (explicit)\n> \"pointer to function ...\".  As a result, several other\n> declarations need some minor fix-up to take account of the\n> new typedef.\n>\n> Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n\nLooks sensible.  Thanks.\n"}]}