aboutsummaryrefslogtreecommitdiffstats
path: root/src/w32proc.c
diff options
context:
space:
mode:
authorAndy Moreton2015-07-28 16:37:31 +0300
committerEli Zaretskii2015-07-28 16:37:31 +0300
commit87b8992ca357e180bf87f4a8df3ef58b7de89695 (patch)
tree0f6b9cea989b76409d0f5bfa7a4a82cd7b00aeab /src/w32proc.c
parent1216f7332d18248017835b1b01ded6345b51b976 (diff)
downloademacs-87b8992ca357e180bf87f4a8df3ef58b7de89695.tar.gz
emacs-87b8992ca357e180bf87f4a8df3ef58b7de89695.zip
Pacify compilation -Wincompatible-pointer-types warnings
* src/w32proc.c (Fw32_get_codepage_charset): Avoid compilation warning. (CompareStringW_Proc): New typedef. (w32_compare_strings): Use it, to pacify compiler warnings under "-Wincompatible-pointer-types". * src/w32fns.c (GetDiskFreeSpaceExW_Proc) (GetDiskFreeSpaceExA_Proc): New typedefs. (Ffile_system_info): Use them, to pacify compiler warnings under "-Wincompatible-pointer-types". Copyright-paperwork-exempt: yes
Diffstat (limited to 'src/w32proc.c')
-rw-r--r--src/w32proc.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/w32proc.c b/src/w32proc.c
index ca4322b69d1..66a9761ad13 100644
--- a/src/w32proc.c
+++ b/src/w32proc.c
@@ -3327,16 +3327,16 @@ yield nil. */)
3327 (Lisp_Object cp) 3327 (Lisp_Object cp)
3328{ 3328{
3329 CHARSETINFO info; 3329 CHARSETINFO info;
3330 DWORD dwcp; 3330 DWORD_PTR dwcp;
3331 3331
3332 CHECK_NUMBER (cp); 3332 CHECK_NUMBER (cp);
3333 3333
3334 if (!IsValidCodePage (XINT (cp))) 3334 if (!IsValidCodePage (XINT (cp)))
3335 return Qnil; 3335 return Qnil;
3336 3336
3337 /* Going through a temporary DWORD variable avoids compiler warning 3337 /* Going through a temporary DWORD_PTR variable avoids compiler warning
3338 about cast to pointer from integer of different size, when 3338 about cast to pointer from integer of different size, when
3339 building --with-wide-int. */ 3339 building --with-wide-int or building for 64bit. */
3340 dwcp = XINT (cp); 3340 dwcp = XINT (cp);
3341 if (TranslateCharsetInfo ((DWORD *) dwcp, &info, TCI_SRCCODEPAGE)) 3341 if (TranslateCharsetInfo ((DWORD *) dwcp, &info, TCI_SRCCODEPAGE))
3342 return make_number (info.ciCharset); 3342 return make_number (info.ciCharset);
@@ -3499,6 +3499,9 @@ get_lcid (const char *locale_name)
3499# define LINGUISTIC_IGNORECASE 0x00000010 3499# define LINGUISTIC_IGNORECASE 0x00000010
3500#endif 3500#endif
3501 3501
3502typedef int (WINAPI *CompareStringW_Proc)
3503 (LCID, DWORD, LPCWSTR, int, LPCWSTR, int);
3504
3502int 3505int
3503w32_compare_strings (const char *s1, const char *s2, char *locname, 3506w32_compare_strings (const char *s1, const char *s2, char *locname,
3504 int ignore_case) 3507 int ignore_case)
@@ -3507,7 +3510,7 @@ w32_compare_strings (const char *s1, const char *s2, char *locname,
3507 wchar_t *string1_w, *string2_w; 3510 wchar_t *string1_w, *string2_w;
3508 int val, needed; 3511 int val, needed;
3509 extern BOOL g_b_init_compare_string_w; 3512 extern BOOL g_b_init_compare_string_w;
3510 static int (WINAPI *pCompareStringW)(LCID, DWORD, LPCWSTR, int, LPCWSTR, int); 3513 static CompareStringW_Proc pCompareStringW;
3511 DWORD flags = 0; 3514 DWORD flags = 0;
3512 3515
3513 USE_SAFE_ALLOCA; 3516 USE_SAFE_ALLOCA;
@@ -3523,8 +3526,9 @@ w32_compare_strings (const char *s1, const char *s2, char *locname,
3523 { 3526 {
3524 if (os_subtype == OS_9X) 3527 if (os_subtype == OS_9X)
3525 { 3528 {
3526 pCompareStringW = GetProcAddress (LoadLibrary ("Unicows.dll"), 3529 pCompareStringW =
3527 "CompareStringW"); 3530 (CompareStringW_Proc) GetProcAddress (LoadLibrary ("Unicows.dll"),
3531 "CompareStringW");
3528 if (!pCompareStringW) 3532 if (!pCompareStringW)
3529 { 3533 {
3530 errno = EINVAL; 3534 errno = EINVAL;