Skip to content
Merged
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
1 change: 1 addition & 0 deletions .codacy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ engines:
- cppcheck-suppressions.txt
exclude_paths:
- src/util_safeio.c
- include/cppcheck_stubs/**
4 changes: 4 additions & 0 deletions include/cppcheck_stubs/SIOCookie.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#pragma once
// Stub for Codacy/Cppcheck static analysis; not used in PS2SDK builds.

int ee_sio_start(int baudrate, int mode, int parity, int stop, int ctrl, int intr);
4 changes: 4 additions & 0 deletions include/cppcheck_stubs/ctype.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#pragma once
// Stub for Codacy/Cppcheck static analysis; not used in PS2SDK builds.

int isspace(int c);
8 changes: 8 additions & 0 deletions include/cppcheck_stubs/debug.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#pragma once
// Stub for Codacy/Cppcheck static analysis; not used in PS2SDK builds.

int scr_printf(const char *fmt, ...);
void scr_setfontcolor(int color);
void scr_setbgcolor(int color);
void scr_clear(void);
void scr_setCursor(int cursor);
5 changes: 5 additions & 0 deletions include/cppcheck_stubs/elf-loader.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#pragma once
// Stub for Codacy/Cppcheck static analysis; not used in PS2SDK builds.

int LoadELFFromFile(const char *filename, int argc, const char *argv[]);
int LoadELFFromFileWithPartition(const char *filename, const char *partition, int argc, const char *argv[]);
10 changes: 10 additions & 0 deletions include/cppcheck_stubs/fileXio_rpc.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#pragma once
// Stub for Codacy/Cppcheck static analysis; not used in PS2SDK builds.

int fileXioInit(void);
int fileXioDopen(const char *path);
int fileXioDclose(int fd);
int fileXioIoctl(int fd, int cmd, void *arg);
int fileXioDevctl(const char *name, int cmd, void *arg, unsigned int arglen, void *buf, unsigned int buflen);
int fileXioMount(const char *mnt, const char *dev, int flag);
int fileXioUmount(const char *mnt);
18 changes: 18 additions & 0 deletions include/cppcheck_stubs/hdd-ioctl.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#pragma once
// Stub for Codacy/Cppcheck static analysis; not used in PS2SDK builds.

#ifndef HDIOC_STATUS
#define HDIOC_STATUS 0
#endif

#ifndef HDIOC_SMARTSTAT
#define HDIOC_SMARTSTAT 0
#endif

#ifndef HDIOC_GETSECTORERROR
#define HDIOC_GETSECTORERROR 0
#endif

#ifndef HDIOC_GETERRORPARTNAME
#define HDIOC_GETERRORPARTNAME 0
#endif
14 changes: 14 additions & 0 deletions include/cppcheck_stubs/io_common.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#pragma once
// Stub for Codacy/Cppcheck static analysis; not used in PS2SDK builds.

#ifndef FIO_MT_RDONLY
#define FIO_MT_RDONLY 0
#endif

#ifndef PDIOC_CLOSEALL
#define PDIOC_CLOSEALL 0
#endif

#ifndef DDIOC_OFF
#define DDIOC_OFF 0
#endif
5 changes: 5 additions & 0 deletions include/cppcheck_stubs/iopcontrol.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#pragma once
// Stub for Codacy/Cppcheck static analysis; not used in PS2SDK builds.

int SifIopReset(const char *arg, int mode);
int SifIopSync(void);
4 changes: 4 additions & 0 deletions include/cppcheck_stubs/iopcontrol_special.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#pragma once
// Stub for Codacy/Cppcheck static analysis; not used in PS2SDK builds.

int SifIopRebootBuffer(const void *ioprp, int size);
4 changes: 4 additions & 0 deletions include/cppcheck_stubs/iopheap.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#pragma once
// Stub for Codacy/Cppcheck static analysis; not used in PS2SDK builds.

int SifInitIopHeap(void);
19 changes: 19 additions & 0 deletions include/cppcheck_stubs/kernel.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#pragma once
// Stub for Codacy/Cppcheck static analysis; not used in PS2SDK builds.

#ifndef UNCACHED_SEG
#define UNCACHED_SEG(x) (x)
#endif

typedef unsigned char u8;
typedef unsigned short u16;
typedef unsigned int u32;
typedef signed int s32;

int AddIntcHandler(int interrupt, int (*handler)(int), int next);
int RemoveIntcHandler(int interrupt, int id);
int EnableIntc(int interrupt);
int DisableIntc(int interrupt);
int SetAlarm(u32 ticks, void (*callback)(s32 alarm_id, u16 time, void *common), void *common);
int GetThreadId(void);
void SignalSema(int sema_id);
36 changes: 36 additions & 0 deletions include/cppcheck_stubs/libcdvd.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#pragma once
// Stub for Codacy/Cppcheck static analysis; not used in PS2SDK builds.

#ifndef SCECdINoD
#define SCECdINoD 0
#endif

#ifndef SCECdEXIT
#define SCECdEXIT 1
#endif

typedef unsigned char u8;
typedef unsigned int u32;

typedef struct sceCdCLOCK {
u8 stat;
u8 second;
u8 minute;
u8 hour;
u8 pad[4];
} sceCdCLOCK;

int sceCdInit(int mode);
int sceCdReadClock(sceCdCLOCK *clock);
int sceCdOpenConfig(int arg0, int arg1, int arg2, u32 *stat);
int sceCdReadConfig(u8 *config, u32 *stat);
int sceCdWriteConfig(const u8 *config, u32 *stat);
int sceCdCloseConfig(u32 *stat);
int sceCdReadKey(int key, int index, int keynum, u8 *buffer);
int sceCdGetError(void);
int sceCdApplySCmd(int cmd, const void *in, int in_size, void *out);
int sceCdMV(u8 *data, u32 *status);
int sceCdAutoAdjustCtrl(int mode, u32 *stat);
int sceCdGetDiskType(void);
int sceCdTrayReq(int mode, u32 *stat);
int sceCdForbidDVDP(u32 *stat);
39 changes: 39 additions & 0 deletions include/cppcheck_stubs/libmc.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#pragma once
// Stub for Codacy/Cppcheck static analysis; not used in PS2SDK builds.

#ifndef MC_TYPE_MC
#define MC_TYPE_MC 0
#endif

#ifndef MC_TYPE_XMC
#define MC_TYPE_XMC 1
#endif

#ifndef sceMcTypePS2
#define sceMcTypePS2 2
#endif

#ifndef sceMcResSucceed
#define sceMcResSucceed 0
#endif

#ifndef sceMcResChangedCard
#define sceMcResChangedCard 1
#endif

#ifndef MC_FORMATTED
#define MC_FORMATTED 1
#endif

int mcInit(int type);
int mcGetInfo(int port, int slot, int *type, int *free, int *format);
int mcOpen(int port, int slot, const char *path, int mode);
int mcClose(int fd);
int mcSeek(int fd, int offset, int origin);
int mcRead(int fd, void *buffer, int size);
int mcWrite(int fd, const void *buffer, int size);
int mcGetDir(int port, int slot, const char *path, int flags, int max_entries, void *mc_table);
int mcMkDir(int port, int slot, const char *path);
int mcSetFileInfo(int port, int slot, const char *path, void *info, int flags);
int mcDelete(int port, int slot, const char *path);
int mcSync(int mode, int *cmd, int *result);
17 changes: 17 additions & 0 deletions include/cppcheck_stubs/libpad.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#pragma once
// Stub for Codacy/Cppcheck static analysis; not used in PS2SDK builds.

typedef unsigned short u16;
typedef unsigned int u32;

typedef struct padButtonStatus {
u16 btns;
u16 _pad;
u32 btns2;
} padButtonStatus;

int padInit(int mode);
int padPortOpen(int port, int slot, void *pad_area);
int padPortClose(int port, int slot);
int padEnd(void);
int padRead(int port, int slot, struct padButtonStatus *buttons);
4 changes: 4 additions & 0 deletions include/cppcheck_stubs/libpwroff.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#pragma once
// Stub for Codacy/Cppcheck static analysis; not used in PS2SDK builds.

void poweroffShutdown(void);
6 changes: 6 additions & 0 deletions include/cppcheck_stubs/limits.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#pragma once
// Stub for Codacy/Cppcheck static analysis; not used in PS2SDK builds.

#ifndef INT_MAX
#define INT_MAX 2147483647
#endif
7 changes: 7 additions & 0 deletions include/cppcheck_stubs/loadfile.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#pragma once
// Stub for Codacy/Cppcheck static analysis; not used in PS2SDK builds.

int SifLoadFileInit(void);
int SifLoadModule(const char *path, int argc, const char *argv);
int SifLoadStartModule(const char *path, int argc, const char *argv, int *ret);
int SifExecModuleBuffer(const void *modptr, int size, int argc, const char *argv, int *ret);
64 changes: 64 additions & 0 deletions include/cppcheck_stubs/osd_config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#pragma once
// Stub for Codacy/Cppcheck static analysis; not used in PS2SDK builds.

typedef struct ConfigParam {
int spdifMode;
int screenType;
int videoOutput;
int japLanguage;
int ps1drvConfig;
int version;
int language;
int timezoneOffset;
} ConfigParam;

typedef struct Config2Param {
int format;
int daylightSaving;
int timeFormat;
int dateFormat;
int version;
int language;
} Config2Param;

#ifndef LANGUAGE_JAPANESE
#define LANGUAGE_JAPANESE 0
#endif
#ifndef LANGUAGE_ENGLISH
#define LANGUAGE_ENGLISH 1
#endif
#ifndef LANGUAGE_FRENCH
#define LANGUAGE_FRENCH 2
#endif
#ifndef LANGUAGE_SPANISH
#define LANGUAGE_SPANISH 3
#endif
#ifndef LANGUAGE_GERMAN
#define LANGUAGE_GERMAN 4
#endif
#ifndef LANGUAGE_ITALIAN
#define LANGUAGE_ITALIAN 5
#endif
#ifndef LANGUAGE_DUTCH
#define LANGUAGE_DUTCH 6
#endif
#ifndef LANGUAGE_PORTUGUESE
#define LANGUAGE_PORTUGUESE 7
#endif
#ifndef LANGUAGE_RUSSIAN
#define LANGUAGE_RUSSIAN 8
#endif
#ifndef LANGUAGE_KOREAN
#define LANGUAGE_KOREAN 9
#endif
#ifndef LANGUAGE_TRAD_CHINESE
#define LANGUAGE_TRAD_CHINESE 10
#endif
#ifndef LANGUAGE_SIMPL_CHINESE
#define LANGUAGE_SIMPL_CHINESE 11
#endif

void SetOsdConfigParam(const ConfigParam *config);
void GetOsdConfigParam(ConfigParam *config);
void SetOsdConfigParam2(const Config2Param *config, int size, int offset);
void GetOsdConfigParam2(Config2Param *config, int size, int offset);
4 changes: 4 additions & 0 deletions include/cppcheck_stubs/ps2sdkapi.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#pragma once
// Stub for Codacy/Cppcheck static analysis; not used in PS2SDK builds.

void SetGsVParam(int mode);
5 changes: 5 additions & 0 deletions include/cppcheck_stubs/sbv_patches.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#pragma once
// Stub for Codacy/Cppcheck static analysis; not used in PS2SDK builds.

int sbv_patch_enable_lmb(void);
int sbv_patch_disable_prefix_check(void);
4 changes: 4 additions & 0 deletions include/cppcheck_stubs/sifcmd.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#pragma once
// Stub for Codacy/Cppcheck static analysis; not used in PS2SDK builds.

void SifExitCmd(void);
12 changes: 12 additions & 0 deletions include/cppcheck_stubs/sifrpc.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#pragma once
// Stub for Codacy/Cppcheck static analysis; not used in PS2SDK builds.

#include "tamtypes.h"

typedef struct SifRpcClientData {
int dummy;
} SifRpcClientData_t;

int SifCallRpc(SifRpcClientData_t *client, int rpc_number, int mode, void *send, int ssize, void *recv, int rsize,
void *endfunc, void *endparam);
int SifInitRpc(int mode);
4 changes: 4 additions & 0 deletions include/cppcheck_stubs/sio.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#pragma once
// Stub for Codacy/Cppcheck static analysis; not used in PS2SDK builds.

void sio_putsn(const char *str);
14 changes: 14 additions & 0 deletions include/cppcheck_stubs/stdarg.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#pragma once
// Stub for Codacy/Cppcheck static analysis; not used in PS2SDK builds.

#if defined(__GNUC__) || defined(__clang__)
typedef __builtin_va_list va_list;
#define va_start(ap, last) __builtin_va_start(ap, last)
#define va_end(ap) __builtin_va_end(ap)
#define va_arg(ap, type) __builtin_va_arg(ap, type)
#else
typedef char *va_list;
#define va_start(ap, last) ((void)0)
#define va_end(ap) ((void)0)
#define va_arg(ap, type) (*(type *)(ap))
#endif
8 changes: 8 additions & 0 deletions include/cppcheck_stubs/stddef.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#pragma once
// Stub for Codacy/Cppcheck static analysis; not used in PS2SDK builds.

typedef unsigned int size_t;

#ifndef NULL
#define NULL ((void *)0)
#endif
4 changes: 4 additions & 0 deletions include/cppcheck_stubs/string.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#pragma once
// Stub for Codacy/Cppcheck static analysis; not used in PS2SDK builds.

#include "stddef.h"
16 changes: 16 additions & 0 deletions include/cppcheck_stubs/tamtypes.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#pragma once
// Stub for Codacy/Cppcheck static analysis; not used in PS2SDK builds.

typedef unsigned char u8;
typedef unsigned short u16;
typedef unsigned int u32;
typedef unsigned long long u64;

typedef signed char s8;
typedef signed short s16;
typedef signed int s32;
typedef signed long long s64;

#ifndef ALIGNED
#define ALIGNED(x) __attribute__((aligned(x)))
#endif
10 changes: 10 additions & 0 deletions include/cppcheck_stubs/usbhdfsd-common.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#pragma once
// Stub for Codacy/Cppcheck static analysis; not used in PS2SDK builds.

#ifndef USBMASS_IOCTL_GET_DRIVERNAME
#define USBMASS_IOCTL_GET_DRIVERNAME 0
#endif

#ifndef USBMASS_DEVCTL_STOP_ALL
#define USBMASS_DEVCTL_STOP_ALL 0
#endif
Loading