Skip to content

Commit

Permalink
Remove unnecessary inline specifier from functions
Browse files Browse the repository at this point in the history
  • Loading branch information
uyjulian committed Feb 22, 2020
1 parent f8ba412 commit df71d4e
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 20 deletions.
8 changes: 4 additions & 4 deletions ee_core/include/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@

#include <tamtypes.h>

inline void _strcpy(char *dst, const char *src);
inline void _strcat(char *dst, const char *src);
void _strcpy(char *dst, const char *src);
void _strcat(char *dst, const char *src);
int _strncmp(const char *s1, const char *s2, int length);
int _strcmp(const char *s1, const char *s2);
char *_strchr(const char *string, int c);
char *_strrchr(const char *string, int c);
char *_strtok(char *strToken, const char *strDelimit);
char *_strstr(const char *string, const char *substring);
inline int _islower(int c);
inline int _toupper(int c);
int _islower(int c);
int _toupper(int c);
int _memcmp(const void *s1, const void *s2, unsigned int length);
unsigned int _strtoui(const char *p);
int _strtoi(const char *p);
Expand Down
8 changes: 4 additions & 4 deletions ee_core/src/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ extern int size_cdvdfsv_irx;
extern void *_end;

/* Do not link to strcpy() from libc */
inline void _strcpy(char *dst, const char *src)
void _strcpy(char *dst, const char *src)
{
strncpy(dst, src, strlen(src) + 1);
}

/* Do not link to strcat() from libc */
inline void _strcat(char *dst, const char *src)
void _strcat(char *dst, const char *src)
{
_strcpy(&dst[strlen(dst)], src);
}
Expand Down Expand Up @@ -177,7 +177,7 @@ char *_strstr(const char *string, const char *substring)
}

/* Do not link to islower() from libc */
inline int _islower(int c)
int _islower(int c)
{
if ((c < 'a') || (c > 'z'))
return 0;
Expand All @@ -188,7 +188,7 @@ inline int _islower(int c)
}

/* Do not link to toupper() from libc */
inline int _toupper(int c)
int _toupper(int c)
{
if (_islower(c))
c -= 32;
Expand Down
2 changes: 1 addition & 1 deletion include/ioprp.h
Original file line number Diff line number Diff line change
@@ -1 +1 @@
inline unsigned int patch_IOPRP_image(void *ioprp_image, void *cdvdman_module, unsigned int size_cdvdman);
unsigned int patch_IOPRP_image(void *ioprp_image, void *cdvdman_module, unsigned int size_cdvdman);
6 changes: 3 additions & 3 deletions include/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ int readFileBuffer(file_buffer_t *readContext, char **outBuf);
void writeFileBuffer(file_buffer_t *fileBuffer, char *inBuf, int size);
void closeFileBuffer(file_buffer_t *fileBuffer);

inline int max(int a, int b);
inline int min(int a, int b);
int max(int a, int b);
int min(int a, int b);
int fromHex(char digit);
char toHex(int digit);

Expand All @@ -50,6 +50,6 @@ int sysDeleteFolder(const char *folder);

int CheckPS2Logo(int fd, u32 lba);

inline void delay(int count);
void delay(int count);

#endif
2 changes: 1 addition & 1 deletion modules/network/smap-ingame/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ static err_t SMapIFInit(NetIF *pNetIF)
return ERR_OK;
}

inline void SMapLowLevelInput(PBuf *pBuf)
void SMapLowLevelInput(PBuf *pBuf)
{
//When we receive data, the interrupt-handler will invoke this function, which means we are in an interrupt-context. Pass on
//the received data to ps2ip.
Expand Down
2 changes: 1 addition & 1 deletion modules/network/smap-ingame/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ int SMAPStart(void);
void SMAPStop(void);
int SMAPGetMACAddress(unsigned char *buffer);

inline void SMapLowLevelInput(struct pbuf *pBuf);
void SMapLowLevelInput(struct pbuf *pBuf);

#include "xfer.h"
2 changes: 1 addition & 1 deletion src/ioprp.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ static inline void Align_offsets(void *base_address, unsigned int *offset_in, st
/*----------------------------------------------------------------------------------------
Replace modules in a IOPRP image.
------------------------------------------------------------------------------------------*/
inline unsigned int patch_IOPRP_image(void *ioprp_image, void *cdvdman_module, unsigned int size_cdvdman)
unsigned int patch_IOPRP_image(void *ioprp_image, void *cdvdman_module, unsigned int size_cdvdman)
{
unsigned int offset_in, offset_out; /* For processing purposes */
struct romdir_entry *romdir_in, *romdir_out;
Expand Down
10 changes: 5 additions & 5 deletions src/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -380,14 +380,14 @@ void closeFileBuffer(file_buffer_t *fileBuffer)
fileBuffer = NULL;
}

// a simple maximum of two inline
inline int max(int a, int b)
// a simple maximum of two
int max(int a, int b)
{
return a > b ? a : b;
}

// a simple minimum of two inline
inline int min(int a, int b)
// a simple minimum of two
int min(int a, int b)
{
return a < b ? a : b;
}
Expand Down Expand Up @@ -606,7 +606,7 @@ int sysDeleteFolder(const char *folder)
/*----------------------------------------------------------------------------------------*/
/* NOP delay. */
/*----------------------------------------------------------------------------------------*/
inline void delay(int count)
void delay(int count)
{
int i, ret;

Expand Down

0 comments on commit df71d4e

Please sign in to comment.