|
2 | 2 | * @file ctype.h |
3 | 3 | * |
4 | 4 | */ |
5 | | -/* Copyright (C) 2017-2023 by Arjan van Vught mailto:info@gd32-dmx.org |
| 5 | +/* Copyright (C) 2017-2026 by Arjan van Vught mailto:info@gd32-dmx.org |
6 | 6 | * |
7 | 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
8 | 8 | * of this software and associated documentation files (the "Software"), to deal |
@@ -31,39 +31,39 @@ extern "C" { |
31 | 31 | #endif |
32 | 32 |
|
33 | 33 | inline int isdigit(int c) { |
34 | | - return (c >= (int) '0' && c <= (int) '9') ? 1 : 0; |
| 34 | + return (c >= (int)'0' && c <= (int)'9') ? 1 : 0; |
35 | 35 | } |
36 | 36 |
|
37 | 37 | inline int isxdigit(int c) { |
38 | | - return ((isdigit(c) != 0) || (((unsigned) c | 32) - (int) 'a' < 6)) ? 1 : 0; |
| 38 | + return ((isdigit(c) != 0) || (((unsigned)c | 32) - (int)'a' < 6)) ? 1 : 0; |
39 | 39 | } |
40 | 40 |
|
41 | 41 | inline int isprint(int c) { |
42 | | - return ((c >= (int) ' ' && c <= (int) '~')) ? 1 : 0; |
| 42 | + return ((c >= (int)' ' && c <= (int)'~')) ? 1 : 0; |
43 | 43 | } |
44 | 44 |
|
45 | 45 | inline int isupper(int c) { |
46 | | - return (c >= (int) 'A' && c <= (int) 'Z') ? 1 : 0; |
| 46 | + return (c >= (int)'A' && c <= (int)'Z') ? 1 : 0; |
47 | 47 | } |
48 | 48 |
|
49 | 49 | inline int islower(int c) { |
50 | | - return (c >= (int) 'a' && c <= (int) 'z') ? 1 : 0; |
| 50 | + return (c >= (int)'a' && c <= (int)'z') ? 1 : 0; |
51 | 51 | } |
52 | 52 |
|
53 | 53 | inline int isalpha(int c) { |
54 | | - return ((isupper(c) != 0) || (islower(c) != 0)) ? 1 : 0; |
| 54 | + return ((isupper(c) != 0) || (islower(c) != 0)) ? 1 : 0; |
55 | 55 | } |
56 | 56 |
|
57 | 57 | inline int tolower(int c) { |
58 | | - return ((isupper(c) != 0) ? (c + 32) : c); |
| 58 | + return ((isupper(c) != 0) ? (c + 32) : c); |
59 | 59 | } |
60 | 60 |
|
61 | 61 | inline int toupper(int c) { |
62 | | - return ((islower(c) != 0) ? (c - 32) : c); |
| 62 | + return ((islower(c) != 0) ? (c - 32) : c); |
63 | 63 | } |
64 | 64 |
|
65 | 65 | inline int isspace(int c) { |
66 | | - return (c == '\t' || c == '\n' || c == '\v' || c == '\f' || c == '\r' || c == ' ' ? 1 : 0); |
| 66 | + return (c == '\t' || c == '\n' || c == '\v' || c == '\f' || c == '\r' || c == ' ' ? 1 : 0); |
67 | 67 | } |
68 | 68 |
|
69 | 69 | #ifdef __cplusplus |
|
0 commit comments