{"thread":{"id":"25961","subject":"[PATCH 07/14] fast-import.c: Initialise variables to suppress msvc warnings","startedAt":"2010-12-04T19:06:36Z","lastAt":"2010-12-04T19:06:36Z","messageCount":1,"participants":["Ramsay Jones"],"isPatch":true,"patchVersion":1,"patchTotal":14},"messages":[{"id":"157320","messageId":"4CFA913C.8000204@ramsay1.demon.co.uk","threadId":"25961","inReplyTo":null,"subject":"[PATCH 07/14] fast-import.c: Initialise variables to suppress msvc warnings","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2010-12-04T19:06:36Z","receivedAt":"2010-12-04T19:06:36Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nThe msvc compiler thinks that three variables could be used\nwhile uninitialised and issues the following warnings:\n\n    ...\\git\\fast-import.c(2474) : warning C4700: uninitialized local \\\n        variable 'e' used\n    ...\\git\\fast-import.c(2314) : warning C4700: uninitialized local \\\n        variable 'oe' used\n    ...\\git\\fast-import.c(2151) : warning C4700: uninitialized local \\\n        variable 'oe' used\n\nIn order to suppress the warnings, we simply initialise all\nthree of the pointer variables to NULL.\n\nSigned-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n---\n fast-import.c |    6 +++---\n 1 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/fast-import.c b/fast-import.c\nindex 8263dbe..1d7cd03 100644\n--- a/fast-import.c\n+++ b/fast-import.c\n@@ -2148,7 +2148,7 @@ static void file_change_m(struct branch *b)\n \tconst char *p = command_buf.buf + 2;\n \tstatic struct strbuf uq = STRBUF_INIT;\n \tconst char *endp;\n-\tstruct object_entry *oe = oe;\n+\tstruct object_entry *oe = NULL;\n \tunsigned char sha1[20];\n \tuint16_t mode, inline_data = 0;\n \n@@ -2311,7 +2311,7 @@ static void note_change_n(struct branch *b, unsigned char old_fanout)\n {\n \tconst char *p = command_buf.buf + 2;\n \tstatic struct strbuf uq = STRBUF_INIT;\n-\tstruct object_entry *oe = oe;\n+\tstruct object_entry *oe = NULL;\n \tstruct branch *s;\n \tunsigned char sha1[20], commit_sha1[20];\n \tchar path[60];\n@@ -2471,7 +2471,7 @@ static int parse_from(struct branch *b)\n \n static struct hash_list *parse_merge(unsigned int *count)\n {\n-\tstruct hash_list *list = NULL, *n, *e = e;\n+\tstruct hash_list *list = NULL, *n, *e = NULL;\n \tconst char *from;\n \tstruct branch *s;\n \n-- \n1.7.3\n"}]}