• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

変愚蛮怒のメインリポジトリです


Commit MetaInfo

Revisiond04feecb2f9c241c88e749d936d2e6e823dd444b (tree)
Time2019-05-08 21:22:59
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #37353 strip_name() を object-flavor.c/h へ移動.

Change Summary

Incremental Difference

--- a/src/externs.h
+++ b/src/externs.h
@@ -240,9 +240,6 @@ extern void fsetfileinfo(concptr path, u32b fcreator, u32b ftype);
240240 /* wizard1.c */
241241 extern void spoil_random_artifact(concptr fname);
242242
243-/* wizard2.c */
244-extern void strip_name(char *buf, KIND_OBJECT_IDX k_idx);
245-
246243
247244 #ifdef JP
248245 /* japanese.c */
--- a/src/object-flavor.c
+++ b/src/object-flavor.c
@@ -2831,3 +2831,35 @@ object_desc_done:
28312831 }
28322832
28332833
2834+/*!
2835+ * @brief nameバッファ内からベースアイテム名を返す / Strip an "object name" into a buffer
2836+ * @param buf ベースアイテム格納先の参照ポインタ
2837+ * @param k_idx ベースアイテムID
2838+ * @return なし
2839+ */
2840+void strip_name(char *buf, KIND_OBJECT_IDX k_idx)
2841+{
2842+ char *t;
2843+
2844+ object_kind *k_ptr = &k_info[k_idx];
2845+
2846+ concptr str = (k_name + k_ptr->name);
2847+
2848+
2849+ /* Skip past leading characters */
2850+ while ((*str == ' ') || (*str == '&')) str++;
2851+
2852+ /* Copy useful chars */
2853+ for (t = buf; *str; str++)
2854+ {
2855+#ifdef JP
2856+ if (iskanji(*str)) { *t++ = *str++; *t++ = *str; continue; }
2857+#endif
2858+ if (*str != '~') *t++ = *str;
2859+ }
2860+
2861+ /* Terminate the new name */
2862+ *t = '\0';
2863+}
2864+
2865+
--- a/src/object-flavor.h
+++ b/src/object-flavor.h
@@ -11,7 +11,7 @@ extern void get_table_sindarin(char *out_string);
1111 extern void flavor_init(void);
1212 extern char *object_desc_kosuu(char *t, object_type *o_ptr);
1313 extern void object_desc(char *buf, object_type *o_ptr, BIT_FLAGS mode);
14-
14+extern void strip_name(char *buf, KIND_OBJECT_IDX k_idx);
1515
1616 /*
1717 * Bit flags for object_desc()
--- a/src/wizard2.c
+++ b/src/wizard2.c
@@ -602,39 +602,6 @@ static tval_desc tvals[] =
602602 { 0, NULL }
603603 };
604604
605-
606-/*!
607- * @brief nameバッファ内からベースアイテム名を返す / Strip an "object name" into a buffer
608- * @param buf ベースアイテム格納先の参照ポインタ
609- * @param k_idx ベースアイテムID
610- * @return なし
611- */
612-void strip_name(char *buf, KIND_OBJECT_IDX k_idx)
613-{
614- char *t;
615-
616- object_kind *k_ptr = &k_info[k_idx];
617-
618- concptr str = (k_name + k_ptr->name);
619-
620-
621- /* Skip past leading characters */
622- while ((*str == ' ') || (*str == '&')) str++;
623-
624- /* Copy useful chars */
625- for (t = buf; *str; str++)
626- {
627-#ifdef JP
628- if (iskanji(*str)) {*t++ = *str++; *t++ = *str; continue;}
629-#endif
630- if (*str != '~') *t++ = *str;
631- }
632-
633- /* Terminate the new name */
634- *t = '\0';
635-}
636-
637-
638605 /*!
639606 * @brief ベースアイテムのウィザード生成のために大項目IDと小項目IDを取得する /
640607 * Specify tval and sval (type and subtype of object) originally
Show on old repository browser