]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - stdlib/rshift.c
stdlib: Tune down fork arc4random tests
[thirdparty/glibc.git] / stdlib / rshift.c
index 8aaee2e2e92aa9ec4ddb49d0628bb4b4ebf13d4e..595051aa0b5731ec7b10fe48fc2e3a1a9c12c790 100644 (file)
@@ -1,6 +1,6 @@
 /* mpn_rshift -- Shift right a low-level natural-number integer.
 
-Copyright (C) 1991-2015 Free Software Foundation, Inc.
+Copyright (C) 1991-2023 Free Software Foundation, Inc.
 
 This file is part of the GNU MP Library.
 
@@ -16,11 +16,13 @@ License for more details.
 
 You should have received a copy of the GNU Lesser General Public License
 along with the GNU MP Library; see the file COPYING.LIB.  If not, see
-<http://www.gnu.org/licenses/>.  */
+<https://www.gnu.org/licenses/>.  */
 
 #include <gmp.h>
 #include "gmp-impl.h"
 
+#include <assert.h>
+
 /* Shift U (pointed to by UP and USIZE limbs long) CNT bits to the right
    and store the USIZE least significant limbs of the result at WP.
    The bits shifted out to the right are returned.
@@ -31,27 +33,16 @@ along with the GNU MP Library; see the file COPYING.LIB.  If not, see
 */
 
 mp_limb_t
-#if __STDC__
 mpn_rshift (register mp_ptr wp,
            register mp_srcptr up, mp_size_t usize,
            register unsigned int cnt)
-#else
-mpn_rshift (wp, up, usize, cnt)
-     register mp_ptr wp;
-     register mp_srcptr up;
-     mp_size_t usize;
-     register unsigned int cnt;
-#endif
 {
   register mp_limb_t high_limb, low_limb;
   register unsigned sh_1, sh_2;
   register mp_size_t i;
   mp_limb_t retval;
 
-#ifdef DEBUG
-  if (usize == 0 || cnt == 0)
-    abort ();
-#endif
+  assert (usize != 0 && cnt != 0);
 
   sh_1 = cnt;