diff options
| author | Eli Zaretskii | 2024-09-18 21:22:04 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2024-09-18 21:22:04 +0300 |
| commit | 252ed22d62fc80e2af6f37cf55c62848f6bc8e29 (patch) | |
| tree | 9e042e7b406a72e3f0eee544bbad3740fbeac7f1 /src | |
| parent | 03a991931863486436193f3e8edd0fd7d7d271c3 (diff) | |
| download | emacs-252ed22d62fc80e2af6f37cf55c62848f6bc8e29.tar.gz emacs-252ed22d62fc80e2af6f37cf55c62848f6bc8e29.zip | |
; Use c-ctype.h in w32*.c
* src/w32.c:
* src/w32fns.c: Replace ctype.h functions by equivalent
c-ctype.h functions.
Diffstat (limited to 'src')
| -rw-r--r-- | src/w32.c | 12 | ||||
| -rw-r--r-- | src/w32fns.c | 10 |
2 files changed, 11 insertions, 11 deletions
| @@ -32,7 +32,6 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ | |||
| 32 | #include <io.h> | 32 | #include <io.h> |
| 33 | #include <errno.h> | 33 | #include <errno.h> |
| 34 | #include <fcntl.h> | 34 | #include <fcntl.h> |
| 35 | #include <ctype.h> | ||
| 36 | #include <signal.h> | 35 | #include <signal.h> |
| 37 | #include <sys/file.h> | 36 | #include <sys/file.h> |
| 38 | #include <time.h> /* must be before nt/inc/sys/time.h, for MinGW64 */ | 37 | #include <time.h> /* must be before nt/inc/sys/time.h, for MinGW64 */ |
| @@ -264,6 +263,7 @@ typedef struct _REPARSE_DATA_BUFFER { | |||
| 264 | 263 | ||
| 265 | #include <wincrypt.h> | 264 | #include <wincrypt.h> |
| 266 | 265 | ||
| 266 | #include <c-ctype.h> | ||
| 267 | #include <c-strcase.h> | 267 | #include <c-strcase.h> |
| 268 | #include <utimens.h> /* for fdutimens */ | 268 | #include <utimens.h> /* for fdutimens */ |
| 269 | 269 | ||
| @@ -2558,7 +2558,7 @@ parse_root (const char * name, const char ** pPath) | |||
| 2558 | return 0; | 2558 | return 0; |
| 2559 | 2559 | ||
| 2560 | /* find the root name of the volume if given */ | 2560 | /* find the root name of the volume if given */ |
| 2561 | if (isalpha (name[0]) && name[1] == ':') | 2561 | if (c_isalpha (name[0]) && name[1] == ':') |
| 2562 | { | 2562 | { |
| 2563 | /* skip past drive specifier */ | 2563 | /* skip past drive specifier */ |
| 2564 | name += 2; | 2564 | name += 2; |
| @@ -3311,7 +3311,7 @@ static BOOL fixed_drives[26]; | |||
| 3311 | at least for non-local drives. Info for fixed drives is never stale. */ | 3311 | at least for non-local drives. Info for fixed drives is never stale. */ |
| 3312 | #define DRIVE_INDEX( c ) ( (c) <= 'Z' ? (c) - 'A' : (c) - 'a' ) | 3312 | #define DRIVE_INDEX( c ) ( (c) <= 'Z' ? (c) - 'A' : (c) - 'a' ) |
| 3313 | #define VOLINFO_STILL_VALID( root_dir, info ) \ | 3313 | #define VOLINFO_STILL_VALID( root_dir, info ) \ |
| 3314 | ( ( isalpha (root_dir[0]) && \ | 3314 | ( ( c_isalpha (root_dir[0]) && \ |
| 3315 | fixed_drives[ DRIVE_INDEX (root_dir[0]) ] ) \ | 3315 | fixed_drives[ DRIVE_INDEX (root_dir[0]) ] ) \ |
| 3316 | || GetTickCount () - info->timestamp < 10000 ) | 3316 | || GetTickCount () - info->timestamp < 10000 ) |
| 3317 | 3317 | ||
| @@ -3380,7 +3380,7 @@ GetCachedVolumeInformation (char * root_dir) | |||
| 3380 | involve network access, and so is extremely quick). */ | 3380 | involve network access, and so is extremely quick). */ |
| 3381 | 3381 | ||
| 3382 | /* Map drive letter to UNC if remote. */ | 3382 | /* Map drive letter to UNC if remote. */ |
| 3383 | if (isalpha (root_dir[0]) && !fixed[DRIVE_INDEX (root_dir[0])]) | 3383 | if (c_isalpha (root_dir[0]) && !fixed[DRIVE_INDEX (root_dir[0])]) |
| 3384 | { | 3384 | { |
| 3385 | char remote_name[ 256 ]; | 3385 | char remote_name[ 256 ]; |
| 3386 | char drive[3] = { root_dir[0], ':' }; | 3386 | char drive[3] = { root_dir[0], ':' }; |
| @@ -3595,9 +3595,9 @@ map_w32_filename (const char * name, const char ** pPath) | |||
| 3595 | default: | 3595 | default: |
| 3596 | if ( left && 'A' <= c && c <= 'Z' ) | 3596 | if ( left && 'A' <= c && c <= 'Z' ) |
| 3597 | { | 3597 | { |
| 3598 | *str++ = tolower (c); /* map to lower case (looks nicer) */ | 3598 | *str++ = c_tolower (c); /* map to lower case (looks nicer) */ |
| 3599 | left--; | 3599 | left--; |
| 3600 | dots = 0; /* started a path component */ | 3600 | dots = 0; /* started a path component */ |
| 3601 | } | 3601 | } |
| 3602 | break; | 3602 | break; |
| 3603 | } | 3603 | } |
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) | |||
| 937 | { | 937 | { |
| 938 | int len = strlen (colorname); | 938 | int len = strlen (colorname); |
| 939 | 939 | ||
| 940 | if (isdigit (colorname[len - 1])) | 940 | if (c_isdigit (colorname[len - 1])) |
| 941 | { | 941 | { |
| 942 | char *ptr, *approx = alloca (len + 1); | 942 | char *ptr, *approx = alloca (len + 1); |
| 943 | 943 | ||
| 944 | strcpy (approx, colorname); | 944 | strcpy (approx, colorname); |
| 945 | ptr = &approx[len - 1]; | 945 | ptr = &approx[len - 1]; |
| 946 | while (ptr > approx && isdigit (*ptr)) | 946 | while (ptr > approx && c_isdigit (*ptr)) |
| 947 | *ptr-- = '\0'; | 947 | *ptr-- = '\0'; |
| 948 | 948 | ||
| 949 | ret = w32_color_map_lookup (approx); | 949 | ret = w32_color_map_lookup (approx); |
| @@ -3725,7 +3725,7 @@ post_character_message (HWND hwnd, UINT msg, | |||
| 3725 | message that has no particular effect. */ | 3725 | message that has no particular effect. */ |
| 3726 | { | 3726 | { |
| 3727 | int c = wParam; | 3727 | int c = wParam; |
| 3728 | if (isalpha (c) && wmsg.dwModifiers == ctrl_modifier) | 3728 | if (c_isalpha (c) && wmsg.dwModifiers == ctrl_modifier) |
| 3729 | c = make_ctrl_char (c) & 0377; | 3729 | c = make_ctrl_char (c) & 0377; |
| 3730 | if (c == quit_char | 3730 | if (c == quit_char |
| 3731 | || (wmsg.dwModifiers == 0 | 3731 | || (wmsg.dwModifiers == 0 |
| @@ -8748,7 +8748,7 @@ lookup_vk_code (char *key) | |||
| 8748 | || (key[0] >= '0' && key[0] <= '9')) | 8748 | || (key[0] >= '0' && key[0] <= '9')) |
| 8749 | return key[0]; | 8749 | return key[0]; |
| 8750 | if (key[0] >= 'a' && key[0] <= 'z') | 8750 | if (key[0] >= 'a' && key[0] <= 'z') |
| 8751 | return toupper(key[0]); | 8751 | return c_toupper (key[0]); |
| 8752 | } | 8752 | } |
| 8753 | } | 8753 | } |
| 8754 | 8754 | ||
| @@ -9518,7 +9518,7 @@ DEFUN ("file-system-info", Ffile_system_info, Sfile_system_info, 1, 1, 0, | |||
| 9518 | BOOL result; | 9518 | BOOL result; |
| 9519 | 9519 | ||
| 9520 | /* find the root name of the volume if given */ | 9520 | /* find the root name of the volume if given */ |
| 9521 | if (isalpha (name[0]) && name[1] == ':') | 9521 | if (c_isalpha (name[0]) && name[1] == ':') |
| 9522 | { | 9522 | { |
| 9523 | rootname[0] = name[0]; | 9523 | rootname[0] = name[0]; |
| 9524 | rootname[1] = name[1]; | 9524 | rootname[1] = name[1]; |