shithub: choc

Download patch

ref: f447ae17ddefc64f2bc803b5c3c81dceb7b59c68
parent: 3524a67dd3c7d48a172c83d3ae170a7176fb3cfa
parent: 77ab2ad364c5e93221a5ead1ec163a59aebf1e61
author: Fabian Greffrath <[email protected]>
date: Wed Aug 18 11:45:14 EDT 2021

Merge pull request #1385 from jrtc27/cheri

Fixes to support CHERI/Morello

--- a/src/doom/r_plane.c
+++ b/src/doom/r_plane.c
@@ -371,15 +371,15 @@
 				
 #ifdef RANGECHECK
     if (ds_p - drawsegs > MAXDRAWSEGS)
-	I_Error ("R_DrawPlanes: drawsegs overflow (%" PRIiPTR ")",
+	I_Error ("R_DrawPlanes: drawsegs overflow (%td)",
 		 ds_p - drawsegs);
     
     if (lastvisplane - visplanes > MAXVISPLANES)
-	I_Error ("R_DrawPlanes: visplane overflow (%" PRIiPTR ")",
+	I_Error ("R_DrawPlanes: visplane overflow (%td)",
 		 lastvisplane - visplanes);
     
     if (lastopening - openings > MAXOPENINGS)
-	I_Error ("R_DrawPlanes: opening overflow (%" PRIiPTR ")",
+	I_Error ("R_DrawPlanes: opening overflow (%td)",
 		 lastopening - openings);
 #endif
 
--- a/src/heretic/r_plane.c
+++ b/src/heretic/r_plane.c
@@ -386,13 +386,13 @@
 
 #ifdef RANGECHECK
     if (ds_p - drawsegs > MAXDRAWSEGS)
-        I_Error("R_DrawPlanes: drawsegs overflow (%" PRIiPTR ")",
+        I_Error("R_DrawPlanes: drawsegs overflow (%td)",
                 ds_p - drawsegs);
     if (lastvisplane - visplanes > MAXVISPLANES)
-        I_Error("R_DrawPlanes: visplane overflow (%" PRIiPTR ")",
+        I_Error("R_DrawPlanes: visplane overflow (%td)",
                 lastvisplane - visplanes);
     if (lastopening - openings > MAXOPENINGS)
-        I_Error("R_DrawPlanes: opening overflow (%" PRIiPTR ")",
+        I_Error("R_DrawPlanes: opening overflow (%td)",
                 lastopening - openings);
 #endif
 
--- a/src/hexen/r_plane.c
+++ b/src/hexen/r_plane.c
@@ -390,17 +390,17 @@
 #ifdef RANGECHECK
     if (ds_p - drawsegs > MAXDRAWSEGS)
     {
-        I_Error("R_DrawPlanes: drawsegs overflow (%" PRIiPTR ")",
+        I_Error("R_DrawPlanes: drawsegs overflow (%td)",
                 ds_p - drawsegs);
     }
     if (lastvisplane - visplanes > MAXVISPLANES)
     {
-        I_Error("R_DrawPlanes: visplane overflow (%" PRIiPTR ")",
+        I_Error("R_DrawPlanes: visplane overflow (%td)",
                 lastvisplane - visplanes);
     }
     if (lastopening - openings > MAXOPENINGS)
     {
-        I_Error("R_DrawPlanes: opening overflow (%" PRIiPTR ")",
+        I_Error("R_DrawPlanes: opening overflow (%td)",
                 lastopening - openings);
     }
 #endif
--- a/src/i_system.c
+++ b/src/i_system.c
@@ -342,7 +342,7 @@
 
     if (size != 0 && new_ptr == NULL)
     {
-        I_Error ("I_Realloc: failed on reallocation of %" PRIuPTR " bytes", size);
+        I_Error ("I_Realloc: failed on reallocation of %zu bytes", size);
     }
 
     return new_ptr;
--- a/src/m_misc.c
+++ b/src/m_misc.c
@@ -424,7 +424,7 @@
 
     if (result == NULL)
     {
-        I_Error("Failed to duplicate string (length %" PRIuPTR ")\n",
+        I_Error("Failed to duplicate string (length %zu)\n",
                 strlen(orig));
     }
 
--- a/src/setup/multiplayer.c
+++ b/src/setup/multiplayer.c
@@ -394,8 +394,8 @@
     const iwad_t *iwad;
     char buf[10];
     int episodes;
-    intptr_t x, y;
-    intptr_t l;
+    int x, y;
+    int l;
     int i;
 
     window = TXT_NewWindow("Select level");
@@ -424,10 +424,10 @@
                 }
 
                 M_snprintf(buf, sizeof(buf),
-                           " E%" PRIiPTR "M%" PRIiPTR " ", x, y);
+                           " E%dM%d ", x, y);
                 button = TXT_NewButton(buf);
                 TXT_SignalConnect(button, "pressed",
-                                  SetExMyWarp, (void *) (x * 10 + y));
+                                  SetExMyWarp, (void *) (intptr_t) (x * 10 + y));
                 TXT_SignalConnect(button, "pressed",
                                   CloseLevelSelectDialog, window);
                 TXT_AddWidget(window, button);
@@ -456,10 +456,10 @@
                 continue;
             }
 
-            M_snprintf(buf, sizeof(buf), " MAP%02" PRIiPTR " ", l);
+            M_snprintf(buf, sizeof(buf), " MAP%02d ", l);
             button = TXT_NewButton(buf);
             TXT_SignalConnect(button, "pressed", 
-                              SetMAPxyWarp, (void *) l);
+                              SetMAPxyWarp, (void *) (intptr_t) l);
             TXT_SignalConnect(button, "pressed",
                               CloseLevelSelectDialog, window);
             TXT_AddWidget(window, button);
--- a/src/strife/r_plane.c
+++ b/src/strife/r_plane.c
@@ -369,15 +369,15 @@
 				
 #ifdef RANGECHECK
     if (ds_p - drawsegs > MAXDRAWSEGS)
-	I_Error ("R_DrawPlanes: drawsegs overflow (%" PRIiPTR ")",
+	I_Error ("R_DrawPlanes: drawsegs overflow (%td)",
 		 ds_p - drawsegs);
     
     if (lastvisplane - visplanes > MAXVISPLANES)
-	I_Error ("R_DrawPlanes: visplane overflow (%" PRIiPTR ")",
+	I_Error ("R_DrawPlanes: visplane overflow (%td)",
 		 lastvisplane - visplanes);
     
     if (lastopening - openings > MAXOPENINGS)
-	I_Error ("R_DrawPlanes: opening overflow (%" PRIiPTR ")",
+	I_Error ("R_DrawPlanes: opening overflow (%td)",
 		 lastopening - openings);
 #endif
 
--- a/textscreen/fonts/Makefile.am
+++ b/textscreen/fonts/Makefile.am
@@ -6,13 +6,13 @@
 if HAVE_FONTS
 
 small.h: small.png convert-font
-	./convert-font small small.png small.h
+	$(srcdir)/convert-font small small.png small.h
 
 normal.h: normal.png convert-font
-	./convert-font normal normal.png normal.h
+	$(srcdir)/convert-font normal normal.png normal.h
 
 large.h: large.png convert-font
-	./convert-font large large.png large.h
+	$(srcdir)/convert-font large large.png large.h
 
 endif