OSDN Git Service

[Refactor] #3539 ほぼ無意味な引数名i, jをそれぞれ意味のある変数名に変えた
authorHourier <66951241+Hourier@users.noreply.github.com>
Mon, 10 Jul 2023 12:52:07 +0000 (21:52 +0900)
committerHourier <66951241+Hourier@users.noreply.github.com>
Mon, 10 Jul 2023 13:37:10 +0000 (22:37 +0900)
src/store/store.cpp
src/store/store.h

index ba50229..0b20db5 100644 (file)
@@ -149,20 +149,20 @@ int store_check_num(ItemEntity *o_ptr, StoreSaleType store_num)
  * Get the ID of a store item and return its value     -RAK-
  * @param com_val 選択IDを返す参照ポインタ
  * @param pmt メッセージキャプション
- * @param i 選択範囲の最小値
- * @param j 選択範囲の最大値
+ * @param min 選択範囲の最小値
+ * @param max 選択範囲の最大値
  * @return 実際に選択したらTRUE、キャンセルしたらFALSE
  */
-int input_stock(COMMAND_CODE *com_val, concptr pmt, int i, int j, [[maybe_unused]] StoreSaleType store_num)
+int input_stock(COMMAND_CODE *com_val, concptr pmt, int min, int max, [[maybe_unused]] StoreSaleType store_num)
 {
-    if (repeat_pull(com_val) && (*com_val >= i) && (*com_val <= j)) {
+    if (repeat_pull(com_val) && (*com_val >= min) && (*com_val <= max)) {
         return true;
     }
 
     msg_print(nullptr);
     *com_val = (-1);
-    const auto lo = I2A(i);
-    const auto hi = (j > 25) ? toupper(I2A(j - 26)) : I2A(j);
+    const auto lo = I2A(min);
+    const auto hi = (max > 25) ? toupper(I2A(max - 26)) : I2A(max);
 #ifdef JP
     const auto title = (store_num == StoreSaleType::HOME) || (store_num == StoreSaleType::MUSEUM) ? "アイテム" : "商品";
     const auto prompt = format("(%s:%c-%c, ESCで中断) %s", title, lo, hi, pmt);
@@ -187,7 +187,7 @@ int input_stock(COMMAND_CODE *com_val, concptr pmt, int i, int j, [[maybe_unused
             k = -1;
         }
 
-        if ((k >= i) && (k <= j)) {
+        if ((k >= min) && (k <= max)) {
             *com_val = k;
             break;
         }
index 92a2b03..52bebfb 100644 (file)
@@ -29,4 +29,4 @@ void store_maintenance(PlayerType *player_ptr, int town_num, StoreSaleType store
 void store_init(int town_num, StoreSaleType store_num);
 void store_examine(PlayerType *player_ptr, StoreSaleType store_num);
 int store_check_num(ItemEntity *o_ptr, StoreSaleType store_num);
-int input_stock(COMMAND_CODE *com_val, concptr pmt, int i, int j, StoreSaleType store_num);
+int input_stock(COMMAND_CODE *com_val, concptr pmt, int min, int max, StoreSaleType store_num);