client/src/unifycr.c
inline int unifycr_would_overflow_long(long a, long b)
{
    /* if both parameters are positive, they could overflow when
     * added together */
    if (a > 0 && b > 0) {
        /* if the distance between a and max is greater than or equal to
         * b, then we could add a and b and still not exceed max */
        if (unifycr_max_long - a >= b) {
            return 0;
        }
        return 1;
    }

    /* if both parameters are negative, they could underflow when
     * added together */
    if (a < 0 && b < 0) {
        /* if the distance between min and a is less than or equal to
         * b, then we could add a and b and still not exceed min */
        if (unifycr_min_long - a <= b) {
            return 0;
        }
        return 1;
    }

    /* if a and b are mixed signs or at least one of them is 0,
     * then adding them together will produce a result closer to 0
     * or at least no further away than either value already is*/
    return 0;
}
/* returns 1 if two input parameters will overflow their type when
 * added together */
returns 1 if two input parameters will overflow their type when
added together
returns 1 if two input parameters will overflow their type when added together
inline int unifycr_would_overflow_long(long a, long b)
{
    if (a > 0 && b > 0) {
        if (unifycr_max_long - a >= b) {
            return 0;
        }
        return 1;
    }
    if (a < 0 && b < 0) {
        if (unifycr_min_long - a <= b) {
            return 0;
        }
        return 1;
    }
    return 0;
}
inline int unifycr_would_overflow_long ( long a , long b ) { if ( a > 0 && b > 0 ) { if ( unifycr_max_long - a >= b ) { return 0 ; } return 1 ; } if ( a < 0 && b < 0 ) { if ( unifycr_min_long - a <= b ) { return 0 ; } return 1 ; } return 0 ; }
returns 1 if two input parameters will overflow their type when
 added together
returns 1 if two input parameters will overflow their type when added together
/* if both parameters are positive, they could overflow when
     * added together */ /* if the distance between a and max is greater than or equal to
         * b, then we could add a and b and still not exceed max */ /* if both parameters are negative, they could underflow when
     * added together */ /* if the distance between min and a is less than or equal to
         * b, then we could add a and b and still not exceed min */ /* if a and b are mixed signs or at least one of them is 0,
     * then adding them together will produce a result closer to 0
     * or at least no further away than either value already is*/