diff --git a/mux/src/command.cpp b/mux/src/command.cpp index 717f3ed59..94b0affff 100644 --- a/mux/src/command.cpp +++ b/mux/src/command.cpp @@ -1131,7 +1131,7 @@ static UTF8 *hook_name(const UTF8 *pCommand, int key) static void process_cmdent(CMDENT *cmdp, UTF8 *switchp, dbref executor, dbref caller, dbref enactor, int eval, bool interactive, UTF8 *arg, UTF8 *unp_command, - UTF8 *cargs[], int ncargs) + const UTF8 *cargs[], int ncargs) { // Perform object type checks. // @@ -1168,7 +1168,6 @@ static void process_cmdent(CMDENT *cmdp, UTF8 *switchp, dbref executor, dbref ca UTF8 *args[MAX_ARG]; int nargs, i, interp, key, xkey, aflags; dbref aowner; - UTF8 *aargs[NUM_ENV_VARS]; ADDENT *add; ATTR *hk_ap2; @@ -1283,6 +1282,7 @@ static void process_cmdent(CMDENT *cmdp, UTF8 *switchp, dbref executor, dbref ca interp = 0; } + UTF8 *aargs[NUM_ENV_VARS]; int nargs2; switch (cmdp->callseq & CS_NARG_MASK) { @@ -1427,7 +1427,7 @@ static void process_cmdent(CMDENT *cmdp, UTF8 *switchp, dbref executor, dbref ca wait_que(add->thing, caller, executor, AttrTrace(aflags, 0), false, lta, NOTHING, 0, buff + iBuff, - NUM_ENV_VARS, aargs, + NUM_ENV_VARS, (const UTF8 **)aargs, mudstate.global_regs); for (i = 0; i < NUM_ENV_VARS; i++) @@ -1671,7 +1671,7 @@ UTF8 *process_command int eval, bool interactive, UTF8 *arg_command, - UTF8 *args[], + const UTF8 *args[], int nargs ) { @@ -2543,7 +2543,7 @@ UTF8 *process_command UTF8 *errbufc = errbuff; mux_exec(errtext, LBUF_SIZE-1, errbuff, &errbufc, mudconf.global_error_obj, caller, enactor, AttrTrace(aflags, EV_EVAL|EV_FCHECK|EV_STRIP_CURLY|EV_TOP), - &pCommand, 1); + (const UTF8 **)&pCommand, 1); notify(executor, errbuff); free_lbuf(errtext); free_lbuf(errbuff); @@ -3973,7 +3973,7 @@ void do_list(dbref executor, dbref caller, dbref enactor, int eval, int extra, } void do_assert(dbref executor, dbref caller, dbref enactor, int eval, int key, - UTF8 *arg1, UTF8 *command, UTF8 *cargs[], int ncargs) + UTF8 *arg1, UTF8 *command, const UTF8 *cargs[], int ncargs) { UNUSED_PARAMETER(key); @@ -3993,7 +3993,7 @@ void do_assert(dbref executor, dbref caller, dbref enactor, int eval, int key, } void do_break(dbref executor, dbref caller, dbref enactor, int eval, int key, - UTF8 *arg1, UTF8 *command, UTF8 *cargs[], int ncargs) + UTF8 *arg1, UTF8 *command, const UTF8 *cargs[], int ncargs) { UNUSED_PARAMETER(key); diff --git a/mux/src/command.h b/mux/src/command.h index 55e8749fa..197a41231 100644 --- a/mux/src/command.h +++ b/mux/src/command.h @@ -10,11 +10,11 @@ #define CMD_NO_ARG(name) extern void name(dbref executor, dbref caller, dbref enactor, int) #define CMD_ONE_ARG(name) extern void name(dbref executor, dbref caller, dbref enactor, int eval, int, UTF8 *) -#define CMD_ONE_ARG_CMDARG(name) extern void name(dbref executor, dbref caller, dbref enactor, int eval, int, UTF8 *, UTF8 *[], int) +#define CMD_ONE_ARG_CMDARG(name) extern void name(dbref executor, dbref caller, dbref enactor, int eval, int, UTF8 *, const UTF8 *[], int) #define CMD_TWO_ARG(name) extern void name(dbref executor, dbref caller, dbref enactor, int, int, UTF8 *, UTF8 *) -#define CMD_TWO_ARG_CMDARG(name) extern void name(dbref executor, dbref caller, dbref enactor, int eval, int, UTF8 *, UTF8 *, UTF8*[], int) +#define CMD_TWO_ARG_CMDARG(name) extern void name(dbref executor, dbref caller, dbref enactor, int eval, int, UTF8 *, UTF8 *, const UTF8*[], int) #define CMD_TWO_ARG_ARGV(name) extern void name(dbref executor, dbref caller, dbref enactor, int eval, int, UTF8 *, UTF8 *[], int) -#define CMD_TWO_ARG_ARGV_CMDARG(name) extern void name(dbref executor, dbref caller, dbref enactor, int eval, int, UTF8 *, UTF8 *[], int, UTF8*[], int) +#define CMD_TWO_ARG_ARGV_CMDARG(name) extern void name(dbref executor, dbref caller, dbref enactor, int eval, int, UTF8 *, UTF8 *[], int, const UTF8*[], int) /* Command function handlers */ /* from comsys.c */ @@ -189,7 +189,7 @@ typedef struct int extra; int callseq; int hookmask; - void (*handler)(dbref executor, dbref caller, dbref enactor, int eval, int, UTF8 *, UTF8 *[], int); + void (*handler)(dbref executor, dbref caller, dbref enactor, int eval, int, UTF8 *, const UTF8 *[], int); } CMDENT_ONE_ARG_CMDARG; typedef struct @@ -211,7 +211,7 @@ typedef struct int extra; int callseq; int hookmask; - void (*handler)(dbref executor, dbref caller, dbref enactor, int, int, UTF8 *, UTF8 *, UTF8*[], int); + void (*handler)(dbref executor, dbref caller, dbref enactor, int, int, UTF8 *, UTF8 *, const UTF8*[], int); } CMDENT_TWO_ARG_CMDARG; typedef struct @@ -234,7 +234,7 @@ typedef struct int callseq; int hookmask; void (*handler)(dbref executor, dbref caller, dbref enactor, int eval, int, - UTF8 *, UTF8 *[], int, UTF8*[], int); + UTF8 *, UTF8 *[], int, const UTF8*[], int); } CMDENT_TWO_ARG_ARGV_CMDARG; typedef struct addedentry ADDENT; diff --git a/mux/src/cque.cpp b/mux/src/cque.cpp index d2f7bd329..addf587c8 100644 --- a/mux/src/cque.cpp +++ b/mux/src/cque.cpp @@ -159,7 +159,7 @@ static void Task_RunQueueEntry(void *pEntry, int iUnused) CLinearTimeDelta ltdUsageBegin = GetProcessorUsage(); UTF8 *log_cmdbuf = process_command(executor, point->caller, - point->enactor, point->eval, false, cp, point->env, + point->enactor, point->eval, false, cp, (const UTF8 **)point->env, point->nargs); CLinearTimeAbsolute ltaEnd; @@ -693,7 +693,7 @@ static BQUE *setup_que int eval, UTF8 *command, int nargs, - UTF8 *args[], + const UTF8 *args[], reg_ref *sargs[] ) { @@ -845,7 +845,7 @@ void wait_que int attr, UTF8 *command, int nargs, - UTF8 *args[], + const UTF8 *args[], reg_ref *sargs[] ) { @@ -976,7 +976,7 @@ void do_wait int key, UTF8 *event, UTF8 *cmd, - UTF8 *cargs[], + const UTF8 *cargs[], int ncargs ) { diff --git a/mux/src/eval.cpp b/mux/src/eval.cpp index 8175297b6..aca3b41dc 100644 --- a/mux/src/eval.cpp +++ b/mux/src/eval.cpp @@ -718,7 +718,7 @@ TryAgain: // void parse_arglist( dbref executor, dbref caller, dbref enactor, UTF8 *dstr, int eval, UTF8 *fargs[], int nfargs, - UTF8 *cargs[], int ncargs, int *nArgsParsed ) + const UTF8 *cargs[], int ncargs, int *nArgsParsed ) { if (dstr == NULL) { @@ -760,7 +760,7 @@ void parse_arglist( dbref executor, dbref caller, dbref enactor, UTF8 *dstr, static const UTF8 *parse_arglist_lite( dbref executor, dbref caller, dbref enactor, const UTF8 *dstr, int eval, UTF8 *fargs[], - int nfargs, UTF8 *cargs[], int ncargs, + int nfargs, const UTF8 *cargs[], int ncargs, int *nArgsParsed) { if (NULL == dstr) @@ -1146,7 +1146,7 @@ void PopRegisters(reg_ref **p, int nNeeded) } void mux_exec( const UTF8 *pStr, size_t nStr, UTF8 *buff, UTF8 **bufc, dbref executor, - dbref caller, dbref enactor, int eval, UTF8 *cargs[], int ncargs) + dbref caller, dbref enactor, int eval, const UTF8 *cargs[], int ncargs) { if ( NULL == pStr || '\0' == pStr[0] @@ -1472,7 +1472,7 @@ void mux_exec( const UTF8 *pStr, size_t nStr, UTF8 *buff, UTF8 **bufc, dbref exe } mux_exec(tstr, LBUF_SIZE-1, buff, &oldp, i, executor, enactor, - AttrTrace(aflags, feval), fargs, nfargs); + AttrTrace(aflags, feval), (const UTF8 **)fargs, nfargs); if (ufp->flags & FN_PRES) { diff --git a/mux/src/externs.h b/mux/src/externs.h index 5a52638d9..59517ea0c 100644 --- a/mux/src/externs.h +++ b/mux/src/externs.h @@ -113,7 +113,7 @@ LBUF_OFFSET trimmed_name(dbref player, UTF8 cbuff[MBUF_SIZE], LBUF_OFFSET nMin, int nfy_que(dbref, int, int, int); int halt_que(dbref, dbref); void wait_que(dbref executor, dbref caller, dbref enactor, int, bool, - CLinearTimeAbsolute&, dbref, int, UTF8 *, int, UTF8 *[], reg_ref *[]); + CLinearTimeAbsolute&, dbref, int, UTF8 *, int, const UTF8 *[], reg_ref *[]); #ifndef WIN32 extern "C" char *crypt(const char *inptr, const char *inkey); @@ -124,10 +124,10 @@ extern bool break_called; void tcache_init(void); UTF8 *parse_to(UTF8 **, UTF8, int); void parse_arglist(dbref executor, dbref caller, dbref enactor, UTF8 *, - int, UTF8 *[], int, UTF8*[], int, int *); + int, UTF8 *[], int, const UTF8*[], int, int *); int get_gender(dbref); void mux_exec(const UTF8 *pdstr, size_t nStr, UTF8 *buff, UTF8 **bufc, dbref executor, - dbref caller, dbref enactor, int eval, UTF8 *cargs[], int ncargs); + dbref caller, dbref enactor, int eval, const UTF8 *cargs[], int ncargs); DCL_INLINE void BufAddRef(lbuf_ref *lbufref) { @@ -364,7 +364,7 @@ bool exit_visible(dbref, dbref, int); bool exit_displayable(dbref, dbref, int); void did_it(dbref player, dbref thing, int what, const UTF8 *def, int owhat, const UTF8 *odef, int awhat, int ctrl_flags, - UTF8 *args[], int nargs); + const UTF8 *args[], int nargs); bool bCanReadAttr(dbref executor, dbref target, ATTR *tattr, bool bParentCheck); bool bCanSetAttr(dbref executor, dbref target, ATTR *tattr); bool bCanLockAttr(dbref executor, dbref target, ATTR *tattr); @@ -432,7 +432,7 @@ bool quick_wild(const UTF8 *, const UTF8 *); bool check_access(dbref player, int mask); void set_prefix_cmds(void); UTF8 *process_command(dbref executor, dbref caller, dbref enactor, int, bool, - UTF8 *, UTF8 *[], int); + UTF8 *, const UTF8 *[], int); size_t LeftJustifyString(UTF8 *field, size_t nWidth, const UTF8 *value); size_t RightJustifyNumber(UTF8 *field, size_t nWidth, INT64 value, UTF8 chFill); diff --git a/mux/src/funceval.cpp b/mux/src/funceval.cpp index a33ea2486..05b0f8a90 100644 --- a/mux/src/funceval.cpp +++ b/mux/src/funceval.cpp @@ -1135,7 +1135,7 @@ FUNCTION(fun_zfun) } mux_exec(tbuf1, LBUF_SIZE-1, buff, bufc, zone, executor, enactor, AttrTrace(aflags, EV_EVAL|EV_STRIP_CURLY|EV_FCHECK), - &(fargs[1]), nfargs - 1); + (const UTF8 **)fargs + 1, nfargs - 1); free_lbuf(tbuf1); } @@ -2198,7 +2198,7 @@ FUNCTION(fun_hasattrp) static void default_handler(UTF8 *buff, UTF8 **bufc, dbref executor, dbref caller, dbref enactor, int eval, - UTF8 *fargs[], int nfargs, UTF8 *cargs[], + UTF8 *fargs[], int nfargs, const UTF8 *cargs[], int ncargs, int key) { // Evaluating the first argument. @@ -2258,7 +2258,7 @@ static void default_handler(UTF8 *buff, UTF8 **bufc, dbref executor, } mux_exec(atr_gotten, LBUF_SIZE-1, buff, bufc, thing, caller, enactor, - AttrTrace(aflags, EV_FCHECK|EV_EVAL), xargs, + AttrTrace(aflags, EV_FCHECK|EV_EVAL), (const UTF8 **)xargs, nxargs); for (i = 0; i < nxargs; i++) @@ -2751,7 +2751,7 @@ static int u_comp(ucomp_context *pctx, const void *s1, const void *s2) return 0; } - UTF8 *elems[2] = { (UTF8 *)s1, (UTF8 *)s2 }; + const UTF8 *elems[2] = { T(s1), T(s2) }; UTF8 *tbuf = alloc_lbuf("u_comp"); mux_strncpy(tbuf, pctx->buff, LBUF_SIZE-1); @@ -3054,8 +3054,7 @@ FUNCTION(fun_mix) } } - UTF8 empty[1] = ""; - UTF8 *os[NUM_ENV_VARS]; + const UTF8 *os[NUM_ENV_VARS]; bool bFirst = true; for ( int wc = 0; wc < nwords @@ -3077,7 +3076,7 @@ FUNCTION(fun_mix) os[i] = split_token(&cp[i], &sep); if (NULL == os[i]) { - os[i] = empty; + os[i] = T(""); } } mux_exec(atext, LBUF_SIZE-1, buff, bufc, thing, executor, enactor, @@ -3130,7 +3129,7 @@ FUNCTION(fun_step) UTF8 *cp = trim_space_sep(fargs[1], &isep); - UTF8 *os[NUM_ENV_VARS]; + const UTF8 *os[NUM_ENV_VARS]; bool bFirst = true; while ( cp && mudstate.func_invk_ctr < mudconf.func_invk_lim @@ -3186,7 +3185,7 @@ FUNCTION(fun_foreach) } UTF8 cbuf[5] = {'\0', '\0', '\0', '\0', '\0'}; - UTF8 *bp = cbuf; + const UTF8 *bp = cbuf; mux_string *sStr = new mux_string(fargs[1]); sStr->trim(); size_t nStr = sStr->length(); @@ -3380,7 +3379,7 @@ FUNCTION(fun_munge) // Call the u-function with the first list as %0. // UTF8 *rlist, *bp; - UTF8 *uargs[2]; + const UTF8 *uargs[2]; bp = rlist = alloc_lbuf("fun_munge"); uargs[0] = list1; diff --git a/mux/src/functions.cpp b/mux/src/functions.cpp index 5f94ebd47..438724b6c 100644 --- a/mux/src/functions.cpp +++ b/mux/src/functions.cpp @@ -340,7 +340,7 @@ bool delim_check dbref executor, dbref caller, dbref enactor, int eval, UTF8 *fargs[], int nfargs, - UTF8 *cargs[], int ncargs, + const UTF8 *cargs[], int ncargs, int sep_arg, SEP *sep, int dflags ) { @@ -2231,7 +2231,7 @@ static FUNCTION(fun_eval) static void do_ufun(UTF8 *buff, UTF8 **bufc, dbref executor, dbref caller, dbref enactor, UTF8 *fargs[], int nfargs, - UTF8 *cargs[], int ncargs, + const UTF8 *cargs[], int ncargs, bool is_local) { UNUSED_PARAMETER(caller); @@ -2260,7 +2260,7 @@ static void do_ufun(UTF8 *buff, UTF8 **bufc, dbref executor, dbref caller, // mux_exec(atext, LBUF_SIZE-1, buff, bufc, thing, executor, enactor, AttrTrace(aflags, EV_FCHECK|EV_EVAL), - &(fargs[1]), nfargs - 1); + (const UTF8 **)&(fargs[1]), nfargs - 1); free_lbuf(atext); // If we're evaluating locally, restore the preserved registers. @@ -6341,7 +6341,8 @@ static FUNCTION(fun_fold) // UTF8 *curr = fargs[1]; UTF8 *cp = curr; - UTF8 *result, *bp, *clist[2]; + UTF8 *result, *bp; + const UTF8 *clist[2]; // May as well handle first case now. // @@ -6760,7 +6761,7 @@ static void filter_handler(UTF8 *buff, UTF8 **bufc, dbref executor, dbref enacto // Process optional arguments %1-%9. // - UTF8 *filter_args[10]; + const UTF8 *filter_args[NUM_ENV_VARS]; int filter_nargs = 1; for (int iArg = 4; iArg < nfargs; iArg++) { @@ -6870,7 +6871,7 @@ static FUNCTION(fun_map) // Process optional arguments %1-%9. // - UTF8 *map_args[10]; + const UTF8 *map_args[NUM_ENV_VARS]; int map_nargs = 1; for (int iArg = 4; iArg < nfargs; iArg++) { @@ -7068,7 +7069,7 @@ static void switch_handler dbref executor, dbref caller, dbref enactor, int eval, UTF8 *fargs[], int nfargs, - UTF8 *cargs[], int ncargs, + const UTF8 *cargs[], int ncargs, bool bSwitch ) { @@ -8593,7 +8594,7 @@ static FUNCTION(fun_error) UTF8 *errbufc = errbuff; if (nfargs == 1) { - UTF8 *arg = fargs[0]; + const UTF8 *arg = fargs[0]; mux_exec(errtext, LBUF_SIZE-1, errbuff, &errbufc, mudconf.global_error_obj, caller, enactor, AttrTrace(aflags, EV_EVAL|EV_FCHECK|EV_STRIP_CURLY), &arg, 1); } diff --git a/mux/src/functions.h b/mux/src/functions.h index e192677d9..a5dbe357c 100644 --- a/mux/src/functions.h +++ b/mux/src/functions.h @@ -14,8 +14,8 @@ typedef struct tagFun { const UTF8 *name; // function name void (*fun)(UTF8 *buff, UTF8 **bufc, dbref executor, dbref caller, - dbref enactor, int eval, UTF8 *fargs[], int nfargs, UTF8 *cargs[], - int ncargs); // handler + dbref enactor, int eval, UTF8 *fargs[], int nfargs, + const UTF8 *cargs[], int ncargs); // handler int maxArgsParsed;// Maximum number of arguments parsed. int minArgs; // Minimum number of args needed or expected int maxArgs; // Maximum number of arguments permitted @@ -75,7 +75,7 @@ bool delim_check dbref executor, dbref caller, dbref enactor, int eval, UTF8 *fargs[], int nfargs, - UTF8 *cargs[], int ncargs, + const UTF8 *cargs[], int ncargs, int sep_arg, SEP *sep, int dflags ); @@ -92,7 +92,7 @@ int countwords(UTF8 *str, SEP *psep); #define FUNCTION(x) \ void x(UTF8 *buff, UTF8 **bufc, dbref executor, dbref caller, \ dbref enactor, int eval, UTF8 *fargs[], int nfargs, \ - UTF8 *cargs[], int ncargs) + const UTF8 *cargs[], int ncargs) // This is for functions that take an optional delimiter character. // @@ -102,7 +102,7 @@ int countwords(UTF8 *str, SEP *psep); #define XFUNCTION(x) void x(UTF8 *buff, UTF8 **bufc, dbref executor, \ dbref caller, dbref enactor, int eval, UTF8 *fargs[], int nfargs, \ - UTF8 *cargs[], int ncargs) + const UTF8 *cargs[], int ncargs) // Interface for adding additional hardcode functions. // diff --git a/mux/src/game.cpp b/mux/src/game.cpp index c7f5e2378..d191d6647 100644 --- a/mux/src/game.cpp +++ b/mux/src/game.cpp @@ -319,7 +319,7 @@ static int atr_match1 wait_que(thing, player, player, AttrTrace(aflags, 0), false, lta, NOTHING, 0, s, - NUM_ENV_VARS, args, + NUM_ENV_VARS, (const UTF8 **)args, mudstate.global_regs); for (int i = 0; i < NUM_ENV_VARS; i++) @@ -657,7 +657,6 @@ void notify_check(dbref target, dbref sender, const mux_string &msg, int key) mux_string *msgFinal = new mux_string; UTF8 *tp; UTF8 *prefix; - UTF8 *args[NUM_ENV_VARS]; dbref aowner, recip, obj; int i, nargs, aflags; FWDLIST *fp; @@ -785,6 +784,7 @@ void notify_check(dbref target, dbref sender, const mux_string &msg, int key) UTF8 *msgPlain = alloc_lbuf("notify_check.plain"); msg.export_TextPlain(msgPlain); bool pass_listen = false; + UTF8 *args[NUM_ENV_VARS]; nargs = 0; if ( check_listens && (key & (MSG_ME | MSG_INV_L)) @@ -824,14 +824,16 @@ void notify_check(dbref target, dbref sender, const mux_string &msg, int key) mudstate.nHearNest++; if (sender != target) { - did_it(sender, target, 0, NULL, 0, NULL, A_AHEAR, 0, args, nargs); + did_it( sender, target, 0, NULL, 0, NULL, A_AHEAR, 0, + (const UTF8 **)args, nargs); } else { - did_it(sender, target, 0, NULL, 0, NULL, A_AMHEAR, 0, args, - nargs); + did_it( sender, target, 0, NULL, 0, NULL, A_AMHEAR, 0, + (const UTF8 **)args, nargs); } - did_it(sender, target, 0, NULL, 0, NULL, A_AAHEAR, 0, args, nargs); + did_it( sender, target, 0, NULL, 0, NULL, A_AAHEAR, 0, + (const UTF8 **)args, nargs); mudstate.nHearNest--; } diff --git a/mux/src/look.cpp b/mux/src/look.cpp index 612f7df4e..1370b1d66 100644 --- a/mux/src/look.cpp +++ b/mux/src/look.cpp @@ -480,7 +480,7 @@ static void look_exits(dbref player, dbref loc, const UTF8 *exit_name) mux_exec(ExitFormat, LBUF_SIZE-1, FormatOutput, &tPtr, loc, player, player, AttrTrace(aflags, EV_FCHECK|EV_EVAL|EV_TOP), - &VisibleObjectList, 1); + (const UTF8 **)&VisibleObjectList, 1); restore_global_regs(preserve); PopRegisters(preserve, MAX_GLOBAL_REGS); @@ -647,7 +647,7 @@ static void look_contents(dbref player, dbref loc, const UTF8 *contents_name, in UTF8 *FormatOutput = alloc_lbuf("look_contents.FO"); tPtr = FormatOutput; - UTF8* ParameterList[] = + const UTF8 *ParameterList[] = { VisibleObjectList, ContentsNameScratch }; reg_ref **preserve = NULL; @@ -1044,7 +1044,7 @@ static bool show_a_desc(dbref player, dbref loc) safe_str(cattr->name, attrname, &cp); *cp = '\0'; - UTF8* ParameterList[] = + const UTF8 *ParameterList[] = { temp, attrname }; mux_exec(DescFormat, LBUF_SIZE-1, FormatOutput, &tPtr, loc, player, player, diff --git a/mux/src/netcommon.cpp b/mux/src/netcommon.cpp index 643b36c46..429e01948 100644 --- a/mux/src/netcommon.cpp +++ b/mux/src/netcommon.cpp @@ -1189,8 +1189,6 @@ void announce_disconnect(dbref player, DESC *d, const UTF8 *reason) dbref aowner, zone, obj; int aflags; size_t nLen; - UTF8 *argv[1]; - argv[0] = (UTF8 *)reason; CLinearTimeAbsolute lta; atr_pget_str_LEN(buf, player, A_ADISCONNECT, &aowner, &aflags, &nLen); if (nLen) @@ -1199,13 +1197,13 @@ void announce_disconnect(dbref player, DESC *d, const UTF8 *reason) wait_que(player, player, mudstate.curr_enactor, AttrTrace(aflags, 0), false, lta, NOTHING, 0, buf, - 1, argv, + 1, &reason, NULL); #else wait_que(player, player, player, AttrTrace(aflags, 0), false, lta, NOTHING, 0, buf, - 1, argv, + 1, &reason, NULL); #endif // FIRANMUX } diff --git a/mux/src/predicates.cpp b/mux/src/predicates.cpp index 44b65609c..6ece6dc41 100644 --- a/mux/src/predicates.cpp +++ b/mux/src/predicates.cpp @@ -662,16 +662,11 @@ void handle_ears(dbref thing, bool could_hear, bool can_hear) // void do_switch ( - dbref executor, - dbref caller, - dbref enactor, - int eval, - int key, + dbref executor, dbref caller, dbref enactor, + int eval, int key, UTF8 *expr, - UTF8 *args[], - int nargs, - UTF8 *cargs[], - int ncargs + UTF8 *args[], int nargs, + const UTF8 *cargs[], int ncargs ) { if ( !expr @@ -765,16 +760,11 @@ void do_switch // void do_if ( - dbref player, - dbref caller, - dbref enactor, - int eval, - int key, + dbref player, dbref caller, dbref enactor, + int eval, int key, UTF8 *expr, - UTF8 *args[], - int nargs, - UTF8 *cargs[], - int ncargs + UTF8 *args[], int nargs, + const UTF8 *cargs[], int ncargs ) { UNUSED_PARAMETER(key); @@ -1228,7 +1218,7 @@ void handle_prog(DESC *d, UTF8 *message) wait_que(d->program_data->wait_enactor, d->player, d->player, AttrTrace(aflags, 0), false, lta, NOTHING, 0, cmd, - 1, &message, + 1, (const UTF8 **)&message, d->program_data->wait_regs); // First, set 'all' to a descriptor we find for this player. @@ -2341,7 +2331,7 @@ bool exit_displayable(dbref exit, dbref player, int key) void did_it(dbref player, dbref thing, int what, const UTF8 *def, int owhat, const UTF8 *odef, int awhat, int ctrl_flags, - UTF8 *args[], int nargs) + const UTF8 *args[], int nargs) { if (MuxAlarm.bAlarmed) { @@ -2741,7 +2731,7 @@ void do_verb(dbref executor, dbref caller, dbref enactor, int eval, int key, // Go do it. // did_it(actor, victim, what, whatd, owhat, owhatd, awhat, - key & VERB_NONAME, xargs, nxargs); + key & VERB_NONAME, (const UTF8 **)xargs, nxargs); // Free user args. // diff --git a/mux/src/set.cpp b/mux/src/set.cpp index 57cdb481c..c41ac72e2 100644 --- a/mux/src/set.cpp +++ b/mux/src/set.cpp @@ -1951,7 +1951,7 @@ void do_trigger(dbref executor, dbref caller, dbref enactor, int eval, int key, notify_quiet(executor, NOPERM_MESSAGE); return; } - did_it(executor, thing, 0, NULL, 0, NULL, pattr->number, 0, argv, nargs); + did_it(executor, thing, 0, NULL, 0, NULL, pattr->number, 0, (const UTF8 **)argv, nargs); if (key & TRIG_NOTIFY) { diff --git a/mux/src/speech.cpp b/mux/src/speech.cpp index e43ccfb6b..5e84c2a28 100644 --- a/mux/src/speech.cpp +++ b/mux/src/speech.cpp @@ -34,7 +34,7 @@ UTF8 *modSpeech(dbref player, UTF8 *message, bool bWhich, UTF8 *command) UTF8 *new_message = alloc_lbuf("modspeech"); UTF8 *t_ptr = new_message; - UTF8 *args[2]; + const UTF8 *args[2]; args[0] = message; args[1] = command; mux_exec(mod, LBUF_SIZE-1, new_message, &t_ptr, player, player, player, diff --git a/mux/src/walkdb.cpp b/mux/src/walkdb.cpp index 84c493c7e..89d89968e 100644 --- a/mux/src/walkdb.cpp +++ b/mux/src/walkdb.cpp @@ -18,8 +18,8 @@ // Cmds run in low-prio Q after a 1 sec delay for the first one. // static void bind_and_queue(dbref executor, dbref caller, dbref enactor, - int eval, UTF8 *action, UTF8 *argstr, UTF8 *cargs[], - int ncargs, int number) + int eval, UTF8 *action, UTF8 *argstr, + const UTF8 *cargs[], int ncargs, int number) { UTF8 *command = replace_tokens(action, argstr, mux_ltoa_t(number), NULL); CLinearTimeAbsolute lta; @@ -37,7 +37,7 @@ static void bind_and_queue(dbref executor, dbref caller, dbref enactor, // and /delimit allows specification of a delimiter. // void do_dolist(dbref executor, dbref caller, dbref enactor, int eval, int key, - UTF8 *list, UTF8 *command, UTF8 *cargs[], int ncargs) + UTF8 *list, UTF8 *command, const UTF8 *cargs[], int ncargs) { if (!list || *list == '\0') { @@ -1149,7 +1149,7 @@ void do_markall(dbref executor, dbref caller, dbref enactor, int key) // do_apply_marked: Perform a command for each marked obj in the db. // void do_apply_marked( dbref executor, dbref caller, dbref enactor, int eval, - int key, UTF8 *command, UTF8 *cargs[], int ncargs) + int key, UTF8 *command, const UTF8 *cargs[], int ncargs) { UNUSED_PARAMETER(eval); UNUSED_PARAMETER(key); diff --git a/mux/src/wiz.cpp b/mux/src/wiz.cpp index eaf6d4dd9..2dc252898 100644 --- a/mux/src/wiz.cpp +++ b/mux/src/wiz.cpp @@ -266,7 +266,7 @@ void do_teleport // do_force_prefixed: Interlude to do_force for the # command // void do_force_prefixed( dbref executor, dbref caller, dbref enactor, int eval, - int key, UTF8 *command, UTF8 *args[], int nargs ) + int key, UTF8 *command, const UTF8 *args[], int nargs ) { UTF8 *cp = parse_to(&command, ' ', 0); if (!command) @@ -287,7 +287,7 @@ void do_force_prefixed( dbref executor, dbref caller, dbref enactor, int eval, // do_force: Force an object to do something. // void do_force( dbref executor, dbref caller, dbref enactor, int eval, int key, - UTF8 *what, UTF8 *command, UTF8 *args[], int nargs ) + UTF8 *what, UTF8 *command, const UTF8 *args[], int nargs ) { UNUSED_PARAMETER(enactor); UNUSED_PARAMETER(key);