summaryrefslogtreecommitdiff
path: root/src/w32proc.c
diff options
context:
space:
mode:
authorAndy Moreton <andrewjmoreton@gmail.com>2015-07-28 16:37:31 +0300
committerEli Zaretskii <eliz@gnu.org>2015-07-28 16:37:31 +0300
commit87b8992ca357e180bf87f4a8df3ef58b7de89695 (patch)
tree0f6b9cea989b76409d0f5bfa7a4a82cd7b00aeab /src/w32proc.c
parent1216f7332d18248017835b1b01ded6345b51b976 (diff)
downloademacs-87b8992ca357e180bf87f4a8df3ef58b7de89695.tar.gz
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. */)
(Lisp_Object cp)
{
CHARSETINFO info;
- DWORD dwcp;
+ DWORD_PTR dwcp;
CHECK_NUMBER (cp);
if (!IsValidCodePage (XINT (cp)))
return Qnil;
- /* Going through a temporary DWORD variable avoids compiler warning
+ /* Going through a temporary DWORD_PTR variable avoids compiler warning
about cast to pointer from integer of different size, when
- building --with-wide-int. */
+ building --with-wide-int or building for 64bit. */
dwcp = XINT (cp);
if (TranslateCharsetInfo ((DWORD *) dwcp, &info, TCI_SRCCODEPAGE))
return make_number (info.ciCharset);
@@ -3499,6 +3499,9 @@ get_lcid (const char *locale_name)
# define LINGUISTIC_IGNORECASE 0x00000010
#endif
+typedef int (WINAPI *CompareStringW_Proc)
+ (LCID, DWORD, LPCWSTR, int, LPCWSTR, int);
+
int
w32_compare_strings (const char *s1, const char *s2, char *locname,
int ignore_case)
@@ -3507,7 +3510,7 @@ w32_compare_strings (const char *s1, const char *s2, char *locname,
wchar_t *string1_w, *string2_w;
int val, needed;
extern BOOL g_b_init_compare_string_w;
- static int (WINAPI *pCompareStringW)(LCID, DWORD, LPCWSTR, int, LPCWSTR, int);
+ static CompareStringW_Proc pCompareStringW;
DWORD flags = 0;
USE_SAFE_ALLOCA;
@@ -3523,8 +3526,9 @@ w32_compare_strings (const char *s1, const char *s2, char *locname,
{
if (os_subtype == OS_9X)
{
- pCompareStringW = GetProcAddress (LoadLibrary ("Unicows.dll"),
- "CompareStringW");
+ pCompareStringW =
+ (CompareStringW_Proc) GetProcAddress (LoadLibrary ("Unicows.dll"),
+ "CompareStringW");
if (!pCompareStringW)
{
errno = EINVAL;