OSDN Git Service

[Refactor] #39962 常に0を返すprocess_autopick_file_command()の返り値をvoidに変更 / Changed the...
authorHourier <hourier@users.sourceforge.jp>
Tue, 3 Mar 2020 12:59:58 +0000 (21:59 +0900)
committerHourier <hourier@users.sourceforge.jp>
Tue, 3 Mar 2020 12:59:58 +0000 (21:59 +0900)
src/autopick.c
src/autopick.h
src/io/read-pref-file.c

index 5cd1689..3cd2370 100644 (file)
@@ -1204,7 +1204,7 @@ static void add_autopick_list(autopick_type *entry)
 /*
  *  Process line for auto picker/destroyer.
  */
-errr process_autopick_file_command(char *buf)
+void process_autopick_file_command(char *buf)
 {
        autopick_type an_entry, *entry = &an_entry;
        int i;
@@ -1222,7 +1222,8 @@ errr process_autopick_file_command(char *buf)
        }
 
        buf[i] = 0;
-       if (!autopick_new_entry(entry, buf, FALSE)) return 0;
+       if (!autopick_new_entry(entry, buf, FALSE)) return;
+
        for (i = 0; i < max_autopick; i++)
        {
                if (!strcmp(entry->name, autopick_list[i].name)
@@ -1232,12 +1233,12 @@ errr process_autopick_file_command(char *buf)
                        && entry->bonus == autopick_list[i].bonus)
                {
                        autopick_free_entry(entry);
-                       return 0;
+                       return;
                }
        }
 
        add_autopick_list(entry);
-       return 0;
+       return;
 }
 
 
index d0bbc81..90adbfc 100644 (file)
@@ -28,7 +28,7 @@ extern int max_max_autopick;
 extern autopick_type *autopick_list;
 
 extern void autopick_load_pref(player_type *player_ptr, bool disp_mes);
-extern errr process_autopick_file_command(char *buf);
+extern void process_autopick_file_command(char *buf);
 extern concptr autopick_line_from_entry(autopick_type *entry);
 extern int is_autopick(player_type *player_ptr, object_type *o_ptr);
 extern void autopick_alter_item(player_type *player_ptr, INVENTORY_IDX item, bool destroy);
index 54b92af..3199b91 100644 (file)
@@ -84,7 +84,9 @@ static errr process_pref_file_aux(player_type *creature_ptr, concptr name, int p
                {
                        if (preftype != PREF_TYPE_AUTOPICK)
                                break;
-                       err = process_autopick_file_command(buf);
+                       
+                       process_autopick_file_command(buf);
+                       err = 0;
                }
        }