From 709116f5543f1dd7db744f38055c20bff640fe86 Mon Sep 17 00:00:00 2001 From: Aren Elchinyan Date: Wed, 31 Jan 2024 19:35:30 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D1=82=D0=B8=D0=BF=D0=B8=D0=B7=D0=B0?= =?UTF-8?q?=D1=86=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/sys.h | 2 +- modlib/lib/tool.c | 6 +++--- modlib/modstd.h | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/sys.h b/include/sys.h index ebd5562..bd9f376 100644 --- a/include/sys.h +++ b/include/sys.h @@ -76,7 +76,7 @@ typedef struct { sys_info_t *(*get_info)( ); module_info_t *(*get_module)(char *module_id); module_info_t *(*mod_list_get)(uint64_t *count); - uint64_t (*new_thread)(uint64_t func); + uint64_t (*new_thread)(void *func); void (*delete_thread)( ); time_t (*get_time)( ); } __attribute__((packed)) env_t; diff --git a/modlib/lib/tool.c b/modlib/lib/tool.c index e70f418..1a9f241 100644 --- a/modlib/lib/tool.c +++ b/modlib/lib/tool.c @@ -167,7 +167,7 @@ char *strchr(char *str, char c) { return NULL; } -int strcmp(const char *s1, const char *s2) { +int strcmp(char *s1, char *s2) { while (*s1 == *s2) { if (*s1 == '\0') { return 0; } s1++; @@ -214,7 +214,7 @@ size_t count_chars(char *str, char c) { return count; } -uint64_t str_contains(const char *str, const char *substr) { +uint64_t str_contains(char *str, char *substr) { uint64_t str_len = strlen(str); uint64_t substr_len = strlen(substr); @@ -247,7 +247,7 @@ void *memset(void *ptr, uint8_t n, size_t size) { void *memmove(void *dest, void *src, size_t n) { char *d = (char *)dest; - const char *s = (const char *)src; + char *s = (char *)src; if (d > s) { // копирование с конца массива, чтобы предотвратить перекрытие diff --git a/modlib/modstd.h b/modlib/modstd.h index 3d83bf8..53fa735 100644 --- a/modlib/modstd.h +++ b/modlib/modstd.h @@ -18,11 +18,11 @@ size_t strcspn(char *str, char *reject); char *strtok(char *str, char *delim); size_t strtol(char *str, char **endptr, int64_t base); char *strchr(char *str, char c); -int strcmp(const char *s1, const char *s2); +int strcmp(char *s1, char *s2); char *trstr(char *str, char sym); char *strdup(char *str); size_t count_chars(char *str, char c); -uint64_t str_contains(const char *str, const char *substr); +uint64_t str_contains(char *str, char *substr); void memcpy(void *dest, void *src, size_t n); void *memset(void *ptr, uint8_t n, size_t size); void *memmove(void *dest, void *src, size_t n);