Use limits.h to find min/max short value

Signed-off-by: Ran Benita <ran234@gmail.com>
master
Ran Benita 2012-03-02 16:12:18 +02:00
parent 266dfae589
commit a0b442356c
1 changed files with 3 additions and 9 deletions

View File

@ -28,17 +28,11 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <config.h> #include <config.h>
#endif #endif
#include <limits.h>
#include "xkbgeom.h" #include "xkbgeom.h"
#include "xkbcommon/xkbcommon.h" #include "xkbcommon/xkbcommon.h"
#include "XKBcommonint.h" #include "XKBcommonint.h"
#ifndef MINSHORT
#define MINSHORT -32768
#endif
#ifndef MAXSHORT
#define MAXSHORT 32767
#endif
static void static void
_XkbCheckBounds(struct xkb_bounds * bounds, int x, int y) _XkbCheckBounds(struct xkb_bounds * bounds, int x, int y)
{ {
@ -62,8 +56,8 @@ XkbcComputeShapeBounds(struct xkb_shape * shape)
if ((!shape) || (shape->num_outlines < 1)) if ((!shape) || (shape->num_outlines < 1))
return False; return False;
shape->bounds.x1 = shape->bounds.y1 = MAXSHORT; shape->bounds.x1 = shape->bounds.y1 = SHRT_MAX;
shape->bounds.x2 = shape->bounds.y2 = MINSHORT; shape->bounds.x2 = shape->bounds.y2 = SHRT_MIN;
for (outline = shape->outlines, o = 0; o < shape->num_outlines; for (outline = shape->outlines, o = 0; o < shape->num_outlines;
o++, outline++) o++, outline++)