On Fri, 11 Jun 2004, [UTF-8] Branko Ä^Libej wrote:
> Peter N. Lundblad wrote:
>
> And one nit from me:
>
> >+/* Compare revision numbers for sorting in decreasing order. */
> >+static int
> >+compare_revnums (const void *p_a, const void *p_b)
> >+{
> >+ svn_revnum_t a, b;
> >+ a = *(svn_revnum_t *)p_a;
> >+ b = *(svn_revnum_t *)p_b;
> >+
> >+ return (a < b) ? 1 : (a > b) ? -1 : 0;
> >+}
> >
> >
> Sigh, I'm so tired of seeing people write these verbose comparison
> expressions... :-)
>
> return b - a;
Don't we risk getting an over/underflow exception on platforms where such
things are signalled? Remember that these are signed numbers, and the
modulo 2 rule only applies to unsigned integral types if I understand the
C(++) standard correctly. But you seem to have ISO C available, so you
might be able to quote some paragraphs...:-)
Please correct me if I'm wrong.
//Peter
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Jun 11 14:27:29 2004