From 2f928c25de4ace033c8c6fc9ae89775683cbb8eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=95=D0=B3=D0=BE=D1=80?= Date: Sun, 17 Nov 2024 09:50:46 +0100 Subject: [PATCH] revert 2bfbbf443aa203bd0211ec78ba062ab9b5216d05 revert fix -Wsign-conversion and some -Wcast-qual only conversions from const to non-const remain --- .../sources/newlib/libc/include/sys/ksys.h | 61 ++++++++----------- 1 file changed, 26 insertions(+), 35 deletions(-) diff --git a/contrib/sdk/sources/newlib/libc/include/sys/ksys.h b/contrib/sdk/sources/newlib/libc/include/sys/ksys.h index a651096d16..36fc2e2904 100644 --- a/contrib/sdk/sources/newlib/libc/include/sys/ksys.h +++ b/contrib/sdk/sources/newlib/libc/include/sys/ksys.h @@ -24,10 +24,6 @@ #include #ifdef __cplusplus - -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wold-style-cast" - extern "C" { #endif @@ -1079,21 +1075,17 @@ KOSAPI void _ksys_draw_line(int xs, int ys, int xe, int ye, ksys_color_t color) KOSAPI void _ksys_draw_number(int number, int x, int y, int len, ksys_color_t color) { unsigned fmt; - fmt = (((unsigned int) len) << 16) | 0x80000000; // no leading zeros + width + fmt = len << 16 | 0x80000000; // no leading zeros + width asm_inline( "int $0x40" : - : "a"(47), - "b"(fmt), - "c"(number), - "d"((x << 16) | y), - "S"(color)); + : "a"(47), "b"(fmt), "c"(number), "d"((x << 16) | y), "S"(color)); } KOSAPI void _ksys_draw_number_bg(unsigned number, int x, int y, int len, ksys_color_t color, ksys_color_t bg) { unsigned fmt; - fmt = (((unsigned int) len) << 16) | 0x80000000; // no leading zeros + width + fmt = len << 16 | 0x80000000; // no leading zeros + width asm_inline( "int $0x40" : @@ -1149,7 +1141,7 @@ enum KSYS_CLIP_TYPES { KOSAPI int _ksys_clip_num(void) { - int val; + unsigned val; asm_inline( "int $0x40" : "=a"(val) @@ -1175,7 +1167,7 @@ KOSAPI char* _ksys_clip_get(int n) // returned buffer must be freed by _ksys_fre KOSAPI int _ksys_clip_set(int n, char* buffer) { - int val; + unsigned val; asm_inline( "int $0x40" : "=a"(val) @@ -1189,7 +1181,7 @@ KOSAPI int _ksys_clip_set(int n, char* buffer) KOSAPI int _ksys_clip_pop() { - int val; + unsigned val; asm_inline( "int $0x40" : "=a"(val) @@ -1202,7 +1194,7 @@ KOSAPI int _ksys_clip_pop() KOSAPI int _ksys_clip_unlock() { - int val; + unsigned val; asm_inline( "int $0x40" : "=a"(val) @@ -1562,7 +1554,7 @@ KOSAPI ksys_file_status_t _ksys_file_read(const char* name, uint64_t offset, uin f.data_size = size; f.data = buf; f.zero = 0; - f.path_ptr = (char*) name; + f.path_ptr = (char*)name; return _ksys_file(&f); } @@ -1576,7 +1568,7 @@ KOSAPI ksys_file_status_t _ksys_file_read_dir(const char* name, uint32_t offset, f.data_size = blocks; f.data = buff; f.zero = 0; - f.path_ptr = (char*) name; + f.path_ptr = (char*)name; return _ksys_file(&f); } @@ -1591,7 +1583,7 @@ KOSAPI ksys_file_status_t _ksys_file_create(const char* name) f.data_size = 0; f.data = NULL; f.zero = 0; - f.path_ptr = (char*) name; + f.path_ptr = (char*)name; return _ksys_file(&f); } @@ -1604,9 +1596,9 @@ KOSAPI ksys_file_status_t _ksys_file_write(const char* name, uint64_t offset, ui f.func_num = KSYS_FILE_WRITE; f.offset64 = offset; f.data_size = size; - f.data = (void*) buf; + f.data = (void*)buf; f.zero = 0; - f.path_ptr = (char*) name; + f.path_ptr = (char*)name; return _ksys_file(&f); } @@ -1620,8 +1612,8 @@ KOSAPI int _ksys_file_set_size(const char* name, uint64_t size) f.data_size = 0; f.data = NULL; f.zero = 0; - f.path_ptr = (char*) name; - return (int) _ksys_file(&f).status; + f.path_ptr = (char*)name; + return _ksys_file(&f).status; } /*========== Function 70, subfunction 5 - get information on file/folder. =====*/ @@ -1641,10 +1633,10 @@ KOSAPI int _ksys_file_info(const char* name, ksys_file_info_t* info) f.func_num = KSYS_FILE_GET_INFO; f.offset64 = 0; f.data_size = 0; - f.data = (void*) info; + f.data = (void*)info; f.zero = 0; - f.path_ptr = (char*) name; - return (int) _ksys_file(&f).status; + f.path_ptr = (char*)name; + return _ksys_file(&f).status; } #define _ksys_dir_info _ksys_file_info @@ -1667,8 +1659,8 @@ KOSAPI int _ksys_exec(const char* path, char* args, bool debug) f.debug = debug; f.args = args; f.zero = 0; - f.path_ptr = (char*) path; - return (int) _ksys_file(&f).status; + f.path_ptr = (char*)path; + return _ksys_file(&f).status; } /*========== Function 70, subfunction 8 - delete file/folder. ==========*/ @@ -1681,8 +1673,8 @@ KOSAPI int _ksys_file_delete(const char* path) f.data_size = 0; f.data = NULL; f.zero = 0; - f.path_ptr = (char*) path; - return (int) _ksys_file(&f).status; + f.path_ptr = (char*)path; + return _ksys_file(&f).status; } #define _ksys_rmdir(x) _ksys_file_delete(x) @@ -1697,8 +1689,8 @@ KOSAPI int _ksys_mkdir(const char* path) f.data_size = 0; f.data = NULL; f.zero = 0; - f.path_ptr = (char*) path; - return (int) _ksys_file(&f).status; + f.path_ptr = (char*)path; + return _ksys_file(&f).status; } /*============= Function 70, subfunction 10 - rename/move. =============*/ @@ -1707,11 +1699,11 @@ KOSAPI int _ksys_file_rename(const char* name, const char* new_name) { ksys_file_t f; f.func_num = KSYS_FILE_REMOVE; - f.data = (void*) new_name; + f.data = (void*)new_name; f.data_size = 0; f.zero = 0; - f.path_ptr = (char*) name; - return (int) _ksys_file(&f).status; + f.path_ptr = (char*)name; + return _ksys_file(&f).status; } #define _ksys_dir_rename _ksys_file_rename @@ -1819,7 +1811,6 @@ KOSAPI int _ksys_posix_pipe2(int pipefd[2], int flags) #ifdef __cplusplus } -#pragma GCC diagnostic pop #endif #endif // _KSYS_H_