# HG changeset patch # User uau # Date 1158588290 0 # Node ID 4e43ba6844d8e593ef0c5fd08198774224cc3b68 # Parent 9ffae26c0add271a3c87042ff4e6753cee49b9b0 Fix stupid use of multiplication to check signs which fails because of overflow. Negative values do not seem to be used so just remove the failing test. diff -r 9ffae26c0add -r 4e43ba6844d8 libaf/af.c --- a/libaf/af.c Mon Sep 18 13:00:51 2006 +0000 +++ b/libaf/af.c Mon Sep 18 14:04:50 2006 +0000 @@ -650,11 +650,9 @@ * \brief calculate greatest common divisior of a and b. * \ingroup af_filter * - * Extended for negative and 0 values. If both are 0 the result is 1. - * The sign of the result will be so that it has the same sign as b. + * If both are 0 the result is 1. */ int af_gcd(register int a, register int b) { - int b_org = b; while (b != 0) { a %= b; if (a == 0) @@ -665,8 +663,6 @@ a += b; if (!a) return 1; - if (a * b_org < 0) - return -a; return a; }