[COMPILING] Prompt system

From: Tharin2002 (Tharin2002@AOL.COM)
Date: 04/02/98


I patched, by hand, the new_prompt.diff file from circlemuds ftp site. When I
compiled it, under windows with MSVC 4.0,  I got the following warnings and
errors from act.other.c:

*snip*

        cl -c /nologo /I. /IC:\MSDEV\INCLUDE act.other.c
act.other.c
act.other.c(727) : warning C4022: 'free' : pointer mismatch for actual
parameter
 1
act.other.c(728) : warning C4047: '=' : 'int ' differs in levels of
indirection
from 'char *'
act.other.c(728) : error C2106: '=' : left operand must be l-value
act.other.c(739) : warning C4047: ':' : 'int ' differs in levels of
indirection
from 'char [3]'
act.other.c(747) : warning C4022: 'free' : pointer mismatch for actual
parameter
 1
act.other.c(748) : warning C4047: '=' : 'int ' differs in levels of
indirection
from 'char *'
act.other.c(748) : error C2106: '=' : left operand must be l-value
NMAKE : fatal error U1077: 'cl' : return code '0x2'
Stop.

*snip*

Here is the section of code that the errors and warnings point to:

*snip*

  if (GET_PROMPT(ch))
    free(GET_PROMPT(ch));
  GET_PROMPT(ch) = str_dup(def_prompts[i][1]);

  sprintf(buf, "Set your prompt to the %s preset prompt.\r\n",
def_prompts[i][0]);
  send_to_char(buf, ch);
}


ACMD(do_prompt) {
  skip_spaces(&argument);

  if (!*argument) {
    sprintf(buf, "Your prompt is currently: %s\r\n", (GET_PROMPT(ch) ?
GET_PROMPT(ch) : "n\a"));
    send_to_char(buf, ch);
    return;
  }

  delete_doubledollar(argument);

  if (GET_PROMPT(ch))
    free(GET_PROMPT(ch));
  GET_PROMPT(ch) = str_dup(argument);

  sprintf(buf, "Okay, set your prompt to: %s\r\n", GET_PROMPT(ch));
  send_to_char(buf, ch);
}

*snip*

Any insight on this would be greatly appreciated :)
Thanks,

Tharin
Knights of the 5th Dimension (no addy as of yet)


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST