]> granicus.if.org Git - nethack/commitdiff
Move, rename, and comment out unused function
authorPasi Kallinen <paxed@alt.org>
Mon, 16 Mar 2020 09:46:08 +0000 (11:46 +0200)
committerPasi Kallinen <paxed@alt.org>
Mon, 16 Mar 2020 09:46:08 +0000 (11:46 +0200)
src/hacklib.c
src/read.c
src/weapon.c

index 5d53bccbc5ee1df62ea443b2e3ade564d6d86e68..89905d194b854aecd4532239cbed65dd9cdc6c02 100644 (file)
@@ -73,6 +73,7 @@
         void            strbuf_nl_to_crlf (strbuf_t *)
         char *          nonconst        (const char *, char *)
         int             swapbits        (int, int, int)
+UNUSED  void            shuffle_int_array (int *, int)
 =*/
 #ifdef LINT
 #define Static /* pacify lint */
@@ -1301,4 +1302,23 @@ int val, bita, bitb;
     return (val ^ ((tmp << bita) | (tmp << bitb)));
 }
 
+#if 0
+/* randomize the given list of numbers  0 <= i < count */
+static void
+shuffle_int_array(indices, count)
+int *indices;
+int count;
+{
+    int i, iswap, temp;
+
+    for (i = count - 1; i > 0; i--) {
+        if ((iswap = rn2(i + 1)) == i)
+            continue;
+        temp = indices[i];
+        indices[i] = indices[iswap];
+        indices[iswap] = temp;
+    }
+}
+#endif
+
 /*hacklib.c*/
index abca909bb0f6ef13b2755ae223e5929ee9a51c7a..18d2cfd2f1b4a56e1f4cebb78e05428fce118c43 100644 (file)
@@ -22,7 +22,6 @@ static char *FDECL(apron_text, (struct obj *, char *buf));
 static void FDECL(stripspe, (struct obj *));
 static void FDECL(p_glow1, (struct obj *));
 static void FDECL(p_glow2, (struct obj *, const char *));
-static void FDECL(randomize, (int *, int));
 static void FDECL(forget, (int));
 static int FDECL(maybe_tame, (struct monst *, struct obj *));
 static boolean FDECL(get_valid_stinking_cloud_pos, (int, int));
@@ -707,23 +706,6 @@ int curse_bless;
     }
 }
 
-/* randomize the given list of numbers  0 <= i < count */
-static void
-randomize(indices, count)
-int *indices;
-int count;
-{
-    int i, iswap, temp;
-
-    for (i = count - 1; i > 0; i--) {
-        if ((iswap = rn2(i + 1)) == i)
-            continue;
-        temp = indices[i];
-        indices[i] = indices[iswap];
-        indices[iswap] = temp;
-    }
-}
-
 /*
  * Forget some things (e.g. after reading a scroll of amnesia).  When called,
  * the following are always forgotten:
index d6e5f98b67c0fe5ee363237531a8cddaf1f9e4e6..c3deda3a44f789683da71f74162549fe1b06d05b 100644 (file)
@@ -1380,7 +1380,6 @@ int n; /* number of skills to drain */
     int skill;
     int i;
     int tmpskills[P_NUM_SKILLS];
-    int tmpidx = 0;
 
     (void) memset((genericptr_t) tmpskills, 0, sizeof(tmpskills));