shithub: rgbds

Download patch

ref: 8b60efa1495128301a407e93bd7c4ac0eb0b0f1e
parent: f996186fae53fa87b1f7a8b3373d91211601d21d
parent: 240fca0861d6924403b39ba8c2752a67137fb45a
author: Eldred Habert <[email protected]>
date: Sat Jun 27 18:07:19 EDT 2020

Merge pull request #530 from JL2210/fix-clang

Fix Clang warning in linkdefs

--- a/include/linkdefs.h
+++ b/include/linkdefs.h
@@ -12,8 +12,8 @@
 #include <stdbool.h>
 #include <stdint.h>
 
-#define RGBDS_OBJECT_VERSION_STRING "RGB%1hhu"
-#define RGBDS_OBJECT_VERSION_NUMBER 9
+#define RGBDS_OBJECT_VERSION_STRING "RGB%1u"
+#define RGBDS_OBJECT_VERSION_NUMBER 9U
 #define RGBDS_OBJECT_REV 4U
 
 enum AssertionType {
--- a/src/link/object.c
+++ b/src/link/object.c
@@ -400,7 +400,7 @@
 		err(1, "Could not open file %s", fileName);
 
 	/* Begin by reading the magic bytes and version number */
-	uint8_t versionNumber;
+	unsigned versionNumber;
 	int matchedElems = fscanf(file, RGBDS_OBJECT_VERSION_STRING,
 				  &versionNumber);
 
@@ -407,11 +407,11 @@
 	if (matchedElems != 1)
 		errx(1, "\"%s\" is not a RGBDS object file", fileName);
 
-	verbosePrint("Reading object file %s, version %hhu\n",
+	verbosePrint("Reading object file %s, version %u\n",
 		     fileName, versionNumber);
 
 	if (versionNumber != RGBDS_OBJECT_VERSION_NUMBER)
-		errx(1, "\"%s\" is an incompatible version %hhu object file",
+		errx(1, "\"%s\" is an incompatible version %u object file",
 		     fileName, versionNumber);
 
 	uint32_t revNum;