{"thread":{"id":"19619","subject":"[PATCH 03/11] Work around a regression in Windows 7, causing erase_in_line() to crash sometimes","startedAt":"2009-05-31T16:15:14Z","lastAt":"2009-06-11T21:13:28Z","messageCount":37,"participants":["Steffen Prohaska","Johannes Sixt","Junio C Hamano","Johannes Schindelin","GeunSik Lim"],"isPatch":true,"patchVersion":1,"patchTotal":11},"messages":[{"id":"115142","messageId":"1243786525-4493-1-git-send-email-prohaska@zib.de","threadId":"19619","inReplyTo":null,"subject":"[PATCH 00/11] Various msysgit patches","fromName":"Steffen Prohaska","fromEmail":"prohaska@zib.de","sentAt":"2009-05-31T16:15:14Z","receivedAt":"2009-05-31T16:15:14Z","isPatch":true,"sender":{"key":"prohaska@zib.de","avatar":"https://avatars.githubusercontent.com/u/217580?v=4"},"body":"Hello,\nHere are more patches that are in msysgit but not yet in official\ngit.git.  The patches have been discussed in the following two\nthreads:\n\n    http://thread.gmane.org/gmane.comp.version-control.msysgit/5373\n    http://thread.gmane.org/gmane.comp.version-control.msysgit/4876\n\nThe first couple of patches are small an obvious.  The patches with\nlarger numbers are more complex and might need discussion.\n\nBest,\nSteffen\n\nEdward Z. Yang (1):\n  connect.c: Support PuTTY plink and TortoisePlink as SSH on Windows\n\nJohannes Schindelin (6):\n  MinGW: GCC >= 4 does not need SNPRINTF_SIZE_CORR anymore\n  Quiet make: do not leave Windows behind\n  Work around a regression in Windows 7, causing erase_in_line() to\n    crash sometimes\n  test-chmtime: work around Windows limitation\n  winansi: fix compile warnings\n  Fix warnings in nedmalloc when compiling with GCC 4.4.0\n\nMarius Storm-Olsen (2):\n  MinGW readdir reimplementation to support d_type\n  Add custom memory allocator to MinGW and MacOS builds\n\nPat Thoyts (1):\n  git: browsing paths with spaces when using the start command\n\nSteffen Prohaska (1):\n  MinGW: Teach Makefile to detect msysgit and apply specific settings\n\n Makefile                     |   26 +-\n compat/mingw.c               |   59 +\n compat/mingw.h               |   29 +\n compat/nedmalloc/License.txt |   23 +\n compat/nedmalloc/Readme.txt  |  136 +\n compat/nedmalloc/malloc.c.h  | 5752 ++++++++++++++++++++++++++++++++++++++++++\n compat/nedmalloc/nedmalloc.c |  966 +++++++\n compat/nedmalloc/nedmalloc.h |  180 ++\n compat/snprintf.c            |    4 +\n compat/win32.h               |    1 +\n compat/winansi.c             |    3 +-\n connect.c                    |    8 +-\n git-web--browse.sh           |    5 +-\n test-chmtime.c               |    9 +\n 14 files changed, 7193 insertions(+), 8 deletions(-)\n create mode 100644 compat/nedmalloc/License.txt\n create mode 100644 compat/nedmalloc/Readme.txt\n create mode 100644 compat/nedmalloc/malloc.c.h\n create mode 100644 compat/nedmalloc/nedmalloc.c\n create mode 100644 compat/nedmalloc/nedmalloc.h\n"},{"id":"115151","messageId":"1243786525-4493-2-git-send-email-prohaska@zib.de","threadId":"19619","inReplyTo":"1243786525-4493-1-git-send-email-prohaska@zib.de","subject":"[PATCH 01/11] MinGW: GCC >= 4 does not need SNPRINTF_SIZE_CORR anymore","fromName":"Steffen Prohaska","fromEmail":"prohaska@zib.de","sentAt":"2009-05-31T16:15:15Z","receivedAt":"2009-05-31T16:15:15Z","isPatch":true,"sender":{"key":"prohaska@zib.de","avatar":"https://avatars.githubusercontent.com/u/217580?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\nSigned-off-by: Steffen Prohaska <prohaska@zib.de>\n---\n Makefile          |    1 -\n compat/snprintf.c |    4 ++++\n 2 files changed, 4 insertions(+), 1 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex eaae45d..77d8d9c 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -845,7 +845,6 @@ ifneq (,$(findstring MINGW,$(uname_S)))\n \tUNRELIABLE_FSTAT = UnfortunatelyYes\n \tOBJECT_CREATION_USES_RENAMES = UnfortunatelyNeedsTo\n \tCOMPAT_CFLAGS += -D__USE_MINGW_ACCESS -DNOGDI -Icompat -Icompat/regex -Icompat/fnmatch\n-\tCOMPAT_CFLAGS += -DSNPRINTF_SIZE_CORR=1\n \tCOMPAT_CFLAGS += -DSTRIP_EXTENSION=\\\".exe\\\"\n \tCOMPAT_OBJS += compat/mingw.o compat/fnmatch/fnmatch.o compat/regex/regex.o compat/winansi.o\n \tEXTLIBS += -lws2_32\ndiff --git a/compat/snprintf.c b/compat/snprintf.c\nindex 357e733..6c0fb05 100644\n--- a/compat/snprintf.c\n+++ b/compat/snprintf.c\n@@ -6,8 +6,12 @@\n  * number of characters to write without the trailing NUL.\n  */\n #ifndef SNPRINTF_SIZE_CORR\n+#if defined(__MINGW32__) && defined(__GNUC__) && __GNUC__ < 4\n+#define SNPRINTF_SIZE_CORR 1\n+#else\n #define SNPRINTF_SIZE_CORR 0\n #endif\n+#endif\n \n #undef vsnprintf\n int git_vsnprintf(char *str, size_t maxsize, const char *format, va_list ap)\n-- \n1.6.3.1.54.g99dd\n"},{"id":"115143","messageId":"1243786525-4493-3-git-send-email-prohaska@zib.de","threadId":"19619","inReplyTo":"1243786525-4493-2-git-send-email-prohaska@zib.de","subject":"[PATCH 02/11] Quiet make: do not leave Windows behind","fromName":"Steffen Prohaska","fromEmail":"prohaska@zib.de","sentAt":"2009-05-31T16:15:16Z","receivedAt":"2009-05-31T16:15:16Z","isPatch":true,"sender":{"key":"prohaska@zib.de","avatar":"https://avatars.githubusercontent.com/u/217580?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nOn Windows, we have to check whether there are scripts which would\noverride .exe files, but this check missed the \"quietification\".\nMake now prints 'BUILTIN all' instead of a long chain of 'test || rm'\ncommands.\n\n[spr: added clarification what make will print. ]\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\nSigned-off-by: Steffen Prohaska <prohaska@zib.de>\n---\n Makefile |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 77d8d9c..af08257 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1202,7 +1202,7 @@ SHELL = $(SHELL_PATH)\n \n all:: shell_compatibility_test $(ALL_PROGRAMS) $(BUILT_INS) $(OTHER_PROGRAMS) GIT-BUILD-OPTIONS\n ifneq (,$X)\n-\t$(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) git$X)), test '$p' -ef '$p$X' || $(RM) '$p';)\n+\t$(QUIET_BUILT_IN)$(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) git$X)), test '$p' -ef '$p$X' || $(RM) '$p';)\n endif\n \n all::\n-- \n1.6.3.1.54.g99dd\n"},{"id":"115140","messageId":"1243786525-4493-4-git-send-email-prohaska@zib.de","threadId":"19619","inReplyTo":"1243786525-4493-3-git-send-email-prohaska@zib.de","subject":"[PATCH 03/11] Work around a regression in Windows 7, causing erase_in_line() to crash sometimes","fromName":"Steffen Prohaska","fromEmail":"prohaska@zib.de","sentAt":"2009-05-31T16:15:17Z","receivedAt":"2009-05-31T16:15:17Z","isPatch":true,"sender":{"key":"prohaska@zib.de","avatar":"https://avatars.githubusercontent.com/u/217580?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nThe function FillConsoleOutputCharacterA() was pretty content in XP to take a NULL\npointer if we did not want to store the number of written columns.  In Windows 7,\nit crashes, but only when called from within Git Bash, not from within cmd.exe.\nGo figure.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\nSigned-off-by: Steffen Prohaska <prohaska@zib.de>\n---\n compat/winansi.c |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/compat/winansi.c b/compat/winansi.c\nindex 44dc293..4bee335 100644\n--- a/compat/winansi.c\n+++ b/compat/winansi.c\n@@ -80,6 +80,7 @@ static void set_console_attr(void)\n static void erase_in_line(void)\n {\n \tCONSOLE_SCREEN_BUFFER_INFO sbi;\n+\tlong dummy; /* Needed for Windows 7 (or Vista) regression */\n \n \tif (!console)\n \t\treturn;\n@@ -87,7 +88,7 @@ static void erase_in_line(void)\n \tGetConsoleScreenBufferInfo(console, &sbi);\n \tFillConsoleOutputCharacterA(console, ' ',\n \t\tsbi.dwSize.X - sbi.dwCursorPosition.X, sbi.dwCursorPosition,\n-\t\tNULL);\n+\t\t&dummy);\n }\n \n \n-- \n1.6.3.1.54.g99dd\n"},{"id":"115145","messageId":"1243786525-4493-5-git-send-email-prohaska@zib.de","threadId":"19619","inReplyTo":"1243786525-4493-4-git-send-email-prohaska@zib.de","subject":"[PATCH 04/11] test-chmtime: work around Windows limitation","fromName":"Steffen Prohaska","fromEmail":"prohaska@zib.de","sentAt":"2009-05-31T16:15:18Z","receivedAt":"2009-05-31T16:15:18Z","isPatch":true,"sender":{"key":"prohaska@zib.de","avatar":"https://avatars.githubusercontent.com/u/217580?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nWindows has problems changing the mtime when the file is write protected,\neven by the owner of said file.\n\nAdd a Windows-only workaround to change the mode if necessary before\ntrying to change the mtime.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\nSigned-off-by: Steffen Prohaska <prohaska@zib.de>\n---\n test-chmtime.c |    9 +++++++++\n 1 files changed, 9 insertions(+), 0 deletions(-)\n\ndiff --git a/test-chmtime.c b/test-chmtime.c\nindex d5358cb..fe476cb 100644\n--- a/test-chmtime.c\n+++ b/test-chmtime.c\n@@ -87,6 +87,15 @@ int main(int argc, const char *argv[])\n \t\t\treturn -1;\n \t\t}\n \n+#ifdef WIN32\n+\t\tif (!(sb.st_mode & S_IWUSR) &&\n+\t\t\t\tchmod(argv[i], sb.st_mode | S_IWUSR)) {\n+\t\t\tfprintf(stderr, \"Could not make user-writable %s: %s\",\n+\t\t\t\targv[i], strerror(errno));\n+\t\t\treturn -1;\n+\t\t}\n+#endif\n+\n \t\tutb.actime = sb.st_atime;\n \t\tutb.modtime = set_eq ? set_time : sb.st_mtime + set_time;\n \n-- \n1.6.3.1.54.g99dd\n"},{"id":"115146","messageId":"1243786525-4493-6-git-send-email-prohaska@zib.de","threadId":"19619","inReplyTo":"1243786525-4493-5-git-send-email-prohaska@zib.de","subject":"[PATCH 05/11] winansi: fix compile warnings","fromName":"Steffen Prohaska","fromEmail":"prohaska@zib.de","sentAt":"2009-05-31T16:15:19Z","receivedAt":"2009-05-31T16:15:19Z","isPatch":true,"sender":{"key":"prohaska@zib.de","avatar":"https://avatars.githubusercontent.com/u/217580?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\nSigned-off-by: Steffen Prohaska <prohaska@zib.de>\n---\n compat/win32.h   |    1 +\n compat/winansi.c |    2 +-\n 2 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/compat/win32.h b/compat/win32.h\nindex c26384e..d531130 100644\n--- a/compat/win32.h\n+++ b/compat/win32.h\n@@ -1,5 +1,6 @@\n /* common Win32 functions for MinGW and Cygwin */\n #include <windows.h>\n+#include <conio.h>\n \n static inline int file_attr_to_st_mode (DWORD attr)\n {\ndiff --git a/compat/winansi.c b/compat/winansi.c\nindex 4bee335..9217c24 100644\n--- a/compat/winansi.c\n+++ b/compat/winansi.c\n@@ -80,7 +80,7 @@ static void set_console_attr(void)\n static void erase_in_line(void)\n {\n \tCONSOLE_SCREEN_BUFFER_INFO sbi;\n-\tlong dummy; /* Needed for Windows 7 (or Vista) regression */\n+\tDWORD dummy; /* Needed for Windows 7 (or Vista) regression */\n \n \tif (!console)\n \t\treturn;\n-- \n1.6.3.1.54.g99dd\n"},{"id":"115144","messageId":"1243786525-4493-7-git-send-email-prohaska@zib.de","threadId":"19619","inReplyTo":"1243786525-4493-6-git-send-email-prohaska@zib.de","subject":"[PATCH 06/11] git: browsing paths with spaces when using the start command","fromName":"Steffen Prohaska","fromEmail":"prohaska@zib.de","sentAt":"2009-05-31T16:15:20Z","receivedAt":"2009-05-31T16:15:20Z","isPatch":true,"sender":{"key":"prohaska@zib.de","avatar":"https://avatars.githubusercontent.com/u/217580?v=4"},"body":"From: Pat Thoyts <patthoyts@users.sourceforge.net>\n\nmsysGit issue 258 tracks a problem opening a browser onto file\npaths that contain spaces or parentheses when calling the\nweb--browse script. This patch modifies how the start command is\ncalled to solve this.\n\nSigned-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>\nSigned-off-by: Steffen Prohaska <prohaska@zib.de>\n---\n git-web--browse.sh |    5 ++++-\n 1 files changed, 4 insertions(+), 1 deletions(-)\n\ndiff --git a/git-web--browse.sh b/git-web--browse.sh\nindex 7ed0fad..4f5c740 100755\n--- a/git-web--browse.sh\n+++ b/git-web--browse.sh\n@@ -161,9 +161,12 @@ case \"$browser\" in\n \t\t;;\n \tesac\n \t;;\n-    w3m|links|lynx|open|start)\n+    w3m|links|lynx|open)\n \teval \"$browser_path\" \"$@\"\n \t;;\n+    start)\n+        exec \"$browser_path\" '\"web-browse\"' \"$@\"\n+        ;;\n     dillo)\n \t\"$browser_path\" \"$@\" &\n \t;;\n-- \n1.6.3.1.54.g99dd\n"},{"id":"115152","messageId":"1243786525-4493-8-git-send-email-prohaska@zib.de","threadId":"19619","inReplyTo":"1243786525-4493-7-git-send-email-prohaska@zib.de","subject":"[PATCH 07/11] connect.c: Support PuTTY plink and TortoisePlink as SSH on Windows","fromName":"Steffen Prohaska","fromEmail":"prohaska@zib.de","sentAt":"2009-05-31T16:15:21Z","receivedAt":"2009-05-31T16:15:21Z","isPatch":true,"sender":{"key":"prohaska@zib.de","avatar":"https://avatars.githubusercontent.com/u/217580?v=4"},"body":"From: Edward Z. Yang <edwardzyang@thewritingpot.com>\n\nOpenSSH uses -p to specify custom ports, while PuTTY plink and\nTortoisePlink use -P. Git now detects if plink is in GIT_SSH and\nmodify its flags as necessary.\n\nWe call plink with -batch, so that it will error out with an error\nmessage instead of waiting for user input.  As reported in msysGit\nissue 96, plink wants to interact with the user asking if a host\nkey should be accepted, but this just blocks the terminal, since\nplink tries to get the answer from stdin.  However, stdin is\nalready connected to Git that wants to send input to the remote\ncommand.\n\nBut we do not pass -batch to TortoisePlink, because TortoisePlink\nuses a GUI to communicate with the user, and it does not understand\n-batch.\n\nSigned-off-by: Edward Z. Yang <edwardzyang@thewritingpot.com>\nSigned-off-by: Steffen Prohaska <prohaska@zib.de>\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n connect.c |    8 ++++++--\n 1 files changed, 6 insertions(+), 2 deletions(-)\n\ndiff --git a/connect.c b/connect.c\nindex f6b8ba6..692d476 100644\n--- a/connect.c\n+++ b/connect.c\n@@ -602,14 +602,18 @@ struct child_process *git_connect(int fd[2], const char *url_orig,\n \t\tdie(\"command line too long\");\n \n \tconn->in = conn->out = -1;\n-\tconn->argv = arg = xcalloc(6, sizeof(*arg));\n+\tconn->argv = arg = xcalloc(7, sizeof(*arg));\n \tif (protocol == PROTO_SSH) {\n \t\tconst char *ssh = getenv(\"GIT_SSH\");\n+\t\tint putty = ssh && strcasestr(ssh, \"plink\");\n \t\tif (!ssh) ssh = \"ssh\";\n \n \t\t*arg++ = ssh;\n+\t\tif (putty && !strcasestr(ssh, \"tortoiseplink\"))\n+\t\t\t*arg++ = \"-batch\";\n \t\tif (port) {\n-\t\t\t*arg++ = \"-p\";\n+\t\t\t/* P is for PuTTY, p is for OpenSSH */\n+\t\t\t*arg++ = putty ? \"-P\" : \"-p\";\n \t\t\t*arg++ = port;\n \t\t}\n \t\t*arg++ = host;\n-- \n1.6.3.1.54.g99dd\n"},{"id":"115147","messageId":"1243786525-4493-9-git-send-email-prohaska@zib.de","threadId":"19619","inReplyTo":"1243786525-4493-8-git-send-email-prohaska@zib.de","subject":"[PATCH 08/11] MinGW readdir reimplementation to support d_type","fromName":"Steffen Prohaska","fromEmail":"prohaska@zib.de","sentAt":"2009-05-31T16:15:22Z","receivedAt":"2009-05-31T16:15:22Z","isPatch":true,"sender":{"key":"prohaska@zib.de","avatar":"https://avatars.githubusercontent.com/u/217580?v=4"},"body":"From: Marius Storm-Olsen <marius@trolltech.com>\n\nThe original readdir implementation was fast, but didn't\nsupport the d_type. This means that git would do additional\nlstats for each entry, to figure out if the entry was a\ndirectory or not. This unneedingly slowed down many\noperations, since Windows API provides this information\ndirectly when walking the directories.\n\nBy running this implementation on Moe's repo structure:\n  mkdir bummer && cd bummer; for ((i=0;i<100;i++)); do\n    mkdir $i && pushd $i;\n      for ((j=0;j<1000;j++)); do echo \"$j\" >$j; done;\n    popd;\n  done\n\nWe see the following speedups:\n  git add .\n  -------------------\n  old: 00:00:23(.087)\n  new: 00:00:21(.512) 1.07x\n\n  git status\n  -------------------\n  old: 00:00:03(.306)\n  new: 00:00:01(.684) 1.96x\n\n  git clean -dxf\n  -------------------\n  old: 00:00:01(.918)\n  new: 00:00:00(.295) 6.50x\n\nSigned-off-by: Marius Storm-Olsen <marius@trolltech.com>\nSigned-off-by: Steffen Prohaska <prohaska@zib.de>\n---\n compat/mingw.c |   59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n compat/mingw.h |   29 +++++++++++++++++++++++++++\n 2 files changed, 88 insertions(+), 0 deletions(-)\n\ndiff --git a/compat/mingw.c b/compat/mingw.c\nindex e190fdd..d85d680 100644\n--- a/compat/mingw.c\n+++ b/compat/mingw.c\n@@ -1171,3 +1171,62 @@ char *getpass(const char *prompt)\n \tfputs(\"\\n\", stderr);\n \treturn strbuf_detach(&buf, NULL);\n }\n+\n+#ifndef NO_MINGW_REPLACE_READDIR\n+/* MinGW readdir implementation to avoid extra lstats for Git */\n+struct mingw_DIR\n+{\n+\tstruct _finddata_t\tdd_dta;\t\t/* disk transfer area for this dir */\n+\tstruct mingw_dirent\tdd_dir;\t\t/* Our own implementation, including d_type */\n+\tlong\t\t\tdd_handle;\t/* _findnext handle */\n+\tint\t\t\tdd_stat; \t/* 0 = next entry to read is first entry, -1 = off the end, positive = 0 based index of next entry */\n+\tchar\t\t\tdd_name[1]; \t/* given path for dir with search pattern (struct is extended) */\n+};\n+\n+struct dirent *mingw_readdir(DIR *dir)\n+{\n+\tWIN32_FIND_DATAA buf;\n+\tHANDLE handle;\n+\tstruct mingw_DIR *mdir = (struct mingw_DIR*)dir;\n+\n+\tif (!dir->dd_handle) {\n+\t\terrno = EBADF; /* No set_errno for mingw */\n+\t\treturn NULL;\n+\t}\n+\n+\tif (dir->dd_handle == (long)INVALID_HANDLE_VALUE && dir->dd_stat == 0)\n+\t{\n+\t\thandle = FindFirstFileA(dir->dd_name, &buf);\n+\t\tDWORD lasterr = GetLastError();\n+\t\tdir->dd_handle = (long)handle;\n+\t\tif (handle == INVALID_HANDLE_VALUE && (lasterr != ERROR_NO_MORE_FILES)) {\n+\t\t\terrno = err_win_to_posix(lasterr);\n+\t\t\treturn NULL;\n+\t\t}\n+\t} else if (dir->dd_handle == (long)INVALID_HANDLE_VALUE) {\n+\t\treturn NULL;\n+\t} else if (!FindNextFileA((HANDLE)dir->dd_handle, &buf)) {\n+\t\tDWORD lasterr = GetLastError();\n+\t\tFindClose((HANDLE)dir->dd_handle);\n+\t\tdir->dd_handle = (long)INVALID_HANDLE_VALUE;\n+\t\t/* POSIX says you shouldn't set errno when readdir can't\n+\t\t   find any more files; so, if another error we leave it set. */\n+\t\tif (lasterr != ERROR_NO_MORE_FILES)\n+\t\t\terrno = err_win_to_posix(lasterr);\n+\t\treturn NULL;\n+\t}\n+\n+\t/* We get here if `buf' contains valid data.  */\n+\tstrcpy(dir->dd_dir.d_name, buf.cFileName);\n+\t++dir->dd_stat;\n+\n+\t/* Set file type, based on WIN32_FIND_DATA */\n+\tmdir->dd_dir.d_type = 0;\n+\tif (buf.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)\n+\t\tmdir->dd_dir.d_type |= DT_DIR;\n+\telse\n+\t\tmdir->dd_dir.d_type |= DT_REG;\n+\n+\treturn (struct dirent*)&dir->dd_dir;\n+}\n+#endif // !NO_MINGW_REPLACE_READDIR\ndiff --git a/compat/mingw.h b/compat/mingw.h\nindex 4c50f5b..4f7ba4c 100644\n--- a/compat/mingw.h\n+++ b/compat/mingw.h\n@@ -235,3 +235,32 @@ int main(int argc, const char **argv) \\\n \treturn mingw_main(argc, argv); \\\n } \\\n static int mingw_main(c,v)\n+\n+#ifndef NO_MINGW_REPLACE_READDIR\n+/*\n+ * A replacement of readdir, to ensure that it reads the file type at\n+ * the same time. This avoid extra unneeded lstats in git on MinGW\n+ */\n+#undef DT_UNKNOWN\n+#undef DT_DIR\n+#undef DT_REG\n+#undef DT_LNK\n+#define DT_UNKNOWN\t0\n+#define DT_DIR\t\t1\n+#define DT_REG\t\t2\n+#define DT_LNK\t\t3\n+\n+struct mingw_dirent\n+{\n+\tlong\t\td_ino;\t\t\t/* Always zero. */\n+\tunion {\n+\t\tunsigned short\td_reclen;\t/* Always zero. */\n+\t\tunsigned char   d_type;\t\t/* Reimplementation adds this */\n+\t};\n+\tunsigned short\td_namlen;\t\t/* Length of name in d_name. */\n+\tchar\t\td_name[FILENAME_MAX];\t/* File name. */\n+};\n+#define dirent mingw_dirent\n+#define readdir(x) mingw_readdir(x)\n+struct dirent *mingw_readdir(DIR *dir);\n+#endif // !NO_MINGW_REPLACE_READDIR\n-- \n1.6.3.1.54.g99dd\n"},{"id":"115141","messageId":"1243786525-4493-11-git-send-email-prohaska@zib.de","threadId":"19619","inReplyTo":"1243786525-4493-10-git-send-email-prohaska@zib.de","subject":"[PATCH 10/11] Fix warnings in nedmalloc when compiling with GCC 4.4.0","fromName":"Steffen Prohaska","fromEmail":"prohaska@zib.de","sentAt":"2009-05-31T16:15:24Z","receivedAt":"2009-05-31T16:15:24Z","isPatch":true,"sender":{"key":"prohaska@zib.de","avatar":"https://avatars.githubusercontent.com/u/217580?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\nSigned-off-by: Steffen Prohaska <prohaska@zib.de>\n---\n compat/nedmalloc/malloc.c.h  |    4 +++-\n compat/nedmalloc/nedmalloc.c |    2 +-\n 2 files changed, 4 insertions(+), 2 deletions(-)\n\ndiff --git a/compat/nedmalloc/malloc.c.h b/compat/nedmalloc/malloc.c.h\nindex 1d9bbe0..678beb8 100644\n--- a/compat/nedmalloc/malloc.c.h\n+++ b/compat/nedmalloc/malloc.c.h\n@@ -1270,7 +1270,9 @@ int mspace_mallopt(int, int);\n /*------------------------------ internal #includes ---------------------- */\n \n #ifdef WIN32\n+#ifndef __GNUC__\n #pragma warning( disable : 4146 ) /* no \"unsigned\" warnings */\n+#endif\n #endif /* WIN32 */\n \n #include <stdio.h>       /* for printing in malloc_stats */\n@@ -2541,7 +2543,7 @@ struct malloc_params {\n static struct malloc_params mparams;\n \n /* Ensure mparams initialized */\n-#define ensure_initialization() (mparams.magic != 0 || init_mparams())\n+#define ensure_initialization() if (mparams.magic == 0) init_mparams()\n \n #if !ONLY_MSPACES\n \ndiff --git a/compat/nedmalloc/nedmalloc.c b/compat/nedmalloc/nedmalloc.c\nindex a381a7d..60a4093 100644\n--- a/compat/nedmalloc/nedmalloc.c\n+++ b/compat/nedmalloc/nedmalloc.c\n@@ -34,7 +34,7 @@ DEALINGS IN THE SOFTWARE.\n /*#define FULLSANITYCHECKS*/\n \n #include \"nedmalloc.h\"\n-#if defined(WIN32) && !defined(__MINGW32__)\n+#if defined(WIN32)\n  #include <malloc.h>\n #endif\n #define MSPACES 1\n-- \n1.6.3.1.54.g99dd\n"},{"id":"115148","messageId":"1243786525-4493-12-git-send-email-prohaska@zib.de","threadId":"19619","inReplyTo":"1243786525-4493-11-git-send-email-prohaska@zib.de","subject":"[PATCH 11/11] MinGW: Teach Makefile to detect msysgit and apply specific settings","fromName":"Steffen Prohaska","fromEmail":"prohaska@zib.de","sentAt":"2009-05-31T16:15:25Z","receivedAt":"2009-05-31T16:15:25Z","isPatch":true,"sender":{"key":"prohaska@zib.de","avatar":"https://avatars.githubusercontent.com/u/217580?v=4"},"body":"This commit changes handling of the msysgit specific settings, so\nthat they can be applied to official git.git.  Some msysgit\nsettings differ from the standard MinGW settings.  We move them\ninto an ifndef block that is only evaluated if a file\nTHIS_IS_MSYSGIT is present in the parent directory, which is the\ncase for an msysgit working environment.  The tag file is unlikely\nto be present accidentally.\n\nSigned-off-by: Steffen Prohaska <prohaska@zib.de>\n---\n Makefile |   14 ++++++++++++--\n 1 files changed, 12 insertions(+), 2 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex f9657ce..7803ae7 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -823,7 +823,6 @@ ifneq (,$(findstring MINGW,$(uname_S)))\n \tpathsep = ;\n \tNO_PREAD = YesPlease\n \tNO_OPENSSL = YesPlease\n-\tNO_CURL = YesPlease\n \tNO_SYMLINK_HEAD = YesPlease\n \tNO_IPV6 = YesPlease\n \tNO_SETENV = YesPlease\n@@ -831,7 +830,6 @@ ifneq (,$(findstring MINGW,$(uname_S)))\n \tNO_STRCASESTR = YesPlease\n \tNO_STRLCPY = YesPlease\n \tNO_MEMMEM = YesPlease\n-\tNO_PTHREADS = YesPlease\n \tNEEDS_LIBICONV = YesPlease\n \tOLD_ICONV = YesPlease\n \tNO_C99_FORMAT = YesPlease\n@@ -853,6 +851,18 @@ ifneq (,$(findstring MINGW,$(uname_S)))\n \tCOMPAT_OBJS += compat/mingw.o compat/fnmatch/fnmatch.o compat/regex/regex.o compat/winansi.o\n \tEXTLIBS += -lws2_32\n \tX = .exe\n+ifneq (,$(wildcard ../THIS_IS_MSYSGIT))\n+\thtmldir=doc/git/html/\n+\tprefix =\n+\tINSTALL = /bin/install\n+\tEXTLIBS += /mingw/lib/libz.a\n+\tNO_R_TO_GCC_LINKER = YesPlease\n+\tINTERNAL_QSORT = YesPlease\n+\tTHREADED_DELTA_SEARCH = YesPlease\n+else\n+\tNO_CURL = YesPlease\n+\tNO_PTHREADS = YesPlease\n+endif\n endif\n ifneq (,$(findstring arm,$(uname_M)))\n \tARM_SHA1 = YesPlease\n-- \n1.6.3.1.54.g99dd\n"},{"id":"115157","messageId":"4A22C674.603@kdbg.org","threadId":"19619","inReplyTo":"1243786525-4493-6-git-send-email-prohaska@zib.de","subject":"Re: [PATCH 05/11] winansi: fix compile warnings","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2009-05-31T18:03:32Z","receivedAt":"2009-05-31T18:03:32Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Steffen Prohaska schrieb:\n> diff --git a/compat/win32.h b/compat/win32.h\n> index c26384e..d531130 100644\n> --- a/compat/win32.h\n> +++ b/compat/win32.h\n> @@ -1,5 +1,6 @@\n>  /* common Win32 functions for MinGW and Cygwin */\n>  #include <windows.h>\n> +#include <conio.h>\n>  \n>  static inline int file_attr_to_st_mode (DWORD attr)\n>  {\n\nI assume this is to remove the warning about missing declaration of \n_getch(). Can we have this patch instead? I don't have conio.h in my \noldish MinGW environment.\n\ndiff --git a/compat/mingw.c b/compat/mingw.c\nindex 52961ee..53053ad 100644\n--- a/compat/mingw.c\n+++ b/compat/mingw.c\n@@ -1211,6 +1211,9 @@ int link(const char *oldpath, const char *newpath)\n  \treturn 0;\n  }\n\n+/* from conio.h */\n+int _getch(void);  // FIXME: really look this up in conio.h!!!!\n+\n  char *getpass(const char *prompt)\n  {\n  \tstruct strbuf buf = STRBUF_INIT;\n\n> diff --git a/compat/winansi.c b/compat/winansi.c\n> index 4bee335..9217c24 100644\n> --- a/compat/winansi.c\n> +++ b/compat/winansi.c\n> @@ -80,7 +80,7 @@ static void set_console_attr(void)\n>  static void erase_in_line(void)\n>  {\n>  \tCONSOLE_SCREEN_BUFFER_INFO sbi;\n> -\tlong dummy; /* Needed for Windows 7 (or Vista) regression */\n> +\tDWORD dummy; /* Needed for Windows 7 (or Vista) regression */\n>  \n>  \tif (!console)\n>  \t\treturn;\n\nThis should really be squashed into 03/11, where the line is introduced.\n\n-- Hannes\n"},{"id":"115160","messageId":"200905312152.11434.j6t@kdbg.org","threadId":"19619","inReplyTo":"4A22C674.603@kdbg.org","subject":"Re: [PATCH 05/11] winansi: fix compile warnings","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2009-05-31T19:52:11Z","receivedAt":"2009-05-31T19:52:11Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"On Sonntag, 31. Mai 2009, Johannes Sixt wrote:\n> Steffen Prohaska schrieb:\n> > diff --git a/compat/win32.h b/compat/win32.h\n> > index c26384e..d531130 100644\n> > --- a/compat/win32.h\n> > +++ b/compat/win32.h\n> > @@ -1,5 +1,6 @@\n> >  /* common Win32 functions for MinGW and Cygwin */\n> >  #include <windows.h>\n> > +#include <conio.h>\n> >\n> >  static inline int file_attr_to_st_mode (DWORD attr)\n> >  {\n>\n> I assume this is to remove the warning about missing declaration of\n> _getch(). Can we have this patch instead? I don't have conio.h in my\n> oldish MinGW environment.\n>\n> diff --git a/compat/mingw.c b/compat/mingw.c\n> index 52961ee..53053ad 100644\n> --- a/compat/mingw.c\n> +++ b/compat/mingw.c\n> @@ -1211,6 +1211,9 @@ int link(const char *oldpath, const char *newpath)\n>   \treturn 0;\n>   }\n>\n> +/* from conio.h */\n> +int _getch(void);  // FIXME: really look this up in conio.h!!!!\n> +\n>   char *getpass(const char *prompt)\n>   {\n>   \tstruct strbuf buf = STRBUF_INIT;\n\nOk, forget this patch; I'll upgrade my MinGW instead, and let's assume all \nother mingw.git h4ckrz who aren't using the latest msysgit will upgrade as \nwell.\n\nNevertheless, I think that the #include <conio.h> is in the wrong file: it \nshould be included from compat/mingw.c.\n\n-- Hannes\n"},{"id":"115161","messageId":"200905312206.18987.j6t@kdbg.org","threadId":"19619","inReplyTo":"1243786525-4493-1-git-send-email-prohaska@zib.de","subject":"Re: [PATCH 00/11] Various msysgit patches","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2009-05-31T20:06:18Z","receivedAt":"2009-05-31T20:06:18Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"On Sonntag, 31. Mai 2009, Steffen Prohaska wrote:\n> Hello,\n> Here are more patches that are in msysgit but not yet in official\n> git.git.  The patches have been discussed in the following two\n> threads:\n>\n>     http://thread.gmane.org/gmane.comp.version-control.msysgit/5373\n>     http://thread.gmane.org/gmane.comp.version-control.msysgit/4876\n\nThanks a lot, your work is very much appreciated. Let me add that these \npatches have been in use for weeks, some even for months now.\n\nPlease consider to resend updated 03/11 and 05/11 as I have suggested \nelsewhere in the thread.\n\n-- Hannes\n"},{"id":"115177","messageId":"1243836256-11958-1-git-send-email-prohaska@zib.de","threadId":"19619","inReplyTo":"4A22C674.603@kdbg.org","subject":"[PATCH 03/11 v2] Work around a regression in Windows 7, causing erase_in_line() to crash sometimes","fromName":"Steffen Prohaska","fromEmail":"prohaska@zib.de","sentAt":"2009-06-01T06:04:16Z","receivedAt":"2009-06-01T06:04:16Z","isPatch":true,"sender":{"key":"prohaska@zib.de","avatar":"https://avatars.githubusercontent.com/u/217580?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nThe function FillConsoleOutputCharacterA() was pretty content in XP to take a NULL\npointer if we did not want to store the number of written columns.  In Windows 7,\nit crashes, but only when called from within Git Bash, not from within cmd.exe.\nGo figure.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\nSigned-off-by: Steffen Prohaska <prohaska@zib.de>\n---\n compat/winansi.c |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\nI squashed the second chunk of 05/11, as suggested by Hannes.\n\ndiff --git a/compat/winansi.c b/compat/winansi.c\nindex 44dc293..9217c24 100644\n--- a/compat/winansi.c\n+++ b/compat/winansi.c\n@@ -80,6 +80,7 @@ static void set_console_attr(void)\n static void erase_in_line(void)\n {\n \tCONSOLE_SCREEN_BUFFER_INFO sbi;\n+\tDWORD dummy; /* Needed for Windows 7 (or Vista) regression */\n \n \tif (!console)\n \t\treturn;\n@@ -87,7 +88,7 @@ static void erase_in_line(void)\n \tGetConsoleScreenBufferInfo(console, &sbi);\n \tFillConsoleOutputCharacterA(console, ' ',\n \t\tsbi.dwSize.X - sbi.dwCursorPosition.X, sbi.dwCursorPosition,\n-\t\tNULL);\n+\t\t&dummy);\n }\n \n \n-- \n1.6.3.1.54.g99dd\n"},{"id":"115179","messageId":"1243838505-27641-1-git-send-email-prohaska@zib.de","threadId":"19619","inReplyTo":"200905312152.11434.j6t@kdbg.org","subject":"[PATCH 05/11 v2] MinGW: fix warning about implicit declaration of _getch()","fromName":"Steffen Prohaska","fromEmail":"prohaska@zib.de","sentAt":"2009-06-01T06:41:45Z","receivedAt":"2009-06-01T06:41:45Z","isPatch":true,"sender":{"key":"prohaska@zib.de","avatar":"https://avatars.githubusercontent.com/u/217580?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nconio.h provides the declaration.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\nSigned-off-by: Steffen Prohaska <prohaska@zib.de>\n---\n compat/mingw.c |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\nThis replaces 05/11.  The original commit messages was\nmisleading.  Apparently, the original 05/11 solved two things.\nFirst, it fixed a warning in winansi.c, which has been squashed\ninto 03/11.  Second, it fixed a warning about implict decl of\n_getch().  Including conio.h in mingw.c is sufficient to fix\nthis warning.\n\ndiff --git a/compat/mingw.c b/compat/mingw.c\nindex e190fdd..12d0c2f 100644\n--- a/compat/mingw.c\n+++ b/compat/mingw.c\n@@ -1,5 +1,6 @@\n #include \"../git-compat-util.h\"\n #include \"win32.h\"\n+#include <conio.h>\n #include \"../strbuf.h\"\n \n unsigned int _CRT_fmode = _O_BINARY;\n-- \n1.6.3.1.54.g99dd\n"},{"id":"115181","messageId":"7vhbz0mmai.fsf@alter.siamese.dyndns.org","threadId":"19619","inReplyTo":"1243786525-4493-11-git-send-email-prohaska@zib.de","subject":"Re: [PATCH 10/11] Fix warnings in nedmalloc when compiling with GCC 4.4.0","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-06-01T07:43:33Z","receivedAt":"2009-06-01T07:43:33Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Steffen Prohaska <prohaska@zib.de> writes:\n\n> @@ -2541,7 +2543,7 @@ struct malloc_params {\n>  static struct malloc_params mparams;\n>  \n>  /* Ensure mparams initialized */\n> -#define ensure_initialization() (mparams.magic != 0 || init_mparams())\n> +#define ensure_initialization() if (mparams.magic == 0) init_mparams()\n>  \n>  #if !ONLY_MSPACES\n\nThe code after the patch looks more fragile than the original.  I know\nthere currently is no code like:\n\n\tif (foo())\n        \tensure_initialization();\n\telse\n        \twarn(\"oops\");\n\nbut this change still feels wrong.\n\nWhat issue is this patch trying to work around?  Returned value not being\nused?\n\n> diff --git a/compat/nedmalloc/nedmalloc.c b/compat/nedmalloc/nedmalloc.c\n> index a381a7d..60a4093 100644\n> --- a/compat/nedmalloc/nedmalloc.c\n> +++ b/compat/nedmalloc/nedmalloc.c\n> @@ -34,7 +34,7 @@ DEALINGS IN THE SOFTWARE.\n>  /*#define FULLSANITYCHECKS*/\n>  \n>  #include \"nedmalloc.h\"\n> -#if defined(WIN32) && !defined(__MINGW32__)\n> +#if defined(WIN32)\n>   #include <malloc.h>\n>  #endif\n\nCan somebody enlighten me what this hunk is about, and how it helps GCC\n4.4?\n\nThere are many \"#if[n]def __MINGW32__\" remaining in the codebase both\ninside and outside compat/ area, so it is not that that symbol is somehow\nspecial.  I cannot even tell which one of the following is closer to the\nreason behind this change:\n\n (1) \"Because tacking '&& !defined(__MINGW32__)' after defined(WIN32) is\n     unnecessary for such and such reasons, it is removed\"; or\n\n (2) \"Because tacking '&& !defined(__MINGW32__)' after defined(WIN32) is\n     harmful for such and such reasons, it is removed\".\n\nPuzzled.\n"},{"id":"115182","messageId":"7vab4smmab.fsf@alter.siamese.dyndns.org","threadId":"19619","inReplyTo":"1243786525-4493-5-git-send-email-prohaska@zib.de","subject":"Re: [PATCH 04/11] test-chmtime: work around Windows limitation","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-06-01T07:43:40Z","receivedAt":"2009-06-01T07:43:40Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Steffen Prohaska <prohaska@zib.de> writes:\n\n> From: Johannes Schindelin <johannes.schindelin@gmx.de>\n>\n> Windows has problems changing the mtime when the file is write protected,\n> even by the owner of said file.\n>\n> Add a Windows-only workaround to change the mode if necessary before\n> trying to change the mtime.\n\nI'll queue this as-is for now, but shouldn't the code remember the\noriginal mode and change it back?\n\n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> Signed-off-by: Steffen Prohaska <prohaska@zib.de>\n> ---\n>  test-chmtime.c |    9 +++++++++\n>  1 files changed, 9 insertions(+), 0 deletions(-)\n>\n> diff --git a/test-chmtime.c b/test-chmtime.c\n> index d5358cb..fe476cb 100644\n> --- a/test-chmtime.c\n> +++ b/test-chmtime.c\n> @@ -87,6 +87,15 @@ int main(int argc, const char *argv[])\n>  \t\t\treturn -1;\n>  \t\t}\n>  \n> +#ifdef WIN32\n> +\t\tif (!(sb.st_mode & S_IWUSR) &&\n> +\t\t\t\tchmod(argv[i], sb.st_mode | S_IWUSR)) {\n> +\t\t\tfprintf(stderr, \"Could not make user-writable %s: %s\",\n> +\t\t\t\targv[i], strerror(errno));\n> +\t\t\treturn -1;\n> +\t\t}\n> +#endif\n> +\n>  \t\tutb.actime = sb.st_atime;\n>  \t\tutb.modtime = set_eq ? set_time : sb.st_mtime + set_time;\n>  \n> -- \n> 1.6.3.1.54.g99dd\n"},{"id":"115183","messageId":"alpine.DEB.1.00.0906011025080.26154@pacific.mpi-cbg.de","threadId":"19619","inReplyTo":"1243836256-11958-1-git-send-email-prohaska@zib.de","subject":"Re: [PATCH 03/11 v2] Work around a regression in Windows 7, causing erase_in_line() to crash sometimes","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-06-01T08:25:48Z","receivedAt":"2009-06-01T08:25:48Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 1 Jun 2009, Steffen Prohaska wrote:\n\n> From: Johannes Schindelin <johannes.schindelin@gmx.de>\n> \n> The function FillConsoleOutputCharacterA() was pretty content in XP to take a NULL\n> pointer if we did not want to store the number of written columns.  In Windows 7,\n> it crashes, but only when called from within Git Bash, not from within cmd.exe.\n> Go figure.\n\nDid I really have too-long lines in my commit message?\n\n> \n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> Signed-off-by: Steffen Prohaska <prohaska@zib.de>\n> ---\n>  compat/winansi.c |    3 ++-\n>  1 files changed, 2 insertions(+), 1 deletions(-)\n> \n> I squashed the second chunk of 05/11, as suggested by Hannes.\n\nMakes sense, thank you!\nDscho\n"},{"id":"115184","messageId":"alpine.DEB.1.00.0906011054410.26154@pacific.mpi-cbg.de","threadId":"19619","inReplyTo":"7vhbz0mmai.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 10/11] Fix warnings in nedmalloc when compiling with GCC 4.4.0","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-06-01T08:57:49Z","receivedAt":"2009-06-01T08:57:49Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 1 Jun 2009, Junio C Hamano wrote:\n\n> Steffen Prohaska <prohaska@zib.de> writes:\n> \n> > @@ -2541,7 +2543,7 @@ struct malloc_params {\n> >  static struct malloc_params mparams;\n> >  \n> >  /* Ensure mparams initialized */\n> > -#define ensure_initialization() (mparams.magic != 0 || init_mparams())\n> > +#define ensure_initialization() if (mparams.magic == 0) init_mparams()\n> >  \n> >  #if !ONLY_MSPACES\n> \n> The code after the patch looks more fragile than the original.  I know\n> there currently is no code like:\n> \n> \tif (foo())\n>         \tensure_initialization();\n> \telse\n>         \twarn(\"oops\");\n> \n> but this change still feels wrong.\n\nI know, but the whole use of ensure_initialization() feels wrong to me, \nand I did _not_ want to change the code too much, lest we end up \nmaintaining a proper fork as has happened with libxdiff.\n\n> What issue is this patch trying to work around?  Returned value not \n> being used?\n\nI forgot what the GCC warning looked like, and have only text-mode access \nto the web right now, so I cannot access any Windows machine and try \nagain.\n\nIt was a warning, though, that much I remember.\n\n> > diff --git a/compat/nedmalloc/nedmalloc.c b/compat/nedmalloc/nedmalloc.c\n> > index a381a7d..60a4093 100644\n> > --- a/compat/nedmalloc/nedmalloc.c\n> > +++ b/compat/nedmalloc/nedmalloc.c\n> > @@ -34,7 +34,7 @@ DEALINGS IN THE SOFTWARE.\n> >  /*#define FULLSANITYCHECKS*/\n> >  \n> >  #include \"nedmalloc.h\"\n> > -#if defined(WIN32) && !defined(__MINGW32__)\n> > +#if defined(WIN32)\n> >   #include <malloc.h>\n> >  #endif\n> \n> Can somebody enlighten me what this hunk is about, and how it helps GCC\n> 4.4?\n\nIt helps in that malloc.h is included even if we happen to compile the \nstuff as a MinGW program.  Otherwise necessary function declarations are \nmissing.\n\n> There are many \"#if[n]def __MINGW32__\" remaining in the codebase both\n> inside and outside compat/ area, so it is not that that symbol is somehow\n> special.  I cannot even tell which one of the following is closer to the\n> reason behind this change:\n> \n>  (1) \"Because tacking '&& !defined(__MINGW32__)' after defined(WIN32) is\n>      unnecessary for such and such reasons, it is removed\"; or\n> \n>  (2) \"Because tacking '&& !defined(__MINGW32__)' after defined(WIN32) is\n>      harmful for such and such reasons, it is removed\".\n\nThe latter.\n\n> Puzzled.\n\nHopefully less so, now.\n\nCiao,\nDscho\n"},{"id":"115185","messageId":"alpine.DEB.1.00.0906011058120.26154@pacific.mpi-cbg.de","threadId":"19619","inReplyTo":"7vab4smmab.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 04/11] test-chmtime: work around Windows limitation","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-06-01T09:00:33Z","receivedAt":"2009-06-01T09:00:33Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 1 Jun 2009, Junio C Hamano wrote:\n\n> Steffen Prohaska <prohaska@zib.de> writes:\n> \n> > From: Johannes Schindelin <johannes.schindelin@gmx.de>\n> >\n> > Windows has problems changing the mtime when the file is write protected,\n> > even by the owner of said file.\n> >\n> > Add a Windows-only workaround to change the mode if necessary before\n> > trying to change the mtime.\n> \n> I'll queue this as-is for now, but shouldn't the code remember the\n> original mode and change it back?\n\nHmm, good point.  As I mentioned in another mail, though, I cannot access \nany Windows machine to fix this issue now, sorry.\n\nNot changing the mode back _might_ paper over another issue: if the files \nare deleted later, that mode change might mean that the deletion now \nsucceeds, and fixing test-chmtime may make it fail again.  Not sure, \nthough.\n\nCiao,\nDscho\n"},{"id":"115189","messageId":"B70B2E5A-970F-4FB1-A109-84EE199A15DF@zib.de","threadId":"19619","inReplyTo":"alpine.DEB.1.00.0906011025080.26154@pacific.mpi-cbg.de","subject":"Re: [PATCH 03/11 v2] Work around a regression in Windows 7, causing erase_in_line() to crash sometimes","fromName":"Steffen Prohaska","fromEmail":"prohaska@zib.de","sentAt":"2009-06-01T10:26:29Z","receivedAt":"2009-06-01T10:26:29Z","isPatch":true,"sender":{"key":"prohaska@zib.de","avatar":"https://avatars.githubusercontent.com/u/217580?v=4"},"body":"\nOn Jun 1, 2009, at 10:25 AM, Johannes Schindelin wrote:\n\n> Hi,\n>\n> On Mon, 1 Jun 2009, Steffen Prohaska wrote:\n>\n>> From: Johannes Schindelin <johannes.schindelin@gmx.de>\n>>\n>> The function FillConsoleOutputCharacterA() was pretty content in XP  \n>> to take a NULL\n>> pointer if we did not want to store the number of written columns.   \n>> In Windows 7,\n>> it crashes, but only when called from within Git Bash, not from  \n>> within cmd.exe.\n>> Go figure.\n>\n> Did I really have too-long lines in my commit message?\n\n\nYes.  See aa3abfc9852a4d4cfaa7f0042102eb56ed2e0daa on 4msysgit's devel.\nYou are author and committer.\n\n\tSteffen\n"},{"id":"115191","messageId":"alpine.DEB.1.00.0906011241100.26154@pacific.mpi-cbg.de","threadId":"19619","inReplyTo":"B70B2E5A-970F-4FB1-A109-84EE199A15DF@zib.de","subject":"Re: [PATCH 03/11 v2] Work around a regression in Windows 7, causing erase_in_line() to crash sometimes","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-06-01T10:41:40Z","receivedAt":"2009-06-01T10:41:40Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 1 Jun 2009, Steffen Prohaska wrote:\n\n> On Jun 1, 2009, at 10:25 AM, Johannes Schindelin wrote:\n> \n> >On Mon, 1 Jun 2009, Steffen Prohaska wrote:\n> >\n> > >From: Johannes Schindelin <johannes.schindelin@gmx.de>\n> > >\n> > >The function FillConsoleOutputCharacterA() was pretty content in XP to take\n> > >a NULL\n> > >pointer if we did not want to store the number of written columns.  In\n> > >Windows 7,\n> > >it crashes, but only when called from within Git Bash, not from within\n> > >cmd.exe.\n> > >Go figure.\n> >\n> >Did I really have too-long lines in my commit message?\n> \n> \n> Yes.  See aa3abfc9852a4d4cfaa7f0042102eb56ed2e0daa on 4msysgit's devel.\n> You are author and committer.\n\nMy bad, then!\n\nCiao,\nDscho\n"},{"id":"115210","messageId":"7vr5y3lxrj.fsf@alter.siamese.dyndns.org","threadId":"19619","inReplyTo":"alpine.DEB.1.00.0906011054410.26154@pacific.mpi-cbg.de","subject":"Re: [PATCH 10/11] Fix warnings in nedmalloc when compiling with GCC 4.4.0","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-06-01T16:33:20Z","receivedAt":"2009-06-01T16:33:20Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n>> > diff --git a/compat/nedmalloc/nedmalloc.c b/compat/nedmalloc/nedmalloc.c\n>> > index a381a7d..60a4093 100644\n>> > --- a/compat/nedmalloc/nedmalloc.c\n>> > +++ b/compat/nedmalloc/nedmalloc.c\n>> > @@ -34,7 +34,7 @@ DEALINGS IN THE SOFTWARE.\n>> >  /*#define FULLSANITYCHECKS*/\n>> >  \n>> >  #include \"nedmalloc.h\"\n>> > -#if defined(WIN32) && !defined(__MINGW32__)\n>> > +#if defined(WIN32)\n>> >   #include <malloc.h>\n>> >  #endif\n>> \n>> Can somebody enlighten me what this hunk is about, and how it helps GCC\n>> 4.4?\n>\n> It helps in that malloc.h is included even if we happen to compile the \n> stuff as a MinGW program.  Otherwise necessary function declarations are \n> missing.\n> ...\n> Hopefully less so, now.\n\nI wish enough information were in the commit log message from the\nbeginning.\n"},{"id":"115223","messageId":"49b7c2350906011638j12948f1do8d1c8f28d0bf2739@mail.gmail.com","threadId":"19619","inReplyTo":"7vr5y3lxrj.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 10/11] Fix warnings in nedmalloc when compiling with GCC 4.4.0","fromName":"GeunSik Lim","fromEmail":"leemgs1@gmail.com","sentAt":"2009-06-01T23:38:55Z","receivedAt":"2009-06-01T23:38:55Z","isPatch":true,"sender":{"key":"leemgs1@gmail.com","avatar":null},"body":"On Tue, Jun 2, 2009 at 1:33 AM, Junio C Hamano <gitster@pobox.com> wrote:\n\n>>> Can somebody enlighten me what this hunk is about, and how it helps GCC\n>>> 4.4?\n>>\nUm... It's strange.\nI can not connect to  http://gcc.gnu.org website\nto get GCC 4.4 manual(pdf format) currently.\nping is normal just.\n\n[invain@fedora9 invain]$ ping gcc.gnu.org\nPING gcc.gnu.org (209.132.176.174) 56(84) bytes of data.\n64 bytes from sourceware.org (209.132.176.174): icmp_seq=1 ttl=40 time=194 ms\n64 bytes from sourceware.org (209.132.176.174): icmp_seq=2 ttl=40 time=199 ms\n^X64 bytes from sourceware.org (209.132.176.174): icmp_seq=3 ttl=40 time=193 ms\n64 bytes from sourceware.org (209.132.176.174): icmp_seq=4 ttl=40 time=203 ms\n^C\n--- gcc.gnu.org ping statistics ---\n4 packets transmitted, 4 received, 0% packet loss, time 3326ms\nrtt min/avg/max/mdev = 193.762/198.126/203.978/4.135 ms\n[invain@fedora9 invain]$\n[invain@fedora9 invain]$ nmap  gcc.gnu.org\n[invain@fedora9 invain]$ nmap -p 80  gcc.gnu.org\n\nStarting Nmap 4.53 ( http://insecure.org ) at 2009-06-02 08:37 KST\nNote: Host seems down. If it is really up, but blocking our ping probes, try -PN\nNmap done: 1 IP address (0 hosts up) scanned in 2.023 seconds\n[invain@fedora9 invain]$\n\n\n\n-- \nRegards,\nGeunSik Lim ( Samsung Electronics )\nBlog : http://blog.naver.com/invain/\ne-Mail: geunsik.lim@samsung.com\n           leemgs@gmail.com , leemgs1@gmail.com\n"},{"id":"115239","messageId":"alpine.DEB.1.00.0906021448300.4440@intel-tinevez-2-302","threadId":"19619","inReplyTo":"7vr5y3lxrj.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 10/11] Fix warnings in nedmalloc when compiling with GCC 4.4.0","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-06-02T12:52:48Z","receivedAt":"2009-06-02T12:52:48Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 1 Jun 2009, Junio C Hamano wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> >> > diff --git a/compat/nedmalloc/nedmalloc.c b/compat/nedmalloc/nedmalloc.c\n> >> > index a381a7d..60a4093 100644\n> >> > --- a/compat/nedmalloc/nedmalloc.c\n> >> > +++ b/compat/nedmalloc/nedmalloc.c\n> >> > @@ -34,7 +34,7 @@ DEALINGS IN THE SOFTWARE.\n> >> >  /*#define FULLSANITYCHECKS*/\n> >> >  \n> >> >  #include \"nedmalloc.h\"\n> >> > -#if defined(WIN32) && !defined(__MINGW32__)\n> >> > +#if defined(WIN32)\n> >> >   #include <malloc.h>\n> >> >  #endif\n> >> \n> >> Can somebody enlighten me what this hunk is about, and how it helps GCC\n> >> 4.4?\n> >\n> > It helps in that malloc.h is included even if we happen to compile the \n> > stuff as a MinGW program.  Otherwise necessary function declarations are \n> > missing.\n> > ...\n> > Hopefully less so, now.\n> \n> I wish enough information were in the commit log message from the\n> beginning.\n\nOkay, how about this in the commit body in addition?\n\n-- snip --\nNedmalloc's source code has a cute #define construct to avoid inserting\nan if() statement, because that might interact badly with enclosing if()\nstatements.  However, there is no danger of that now, but GCC > 4\ncomplains \"warning: value computed is not used\".\n\nAlso, with the version of MinGW's headers in msysGit, we need to include \nmalloc.h lest the compiler complain about an \"incompatible implicit \ndeclaration of built-in function 'alloca'\".\n-- snap --\n\nHmm?\nDscho\n"},{"id":"115257","messageId":"7viqjefxcv.fsf@alter.siamese.dyndns.org","threadId":"19619","inReplyTo":"alpine.DEB.1.00.0906021448300.4440@intel-tinevez-2-302","subject":"Re: [PATCH 10/11] Fix warnings in nedmalloc when compiling with GCC 4.4.0","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-06-02T15:50:56Z","receivedAt":"2009-06-02T15:50:56Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> Okay, how about this in the commit body in addition?\n>\n> -- snip --\n> Nedmalloc's source code has a cute #define construct to avoid inserting\n> an if() statement, because that might interact badly with enclosing if()\n> statements.  However, there is no danger of that now, but GCC > 4\n> complains \"warning: value computed is not used\".\n>\n> Also, with the version of MinGW's headers in msysGit, we need to include \n> malloc.h lest the compiler complain about an \"incompatible implicit \n> declaration of built-in function 'alloca'\".\n> -- snap --\n>\n> Hmm?\n\nAs to the first one, I think your problem description is clear (the\nproblem is clear without being explained to begin with) but \"there is no\ndanger of that now\" is somewhere between a lame excuse for not doing it\nthe right way and a bug waiting to happen.  If \"value computed is not\nused\" is the issue, why doesn't this work?\n\n    #define ensure_initialization() (void)(mparams.magic != 0 || init_mparams())\n\nor at least wrap your fragile \"if\" in a bog-standard do {} while(0), like...\n\n    #define ensure_initialization() \\\n    \tdo { if (mparams.magic == 0) init_mparams(); } while (0)\n\nThen you do not have to make excuses, and instead can just say\n\n\tSquelch GCC > 4's \"value computed not used\" warnings from\n\tensure_initialization() macro definition.\n\nAs to the second one, I think you lost \"even if we happen to\" part (that\nlogically corresponds to \"... that is why we do not want to limit the\ninclusion to !__MINGW32__ case\") from the description, making it less\nreadable...\n"},{"id":"115341","messageId":"alpine.DEB.1.00.0906031455520.10241@intel-tinevez-2-302","threadId":"19619","inReplyTo":"7viqjefxcv.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 10/11] Fix warnings in nedmalloc when compiling with GCC 4.4.0","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-06-03T12:57:02Z","receivedAt":"2009-06-03T12:57:02Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 2 Jun 2009, Junio C Hamano wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> > Okay, how about this in the commit body in addition?\n> >\n> > -- snip --\n> > Nedmalloc's source code has a cute #define construct to avoid inserting\n> > an if() statement, because that might interact badly with enclosing if()\n> > statements.  However, there is no danger of that now, but GCC > 4\n> > complains \"warning: value computed is not used\".\n> >\n> > Also, with the version of MinGW's headers in msysGit, we need to include \n> > malloc.h lest the compiler complain about an \"incompatible implicit \n> > declaration of built-in function 'alloca'\".\n> > -- snap --\n> >\n> > Hmm?\n> \n> As to the first one, I think your problem description is clear (the\n> problem is clear without being explained to begin with) but \"there is no\n> danger of that now\" is somewhere between a lame excuse for not doing it\n> the right way and a bug waiting to happen.  If \"value computed is not\n> used\" is the issue, why doesn't this work?\n> \n>     #define ensure_initialization() (void)(mparams.magic != 0 || init_mparams())\n\nThat works.\n\n> As to the second one, I think you lost \"even if we happen to\" part (that\n> logically corresponds to \"... that is why we do not want to limit the\n> inclusion to !__MINGW32__ case\") from the description, making it less\n> readable...\n\nYou mean \"even if we happen to be on Windows\"?  Fine with me.  Want me to \nresend a fixed patch?\n\nCiao,\nDscho\n"},{"id":"115358","messageId":"7vprdl9qon.fsf@alter.siamese.dyndns.org","threadId":"19619","inReplyTo":"alpine.DEB.1.00.0906031455520.10241@intel-tinevez-2-302","subject":"Re: [PATCH 10/11] Fix warnings in nedmalloc when compiling with GCC 4.4.0","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-06-03T17:23:52Z","receivedAt":"2009-06-03T17:23:52Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n>> As to the second one, I think you lost \"even if we happen to\" part (that\n>> logically corresponds to \"... that is why we do not want to limit the\n>> inclusion to !__MINGW32__ case\") from the description, making it less\n>> readable...\n>\n> You mean \"even if we happen to be on Windows\"?\n\nI meant this part from your earlier message.\n\n> It helps in that malloc.h is included even if we happen to compile the \n> stuff as a MinGW program.  Otherwise necessary function declarations are \n> missing.\n\ncompared with the newer \"how about\" version, which is\n\n>> > Also, with the version of MinGW's headers in msysGit, we need to include \n>> > malloc.h lest the compiler complain about an \"incompatible implicit \n>> > declaration of built-in function 'alloca'\".\n\nI thought the former explains the change in question\n\n>> > -#if defined(WIN32) && !defined(__MINGW32__)\n>> > +#if defined(WIN32)\n\nmuch more clearly: \"If you are compiling for Windows, regardless of\nMINGW32, you would want this section to apply\".\n\n> ...  Want me to resend a fixed patch?\n\nSurely.  I think I could come up with something based on the discussion\nhere, but I'd rather not.  A patch signed off by either you or Steffen, or\nboth is very much appreciated.\n"},{"id":"115810","messageId":"alpine.DEB.1.00.0906081645490.4461@intel-tinevez-2-302","threadId":"19619","inReplyTo":"7vprdl9qon.fsf@alter.siamese.dyndns.org","subject":"[PATCH 10/11 v2] Fix warnings in nedmalloc when compiling with GCC 4.4.0","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-06-08T14:46:49Z","receivedAt":"2009-06-08T14:46:49Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nNedmalloc's source code has a cute #define construct to avoid inserting\nan if() statement, because that might interact badly with enclosing if()\nstatements.  However, GCC > 4 complains with a \"warning: value computed\nis not used\".  So we cast the result to \"void\".\n\nGCC also does not understand the Visual C++ specific pragmas, so we need\nto disable them for MinGW.\n\nWe need to include malloc.h on Windows even if we happen to compile the\nstuff as a MinGW program.  Otherwise the function declaration of alloca()\nis missing.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n\n\tForgot to send.\n\n compat/nedmalloc/malloc.c.h  |    4 +++-\n compat/nedmalloc/nedmalloc.c |    2 +-\n 2 files changed, 4 insertions(+), 2 deletions(-)\n\ndiff --git a/compat/nedmalloc/malloc.c.h b/compat/nedmalloc/malloc.c.h\nindex bb0f482..b5b1495 100644\n--- a/compat/nedmalloc/malloc.c.h\n+++ b/compat/nedmalloc/malloc.c.h\n@@ -1270,7 +1270,9 @@ int mspace_mallopt(int, int);\n /*------------------------------ internal #includes ---------------------- */\n \n #ifdef WIN32\n+#ifndef __GNUC__\n #pragma warning( disable : 4146 ) /* no \"unsigned\" warnings */\n+#endif\n #endif /* WIN32 */\n \n #include <stdio.h>       /* for printing in malloc_stats */\n@@ -2541,7 +2543,7 @@ struct malloc_params {\n static struct malloc_params mparams;\n \n /* Ensure mparams initialized */\n-#define ensure_initialization() (mparams.magic != 0 || init_mparams())\n+#define ensure_initialization() ((void)(mparams.magic == 0 || init_mparams()))\n \n #if !ONLY_MSPACES\n \ndiff --git a/compat/nedmalloc/nedmalloc.c b/compat/nedmalloc/nedmalloc.c\nindex 41a3234..d9a17a8 100644\n--- a/compat/nedmalloc/nedmalloc.c\n+++ b/compat/nedmalloc/nedmalloc.c\n@@ -34,7 +34,7 @@ DEALINGS IN THE SOFTWARE.\n /*#define FULLSANITYCHECKS*/\n \n #include \"nedmalloc.h\"\n-#if defined(WIN32) && !defined(__MINGW32__)\n+#if defined(WIN32)\n  #include <malloc.h>\n #endif\n #define MSPACES 1\n-- \n1.6.3.284.g6fecc\n"},{"id":"115819","messageId":"7vzlcizn3w.fsf@alter.siamese.dyndns.org","threadId":"19619","inReplyTo":"alpine.DEB.1.00.0906081645490.4461@intel-tinevez-2-302","subject":"Re: [PATCH 10/11 v2] Fix warnings in nedmalloc when compiling with GCC 4.4.0","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-06-08T16:50:11Z","receivedAt":"2009-06-08T16:50:11Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> Nedmalloc's source code has a cute #define construct to avoid inserting\n> an if() statement, because that might interact badly with enclosing if()\n> statements.  However, GCC > 4 complains with a \"warning: value computed\n> is not used\".  So we cast the result to \"void\".\n>\n> \tForgot to send.\n\nThanks.  The description on the pragma is a good thing to add, which you\ndid.\n\nIs Visual C++ happy with casting discarded result to (void)?  I'd find it\nbroken if it isn't, but it would not hurt to ask just to make sure.\n\nSteffen, can we move the series, with this patch replaced, to 'next' now?\nI think it looks good (thanks!) but again it would not hurt to ask just to\nmake sure ;-).\n\n>  compat/nedmalloc/malloc.c.h  |    4 +++-\n>  compat/nedmalloc/nedmalloc.c |    2 +-\n>  2 files changed, 4 insertions(+), 2 deletions(-)\n>\n> diff --git a/compat/nedmalloc/malloc.c.h b/compat/nedmalloc/malloc.c.h\n> index bb0f482..b5b1495 100644\n> --- a/compat/nedmalloc/malloc.c.h\n> +++ b/compat/nedmalloc/malloc.c.h\n> @@ -1270,7 +1270,9 @@ int mspace_mallopt(int, int);\n>  /*------------------------------ internal #includes ---------------------- */\n>  \n>  #ifdef WIN32\n> +#ifndef __GNUC__\n>  #pragma warning( disable : 4146 ) /* no \"unsigned\" warnings */\n> +#endif\n>  #endif /* WIN32 */\n>  \n>  #include <stdio.h>       /* for printing in malloc_stats */\n> @@ -2541,7 +2543,7 @@ struct malloc_params {\n>  static struct malloc_params mparams;\n>  \n>  /* Ensure mparams initialized */\n> -#define ensure_initialization() (mparams.magic != 0 || init_mparams())\n> +#define ensure_initialization() ((void)(mparams.magic == 0 || init_mparams()))\n>  \n>  #if !ONLY_MSPACES\n>  \n"},{"id":"115828","messageId":"200906082024.00361.j6t@kdbg.org","threadId":"19619","inReplyTo":"7vzlcizn3w.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 10/11 v2] Fix warnings in nedmalloc when compiling with GCC 4.4.0","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2009-06-08T18:24:00Z","receivedAt":"2009-06-08T18:24:00Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"On Montag, 8. Juni 2009, Junio C Hamano wrote:\n> Is Visual C++ happy with casting discarded result to (void)?  I'd find it\n> broken if it isn't, but it would not hurt to ask just to make sure.\n\nIt is OK. Visual C++ is not *that* broken ;)\n\n-- Hannes\n"},{"id":"115873","messageId":"CD46A3E1-A85C-4D03-854C-973B91ACC506@zib.de","threadId":"19619","inReplyTo":"7vzlcizn3w.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 10/11 v2] Fix warnings in nedmalloc when compiling with GCC 4.4.0","fromName":"Steffen Prohaska","fromEmail":"prohaska@zib.de","sentAt":"2009-06-09T06:06:51Z","receivedAt":"2009-06-09T06:06:51Z","isPatch":true,"sender":{"key":"prohaska@zib.de","avatar":"https://avatars.githubusercontent.com/u/217580?v=4"},"body":"\nOn Jun 8, 2009, at 6:50 PM, Junio C Hamano wrote:\n\n> Steffen, can we move the series, with this patch replaced, to 'next'  \n> now?\n> I think it looks good (thanks!) but again it would not hurt to ask  \n> just to\n> make sure ;-).\n\nI agree, it looks good.  Thanks.\n\n\tSteffen\n"},{"id":"115997","messageId":"4A2F7C80.1090807@viscovery.net","threadId":"19619","inReplyTo":"CD46A3E1-A85C-4D03-854C-973B91ACC506@zib.de","subject":"Re: [PATCH 10/11 v2] Fix warnings in nedmalloc when compiling with GCC 4.4.0","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2009-06-10T09:27:28Z","receivedAt":"2009-06-10T09:27:28Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Steffen Prohaska schrieb:\n> \n> On Jun 8, 2009, at 6:50 PM, Junio C Hamano wrote:\n> \n>> Steffen, can we move the series, with this patch replaced, to 'next' now?\n>> I think it looks good (thanks!) but again it would not hurt to ask\n>> just to\n>> make sure ;-).\n> \n> I agree, it looks good.  Thanks.\n\nPlease don't advance this series to master just yet: I see severe breakage\nwith the nedmalloc patch on one of my systems, but I ran out of time to\ninvestigate further. (And I'm afraid I can continue only next Monday.)\n\n-- Hannes\n"},{"id":"116091","messageId":"4A316EA8.1040203@kdbg.org","threadId":"19619","inReplyTo":"4A2F7C80.1090807@viscovery.net","subject":"[PATCH] Fix typo in nedmalloc warning fix","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2009-06-11T20:52:56Z","receivedAt":"2009-06-11T20:52:56Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Signed-off-by: Johannes Sixt <j6t@kdbg.org>\n---\n  Johannes Sixt schrieb:\n  > Please don't advance this series to master just yet: I see severe breakage\n  > with the nedmalloc patch on one of my systems, but I ran out of time to\n  > investigate further. (And I'm afraid I can continue only next Monday.)\n\n  So, I have the failure on my other system as well, and this is the fix ;)\n\n  -- Hannes\n\n  compat/nedmalloc/malloc.c.h |    2 +-\n  1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/compat/nedmalloc/malloc.c.h b/compat/nedmalloc/malloc.c.h\nindex b5b1495..74c42e3 100644\n--- a/compat/nedmalloc/malloc.c.h\n+++ b/compat/nedmalloc/malloc.c.h\n@@ -2543,7 +2543,7 @@ struct malloc_params {\n  static struct malloc_params mparams;\n\n  /* Ensure mparams initialized */\n-#define ensure_initialization() ((void)(mparams.magic == 0 || init_mparams()))\n+#define ensure_initialization() ((void)(mparams.magic != 0 || init_mparams()))\n\n  #if !ONLY_MSPACES\n\n-- \n1.6.3.2.1225.g177fa.dirty\n"},{"id":"116092","messageId":"4A316F6C.8030409@kdbg.org","threadId":"19619","inReplyTo":"4A316EA8.1040203@kdbg.org","subject":"[PATCH] compat/ has subdirectories: do not omit them in 'make clean'","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2009-06-11T20:56:12Z","receivedAt":"2009-06-11T20:56:12Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Signed-off-by: Johannes Sixt <j6t@kdbg.org>\n---\n  Johannes Sixt schrieb:\n  >  So, I have the failure on my other system as well, and this is the fix ;)\n\n  And this was quite helpful to find the breakage.\n\n  -- Hannes\n\n  Makefile |    2 +-\n  1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex a38dcdd..7002688 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1691,7 +1691,7 @@ distclean: clean\n  \t$(RM) configure\n\n  clean:\n-\t$(RM) *.o mozilla-sha1/*.o arm/*.o ppc/*.o compat/*.o xdiff/*.o \\\n+\t$(RM) *.o mozilla-sha1/*.o arm/*.o ppc/*.o compat/*.o compat/*/*.o xdiff/*.o \\\n  \t\t$(LIB_FILE) $(XDIFF_LIB)\n  \t$(RM) $(ALL_PROGRAMS) $(BUILT_INS) git$X\n  \t$(RM) $(TEST_PROGRAMS)\n-- \n1.6.3.2.1225.g177fa.dirty\n"},{"id":"116094","messageId":"alpine.DEB.1.00.0906112313050.26154@pacific.mpi-cbg.de","threadId":"19619","inReplyTo":"4A316EA8.1040203@kdbg.org","subject":"Re: [PATCH] Fix typo in nedmalloc warning fix","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-06-11T21:13:28Z","receivedAt":"2009-06-11T21:13:28Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 11 Jun 2009, Johannes Sixt wrote:\n\n> Signed-off-by: Johannes Sixt <j6t@kdbg.org>\n> ---\n>  Johannes Sixt schrieb:\n>  > Please don't advance this series to master just yet: I see severe breakage\n>  > with the nedmalloc patch on one of my systems, but I ran out of time to\n>  > investigate further. (And I'm afraid I can continue only next Monday.)\n> \n>  So, I have the failure on my other system as well, and this is the fix ;)\n> \n>  -- Hannes\n> \n>  compat/nedmalloc/malloc.c.h |    2 +-\n>  1 files changed, 1 insertions(+), 1 deletions(-)\n> \n> diff --git a/compat/nedmalloc/malloc.c.h b/compat/nedmalloc/malloc.c.h\n> index b5b1495..74c42e3 100644\n> --- a/compat/nedmalloc/malloc.c.h\n> +++ b/compat/nedmalloc/malloc.c.h\n> @@ -2543,7 +2543,7 @@ struct malloc_params {\n>  static struct malloc_params mparams;\n> \n>  /* Ensure mparams initialized */\n> -#define ensure_initialization() ((void)(mparams.magic == 0 ||\n> init_mparams()))\n> +#define ensure_initialization() ((void)(mparams.magic != 0 ||\n> init_mparams()))\n\nAargh!\n\nThanks for catching this stupid bug,\nDscho\n"}]}