Chris Shoemaker <[EMAIL PROTECTED]> writes:

> Modified: gnucash/trunk/src/engine/test-core/test-engine-stuff.c
> ===================================================================
> --- gnucash/trunk/src/engine/test-core/test-engine-stuff.c    2006-05-04 
> 09:18:39 UTC (rev 13918)
> +++ gnucash/trunk/src/engine/test-core/test-engine-stuff.c    2006-05-05 
> 00:17:04 UTC (rev 13919)
> @@ -961,8 +961,7 @@
>          amt = val;
>      } else {
>          gnc_numeric amt2 = xaccSplitGetAmount(s);
> -        int i = gnc_numeric_positive_p(amt2) + gnc_numeric_positive_p(amt);
> -        if (i % 2)
> +        if (gnc_numeric_positive_p(amt2) ^ gnc_numeric_positive_p(val))
>              amt = gnc_numeric_neg(amt2);
>      }   

This seems rather confusing or convoluted.   Why not just run:

  if (gnc_numeric_positive_p(amt2) != gnc_numeric_positive_p(val))
   ...

Are there really multiple bits such that you need to xor?

-derek

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       [EMAIL PROTECTED]                        PGP key available
_______________________________________________
gnucash-devel mailing list
[email protected]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel

Reply via email to