Skip to content

Commit

Permalink
Tidying up comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Brown committed Nov 24, 2023
1 parent 831da86 commit c43dc3a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 21 deletions.
18 changes: 3 additions & 15 deletions sibo.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,15 @@
#include <utime.h>
#include <stdarg.h>

// #ifdef _WIN32
// #include <windows.h>
// // const char *slash = "\\";
// #else
// // Assume it's something POSIX-compliant
// #include <stdbool.h>
// #include <unistd.h>
// #include <sys/stat.h>
// // const char *slash = "/";
// #endif

#ifdef _WIN32
#include <windows.h>
const char *slash = "\\";
#else
#else // _WIN32
// Assume it's something POSIX-compliant
#include <unistd.h>
const char *slash = "/";
#endif
#endif // _WIN32


#define FLASH_TYPE 0xf1a5
Expand Down Expand Up @@ -151,6 +141,4 @@ struct PsiDateTime {
uint16_t psi_date;
};



#endif
#endif // SIBO_LIB
11 changes: 5 additions & 6 deletions siboimg.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
// TODO: Use structs to read values from image files rather than separate variables
// TODO: Handle volume name records (first byte of volume name is 0x00) (need examples of this!)
// TODO: Check for out of range pointer (to trap error and avoid segfault)
// TODO: Add ability to find an FEFS image in a ROM dump

#include "sibo.h"
#include "statwrap.h"
Expand Down Expand Up @@ -261,18 +260,18 @@ void walkpath(int pos, char path[], char *buffer[], const char img_name[], const
} else {
#ifdef _WIN32
CreateDirectory(localpath, NULL);
#else
#else // _WIN32
mkdir(localpath, 0777);
#endif
#endif // _WIN32
}

walkpath (first_entry_ptr, newpath, buffer, img_name, buffer_len, is_fefs32);
if (is_readonly) {
#ifdef _WIN32
SetFileAttributesA(localpath, FILE_ATTRIBUTE_READONLY);
#else
#else // _WIN32
chmod(localpath, (is_file) ? 0444 : 0555);
#endif
#endif // _WIN32
}
#ifdef _WIN32
if (is_hidden) {
Expand All @@ -281,7 +280,7 @@ void walkpath(int pos, char path[], char *buffer[], const char img_name[], const
if (is_system) {
SetFileAttributesA(localpath, FILE_ATTRIBUTE_SYSTEM);
}
#endif
#endif // _WIN32
}
} else {
printf("Invalid entry found, skipping ");
Expand Down

0 comments on commit c43dc3a

Please sign in to comment.