mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-01-11 18:41:14 +00:00
clang-format fix
This commit is contained in:
parent
5252ffdf32
commit
957d53dc17
@ -1,10 +1,10 @@
|
|||||||
#include <cstdio>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <dirent.h>
|
|
||||||
#include <cerrno>
|
|
||||||
#include <SDL3/SDL.h>
|
|
||||||
#include "filesys.h"
|
#include "filesys.h"
|
||||||
|
|
||||||
|
#include <SDL3/SDL.h>
|
||||||
|
#include <cerrno>
|
||||||
|
#include <cstdio>
|
||||||
|
#include <dirent.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
|
||||||
// Missing from Switch SDL3 implementation
|
// Missing from Switch SDL3 implementation
|
||||||
#ifndef S_ISREG
|
#ifndef S_ISREG
|
||||||
@ -20,13 +20,16 @@ bool NX_GetPathInfo(const char *path, SDL_PathInfo *info)
|
|||||||
|
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
return SDL_SetError("Can't stat: %s", strerror(errno));
|
return SDL_SetError("Can't stat: %s", strerror(errno));
|
||||||
} else if (S_ISREG(statbuf.st_mode)) {
|
}
|
||||||
|
else if (S_ISREG(statbuf.st_mode)) {
|
||||||
tmp_info.type = SDL_PATHTYPE_FILE;
|
tmp_info.type = SDL_PATHTYPE_FILE;
|
||||||
tmp_info.size = (Uint64) statbuf.st_size;
|
tmp_info.size = (Uint64) statbuf.st_size;
|
||||||
} else if (S_ISDIR(statbuf.st_mode)) {
|
}
|
||||||
|
else if (S_ISDIR(statbuf.st_mode)) {
|
||||||
tmp_info.type = SDL_PATHTYPE_DIRECTORY;
|
tmp_info.type = SDL_PATHTYPE_DIRECTORY;
|
||||||
tmp_info.size = 0;
|
tmp_info.size = 0;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
tmp_info.type = SDL_PATHTYPE_OTHER;
|
tmp_info.type = SDL_PATHTYPE_OTHER;
|
||||||
tmp_info.size = (Uint64) statbuf.st_size;
|
tmp_info.size = (Uint64) statbuf.st_size;
|
||||||
}
|
}
|
||||||
@ -35,7 +38,9 @@ bool NX_GetPathInfo(const char *path, SDL_PathInfo *info)
|
|||||||
tmp_info.modify_time = (SDL_Time) SDL_SECONDS_TO_NS(statbuf.st_mtime);
|
tmp_info.modify_time = (SDL_Time) SDL_SECONDS_TO_NS(statbuf.st_mtime);
|
||||||
tmp_info.access_time = (SDL_Time) SDL_SECONDS_TO_NS(statbuf.st_atime);
|
tmp_info.access_time = (SDL_Time) SDL_SECONDS_TO_NS(statbuf.st_atime);
|
||||||
|
|
||||||
if (info) *info = tmp_info;
|
if (info) {
|
||||||
|
*info = tmp_info;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user