OSDN Git Service

[Refactor] #37353 メッセージ整理。
[hengband/hengband.git] / src / autopick.c
index 69e89b7..e879031 100644 (file)
@@ -273,7 +273,7 @@ static bool autopick_new_entry(autopick_type *entry, cptr str, bool allow_defaul
                        break;
                }
 
-               if (isupper(c)) c = tolower(c);
+               if (isupper(c)) c = (char)tolower(c);
 
                buf[i] = c;
        }
@@ -1587,10 +1587,8 @@ static void auto_destroy_item(object_type *o_ptr, int autopick_idx)
                /* Describe the object (with {terrible/special}) */
                object_desc(o_name, o_ptr, 0);
 
-               /* Message */
                msg_format(_("%sは破壊不能だ。", "You cannot auto-destroy %s."), o_name);
 
-               /* Done */
                return;
        }
 
@@ -1608,7 +1606,7 @@ static void auto_destroy_item(object_type *o_ptr, int autopick_idx)
 /*
  *  Auto-destroy marked item
  */
-static void autopick_delayed_alter_aux(int item)
+static void autopick_delayed_alter_aux(INVENTORY_IDX item)
 {
        object_type *o_ptr;
 
@@ -1649,7 +1647,7 @@ static void autopick_delayed_alter_aux(int item)
  */
 void autopick_delayed_alter(void)
 {
-       int item;
+       INVENTORY_IDX item;
 
        /* 
         * Scan inventry in reverse order to prevent
@@ -1662,7 +1660,7 @@ void autopick_delayed_alter(void)
        item = cave[p_ptr->y][p_ptr->x].o_idx;
        while (item)
        {
-               int next = o_list[item].next_o_idx;
+               OBJECT_IDX next = o_list[item].next_o_idx;
                autopick_delayed_alter_aux(-item);
                item = next;
        }
@@ -1675,7 +1673,7 @@ void autopick_delayed_alter(void)
  * Auto-destroyer works only on inventory or on floor stack only when
  * requested.
  */
-void autopick_alter_item(int item, bool destroy)
+void autopick_alter_item(INVENTORY_IDX item, bool destroy)
 {
        object_type *o_ptr;
        int idx;
@@ -1703,7 +1701,7 @@ void autopick_alter_item(int item, bool destroy)
  */
 void autopick_pickup_items(cave_type *c_ptr)
 {
-       s16b this_o_idx, next_o_idx = 0;
+       OBJECT_IDX this_o_idx, next_o_idx = 0;
        
        /* Scan the pile of objects */
        for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
@@ -1733,7 +1731,6 @@ void autopick_pickup_items(cave_type *c_ptr)
                                /* Describe the object */
                                object_desc(o_name, o_ptr, 0);
 
-                               /* Message */
                                msg_format(_("ザックには%sを入れる隙間がない。", "You have no room for %s."), o_name);
                                /* Hack - remember that the item has given a message here. */
                                o_ptr->marked |= OM_NOMSG;
@@ -1936,10 +1933,8 @@ bool autopick_autoregister(object_type *o_ptr)
                /* Describe the object (with {terrible/special}) */
                object_desc(o_name, o_ptr, 0);
 
-               /* Message */
                msg_format(_("%sは破壊不能だ。", "You cannot auto-destroy %s."), o_name);
 
-               /* Done */
                return FALSE;
        }
 
@@ -2784,17 +2779,10 @@ static cptr *read_text_lines(cptr filename)
 static void prepare_default_pickpref(void)
 {
        const cptr messages[] = {
-#ifdef JP
-               "あなたは「自動拾いエディタ」を初めて起動しました。",
-               "自動拾いのユーザー設定ファイルがまだ書かれていないので、",
-               "基本的な自動拾い設定ファイルをlib/pref/picktype.prfからコピーします。",
-               NULL
-#else
-               "You have activated the Auto-Picker Editor for the first time.",
-               "Since user pref file for autopick is not yet created,",
-               "the default setting is loaded from lib/pref/pickpref.prf .",
+               _("あなたは「自動拾いエディタ」を初めて起動しました。", "You have activated the Auto-Picker Editor for the first time."),
+               _("自動拾いのユーザー設定ファイルがまだ書かれていないので、", "Since user pref file for autopick is not yet created,"),
+               _("基本的な自動拾い設定ファイルをlib/pref/picktype.prfからコピーします。", "the default setting is loaded from lib/pref/pickpref.prf ."),
                NULL
-#endif
        };
 
        char buf[1024];
@@ -2932,7 +2920,7 @@ static void free_text_lines(cptr *lines_list)
 /*
  * Delete or insert string
  */
-static void toggle_keyword(text_body_type *tb, int flg)
+static void toggle_keyword(text_body_type *tb, BIT_FLAGS flg)
 {
        int by1, by2, y;
        bool add = TRUE;
@@ -3104,7 +3092,7 @@ static void toggle_command_letter(text_body_type *tb, byte flg)
 /*
  * Delete or insert string
  */
-static void add_keyword(text_body_type *tb, int flg)
+static void add_keyword(text_body_type *tb, BIT_FLAGS flg)
 {
        int by1, by2, y;
 
@@ -3258,7 +3246,7 @@ static bool insert_return_code(text_body_type *tb)
  */
 static object_type *choose_object(cptr q, cptr s)
 {
-       int item;
+       OBJECT_IDX item;
 
        if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR | USE_EQUIP))) return NULL;
 
@@ -3278,7 +3266,6 @@ static bool entry_from_choosed_object(autopick_type *entry)
        object_type *o_ptr;
        cptr q, s;
 
-       /* Get an item */
 #ifdef JP
        q = "どのアイテムを登録しますか? ";
        s = "アイテムを持っていない。";
@@ -3303,7 +3290,6 @@ static byte get_object_for_search(object_type **o_handle, cptr *search_strp)
        object_type *o_ptr;
        cptr q, s;
 
-       /* Get an item */
 #ifdef JP
        q = "どのアイテムを検索しますか? ";
        s = "アイテムを持っていない。";
@@ -3460,7 +3446,6 @@ static byte get_string_for_search(object_type **o_handle, cptr *search_strp)
                        return (back ? -1 : 1);
 
                case KTRL('i'):
-                       /* Get an item */
                        return get_object_for_search(o_handle, search_strp);
 
                case KTRL('l'):
@@ -3803,11 +3788,11 @@ static void search_for_string(text_body_type *tb, cptr search_str, bool forward)
 /*
  * Editor command id's
  */
-#define EC_QUIT                1 
-#define EC_SAVEQUIT            2     
-#define EC_REVERT             3 
-#define EC_HELP                4 
-#define EC_RETURN             5        
+#define EC_QUIT            1
+#define EC_SAVEQUIT        2
+#define EC_REVERT             3
+#define EC_HELP            4
+#define EC_RETURN             5
 #define EC_LEFT                       6 
 #define EC_DOWN                       7 
 #define EC_UP                 8 
@@ -4868,7 +4853,7 @@ static bool insert_macro_line(text_body_type *tb)
        while (i)
        {
                /* Save the key */
-               buf[n++] = i;
+               buf[n++] = (char)i;
 
                /* Do not process macros */
                inkey_base = TRUE;
@@ -4929,7 +4914,7 @@ static bool insert_keymap_line(text_body_type *tb)
 {
        char tmp[1024];
        char buf[2];
-       int mode;
+       BIT_FLAGS mode;
        cptr act;
 
        /* Roguelike */
@@ -5897,8 +5882,8 @@ static void insert_single_letter(text_body_type *tb, int key)
                next = inkey();
                if (j+2 < MAX_LINELEN)
                {
-                       buf[j++] = key;
-                       buf[j++] = next;
+                       buf[j++] = (char)key;
+                       buf[j++] = (char)next;
                        tb->cx += 2;
                }
                else
@@ -5908,7 +5893,7 @@ static void insert_single_letter(text_body_type *tb, int key)
 #endif
        {
                if (j+1 < MAX_LINELEN)
-                       buf[j++] = key;
+                       buf[j++] = (char)key;
                tb->cx++;
        }
 
@@ -6164,7 +6149,7 @@ void do_cmd_edit_autopick(void)
                /* Other commands */
                else
                {
-                       com_id = get_com_id(key);
+                       com_id = get_com_id((char)key);
                }
 
                if (com_id) quit = do_editor_command(tb, com_id);
@@ -6191,7 +6176,7 @@ void do_cmd_edit_autopick(void)
        process_autopick_file(buf);
 
        /* HACK -- reset start_time so that playtime is not increase while edit */
-       start_time = time(NULL);
+       start_time = (u32b)time(NULL);
 
        /* Save cursor location */
        cx_save = tb->cx;