Merge branch 'jc/doc-diff-filter-exclude'
[gitweb.git] / compat / mingw.c
index 0b46a7f95e030e7885cec877251f7ffc674e66c4..2b5467deadc1162edb134e4f5d95f2b8b5d82368 100644 (file)
@@ -837,15 +837,12 @@ struct tm *localtime_r(const time_t *timep, struct tm *result)
 
 char *mingw_getcwd(char *pointer, int len)
 {
-       int i;
        wchar_t wpointer[MAX_PATH];
        if (!_wgetcwd(wpointer, ARRAY_SIZE(wpointer)))
                return NULL;
        if (xwcstoutf(pointer, wpointer, len) < 0)
                return NULL;
-       for (i = 0; pointer[i]; i++)
-               if (pointer[i] == '\\')
-                       pointer[i] = '/';
+       convert_slashes(pointer);
        return pointer;
 }
 
@@ -2165,7 +2162,7 @@ int xwcstoutf(char *utf, const wchar_t *wcs, size_t utflen)
        return -1;
 }
 
-static void setup_windows_environment()
+static void setup_windows_environment(void)
 {
        char *tmp = getenv("TMPDIR");
 
@@ -2186,9 +2183,7 @@ static void setup_windows_environment()
                 * executable (by not mistaking the dir separators
                 * for escape characters).
                 */
-               for (; *tmp; tmp++)
-                       if (*tmp == '\\')
-                               *tmp = '/';
+               convert_slashes(tmp);
        }
 
        /* simulate TERM to enable auto-color (see color.c) */
@@ -2209,7 +2204,7 @@ typedef struct {
 extern int __wgetmainargs(int *argc, wchar_t ***argv, wchar_t ***env, int glob,
                _startupinfo *si);
 
-static NORETURN void die_startup()
+static NORETURN void die_startup(void)
 {
        fputs("fatal: not enough memory for initialization", stderr);
        exit(128);
@@ -2229,7 +2224,7 @@ static char *wcstoutfdup_startup(char *buffer, const wchar_t *wcs, size_t len)
        return memcpy(malloc_startup(len), buffer, len);
 }
 
-void mingw_startup()
+void mingw_startup(void)
 {
        int i, maxlen, argc;
        char *buffer;