It seems the MSSP-patch didn't include the necessary includes. Add this to fix the errors:
Also, most of the other things: change the vars to size_t either at the beginning of the file or cast when comparing. And a bug. Here's a simple fix:
Code:
--- a/src/dg_scripts.c
+++ b/src/dg_scripts.c
@@ -2428,7 +2428,7 @@ static void dg_letter_value(struct script_data *sc, trig_d return;
}
- if (num > strlen(string)) {
+ if ((size_t)num > strlen(string)) {
script_log("Trigger #%d : dg_letter number > strlen!", GET_TRIG_VNUM(trig)) return;
}
diff --git a/src/spec_procs.c b/src/spec_procs.c
index 0b23149..d8006f9 100644
--- a/src/spec_procs.c
+++ b/src/spec_procs.c
@@ -100,7 +100,7 @@ void list_skills(struct char_data *ch)
{
const char *overflow = "\r\n**OVERFLOW**\r\n";
int i, sortpos, ret;
- size_t len = 0, nlen;
+ size_t len = 0;
char buf2[MAX_STRING_LENGTH];
len = snprintf(buf2, sizeof(buf2), "You have %d practice session%s remaining.\r\n"
@@ -111,9 +111,9 @@ void list_skills(struct char_data *ch)
i = spell_sort_info[sortpos];
if (GET_LEVEL(ch) >= spell_info[i].min_level[(int) GET_CLASS(ch)]) {
ret = snprintf(buf2 + len, sizeof(buf2) - len, "%-20s %s\r\n", spell_info[i].name, how_good(GET_SKILL(ch, i)));
- if (len + nlen >= sizeof(buf2) || ret < 0)
+ if (ret < 0 || len + ret >= sizeof(buf2))
break;
- len += nlen;
+ len += ret;
}
}
if (len >= sizeof(buf2))
diff --git a/src/genobj.c b/src/genobj.c
index 8dfcc6a..fb0efb4 100644
--- a/src/genobj.c
+++ b/src/genobj.c
@@ -482,7 +483,7 @@ int delete_object(obj_rnum rnum)
/* oset handling, this location should be temporary */
bool oset_alias(struct obj_data *obj, char * argument)
{
- static int max_len = 64;
+ static size_t max_len = 64;
int i = GET_OBJ_RNUM(obj);
skip_spaces(&argument);
@@ -553,7 +554,7 @@ bool oset_apply(struct obj_data *obj, char * argument)
bool oset_short_description(struct obj_data *obj, char * argument)
{
- static int max_len = 64;
+ static size_t max_len = 64;
int i = GET_OBJ_RNUM(obj);
skip_spaces(&argument);
@@ -571,7 +572,7 @@ bool oset_short_description(struct obj_data *obj, char * arg
bool oset_long_description(struct obj_data *obj, char * argument)
{
- static int max_len = 128;
+ static size_t max_len = 128;
int i = GET_OBJ_RNUM(obj);
skip_spaces(&argument);
diff --git a/src/ibt.c b/src/ibt.c
index 10a81b5..6d30070 100755
--- a/src/ibt.c
+++ b/src/ibt.c
@@ -518,7 +518,7 @@ ACMD(do_ibt)
} else {
send_to_char(ch, "%s%s by %s%s\r\n",QCYN, ibt_types[subcmd], QYEL, ibtData->name);
- send_to_char(ch, "%sSubmitted: %s%s", QCYN, QYEL, ibtData->dated ? ctime(&ibtData->dated) : "Unknown\r\n");
+ send_to_char(ch, "%sSubmitted: %s%s", QCYN, QYEL, ibtData->dated ? ctime((const time_t*)&ibtData->dated) : "Unknown\r\n");
if (GET_LEVEL(ch) >= LVL_IMMORT) {
send_to_char(ch, "%sLevel: %s%d\r\n",QCYN, QYEL, ibtData->level);
send_to_char(ch, "%sRoom : %s%d\r\n",QCYN, QYEL, ibtData->room);
diff --git a/src/utils.c b/src/utils.c
index c0b8594..f63de1a 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -983,7 +983,8 @@ void char_from_furniture(struct char_data *ch)
*/
void column_list(struct char_data *ch, int num_cols, const char **list, int list_length, bool show_nums)
{
- int num_per_col, col_width,r,c,i, offset=0, len=0, temp_len, max_len=0;
+ size_t max_len = 0;
+ int num_per_col, col_width,r,c,i, offset=0, len=0, temp_len;
char buf[MAX_STRING_LENGTH];
/* Work out the longest list item */
@@ -1010,7 +1011,7 @@ void column_list(struct char_data *ch, int num_cols, const char **list, int list
if (show_nums) col_width-=4;
- if (col_width < max_len)
+ if (col_width < 0 || (size_t)col_width < max_len)
log("Warning: columns too narrow for correct output to %s in simple_column_list (utils.c)", GET_NAME(ch));
/* Calculate how many list items there should be per column */