Skip to content

Commit 00bb744

Browse files
committed
Merge branch 'dl/compat-cleanup'
Code cleanup. * dl/compat-cleanup: compat/*.[ch]: remove extern from function declarations using spatch mingw: apply array.cocci rule
2 parents 59438be + 7027f50 commit 00bb744

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

compat/mingw.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1265,7 +1265,7 @@ static wchar_t *make_environment_block(char **deltaenv)
12651265
}
12661266

12671267
ALLOC_ARRAY(result, size);
1268-
memcpy(result, wenv, size * sizeof(*wenv));
1268+
COPY_ARRAY(result, wenv, size);
12691269
FreeEnvironmentStringsW(wenv);
12701270
return result;
12711271
}
@@ -1309,7 +1309,7 @@ static wchar_t *make_environment_block(char **deltaenv)
13091309
continue;
13101310

13111311
size = wcslen(array[i]) + 1;
1312-
memcpy(p, array[i], size * sizeof(*p));
1312+
COPY_ARRAY(p, array[i], size);
13131313
p += size;
13141314
}
13151315
*p = L'\0';

compat/mingw.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ typedef _sigset_t sigset_t;
1111
#undef _POSIX_THREAD_SAFE_FUNCTIONS
1212
#endif
1313

14-
extern int mingw_core_config(const char *var, const char *value, void *cb);
14+
int mingw_core_config(const char *var, const char *value, void *cb);
1515
#define platform_core_config mingw_core_config
1616

1717
/*
@@ -443,7 +443,7 @@ static inline void convert_slashes(char *path)
443443
*path = '/';
444444
}
445445
#define PATH_SEP ';'
446-
extern char *mingw_query_user_email(void);
446+
char *mingw_query_user_email(void);
447447
#define query_user_email mingw_query_user_email
448448
#if !defined(__MINGW64_VERSION_MAJOR) && (!defined(_MSC_VER) || _MSC_VER < 1800)
449449
#define PRIuMAX "I64u"
@@ -580,4 +580,4 @@ int main(int argc, const char **argv);
580580
/*
581581
* Used by Pthread API implementation for Windows
582582
*/
583-
extern int err_win_to_posix(DWORD winerr);
583+
int err_win_to_posix(DWORD winerr);

compat/win32/pthread.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ typedef struct {
5050
DWORD tid;
5151
} pthread_t;
5252

53-
extern int pthread_create(pthread_t *thread, const void *unused,
53+
int pthread_create(pthread_t *thread, const void *unused,
5454
void *(*start_routine)(void*), void *arg);
5555

5656
/*
@@ -59,10 +59,10 @@ extern int pthread_create(pthread_t *thread, const void *unused,
5959
*/
6060
#define pthread_join(a, b) win32_pthread_join(&(a), (b))
6161

62-
extern int win32_pthread_join(pthread_t *thread, void **value_ptr);
62+
int win32_pthread_join(pthread_t *thread, void **value_ptr);
6363

6464
#define pthread_equal(t1, t2) ((t1).tid == (t2).tid)
65-
extern pthread_t pthread_self(void);
65+
pthread_t pthread_self(void);
6666

6767
static inline void NORETURN pthread_exit(void *ret)
6868
{

0 commit comments

Comments
 (0)