OSDN Git Service

[Refactor] #37353 mutation~z-util間整理。 / Refactor between mutation and z-util.
authorDeskull <deskull@users.sourceforge.jp>
Fri, 9 Nov 2018 10:38:27 +0000 (19:38 +0900)
committerDeskull <deskull@users.sourceforge.jp>
Fri, 9 Nov 2018 10:38:27 +0000 (19:38 +0900)
src/externs.h
src/mutation.c
src/z-util.c
src/z-util.h

index 7b25cfe..0fc8538 100644 (file)
@@ -1388,7 +1388,6 @@ extern void do_cmd_gain_hissatsu(void);
 extern MULTIPLY mult_hissatsu(MULTIPLY mult, BIT_FLAGS *flgs, monster_type *m_ptr, BIT_FLAGS mode);
 
 /* mutation.c */
-extern int count_bits(BIT_FLAGS x);
 extern bool gain_random_mutation(int choose_mut);
 extern bool lose_mutation(int choose_mut);
 extern void lose_all_mutations(void);
index f47cae7..96cadc4 100644 (file)
@@ -2019,23 +2019,6 @@ void do_cmd_knowledge_mutations(void)
        fd_kill(file_name);
 }
 
-/*!
- * @brief 符号なし32ビット整数のビット数を返す。
- * @param x ビット数を調べたい変数
- * @return ビット数
- */
-int count_bits(BIT_FLAGS x)
-{
-       int n = 0;
-
-       if (x) do
-       {
-               n++;
-       }
-       while (0 != (x = x&(x-1)));
-
-       return (n);
-}
 
 /*!
  * @brief 現在プレイヤー得ている突然変異の数を返す。
index 2f4c1df..d11e840 100644 (file)
@@ -266,3 +266,19 @@ void s64b_mod(s32b *A1, u32b *A2, s32b B1, u32b B2)
        s64b_sub(A1, A2, tmp1, tmp2);
 }
 
+/*!
+* @brief 符号なし32ビット整数のビット数を返す。
+* @param x ビット数を調べたい変数
+* @return ビット数
+*/
+int count_bits(BIT_FLAGS x)
+{
+       int n = 0;
+
+       if (x) do
+       {
+               n++;
+       } while (0 != (x = x&(x - 1)));
+
+       return (n);
+}
index 42c2f19..088b10b 100644 (file)
@@ -64,3 +64,5 @@ extern void s64b_mod(s32b *A1, u32b *A2, s32b B1, u32b B2);
 
 #endif
 
+extern int count_bits(BIT_FLAGS x);
+