examples/fxload: Eliminate all reserved C identifiers (leading underscores)

The C langugage reserves various identifiers for itself that user code
must not use.

Fixes all clang-tidy bugprone-reserved-identifier warnings

Also, 4 of 5 file extension tests were case insensitive, and 1 was not.
Changed it to be insensitive too.

References #1479
This commit is contained in:
Sean McBride 2024-04-09 13:28:25 -04:00 committed by Tormod Volden
parent 00454ab087
commit 9ffdb7fe6e
3 changed files with 8 additions and 7 deletions

View file

@ -9,7 +9,6 @@ bugprone-*,\
-bugprone-macro-parentheses,\
-bugprone-misplaced-widening-cast,\
-bugprone-narrowing-conversions,\
-bugprone-reserved-identifier,\
-bugprone-signed-char-misuse,\
-bugprone-suspicious-string-compare,\
-bugprone-switch-missing-default-case,\

View file

@ -38,7 +38,9 @@
#include <syslog.h>
static bool dosyslog = false;
#include <strings.h>
#define _stricmp strcasecmp
#define libusb_strcasecmp strcasecmp
#else
#define libusb_strcasecmp _stricmp
#endif
#ifndef FXLOAD_VERSION
@ -263,13 +265,13 @@ int main(int argc, char*argv[])
for (i=0; i<ARRAYSIZE(path); i++) {
if (path[i] != NULL) {
ext = path[i] + strlen(path[i]) - 4;
if ((_stricmp(ext, ".hex") == 0) || (strcmp(ext, ".ihx") == 0))
if ((libusb_strcasecmp(ext, ".hex") == 0) || (libusb_strcasecmp(ext, ".ihx") == 0))
img_type[i] = IMG_TYPE_HEX;
else if (_stricmp(ext, ".iic") == 0)
else if (libusb_strcasecmp(ext, ".iic") == 0)
img_type[i] = IMG_TYPE_IIC;
else if (_stricmp(ext, ".bix") == 0)
else if (libusb_strcasecmp(ext, ".bix") == 0)
img_type[i] = IMG_TYPE_BIX;
else if (_stricmp(ext, ".img") == 0)
else if (libusb_strcasecmp(ext, ".img") == 0)
img_type[i] = IMG_TYPE_IMG;
else {
logerror("%s is not a recognized image type\n", path[i]);

View file

@ -1 +1 @@
#define LIBUSB_NANO 11914
#define LIBUSB_NANO 11915