]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
maint: remove unused functions and constants
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 22 Apr 2017 09:46:46 +0000 (02:46 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 22 Apr 2017 09:47:21 +0000 (02:47 -0700)
These were found by clang.
* gl/lib/rand-isaac.c (min):
* gl/lib/randint.c (shift_right):
* src/md5sum.c (algorithm):
Remove; unused.

gl/lib/rand-isaac.c
gl/lib/randint.c
src/md5sum.c

index 3e360632ba2ee90afc79bb1f94918b09db6a210d..88640aeb00b4f8d08056c2d1b5c4e5c253ae772d 100644 (file)
   __attribute__ ((__no_sanitize_undefined__))
 #endif
 
-/* The minimum of two sizes A and B.  */
-static inline size_t
-min (size_t a, size_t b)
-{
-  return (a < b ? a : b);
-}
-
 /* A if 32-bit ISAAC, B if 64-bit.  This is a macro, not an inline
    function, to prevent undefined behavior if the unused argument
    shifts by more than a word width.  */
index e3ec8415a9a0ac62faab78bf1e0d4883e4e6643e..4561067e848ece935c560c867c79a3ef34421094 100644 (file)
@@ -106,13 +106,6 @@ static inline randint shift_left (randint x)
   return HUGE_BYTES ? 0 : x << CHAR_BIT;
 }
 
-/* Return X shifted right by CHAR_BIT bits.  */
-static inline randint
-shift_right (randint x)
-{
-  return HUGE_BYTES ? 0 : x >> CHAR_BIT;
-}
-
 
 /* Consume random data from *S to generate a random number in the range
    0 .. GENMAX.  */
@@ -148,9 +141,9 @@ randint_genmax (struct randint_source *s, randint genmax)
           /* Increase RANDMAX by appending random bytes to RANDNUM and
              UCHAR_MAX to RANDMAX until RANDMAX is no less than
              GENMAX.  This may lose up to CHAR_BIT bits of information
-             if shift_right (RANDINT_MAX) < GENMAX, but it is not
-             worth the programming hassle of saving these bits since
-             GENMAX is rarely that large in practice.  */
+             if (HUGE_BYTES ? 0 : RANDINT_MAX >> CHAR_BIT) < GENMAX,
+             but it is not worth the programming hassle of saving
+             these bits since GENMAX is rarely that large in practice.  */
 
           i = 0;
 
index 91cdfb24f7dff2a24515a5037c4d1d0dba952921..9de0eb9217c5321e51bdd5252f7c4254a599c6fd 100644 (file)
@@ -170,12 +170,8 @@ enum Algorithm
 {
   BLAKE2b
 };
-static enum Algorithm const algorithm[] =
-{
-  BLAKE2b
-};
-ARGMATCH_VERIFY (algorithm_in_string, algorithm);
-ARGMATCH_VERIFY (algorithm_out_string, algorithm);
+verify (ARRAY_CARDINALITY (algorithm_in_string) == 2);
+verify (ARRAY_CARDINALITY (algorithm_out_string) == 2);
 
 static enum Algorithm b2_algorithm;
 static uintmax_t b2_length;