mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-21 18:52:07 +00:00
Cleanup GCC compiler attributes
Added define 'unused_' for '__attribute__((unused))'. The oldest version of GCC with online docs (GCC 2.95.3, released in March 16, 2001 [1]) already has support for this attribute, so it doesn't make sense to check the version. Renamed 'noreturn' to 'noreturn_' for consistency. [1] https://gcc.gnu.org/onlinedocs/ Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
This commit is contained in:
@@ -20,6 +20,8 @@
|
||||
#include "asm/symbol.h"
|
||||
#include "asm/symbol.h"
|
||||
|
||||
#include "helpers.h"
|
||||
|
||||
#include "asmy.h"
|
||||
|
||||
bool oDontExpandStrings;
|
||||
@@ -219,7 +221,7 @@ uint32_t PutMacroArg(char *src, uint32_t size)
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t PutUniqueArg(__attribute ((unused)) char *src, uint32_t size)
|
||||
uint32_t PutUniqueArg(unused_ char *src, uint32_t size)
|
||||
{
|
||||
char *s;
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
|
||||
#include "extern/err.h"
|
||||
|
||||
#include "helpers.h"
|
||||
#include "version.h"
|
||||
|
||||
struct sSymbol *tHashedSymbols[HASHSIZE];
|
||||
@@ -62,7 +63,7 @@ void helper_RemoveLeadingZeros(char *string)
|
||||
memmove(string, new_beginning, strlen(new_beginning) + 1);
|
||||
}
|
||||
|
||||
int32_t Callback_NARG(__attribute__ ((unused)) struct sSymbol *sym)
|
||||
int32_t Callback_NARG(unused_ struct sSymbol *sym)
|
||||
{
|
||||
uint32_t i = 0;
|
||||
|
||||
@@ -72,7 +73,7 @@ int32_t Callback_NARG(__attribute__ ((unused)) struct sSymbol *sym)
|
||||
return i;
|
||||
}
|
||||
|
||||
int32_t Callback__LINE__(struct sSymbol __attribute__((unused)) *sym)
|
||||
int32_t Callback__LINE__(unused_ struct sSymbol *sym)
|
||||
{
|
||||
return nLineNo;
|
||||
}
|
||||
|
||||
8
src/extern/err.c
vendored
8
src/extern/err.c
vendored
@@ -33,7 +33,7 @@ void rgbds_vwarnx(const char *fmt, va_list ap)
|
||||
putc('\n', stderr);
|
||||
}
|
||||
|
||||
noreturn void rgbds_verr(int status, const char *fmt, va_list ap)
|
||||
noreturn_ void rgbds_verr(int status, const char *fmt, va_list ap)
|
||||
{
|
||||
fprintf(stderr, "error");
|
||||
if (fmt) {
|
||||
@@ -44,7 +44,7 @@ noreturn void rgbds_verr(int status, const char *fmt, va_list ap)
|
||||
exit(status);
|
||||
}
|
||||
|
||||
noreturn void rgbds_verrx(int status, const char *fmt, va_list ap)
|
||||
noreturn_ void rgbds_verrx(int status, const char *fmt, va_list ap)
|
||||
{
|
||||
fprintf(stderr, "error");
|
||||
if (fmt) {
|
||||
@@ -73,7 +73,7 @@ void rgbds_warnx(const char *fmt, ...)
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
noreturn void rgbds_err(int status, const char *fmt, ...)
|
||||
noreturn_ void rgbds_err(int status, const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
@@ -82,7 +82,7 @@ noreturn void rgbds_err(int status, const char *fmt, ...)
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
noreturn void rgbds_errx(int status, const char *fmt, ...)
|
||||
noreturn_ void rgbds_errx(int status, const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
|
||||
@@ -179,7 +179,7 @@ void script_PrintFileStack(void)
|
||||
fprintf(stderr, "%s(%d)", linkerscript_path, include_line[i]);
|
||||
}
|
||||
|
||||
noreturn void script_fatalerror(const char *fmt, ...)
|
||||
noreturn_ void script_fatalerror(const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
|
||||
Reference in New Issue
Block a user