Skip to content

Instantly share code, notes, and snippets.

@jonm
jonm / shop-keeper-return-value.txt
Created October 4, 2015 01:34
the `shop_keeper` function is missing return values
[~/src/SillyMUD/src]$ make
gcc -g -DIMPL_SECURITY -DNEW_RENT -DLEVEL_LOSS -DNEWEXP -DGROUP_NAMES -DIMPL_SECURITY -DNEW_RENT -DLEVEL_LOSS -DNEWEXP -DGROUP_NAMES -c -o shop.o shop.c
...
shop.c:583:5: error: non-void function 'shop_keeper' should return a value
[-Wreturn-type]
return;
^
shop.c:588:5: error: non-void function 'shop_keeper' should return a value
[-Wreturn-type]
return;
@jonm
jonm / shop_keeper.c
Created October 4, 2015 01:40
the `shop_keeper` function from `shop.c` is missing some return values
int shop_keeper(struct char_data *ch, int cmd, char *arg, char *mob, int type)
{
char argm[100], buf[MAX_STRING_LENGTH];
struct char_data *temp_char;
struct char_data *keeper;
int shop_nr;
int citizen(struct char_data *ch, int cmd, char *arg, struct char_data *mob, int type);
if(type == EVENT_DWARVES_STRIKE) {
@jonm
jonm / mobact-return-value.txt
Created October 4, 2015 01:47
the `AssistFriend` function has a missing return value
[~/src/SillyMUD/src]$ make
gcc -g -DIMPL_SECURITY -DNEW_RENT -DLEVEL_LOSS -DNEWEXP -DGROUP_NAMES -DIMPL_SECURITY -DNEW_RENT -DLEVEL_LOSS -DNEWEXP -DGROUP_NAMES -c -o mobact.o mobact.c
...
mobact.c:452:5: error: non-void function 'AssistFriend' should return a value
[-Wreturn-type]
return;
^
...
6 warnings and 1 error generated.
make: *** [mobact.o] Error 1
@jonm
jonm / fight-c-return-value.txt
Created October 4, 2015 01:52
the function `DamageMessages` is missing some return values
[~/src/SillyMUD/src]$ make
gcc -g -DIMPL_SECURITY -DNEW_RENT -DLEVEL_LOSS -DNEWEXP -DGROUP_NAMES -DIMPL_SECURITY -DNEW_RENT -DLEVEL_LOSS -DNEWEXP -DGROUP_NAMES -c -o fight.o fight.c
...
fight.c:1048:33: error: non-void function 'DamageMessages' should return a value
[-Wreturn-type]
if (attacktype == SKILL_KICK) return; /* filter out kicks,
^
fight.c:1144:11: error: non-void function 'DamageMessages' should return a value
[-Wreturn-type]
return;
@jonm
jonm / bank-return-value.txt
Created October 4, 2015 02:00
the `bank` function in `spec_procs.c` is missing a return value
gcc -g -DIMPL_SECURITY -DNEW_RENT -DLEVEL_LOSS -DNEWEXP -DGROUP_NAMES -DIMPL_SECURITY -DNEW_RENT -DLEVEL_LOSS -DNEWEXP -DGROUP_NAMES -c -o spec_procs.o spec_procs.c
...
spec_procs.c:3280:5: error: non-void function 'bank' should return a value [-Wreturn-type]
return;
^
...
30 warnings and 1 error generated.
make: *** [spec_procs.o] Error 1
@jonm
jonm / log-msg-extra-arg.txt
Created October 4, 2015 02:06
`log_msg()` is being called with an extra argument
[~/src/SillyMUD/src]$ make
gcc -g -DIMPL_SECURITY -DNEW_RENT -DLEVEL_LOSS -DNEWEXP -DGROUP_NAMES -DIMPL_SECURITY -DNEW_RENT -DLEVEL_LOSS -DNEWEXP -DGROUP_NAMES -c -o board.o board.c
...
board.c:387:19: error: too many arguments to function call, expected single
argument 'buf', have 2 arguments
log_msg(buf,0);
~~~~~~~ ^
./protos.h:1758:1: note: 'log_msg' declared here
void log_msg(char *buf);
^
@jonm
jonm / log-msg.c
Created October 4, 2015 02:08
definition of the `log_msg()` function
void log_msg (char *s) { log_sev(s, 1); } /*thought this was a prototype - heheh */
/* This is an excerpt from a DikuMUD-derived codebase. DikuMUD was created by Sebastian Hammer, Michael Seifert</a>,
Hans Henrik Stærfeldt, Tom Madsen, and Katja Nyboe. This code is subject to the DikuMud License, as found at
https://github.com/jonm/SillyMUD/blob/43344e6dc864de7518c2fc0dbf7b7cf14f5924a2/doc/license.doc
*/
@jonm
jonm / board-load-board.c
Created October 4, 2015 02:17
the `board_load_board()` function
void board_load_board() {
FILE *the_file;
int ind;
int bnum;
char buf[256];
memset(boards, 0, sizeof(boards)); /* Zero out the array, make sure no */
/* Funky pointers are left in the */
/* Allocated space */
@jonm
jonm / spec-procs2-return-value.txt
Created October 4, 2015 02:21
more missing return values in `spec_procs2.c`
gcc -g -DIMPL_SECURITY -DNEW_RENT -DLEVEL_LOSS -DNEWEXP -DGROUP_NAMES -DIMPL_SECURITY -DNEW_RENT -DLEVEL_LOSS -DNEWEXP -DGROUP_NAMES -c -o spec_procs2.o spec_procs2.c
...
spec_procs2.c:536:8: error: non-void function 'magic_user' should return a value [-Wreturn-type]
return;
^
spec_procs2.c:541:5: error: non-void function 'magic_user' should return a value [-Wreturn-type]
return;
^
...
spec_procs2.c:1871:8: error: non-void function 'MakeQuest' should return a value [-Wreturn-type]
@jonm
jonm / spec-procs3-return-value.txt
Created October 4, 2015 02:27
also missing a return value in `spec_procs3.c`
[~/src/SillyMUD/src]$ make
gcc -g -DIMPL_SECURITY -DNEW_RENT -DLEVEL_LOSS -DNEWEXP -DGROUP_NAMES -DIMPL_SECURITY -DNEW_RENT -DLEVEL_LOSS -DNEWEXP -DGROUP_NAMES -c -o spec_procs3.o spec_procs3.c
...
spec_procs3.c:806:5: error: non-void function 'turbo_lift' should return a value
[-Wreturn-type]
return;
^
...
5 warnings and 1 error generated.
make: *** [spec_procs3.o] Error 1