mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Enable -Wpedantic
Fix a few warnings related needed to build the source with this option. Add new exception to .checkpatch.conf. Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
This commit is contained in:
@@ -53,6 +53,9 @@
|
||||
# Prefer stdint.h types over kernel types
|
||||
--ignore PREFER_KERNEL_TYPES
|
||||
|
||||
# Don't ask to replace sscanf by kstrto
|
||||
--ignore SSCANF_TO_KSTRTO
|
||||
|
||||
# Parentheses can make the code clearer
|
||||
--ignore UNNECESSARY_PARENTHESES
|
||||
|
||||
|
||||
2
Makefile
2
Makefile
@@ -26,7 +26,7 @@ PNGLDLIBS := `${PKG_CONFIG} --static --libs-only-l libpng`
|
||||
|
||||
VERSION_STRING := `git describe --tags --dirty --always 2>/dev/null`
|
||||
|
||||
WARNFLAGS := -Wall -Werror
|
||||
WARNFLAGS := -Werror -Wall -Wpedantic
|
||||
|
||||
# Overridable CFLAGS
|
||||
CFLAGS := -g
|
||||
|
||||
@@ -640,7 +640,6 @@ scanagain:
|
||||
|
||||
/* Check for line continuation character */
|
||||
if (*pLexBuffer == '\\') {
|
||||
|
||||
/*
|
||||
* Look for line continuation character after a series of
|
||||
* spaces. This is also useful for files that use Windows line
|
||||
|
||||
@@ -147,10 +147,13 @@ void opt_Parse(char *s)
|
||||
case 'z':
|
||||
if (strlen(&s[1]) <= 2) {
|
||||
int32_t result;
|
||||
unsigned int fillchar;
|
||||
|
||||
result = sscanf(&s[1], "%x", &newopt.fillchar);
|
||||
result = sscanf(&s[1], "%x", &fillchar);
|
||||
if (!((result == EOF) || (result == 1)))
|
||||
errx(1, "Invalid argument for option 'z'");
|
||||
|
||||
newopt.fillchar = fillchar;
|
||||
} else {
|
||||
errx(1, "Invalid argument for option 'z'");
|
||||
}
|
||||
|
||||
@@ -317,9 +317,9 @@ static void rgba_png_palette(struct PNGImage *img,
|
||||
png_color **palette_ptr_ptr, int *num_colors)
|
||||
{
|
||||
if (png_get_valid(img->png, img->info, PNG_INFO_PLTE))
|
||||
return rgba_PLTE_palette(img, palette_ptr_ptr, num_colors);
|
||||
rgba_PLTE_palette(img, palette_ptr_ptr, num_colors);
|
||||
else
|
||||
return rgba_build_palette(img, palette_ptr_ptr, num_colors);
|
||||
rgba_build_palette(img, palette_ptr_ptr, num_colors);
|
||||
}
|
||||
|
||||
static void rgba_PLTE_palette(struct PNGImage *img,
|
||||
|
||||
Reference in New Issue
Block a user