Mercurial > hg > early-roguelike
diff srogue/encumb.c @ 217:94a0d9dd5ce1
Super-Rogue: convert to ANSI-style function declarations.
This fixes most of the build warnings.
author | John "Elwin" Edwards |
---|---|
date | Sun, 31 Jan 2016 13:45:07 -0500 |
parents | 2128c7dc8a40 |
children |
line wrap: on
line diff
--- a/srogue/encumb.c Thu Jan 28 18:55:47 2016 -0500 +++ b/srogue/encumb.c Sun Jan 31 13:45:07 2016 -0500 @@ -10,14 +10,19 @@ * See the file LICENSE.TXT for full copyright and licensing information. */ +#include <string.h> #include "rogue.h" #include "rogue.ext" +int packweight(void); +int pack_vol(void); + /* * updpack: * Update his pack weight and adjust fooduse accordingly */ -updpack() +void +updpack(void) { reg int topcarry, curcarry; @@ -44,7 +49,8 @@ * packweight: * Get the total weight of the hero's pack */ -packweight() +int +packweight(void) { reg struct object *obj; reg struct linked_list *pc; @@ -72,8 +78,8 @@ * itemweight: * Get the weight of an object */ -itemweight(wh) -struct object *wh; +int +itemweight(struct object *wh) { reg int weight; @@ -97,7 +103,8 @@ * pack_vol: * Get the total volume of the hero's pack */ -pack_vol() +int +pack_vol(void) { reg struct object *obj; reg struct linked_list *pc; @@ -115,8 +122,8 @@ * itemvol: * Get the volume of an object */ -itemvol(wh) -struct object *wh; +int +itemvol(struct object *wh) { reg int volume, what, extra; @@ -139,9 +146,10 @@ * playenc: * Get hero's carrying ability above norm */ -playenc() +int +playenc(void) { - reg estr = him->s_ef.a_str; + reg int estr = him->s_ef.a_str; if (estr >= 24) return 3000; switch(him->s_ef.a_str) { @@ -174,7 +182,8 @@ * totalenc: * Get total weight that the hero can carry */ -totalenc() +int +totalenc(void) { reg int wtotal; @@ -192,8 +201,8 @@ * whgtchk: * See if the hero can carry his pack */ -wghtchk(fromfuse) -int fromfuse; +void +wghtchk(int fromfuse) { reg int dropchk, err = TRUE; reg char ch; @@ -231,7 +240,8 @@ * 0 hit for medium pack weight * -1 hit for heavy pack weight */ -hitweight() +int +hitweight(void) { return(2 - foodlev); }