diff --git a/include/romfs_dev.h b/include/romfs_dev.h index 6f555a6..2b6af1b 100644 --- a/include/romfs_dev.h +++ b/include/romfs_dev.h @@ -61,7 +61,7 @@ typedef enum { * @brief Mounts the Application's RomFS. * @param name Device mount name. */ -int32_t romfsMount(const char *name, const char * path, RomfsSource source); +int32_t romfsMount(const char *name, const char *path, RomfsSource source); /** * @brief Mounts RomFS from an open file. @@ -80,7 +80,7 @@ typedef struct { uint64_t offset; ///< Length of the file's data. } romfs_fileInfo; -int romfsGetFileInfoPerPath(const char* romfs, const char *path, romfs_fileInfo* out); +int romfsGetFileInfoPerPath(const char *romfs, const char *path, romfs_fileInfo *out); #ifdef __cplusplus } diff --git a/source/romfs_dev.c b/source/romfs_dev.c index 7164867..f5cbd2f 100644 --- a/source/romfs_dev.c +++ b/source/romfs_dev.c @@ -44,14 +44,14 @@ static char __component[PATH_MAX + 1]; static romfs_dir *romFS_dir(romfs_mount *mount, uint32_t off) { if (off + sizeof(romfs_dir) > mount->header.dirTableSize) { return NULL; } - romfs_dir *curDir = ((romfs_dir * )((uint8_t *) mount->dirTable + off)); + romfs_dir *curDir = ((romfs_dir *) ((uint8_t *) mount->dirTable + off)); if (off + sizeof(romfs_dir) + curDir->nameLen > mount->header.dirTableSize) { return NULL; } return curDir; } static romfs_file *romFS_file(romfs_mount *mount, uint32_t off) { if (off + sizeof(romfs_file) > mount->header.fileTableSize) { return NULL; } - romfs_file *curFile = ((romfs_file * )((uint8_t *) mount->fileTable + off)); + romfs_file *curFile = ((romfs_file *) ((uint8_t *) mount->fileTable + off)); if (off + sizeof(romfs_file) + curFile->nameLen > mount->header.fileTableSize) { return NULL; } return curFile; } @@ -386,7 +386,7 @@ static inline uint8_t normalizePathChar(uint8_t c) { } static uint32_t calcHash(uint32_t parent, const uint8_t *name, uint32_t namelen, uint32_t total) { - uint32_t hash = parent ^123456789; + uint32_t hash = parent ^ 123456789; uint32_t i; for (i = 0; i < namelen; i++) { hash = (hash >> 5) | (hash << 27); @@ -437,7 +437,7 @@ static int searchForFile(romfs_mount *mount, romfs_dir *parent, const uint8_t *n uint32_t curOff; *out = NULL; for (curOff = mount->fileHashTable[hash]; curOff != romFS_none; - curOff = curFile->nextHash) { + curOff = curFile->nextHash) { curFile = romFS_file(mount, curOff); if (curFile == NULL) { return EFAULT;