diff --git a/include/main.h b/include/main.h index de8c719..a6693a2 100644 --- a/include/main.h +++ b/include/main.h @@ -69,7 +69,6 @@ void TimerEnd(void); /// check path for processing pseudo-devices like `mc?:/` char *CheckPath(char *path); -static void AlarmCallback(s32 alarm_id, u16 time, void *common); int dischandler(); // there is no need to call this on a PSX DESR since OSDSYS performs it at boot void CDVDBootCertify(u8 romver[16]); @@ -99,10 +98,6 @@ void loadUDPTTY(); #endif #if defined(HDD) || defined(HDD_RUNTIME) -#include -#include -#include -#include extern char PART[128]; extern int HDD_USABLE; #define MPART PART @@ -120,7 +115,6 @@ int LookForBDMDevice(void); #endif #ifdef FILEXIO -#include int LoadFIO(void); // Load FileXio and it´s dependencies #endif diff --git a/include/platform_includes.h b/include/platform_includes.h new file mode 100644 index 0000000..6dc21f8 --- /dev/null +++ b/include/platform_includes.h @@ -0,0 +1,20 @@ +#ifndef PLATFORM_INCLUDES_H +#define PLATFORM_INCLUDES_H + +#ifndef __CPPCHECK__ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#endif /* __CPPCHECK__ */ + +#endif /* PLATFORM_INCLUDES_H */ diff --git a/include/util_safeio.h b/include/util_safeio.h index f8f457a..3891b21 100644 --- a/include/util_safeio.h +++ b/include/util_safeio.h @@ -21,7 +21,7 @@ * @param buf_sz size of destination buffer * @return bytes read (>=0), or negative on error */ -ssize_t safe_read_once_nt(int fd, char *buf, size_t buf_sz); +ssize_t safe_read_once_nt(int fd, void *buf, size_t buf_sz); /** * @brief Read until EOF or buffer full without exceeding buf_sz. diff --git a/src/main.c b/src/main.c index ea8cb9d..aa8266c 100644 --- a/src/main.c +++ b/src/main.c @@ -1,6 +1,20 @@ #include #include +#if defined(FILEXIO) || defined(HDD) || defined(HDD_RUNTIME) || defined(MX4SIO) || defined(MX4SIO_RUNTIME) +#ifndef __CPPCHECK__ +#include +#endif +#endif + +#if defined(HDD) || defined(HDD_RUNTIME) +#ifndef __CPPCHECK__ +#include +#include +#include +#endif +#endif + #include "util_safe_compat.h" #include "util_safe.h" #include "main.h" @@ -231,7 +245,7 @@ static void __attribute__((unused)) EnableConfigPath(CONFIG_SOURCES_ID source) config_path_enabled[source] = 1; } -static void DisableConfigPath(CONFIG_SOURCES_ID source) +static void __attribute__((unused)) DisableConfigPath(CONFIG_SOURCES_ID source) { if (source < SOURCE_COUNT) config_path_enabled[source] = 0; @@ -1544,6 +1558,7 @@ void poweroffCallback(void *arg) } #endif +static void AlarmCallback(s32 alarm_id, u16 time, void *common); int dischandler() { int OldDiscType, DiscType, ValidDiscInserted, result, first_run = 1; diff --git a/src/timer.c b/src/timer.c index 973a1f1..ae76936 100644 --- a/src/timer.c +++ b/src/timer.c @@ -36,17 +36,15 @@ #include #include +#ifndef __CPPCHECK__ +#include +#endif void TimerInit(void); u64 Timer(void); void TimerEnd(void); void delay(int delay); //________________ From uLaunchELF ______________________ -// Timer Define - -#define T0_COUNT ((volatile unsigned long *)0x10000000) -#define T0_MODE ((volatile unsigned long *)0x10000010) - static int TimerInterruptID = -1; static u64 TimerInterruptCount = 0; diff --git a/src/util_safeio.c b/src/util_safeio.c index f476f8c..164416d 100644 --- a/src/util_safeio.c +++ b/src/util_safeio.c @@ -40,9 +40,9 @@ static ssize_t safe_read_loop(int fd, char *buf, size_t buf_sz, int nul_terminat return (ssize_t)offset; } -ssize_t safe_read_once_nt(int fd, char *buf, size_t buf_sz) +ssize_t safe_read_once_nt(int fd, void *buf, size_t buf_sz) { - return safe_read_loop(fd, buf, buf_sz, 1); + return safe_read_loop(fd, (char *)buf, buf_sz, 1); } ssize_t safe_read_fully_bin(int fd, void *buf, size_t buf_sz)