diff srogue/rip.c @ 306:057c5114e244

Super-Rogue: fix some out-of-range constants. Constants K_ARROW etc., for causes of death other than monsters, are in the 240-255 range. They were often passed to functions taking char, which is usually signed, making the values out of range. The function declarations have been changed to unsigned char, which is also the type used by the scoreboard code.
author John "Elwin" Edwards
date Sat, 17 Apr 2021 15:41:12 -0400
parents e52a8a7ad4c5
children
line wrap: on
line diff
--- a/srogue/rip.c	Thu Apr 15 20:55:34 2021 -0400
+++ b/srogue/rip.c	Sat Apr 17 15:41:12 2021 -0400
@@ -61,7 +61,7 @@
 
 #include <time.h>
 void
-death(char monst)
+death(unsigned char monst)
 {
 	reg char *killer;
 	int dp;
@@ -122,7 +122,7 @@
  *	Figure score and post it.
  */
 void
-score(int amount, int aflag, char monst)
+score(int amount, int aflag, unsigned char monst)
 {
 	reg struct sc_ent *scp, *sc2;
 	reg int i, prflags = 0;
@@ -219,7 +219,7 @@
 	showtop(prflags);		/* print top ten list */
 }
 
-void writelog(int amount, int aflag, char monst)
+void writelog(int amount, int aflag, unsigned char monst)
 {
 	char logmessage[220], ltemp[80], mlev[40];
 	char *killer;