{"thread":{"id":"33647","subject":"[PATCH 4/6] compat/win32mmap.c: Fix some sparse warnings","startedAt":"2013-04-27T19:18:03Z","lastAt":"2013-04-27T19:18:03Z","messageCount":1,"participants":["Ramsay Jones"],"isPatch":true,"patchVersion":1,"patchTotal":6},"messages":[{"id":"215731","messageId":"517C246B.3010307@ramsay1.demon.co.uk","threadId":"33647","inReplyTo":null,"subject":"[PATCH 4/6] compat/win32mmap.c: Fix some sparse warnings","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2013-04-27T19:18:03Z","receivedAt":"2013-04-27T19:18:03Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nSparse issues two 'Using plain integer as NULL pointer' warnings\nagainst the call to the CreateFileMapping() function. The warnings\nrelate to the second and sixth parameters, which both have pointer\ntype. In order to suppress the warnings, we simply pass the NULL\npointer, rather than '0', to those parameters in the function call.\n\nSigned-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n---\n compat/win32mmap.c | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/compat/win32mmap.c b/compat/win32mmap.c\nindex 61d2ef8..80a8c9a 100644\n--- a/compat/win32mmap.c\n+++ b/compat/win32mmap.c\n@@ -21,8 +21,8 @@ void *git_mmap(void *start, size_t length, int prot, int flags, int fd, off_t of\n \tif (!(flags & MAP_PRIVATE))\n \t\tdie(\"Invalid usage of mmap when built with USE_WIN32_MMAP\");\n \n-\thmap = CreateFileMapping((HANDLE)_get_osfhandle(fd), 0, PAGE_WRITECOPY,\n-\t\t0, 0, 0);\n+\thmap = CreateFileMapping((HANDLE)_get_osfhandle(fd), NULL,\n+\t\tPAGE_WRITECOPY, 0, 0, NULL);\n \n \tif (!hmap)\n \t\treturn MAP_FAILED;\n-- \n1.8.2\n"}]}