OSDN Git Service

[Refactor] #2155 t~zのフォルダについて、return (hoge); をreturn hoge; に置換した
authorHourier <66951241+Hourier@users.noreply.github.com>
Sat, 12 Feb 2022 13:06:34 +0000 (22:06 +0900)
committerHourier <66951241+Hourier@users.noreply.github.com>
Sun, 13 Feb 2022 06:54:08 +0000 (15:54 +0900)
13 files changed:
src/target/target-preparation.cpp
src/term/z-form.cpp
src/term/z-rand.cpp
src/term/z-term.cpp
src/timed-effect/player-cut.cpp
src/util/angband-files.cpp
src/util/quarks.cpp
src/util/sort.cpp
src/util/string-processor.cpp
src/util/tag-sorter.cpp
src/view/display-map.cpp
src/view/display-messages.cpp
src/wizard/wizard-item-modifier.cpp

index a6b4c64..a712c99 100644 (file)
@@ -198,7 +198,7 @@ void target_sensing_monsters_prepare(PlayerType *player_ptr, std::vector<MONSTER
 
         /* Unknown monsters first */
         if ((ap_r_ptr1->r_tkills == 0) != (ap_r_ptr2->r_tkills == 0))
-            return (ap_r_ptr1->r_tkills == 0);
+            return ap_r_ptr1->r_tkills == 0;
 
         /* Higher level monsters first (if known) */
         if (ap_r_ptr1->r_tkills && ap_r_ptr2->r_tkills && ap_r_ptr1->level != ap_r_ptr2->level)
index 913fe04..9cc97f0 100644 (file)
@@ -173,7 +173,7 @@ static uint vstrnfmt_aux_dflt(char *buf, uint max, concptr fmt, vptr arg)
         len = max - 1;
     tmp[len] = '\0';
     strcpy(buf, tmp);
-    return (len);
+    return len;
 }
 
 /*
@@ -694,7 +694,7 @@ uint strnfmt(char *buf, uint max, concptr fmt, ...)
     va_end(vp);
 
     /* Return the number of bytes written */
-    return (len);
+    return len;
 }
 
 /*
@@ -717,7 +717,7 @@ uint strfmt(char *buf, concptr fmt, ...)
     va_end(vp);
 
     /* Return the number of bytes written */
-    return (len);
+    return len;
 }
 
 /*
@@ -741,7 +741,7 @@ char *format(concptr fmt, ...)
     va_end(vp);
 
     /* Return the result */
-    return (res);
+    return res;
 }
 
 /*
index 32e08ce..dc527bc 100644 (file)
@@ -107,7 +107,7 @@ int16_t damroll(DICE_NUMBER num, DICE_SID sides)
  */
 int16_t maxroll(DICE_NUMBER num, DICE_SID sides)
 {
-    return (num * sides);
+    return num * sides;
 }
 
 /*
@@ -135,7 +135,7 @@ int32_t div_round(int32_t n, int32_t d)
     }
 
     /* Return */
-    return (tmp);
+    return tmp;
 }
 
 /*
index a623d29..589cd92 100644 (file)
@@ -100,7 +100,7 @@ errr term_user(int n)
         return -1;
 
     /* Call the hook */
-    return ((*Term->user_hook)(n));
+    return (*Term->user_hook)(n);
 }
 
 /*
@@ -113,7 +113,7 @@ errr term_xtra(int n, int v)
         return -1;
 
     /* Call the hook */
-    return ((*Term->xtra_hook)(n, v));
+    return (*Term->xtra_hook)(n, v);
 }
 
 /*** Fake hooks ***/
@@ -1437,11 +1437,11 @@ errr term_putch(TERM_LEN x, TERM_LEN y, TERM_COLOR a, char c)
 
     /* Move first */
     if ((res = term_gotoxy(x, y)) != 0)
-        return (res);
+        return res;
 
     /* Then add the char */
     if ((res = term_addch(a, c)) != 0)
-        return (res);
+        return res;
 
     return 0;
 }
@@ -1455,11 +1455,11 @@ errr term_putstr(TERM_LEN x, TERM_LEN y, int n, TERM_COLOR a, concptr s)
 
     /* Move first */
     if ((res = term_gotoxy(x, y)) != 0)
-        return (res);
+        return res;
 
     /* Then add the string */
     if ((res = term_addstr(n, a, s)) != 0)
-        return (res);
+        return res;
 
     return 0;
 }
@@ -2087,18 +2087,18 @@ errr term_putstr_v(TERM_LEN x, TERM_LEN y, int n, byte a, concptr s)
     for (int i = 0; i < n && s[i] != 0; i++) {
         /* Move first */
         if ((res = term_gotoxy(x, y0)) != 0)
-            return (res);
+            return res;
 
         if (iskanji(s[i])) {
             if ((res = term_addstr(2, a, &s[i])) != 0)
-                return (res);
+                return res;
             i++;
             y0++;
             if (s[i] == 0)
                 break;
         } else {
             if ((res = term_addstr(1, a, &s[i])) != 0)
-                return (res);
+                return res;
             y0++;
         }
     }
index bf2c993..9e7eed7 100644 (file)
@@ -189,24 +189,24 @@ int PlayerCut::get_accumulation_rank(int total, int damage)
     }
 
     if (damage > 45) {
-        return (6 + max);
+        return 6 + max;
     }
 
     if (damage > 33) {
-        return (5 + max);
+        return 5 + max;
     }
 
     if (damage > 25) {
-        return (4 + max);
+        return 4 + max;
     }
 
     if (damage > 18) {
-        return (3 + max);
+        return 3 + max;
     }
 
     if (damage > 11) {
-        return (2 + max);
+        return 2 + max;
     }
 
