/* Hex-mode XXX */
if (*str == 'x')
{
- *s = 16 * dehex(*++str);
- *s++ += dehex(*++str);
+ *s = 16 * (char)dehex(*++str);
+ *s++ += (char)dehex(*++str);
}
/* Hack -- simple way to specify "backslash" */
/* Octal-mode */
else if (*str == '0')
{
- *s = 8 * deoct(*++str);
- *s++ += deoct(*++str);
+ *s = 8 * (char)deoct(*++str);
+ *s++ += (char)deoct(*++str);
}
/* Octal-mode */
else if (*str == '1')
{
- *s = 64 + 8 * deoct(*++str);
- *s++ += deoct(*++str);
+ *s = 64 + 8 * (char)deoct(*++str);
+ *s++ += (char)deoct(*++str);
}
/* Octal-mode */
else if (*str == '2')
{
- *s = 64 * 2 + 8 * deoct(*++str);
- *s++ += deoct(*++str);
+ *s = 64 * 2 + 8 * (char)deoct(*++str);
+ *s++ += (char)deoct(*++str);
}
/* Octal-mode */
else if (*str == '3')
{
- *s = 64 * 3 + 8 * deoct(*++str);
- *s++ += deoct(*++str);
+ *s = 64 * 3 + 8 * (char)deoct(*++str);
+ *s++ += (char)deoct(*++str);
}
/* Skip the final char */
switch(ch)
{
case '&':
- while ((tmp = my_strchr(macro_modifier_chr, *str)))
+ while ((tmp = my_strchr(macro_modifier_chr, *str)) != 0)
{
j = (int)(tmp - macro_modifier_chr);
tmp = macro_modifier_name[j];
/*
* Hack -- Select floor music.
*/
-void select_floor_music()
+void select_floor_music(void)
{
int i;
/* No sound */
/*
* This function looks up a quark
*/
-cptr quark_str(s16b i)
+cptr quark_str(STR_OFFSET i)
{
cptr q;
p = 0;
}
- /* Message Length */
+ /* Original Message Length */
n = (msg ? strlen(msg) : 0);
/* Hack -- flush when requested or needed */
/* Paranoia */
if (n > 1000) return;
+ /* Copy it */
+ if (!cheat_turn)
+ {
+ strcpy(buf, msg);
+ }
+ else
+ {
+ sprintf(buf, ("T:%d - %s"), turn, msg);
+ }
- /* Memorize the message */
- if (character_generated) message_add(msg);
-
+ /* New Message Length */
+ n = (buf ? strlen(buf) : 0);
- /* Copy it */
- strcpy(buf, msg);
+ /* Memorize the message */
+ if (character_generated) message_add(buf);
/* Analyze the buffer */
t = buf;
*
* Hack -- allow "command_arg" to specify a quantity
*/
-s16b get_quantity(cptr prompt, int max)
+QUANTITY get_quantity(cptr prompt, QUANTITY max)
{
bool res;
- int amt;
+ COMMAND_CODE amt;
char tmp[80];
char buf[80];
if (!res) return 0;
/* Extract a number */
- amt = atoi(buf);
+ amt = (COMMAND_CODE)atoi(buf);
/* A letter means "all" */
if (isalpha(buf[0])) amt = max;
if (always_repeat && (command_arg <= 0))
{
/* Hack -- auto repeat certain commands */
- if (my_strchr("TBDoc+", command_cmd))
+ if (my_strchr("TBDoc+", (COMMAND_CODE)command_cmd))
{
/* Repeat 99 times */
command_arg = 99;
static int repeat__idx = 0;
/* Saved "stuff" */
-static int repeat__key[REPEAT_MAX];
+static COMMAND_CODE repeat__key[REPEAT_MAX];
-void repeat_push(int what)
+void repeat_push(COMMAND_CODE what)
{
/* Too many keys */
if (repeat__cnt == REPEAT_MAX) return;
}
-bool repeat_pull(int *what)
+bool repeat_pull(COMMAND_CODE *what)
{
/* All out of keys */
if (repeat__idx == repeat__cnt) return (FALSE);
void repeat_check(void)
{
- int what;
+ COMMAND_CODE what;
/* Ignore some commands */
if (command_cmd == ESCAPE) return;