summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2019-09-30 13:19:23 +0900
committerLibravatar Junio C Hamano <gitster@pobox.com>2019-09-30 13:19:23 +0900
commit00bb74453d487f13785f0bb4bc28853a7111ffc7 (patch)
tree753877260a00ce78ef224b87dc56b9a9871ed72e
parentMerge branch 'js/visual-studio' (diff)
parentcompat/*.[ch]: remove extern from function declarations using spatch (diff)
downloadtgif-00bb74453d487f13785f0bb4bc28853a7111ffc7.tar.xz
Merge branch 'dl/compat-cleanup'
Code cleanup. * dl/compat-cleanup: compat/*.[ch]: remove extern from function declarations using spatch mingw: apply array.cocci rule
-rw-r--r--compat/mingw.c4
-rw-r--r--compat/mingw.h6
-rw-r--r--compat/win32/pthread.h6
3 files changed, 8 insertions, 8 deletions
diff --git a/compat/mingw.c b/compat/mingw.c
index 738f0a826a..a3b1e9e3bb 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -1265,7 +1265,7 @@ static wchar_t *make_environment_block(char **deltaenv)
}
ALLOC_ARRAY(result, size);
- memcpy(result, wenv, size * sizeof(*wenv));
+ COPY_ARRAY(result, wenv, size);
FreeEnvironmentStringsW(wenv);
return result;
}
@@ -1309,7 +1309,7 @@ static wchar_t *make_environment_block(char **deltaenv)
continue;
size = wcslen(array[i]) + 1;
- memcpy(p, array[i], size * sizeof(*p));
+ COPY_ARRAY(p, array[i], size);
p += size;
}
*p = L'\0';
diff --git a/compat/mingw.h b/compat/mingw.h
index a03e40e6e2..9ad204c57c 100644
--- a/compat/mingw.h
+++ b/compat/mingw.h
@@ -11,7 +11,7 @@ typedef _sigset_t sigset_t;
#undef _POSIX_THREAD_SAFE_FUNCTIONS
#endif
-extern int mingw_core_config(const char *var, const char *value, void *cb);
+int mingw_core_config(const char *var, const char *value, void *cb);
#define platform_core_config mingw_core_config
/*
@@ -443,7 +443,7 @@ static inline void convert_slashes(char *path)
*path = '/';
}
#define PATH_SEP ';'
-extern char *mingw_query_user_email(void);
+char *mingw_query_user_email(void);
#define query_user_email mingw_query_user_email
#if !defined(__MINGW64_VERSION_MAJOR) && (!defined(_MSC_VER) || _MSC_VER < 1800)
#define PRIuMAX "I64u"
@@ -580,4 +580,4 @@ int main(int argc, const char **argv);
/*
* Used by Pthread API implementation for Windows
*/
-extern int err_win_to_posix(DWORD winerr);
+int err_win_to_posix(DWORD winerr);
diff --git a/compat/win32/pthread.h b/compat/win32/pthread.h
index c6cb8dd219..f1cfe73de9 100644
--- a/compat/win32/pthread.h
+++ b/compat/win32/pthread.h
@@ -50,7 +50,7 @@ typedef struct {
DWORD tid;
} pthread_t;
-extern int pthread_create(pthread_t *thread, const void *unused,
+int pthread_create(pthread_t *thread, const void *unused,
void *(*start_routine)(void*), void *arg);
/*
@@ -59,10 +59,10 @@ extern int pthread_create(pthread_t *thread, const void *unused,
*/
#define pthread_join(a, b) win32_pthread_join(&(a), (b))
-extern int win32_pthread_join(pthread_t *thread, void **value_ptr);
+int win32_pthread_join(pthread_t *thread, void **value_ptr);
#define pthread_equal(t1, t2) ((t1).tid == (t2).tid)
-extern pthread_t pthread_self(void);
+pthread_t pthread_self(void);
static inline void NORETURN pthread_exit(void *ret)
{