diff options
author | Larsson@.(none) <Larsson@.(none)> | 2010-02-26 08:55:36 +0100 |
---|---|---|
committer | unknown <Alexander Larsson@.(none)> | 2010-03-01 15:12:32 +0100 |
commit | ea92e6c063eb667f1eb69ce1103987c461d56219 (patch) | |
tree | 13e3c8fc8d49c6be41557ba0db5666f08e196224 /common | |
parent | bb77edf6435af599830e9500c13b8ef9d196e9c0 (diff) |
Fix warnings from visual studio compiler
Diffstat (limited to 'common')
-rw-r--r-- | common/lines.c | 20 | ||||
-rw-r--r-- | common/pixman_utils.c | 10 |
2 files changed, 15 insertions, 15 deletions
diff --git a/common/lines.c b/common/lines.c index 8e44ac3a..e02f3d67 100644 --- a/common/lines.c +++ b/common/lines.c @@ -77,7 +77,7 @@ SOFTWARE. #define xrealloc(a,b) realloc(a,b) #define xfree(i) free(i) -typedef uint32_t CARD32; +typedef unsigned int CARD32; typedef int Boolean; typedef pixman_rectangle32_t xRectangle; typedef SpicePoint DDXPointRec; @@ -89,7 +89,7 @@ typedef struct lineGC *GCPtr; * a signed type. */ #define MAX_COORDINATE 2147483647 -#define MIN_COORDINATE -2147483648 +#define MIN_COORDINATE -2147483647 #define miZeroLine spice_canvas_zero_line #define miZeroDashLine spice_canvas_zero_dash_line @@ -99,7 +99,7 @@ typedef struct lineGC *GCPtr; static int inline ICEIL (double x) { - int _cTmp = x; + int _cTmp = (int)x; return ((x == _cTmp) || (x < 0.0)) ? _cTmp : _cTmp + 1; } @@ -1420,7 +1420,7 @@ miZeroClipLine (int xmin, int ymin, int xmax, int ymax, utmp++; if (negslope) - utmp = -utmp; + utmp = (uint32_t)(-(int32_t)utmp); if (eqn & T_2NDX) /* We are calculating X steps */ x1 = anchorval + utmp; @@ -2114,8 +2114,8 @@ miLineJoin (GCPtr pGC, Boolean foreground, SpanDataPtr spanData, LineFacePtr pLe scale = ady; if (adx > ady) scale = adx; - slopes[2].dx = (dx * 65536) / scale; - slopes[2].dy = (dy * 65536) / scale; + slopes[2].dx = (int) ((dx * 65536) / scale); + slopes[2].dy = (int) ((dy * 65536) / scale); slopes[2].k = ((pLeft->xa + pRight->xa) * slopes[2].dy - (pLeft->ya + pRight->ya) * slopes[2].dx) / 2.0; edgecount = 3; @@ -2217,7 +2217,7 @@ miLineArcD (GCPtr pGC, pts = points; wids = widths; - xbase = floor (xorg); + xbase = (int)floor (xorg); x0 = xorg - xbase; ybase = ICEIL (yorg); y0 = yorg - ybase; @@ -2225,7 +2225,7 @@ miLineArcD (GCPtr pGC, xrk = x0 + x0 - 1.0; yk = y0 + y0 - 1.0; radius = ((double) pGC->lineWidth) / 2.0; - y = floor (radius - y0 + 1.0); + y = (int)floor (radius - y0 + 1.0); ybase -= y; ymin = ybase; ymax = 65536; @@ -2303,7 +2303,7 @@ miLineArcD (GCPtr pGC, } er = xrk - (xr << 1) - er; el = (xl << 1) - xlk - el; - boty = floor (-y0 - radius + 1.0); + boty = (int)floor (-y0 - radius + 1.0); if (ybase + y - boty > ymax) boty = ymax - ybase - y; while (y > boty) { @@ -3251,7 +3251,7 @@ miWideDashSegment (GCPtr pGC, &lcapFace, (LineFacePtr) NULL, rcenterx, rcentery, FALSE); } } - dashRemain = ((double) dashRemain) - LRemain; + dashRemain = (int)(((double) dashRemain) - LRemain); if (dashRemain == 0) { dashIndex++; if (dashIndex == pGC->numInDashList) diff --git a/common/pixman_utils.c b/common/pixman_utils.c index 27257f7a..30e89192 100644 --- a/common/pixman_utils.c +++ b/common/pixman_utils.c @@ -43,7 +43,7 @@ solid_rop_ ## _name ## _ ## _size (_type *ptr, int len, _type src) \ { \ while (len--) { \ _type dst = *ptr; \ - if (dst) /* avoid unused warning */; \ + if (dst) /* avoid unused warning */{}; \ *ptr = (_type)(_equation); \ ptr++; \ } \ @@ -56,8 +56,8 @@ tiled_rop_ ## _name ## _ ## _size (_type *ptr, int len, _type *tile, _type *tile while (len--) { \ _type src = *tile; \ _type dst = *ptr; \ - if (src) /* avoid unused warning */; \ - if (dst) /* avoid unused warning */; \ + if (src) /* avoid unused warning */{}; \ + if (dst) /* avoid unused warning */{}; \ *ptr = (_type)(_equation); \ ptr++; \ tile++; \ @@ -73,8 +73,8 @@ static void \ while (len--) { \ _type src = *src_line; \ _type dst = *ptr; \ - if (src) /* avoid unused warning */; \ - if (dst) /* avoid unused warning */; \ + if (src) /* avoid unused warning */ {}; \ + if (dst) /* avoid unused warning */{}; \ *ptr = (_type)(_equation); \ ptr++; \ src_line++; \ |