VERS=1.0
CC?=gcc
-CCFLAGS+=-std=c99 -D _DEFAULT_SOURCE -Wall -Wpedantic -g
+CCFLAGS+=-std=c99 -D _DEFAULT_SOURCE -Wall -Wpedantic -Wextra -g
LIBS=
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
return GO_TERMINATE;
}
-static int inven(token_t obj)
+static int inven(void)
/* Inventory. If object, treat same as find. Else report on current burden. */
{
int spk=NO_CARRY;
case 16: /* TOSS */ return GO_UNKNOWN;
case 17: /* QUIT */ return quit(input);
case 18: /* FIND */ return GO_UNKNOWN;
- case 19: /* INVEN */ return inven(obj);
+ case 19: /* INVEN */ return inven();
case 20: /* FEED */ return GO_UNKNOWN;
case 21: /* FILL */ return fill(verb, obj);
case 22: /* BLAST */ return blast();
// Handle format specifiers (including the custom %C, %L, %S) by adjusting the parameter accordingly, and replacing the specifier with %s.
int pi = 0; // parameter index
- for (int i = 0; i < strlen(msg); ++i)
+ for (int i = 0; i < (int)strlen(msg); ++i)
{
if (msg[i] == '%')
{
{
copy[i + 1] = 's';
packed_to_token(PARMS[pi], parameters[pi]);
- for (int j = 0; j < strlen(parameters[pi]); ++j)
+ for (int j = 0; j < (int)strlen(parameters[pi]); ++j)
{
parameters[pi][j] = tolower(parameters[pi][j]);
}
{
copy[i + 1] = 's';
packed_to_token(PARMS[pi], parameters[pi]);
- for (int j = 0; j < strlen(parameters[pi]); ++j)
+ for (int j = 0; j < (int)strlen(parameters[pi]); ++j)
{
parameters[pi][j] = tolower(parameters[pi][j]);
}
Ninneman. Eric received Don Woods's encouragement to update and ship
the game; Jason signed on early in the process to help. The assistance
of Peje Nilsson in restructuring some particularly grotty gotos is
-gratefully acknowledged.
+gratefully acknowledged. Petr Voropaev contributed fuzz testing.
== Nomenclature ==
SETPRM(1,score,mxscor);
SETPRM(3,game.turns,game.turns);
RSPEAK(TOTAL_SCORE);
- for (long i=1; i<=CLSSES; i++) {
+ for (long i=1; i<=(long)CLSSES; i++) {
if(CVAL[i] >= score) {
newspeak(class_messages[i]);
i=CVAL[i]+1-score;