Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions include/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down Expand Up @@ -99,10 +98,6 @@ void loadUDPTTY();
#endif

#if defined(HDD) || defined(HDD_RUNTIME)
#include <hdd-ioctl.h>
#include <io_common.h>
#include <assert.h>
#include <libpwroff.h>
extern char PART[128];
extern int HDD_USABLE;
#define MPART PART
Expand All @@ -120,7 +115,6 @@ int LookForBDMDevice(void);
#endif

#ifdef FILEXIO
#include <fileXio_rpc.h>
int LoadFIO(void); // Load FileXio and it´s dependencies
#endif

Expand Down
20 changes: 20 additions & 0 deletions include/platform_includes.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#ifndef PLATFORM_INCLUDES_H
#define PLATFORM_INCLUDES_H

#ifndef __CPPCHECK__
#include <assert.h>

Check warning on line 5 in include/platform_includes.h

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

include/platform_includes.h#L5

Include file: <assert.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <ctype.h>

Check warning on line 6 in include/platform_includes.h

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

include/platform_includes.h#L6

Include file: <ctype.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <errno.h>

Check warning on line 7 in include/platform_includes.h

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

include/platform_includes.h#L7

Include file: <errno.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <fcntl.h>

Check warning on line 8 in include/platform_includes.h

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

include/platform_includes.h#L8

Include file: <fcntl.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <limits.h>

Check warning on line 9 in include/platform_includes.h

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

include/platform_includes.h#L9

Include file: <limits.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <malloc.h>

Check warning on line 10 in include/platform_includes.h

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

include/platform_includes.h#L10

Include file: <malloc.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <stddef.h>

Check warning on line 11 in include/platform_includes.h

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

include/platform_includes.h#L11

Include file: <stddef.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <stdint.h>

Check warning on line 12 in include/platform_includes.h

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

include/platform_includes.h#L12

Include file: <stdint.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <stdarg.h>

Check warning on line 13 in include/platform_includes.h

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

include/platform_includes.h#L13

Include file: <stdarg.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <stdio.h>

Check warning on line 14 in include/platform_includes.h

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

include/platform_includes.h#L14

Include file: <stdio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <stdlib.h>

Check warning on line 15 in include/platform_includes.h

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

include/platform_includes.h#L15

Include file: <stdlib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <string.h>

Check warning on line 16 in include/platform_includes.h

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

include/platform_includes.h#L16

Include file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <unistd.h>

Check warning on line 17 in include/platform_includes.h

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

include/platform_includes.h#L17

Include file: <unistd.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#endif /* __CPPCHECK__ */

#endif /* PLATFORM_INCLUDES_H */
2 changes: 1 addition & 1 deletion include/util_safeio.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
17 changes: 16 additions & 1 deletion src/main.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
#include <errno.h>
#include <string.h>

#if defined(FILEXIO) || defined(HDD) || defined(HDD_RUNTIME) || defined(MX4SIO) || defined(MX4SIO_RUNTIME)
#ifndef __CPPCHECK__
#include <fileXio_rpc.h>

Check warning on line 6 in src/main.c

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/main.c#L6

Include file: <fileXio_rpc.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#endif
#endif

#if defined(HDD) || defined(HDD_RUNTIME)
#ifndef __CPPCHECK__
#include <hdd-ioctl.h>

Check warning on line 12 in src/main.c

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/main.c#L12

Include file: <hdd-ioctl.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <io_common.h>

Check warning on line 13 in src/main.c

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/main.c#L13

Include file: <io_common.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <libpwroff.h>

Check warning on line 14 in src/main.c

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/main.c#L14

Include file: <libpwroff.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#endif
#endif

#include "util_safe_compat.h"
#include "util_safe.h"
#include "main.h"
Expand Down Expand Up @@ -231,7 +245,7 @@
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;
Expand Down Expand Up @@ -1544,6 +1558,7 @@
}

#endif
static void AlarmCallback(s32 alarm_id, u16 time, void *common);
int dischandler()
{
int OldDiscType, DiscType, ValidDiscInserted, result, first_run = 1;
Expand Down
8 changes: 3 additions & 5 deletions src/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,15 @@

#include <tamtypes.h>
#include <kernel.h>
#ifndef __CPPCHECK__
#include <timer.h>

Check warning on line 40 in src/timer.c

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/timer.c#L40

Include file: <timer.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#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;

Expand Down
4 changes: 2 additions & 2 deletions src/util_safeio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading