]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Merge with gnulib.
authorBruno Haible <bruno@clisp.org>
Tue, 19 Nov 2002 13:33:24 +0000 (13:33 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:08:52 +0000 (12:08 +0200)
lib/ChangeLog
lib/gcd.c
lib/gcd.h

index d29b2b02ae797830269a15a548e82385bfc3807c..d96051b4f4ad385b8ea4ab01c4f388bb2dc59d60 100644 (file)
@@ -1,3 +1,8 @@
+2002-11-06  Bruno Haible  <bruno@clisp.org>
+
+       * gcd.h (gcd): Change argument type to 'unsigned long'.
+       * gcd.c (gcd): Likewise.
+
 2002-11-15  Bruno Haible  <bruno@clisp.org>
 
        * alloca.c: Update from current gnulib version.
index 3a14e501218cc0dce8655644752033182170fd2e..b79087974970e13d385c0403941bc8e4fff80933 100644 (file)
--- a/lib/gcd.c
+++ b/lib/gcd.c
@@ -1,6 +1,6 @@
 /* Arithmetic.
    Copyright (C) 2001-2002 Free Software Foundation, Inc.
-   Written by Bruno Haible <haible@clisp.cons.org>, 2001.
+   Written by Bruno Haible <bruno@clisp.org>, 2001.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -22,8 +22,8 @@
 #include <stdlib.h>
 
 /* Return the greatest common divisor of a > 0 and b > 0.  */
-unsigned int
-gcd (unsigned int a, unsigned int b)
+unsigned long
+gcd (unsigned long a, unsigned long b)
 {
   /* Why no division, as in Euclid's algorithm? Because in Euclid's algorithm
      the division result floor(a/b) or floor(b/a) is very often = 1 or = 2,
@@ -33,7 +33,7 @@ gcd (unsigned int a, unsigned int b)
      bit in a single instruction, and the algorithm uses fewer variables than
      Euclid's algorithm.  */
 
-  unsigned int c = a | b;
+  unsigned long c = a | b;
   c = c ^ (c - 1);
   /* c = largest power of 2 that divides a and b.  */
 
index 6be393383d19c5b0c1a0faa014b2293d1c72c4b8..39ea5ed8da9689bf251e25dd54ab02b66237791f 100644 (file)
--- a/lib/gcd.h
+++ b/lib/gcd.h
@@ -1,6 +1,6 @@
 /* Arithmetic.
    Copyright (C) 2001-2002 Free Software Foundation, Inc.
-   Written by Bruno Haible <haible@clisp.cons.org>, 2001.
+   Written by Bruno Haible <bruno@clisp.org>, 2001.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -20,6 +20,6 @@
 #define _GCD_H
 
 /* Return the greatest common divisor of a > 0 and b > 0.  */
-extern unsigned int gcd (unsigned int a, unsigned int b);
+extern unsigned long gcd (unsigned long a, unsigned long b);
 
 #endif /* _GCD_H */