-    return (1 + max);
+    return 1 + max;
 }
index 13ecb8a..8e78c32 100644 (file)
@@ -225,7 +225,7 @@ FILE *angband_fopen_temp(char *buf, int max)
 {
     if (path_temp(buf, max))
         return nullptr;
-    return (angband_fopen(buf, "w"));
+    return angband_fopen(buf, "w");
 }
 #endif /* HAVE_MKSTEMP */
 
@@ -399,7 +399,7 @@ int fd_make(concptr file, BIT_FLAGS mode)
     if (path_parse(buf, 1024, file))
         return -1;
 
-    return (open(buf, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, mode));
+    return open(buf, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, mode);
 }
 
 /*
@@ -413,7 +413,7 @@ int fd_open(concptr file, int flags)
     if (path_parse(buf, 1024, file))
         return -1;
 
-    return (open(buf, flags | O_BINARY, 0));
+    return open(buf, flags | O_BINARY, 0);
 }
 
 /*
index fe2c3ca..e84324e 100644 (file)
@@ -62,5 +62,5 @@ concptr quark_str(STR_OFFSET i)
     q = quark__str[i].data();
 
     /* Return the quark */
-    return (q);
+    return q;
 }
index e0043e7..e35dd96 100644 (file)
@@ -103,7 +103,7 @@ bool ang_sort_comp_distance(PlayerType *player_ptr, vptr u, vptr v, int a, int b
     POSITION db = ((kx > ky) ? (kx + kx + ky) : (ky + ky + kx));
 
     /* Compare the distances */
-    return (da <= db);
+    return da <= db;
 }
 
 /*
@@ -284,7 +284,7 @@ bool ang_sort_art_comp(PlayerType *player_ptr, vptr u, vptr v, int a, int b)
     }
 
     /* Compare indexes */
-    return (w1 <= w2);
+    return w1 <= w2;
 }
 
 /*
@@ -456,7 +456,7 @@ bool ang_sort_comp_hook(PlayerType *player_ptr, vptr u, vptr v, int a, int b)
     }
 
     /* Compare indexes */
-    return (w1 <= w2);
+    return w1 <= w2;
 }
 
 /*!
index 8692766..8ebf634 100644 (file)
@@ -20,7 +20,7 @@ concptr macro_trigger_keycode[2][MAX_MACRO_TRIG]; /*!< マクロの内容 */
  */
 static char octify(uint i)
 {
-    return (hexsym[i % 8]);
+    return hexsym[i % 8];
 }
 
 /*
@@ -28,7 +28,7 @@ static char octify(uint i)
  */
 static char hexify(uint i)
 {
-    return (hexsym[i % 16]);
+    return hexsym[i % 16];
 }
 
 /*
@@ -37,7 +37,7 @@ static char hexify(uint i)
 static int deoct(char c)
 {
     if (isdigit(c))
-        return (D2I(c));
+        return D2I(c);
     return 0;
 }
 
@@ -47,17 +47,17 @@ static int deoct(char c)
 static int dehex(char c)
 {
     if (isdigit(c))
-        return (D2I(c));
+        return D2I(c);
     if (islower(c))
-        return (A2I(c) + 10);
+        return A2I(c) + 10;
     if (isupper(c))
-        return (A2I(tolower(c)) + 10);
+        return A2I(tolower(c)) + 10;
     return 0;
 }
 
 static char force_upper(char a)
 {
-    return (islower(a)) ? toupper(a) : a;
+    return islower(a) ? toupper(a) : a;
 }
 
 static int angband_stricmp(concptr a, concptr b)
@@ -435,9 +435,9 @@ size_t angband_strcat(char *buf, concptr src, size_t bufsize)
 {
     size_t dlen = strlen(buf);
     if (dlen < bufsize - 1) {
-        return (dlen + angband_strcpy(buf + dlen, src, bufsize - dlen));
+        return dlen + angband_strcpy(buf + dlen, src, bufsize - dlen);
     } else {
-        return (dlen + strlen(src));
+        return dlen + strlen(src);
     }
 }
 
index b1772d4..078442d 100644 (file)
@@ -45,7 +45,7 @@ static tag_type median3(tag_type elements[], int left, int right)
         swap(&elements[center], &elements[right]);
 
     swap(&elements[center], &elements[right - 1]);
-    return (elements[right - 1]);
+    return elements[right - 1];
 }
 
 /*
index 1d9696b..f1bd13d 100644 (file)
@@ -125,7 +125,7 @@ static bool is_revealed_wall(floor_type *floor_ptr, feature_type *f_ptr, POSITIO
             n++;
     }
 
-    return (n != 8);
+    return n != 8;
 }
 
 /*!
index cd3275d..91299aa 100644 (file)
@@ -79,7 +79,7 @@ int32_t message_num(void)
 concptr message_str(int age)
 {
     if ((age < 0) || (age >= message_num()))
-        return ("");
+        return "";
 
     return message_history[age]->c_str();
 }
@@ -189,9 +189,9 @@ bool is_msg_window_flowed(void)
         if (num_more < angband_term[i]->hgt)
             return false;
 
-        return (num_more >= 0);
+        return num_more >= 0;
     }
-    return (num_more >= 0);
+    return num_more >= 0;
 }
 
 /*
index 4c1d988..22eefb6 100644 (file)
@@ -714,7 +714,7 @@ static int is_slot_able_to_be_ego(PlayerType *player_ptr, ObjectType *o_ptr)
         return slot;
 
     if ((o_ptr->tval == ItemKindType::SHOT) || (o_ptr->tval == ItemKindType::ARROW) || (o_ptr->tval == ItemKindType::BOLT))
-        return (INVEN_AMMO);
+        return INVEN_AMMO;
 
     return -1;
 }