mirror of
https://github.com/tbamud/tbamud.git
synced 2025-12-23 10:40:13 +01:00
Merge pull request #13 from zlangley/warnings
Fix most compiler warnings and fix for OSX.
This commit is contained in:
commit
4e27091e57
6 changed files with 15 additions and 8 deletions
11
src/comm.c
11
src/comm.c
|
|
@ -669,8 +669,15 @@ static int get_max_players(void)
|
||||||
/* set the current to the maximum */
|
/* set the current to the maximum */
|
||||||
limit.rlim_cur = limit.rlim_max;
|
limit.rlim_cur = limit.rlim_max;
|
||||||
if (setrlimit(RLIMIT_NOFILE, &limit) < 0) {
|
if (setrlimit(RLIMIT_NOFILE, &limit) < 0) {
|
||||||
perror("SYSERR: calling setrlimit");
|
#if defined(__APPLE__) && defined(RLIMIT_NOFILE) && defined(OPEN_MAX)
|
||||||
exit(1);
|
/* On OS X, setting rlim_cur above OPEN_MAX fails, so try again
|
||||||
|
* with OPEN_MAX. */
|
||||||
|
limit.rlim_cur = OPEN_MAX;
|
||||||
|
#endif
|
||||||
|
if (setrlimit(RLIMIT_NOFILE, &limit) < 0) {
|
||||||
|
perror("SYSERR: calling setrlimit");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#ifdef RLIM_INFINITY
|
#ifdef RLIM_INFINITY
|
||||||
if (limit.rlim_max == RLIM_INFINITY)
|
if (limit.rlim_max == RLIM_INFINITY)
|
||||||
|
|
|
||||||
|
|
@ -207,7 +207,7 @@ static void hedit_disp_menu(struct descriptor_data *d)
|
||||||
void hedit_parse(struct descriptor_data *d, char *arg)
|
void hedit_parse(struct descriptor_data *d, char *arg)
|
||||||
{
|
{
|
||||||
char buf[MAX_STRING_LENGTH];
|
char buf[MAX_STRING_LENGTH];
|
||||||
char *oldtext = '\0';
|
char *oldtext = "";
|
||||||
int number;
|
int number;
|
||||||
|
|
||||||
switch (OLC_MODE(d)) {
|
switch (OLC_MODE(d)) {
|
||||||
|
|
|
||||||
|
|
@ -971,7 +971,7 @@ void mag_rooms(int level, struct char_data *ch, int spellnum)
|
||||||
room_rnum rnum;
|
room_rnum rnum;
|
||||||
int duration;
|
int duration;
|
||||||
bool failure = FALSE;
|
bool failure = FALSE;
|
||||||
event_id IdNum = -1;
|
event_id IdNum = eNULL;
|
||||||
const char *msg = NULL;
|
const char *msg = NULL;
|
||||||
const char *room = NULL;
|
const char *room = NULL;
|
||||||
|
|
||||||
|
|
@ -995,7 +995,7 @@ void mag_rooms(int level, struct char_data *ch, int spellnum)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (failure || (event_id)IdNum == -1) {
|
if (failure || IdNum == eNULL) {
|
||||||
send_to_char(ch, "You failed!\r\n");
|
send_to_char(ch, "You failed!\r\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -474,7 +474,7 @@ void page_string(struct descriptor_data *d, char *str, int keep_internal)
|
||||||
if (!str || !*str)
|
if (!str || !*str)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ((GET_PAGE_LENGTH(d->character) < 5 || GET_PAGE_LENGTH(d->character) > 255))
|
if (GET_PAGE_LENGTH(d->character) < 5)
|
||||||
GET_PAGE_LENGTH(d->character) = PAGE_LENGTH;
|
GET_PAGE_LENGTH(d->character) = PAGE_LENGTH;
|
||||||
d->showstr_count = count_pages(str, d->character);
|
d->showstr_count = count_pages(str, d->character);
|
||||||
CREATE(d->showstr_vector, char *, d->showstr_count);
|
CREATE(d->showstr_vector, char *, d->showstr_count);
|
||||||
|
|
|
||||||
|
|
@ -1184,7 +1184,8 @@ static int Crash_load_objs(struct char_data *ch) {
|
||||||
int i, num_of_days, orig_rent_code, num_objs=0;
|
int i, num_of_days, orig_rent_code, num_objs=0;
|
||||||
unsigned long cost;
|
unsigned long cost;
|
||||||
struct obj_data *cont_row[MAX_BAG_ROWS];
|
struct obj_data *cont_row[MAX_BAG_ROWS];
|
||||||
int rentcode,timed,netcost,gold,account,nitems;
|
int rentcode = RENT_UNDEF;
|
||||||
|
int timed,netcost,gold,account,nitems;
|
||||||
obj_save_data *loaded, *current;
|
obj_save_data *loaded, *current;
|
||||||
|
|
||||||
if (!get_filename(filename, sizeof(filename), CRASH_FILE, GET_NAME(ch)))
|
if (!get_filename(filename, sizeof(filename), CRASH_FILE, GET_NAME(ch)))
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,6 @@
|
||||||
#endif
|
#endif
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include "protocol.h"
|
#include "protocol.h"
|
||||||
#include <malloc.h>
|
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
The following section is for Diku/Merc derivatives. Replace as needed.
|
The following section is for Diku/Merc derivatives. Replace as needed.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue