* of "O_RDONLY", "O_WRONLY", and "O_RDWR" in "A-win-h", and then
* we must simulate the effect of the proper "open()" call below.
*/
-int fd_make(cptr file, int mode)
+int fd_make(cptr file, BIT_FLAGS mode)
{
char buf[1024];
/* 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];
return;
}
- for(i = 0; i < max_quests; i++)
+ for(i = 0; i < max_q_idx; i++)
{ // TODO マクロで類似条件を統合すること
if(quest[i].status == QUEST_STATUS_TAKEN &&
(quest[i].type == QUEST_TYPE_KILL_LEVEL || quest[i].type == QUEST_TYPE_RANDOM) &&
/*
* Add a new "quark" to the set of quarks.
*/
-s16b quark_add(cptr str)
+u16b quark_add(cptr str)
{
- int i;
+ u16b i;
/* Look for an existing quark */
for (i = 1; i < quark__num; i++)
*/
void message_add(cptr str)
{
- int i, k, x, m, n;
+ u32b i, n;
+ int k, x, m;
char u[4096];
char splitted1[81];
}
else
{
- sprintf(buf, ("T:%d - %s"), turn, msg);
+ sprintf(buf, ("T:%d - %s"), (int)turn, msg);
}
/* New Message Length */
- n = (buf ? strlen(buf) : 0);
+ n = strlen(buf);
/* Memorize the message */
if (character_generated) message_add(buf);
* mode & CHECK_NO_HISTORY : no message_add
* mode & CHECK_DEFAULT_Y : accept any key as y, except n and Esc.
*/
-bool get_check_strict(cptr prompt, int mode)
+bool get_check_strict(cptr prompt, BIT_FLAGS mode)
{
int i;
char buf[80];
*
* Hack -- allow "command_arg" to specify a quantity
*/
-s16b get_quantity(cptr prompt, COMMAND_CODE max)
+QUANTITY get_quantity(cptr prompt, QUANTITY max)
{
- bool res;
- COMMAND_CODE amt;
+ bool res, result;
+ QUANTITY amt;
char tmp[80];
char buf[80];
+ COMMAND_CODE code;
/* Use "command_arg" */
#ifdef ALLOW_REPEAT /* TNB */
/* Get the item index */
- if ((max != 1) && repeat_pull(&amt))
+ result = repeat_pull(&code);
+ amt = (QUANTITY)code;
+ if ((max != 1) && result)
{
/* Enforce the maximum */
if (amt > max) amt = max;
#ifdef ALLOW_REPEAT /* TNB */
- if (amt) repeat_push(amt);
+ if (amt) repeat_push((COMMAND_CODE)amt);
#endif /* ALLOW_REPEAT -- TNB */
{
int i;
- char cmd;
+ s16b cmd;
int mode;
cptr act;
/* Command Count */
if (cmd == '0')
{
- int old_arg = command_arg;
+ COMMAND_ARG old_arg = command_arg;
/* Reset */
command_arg = 0;
if (always_repeat && (command_arg <= 0))
{
/* Hack -- auto repeat certain commands */
- if (my_strchr("TBDoc+", command_cmd))
+ if (my_strchr("TBDoc+", (char)command_cmd))
{
/* Repeat 99 times */
command_arg = 99;
}
else
{
- int mode;
+ BIT_FLAGS mode;
cptr act, s;
/* Roguelike */
continue;
}
#endif
- *str = tolower(*str);
+ *str = (char)tolower(*str);
}
}