[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 252ed22d62f: ; Use c-ctype.h in w32*.c
From: |
Eli Zaretskii |
Subject: |
master 252ed22d62f: ; Use c-ctype.h in w32*.c |
Date: |
Wed, 18 Sep 2024 14:24:00 -0400 (EDT) |
branch: master
commit 252ed22d62fc80e2af6f37cf55c62848f6bc8e29
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>
; Use c-ctype.h in w32*.c
* src/w32.c:
* src/w32fns.c: Replace ctype.h functions by equivalent
c-ctype.h functions.
---
src/w32.c | 12 ++++++------
src/w32fns.c | 10 +++++-----
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/src/w32.c b/src/w32.c
index cec15606bf2..05f0ebf396e 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -32,7 +32,6 @@ along with GNU Emacs. If not, see
<https://www.gnu.org/licenses/>. */
#include <io.h>
#include <errno.h>
#include <fcntl.h>
-#include <ctype.h>
#include <signal.h>
#include <sys/file.h>
#include <time.h> /* must be before nt/inc/sys/time.h, for MinGW64 */
@@ -264,6 +263,7 @@ typedef struct _REPARSE_DATA_BUFFER {
#include <wincrypt.h>
+#include <c-ctype.h>
#include <c-strcase.h>
#include <utimens.h> /* for fdutimens */
@@ -2558,7 +2558,7 @@ parse_root (const char * name, const char ** pPath)
return 0;
/* find the root name of the volume if given */
- if (isalpha (name[0]) && name[1] == ':')
+ if (c_isalpha (name[0]) && name[1] == ':')
{
/* skip past drive specifier */
name += 2;
@@ -3311,7 +3311,7 @@ static BOOL fixed_drives[26];
at least for non-local drives. Info for fixed drives is never stale. */
#define DRIVE_INDEX( c ) ( (c) <= 'Z' ? (c) - 'A' : (c) - 'a' )
#define VOLINFO_STILL_VALID( root_dir, info ) \
- ( ( isalpha (root_dir[0]) && \
+ ( ( c_isalpha (root_dir[0]) && \
fixed_drives[ DRIVE_INDEX (root_dir[0]) ] ) \
|| GetTickCount () - info->timestamp < 10000 )
@@ -3380,7 +3380,7 @@ GetCachedVolumeInformation (char * root_dir)
involve network access, and so is extremely quick). */
/* Map drive letter to UNC if remote. */
- if (isalpha (root_dir[0]) && !fixed[DRIVE_INDEX (root_dir[0])])
+ if (c_isalpha (root_dir[0]) && !fixed[DRIVE_INDEX (root_dir[0])])
{
char remote_name[ 256 ];
char drive[3] = { root_dir[0], ':' };
@@ -3595,9 +3595,9 @@ map_w32_filename (const char * name, const char ** pPath)
default:
if ( left && 'A' <= c && c <= 'Z' )
{
- *str++ = tolower (c); /* map to lower case (looks nicer) */
+ *str++ = c_tolower (c); /* map to lower case (looks nicer) */
left--;
- dots = 0; /* started a path component */
+ dots = 0; /* started a path component */
}
break;
}
diff --git a/src/w32fns.c b/src/w32fns.c
index bd65aa48a14..0a3f5c38a58 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -937,13 +937,13 @@ x_to_w32_color (const char * colorname)
{
int len = strlen (colorname);
- if (isdigit (colorname[len - 1]))
+ if (c_isdigit (colorname[len - 1]))
{
char *ptr, *approx = alloca (len + 1);
strcpy (approx, colorname);
ptr = &approx[len - 1];
- while (ptr > approx && isdigit (*ptr))
+ while (ptr > approx && c_isdigit (*ptr))
*ptr-- = '\0';
ret = w32_color_map_lookup (approx);
@@ -3725,7 +3725,7 @@ post_character_message (HWND hwnd, UINT msg,
message that has no particular effect. */
{
int c = wParam;
- if (isalpha (c) && wmsg.dwModifiers == ctrl_modifier)
+ if (c_isalpha (c) && wmsg.dwModifiers == ctrl_modifier)
c = make_ctrl_char (c) & 0377;
if (c == quit_char
|| (wmsg.dwModifiers == 0
@@ -8748,7 +8748,7 @@ lookup_vk_code (char *key)
|| (key[0] >= '0' && key[0] <= '9'))
return key[0];
if (key[0] >= 'a' && key[0] <= 'z')
- return toupper(key[0]);
+ return c_toupper (key[0]);
}
}
@@ -9518,7 +9518,7 @@ DEFUN ("file-system-info", Ffile_system_info,
Sfile_system_info, 1, 1, 0,
BOOL result;
/* find the root name of the volume if given */
- if (isalpha (name[0]) && name[1] == ':')
+ if (c_isalpha (name[0]) && name[1] == ':')
{
rootname[0] = name[0];
rootname[1] = name[1];
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 252ed22d62f: ; Use c-ctype.h in w32*.c,
Eli Zaretskii <=