patch-lib_src___oo2c_h 1.0 KB

12345678910111213141516171819202122
  1. $OpenBSD: patch-lib_src___oo2c_h,v 1.1 2011/01/18 12:03:19 jasper Exp $
  2. --- lib/src/__oo2c.h.orig Sat Dec 24 15:55:21 2005
  3. +++ lib/src/__oo2c.h Tue Jan 18 13:47:55 2011
  4. @@ -152,7 +152,7 @@ extern OOC_INT32 _cmp32(const OOC_CHAR32* l, const OOC
  5. /* def: _x MOD _y >= 0 for _y>0, and undefined otherwise */
  6. #define _div(_x,_y) ({ \
  7. typeof(_x) _quot = _x / _y; \
  8. - if ((_x<0) && (_y>0) && (_quot*_y!=_x)) _quot--; \
  9. + if ((((_x<0) && (_y>0)) || ((_x>0) && (_y<0))) && (_quot*_y!=_x)) _quot--; \
  10. _quot; })
  11. /* MOD(integer, integer) -- note: macro uses gcc style expression statement */
  12. @@ -164,7 +164,7 @@ extern OOC_INT32 _cmp32(const OOC_CHAR32* l, const OOC
  13. /* def: _x MOD _y >= 0 for _y>0, and undefined otherwise */
  14. #define _mod(_x,_y) ({ \
  15. typeof(_x) _rem = _x % _y; \
  16. - if ((_x<0) && (_y>0) && (_rem != 0)) _rem += _y; \
  17. + if ((((_x<0) && (_y>0)) || ((_x>0) && (_y<0))) && (_rem != 0)) _rem += _y; \
  18. _rem; })
  19. /* i IN s */