-Wextra warnings fixed

This commit is contained in:
2023-03-15 16:54:36 +06:00
parent a200f2c965
commit a6a6d2d4ae
12 changed files with 23 additions and 18 deletions

View File

@@ -2,7 +2,9 @@
#include "../String/StringBuilder.h"
#include "io_includes.h"
kt_define(FileHandle, (freeMembers_t)file_close, NULL)
void __file_freeMembers(void* _f){ fclose((FileHandle)_f); }
kt_define(FileHandle, __file_freeMembers, NULL)
bool file_exists(const char* path){
if(path[0]=='.'){

View File

@@ -1,6 +1,6 @@
#include "filesystem.h"
char* __path_concat(u16 n, ...){
char* __path_concat(u32 n, ...){
char** parts=(char**)malloc(n*sizeof(char*));
u32* lengths=malloc(n*sizeof(u32));
u32 totalLength=0;
@@ -56,9 +56,9 @@ Maybe path_throwIfEscapes(const char* path){
char* path_parentDir(char* dir){
char* copy=cptr_copy(dir);
u32 length=cptr_length(copy);
i32 length=cptr_length(copy);
i32 i=cptr_lastIndexOfChar(copy,path_sep);
if(i==length-1){
if(i!=-1 && i==length-1){
copy[length-1]=0;
i=cptr_lastIndexOfChar(copy,path_sep);
}

View File

@@ -14,7 +14,7 @@ static const char path_sep='/';
static const char path_notSep='\\';
#endif
char* __path_concat(u16 n, ...);
char* __path_concat(u32 n, ...);
/// @brief merges path parts together and puts <path_sep> between them
/// @return new cstr
#define path_concat(PATH_PARTS...) __path_concat(count_args(PATH_PARTS), PATH_PARTS)