opt: animations logic all use the int type

avoid the coordinates being forcibly limited to positive numbers
This commit is contained in:
DreamMaoMao 2026-01-03 09:37:34 +08:00
parent 0d13b1002e
commit 2771053ee6
21 changed files with 876 additions and 861 deletions

View file

@ -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);