mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-02-22 01:40:22 -05:00
opt: animations logic all use the int type
avoid the coordinates being forcibly limited to positive numbers
This commit is contained in:
parent
0d13b1002e
commit
2771053ee6
21 changed files with 876 additions and 861 deletions
|
|
@ -36,8 +36,8 @@ void *ecalloc(size_t nmemb, size_t size) {
|
|||
return p;
|
||||
}
|
||||
|
||||
int fd_set_nonblock(int fd) {
|
||||
int flags = fcntl(fd, F_GETFL);
|
||||
int32_t fd_set_nonblock(int32_t fd) {
|
||||
int32_t flags = fcntl(fd, F_GETFL);
|
||||
if (flags < 0) {
|
||||
perror("fcntl(F_GETFL):");
|
||||
return -1;
|
||||
|
|
@ -50,8 +50,8 @@ int fd_set_nonblock(int fd) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int regex_match(const char *pattern, const char *str) {
|
||||
int errnum;
|
||||
int32_t regex_match(const char *pattern, const char *str) {
|
||||
int32_t errnum;
|
||||
PCRE2_SIZE erroffset;
|
||||
|
||||
if (!pattern || !str) {
|
||||
|
|
@ -70,7 +70,7 @@ int regex_match(const char *pattern, const char *str) {
|
|||
|
||||
pcre2_match_data *match_data =
|
||||
pcre2_match_data_create_from_pattern(re, NULL);
|
||||
int ret =
|
||||
int32_t ret =
|
||||
pcre2_match(re, (PCRE2_SPTR)str, strlen(str), 0, 0, match_data, NULL);
|
||||
|
||||
pcre2_match_data_free(match_data);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue