From 5f46e9aa0dc75aa248d6489b8792d1939cb98219 Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Wed, 3 Mar 2021 11:03:02 +0300 Subject: [PATCH] fix build using Watcom --- src/nanosvg.h | 4 +++- src/nanosvgrast.h | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/nanosvg.h b/src/nanosvg.h index 4c03ee58..c3c3ceb2 100644 --- a/src/nanosvg.h +++ b/src/nanosvg.h @@ -1488,7 +1488,9 @@ static NSVGcoordinate nsvg__parseCoordinateRaw(const char* str) static NSVGcoordinate nsvg__coord(float v, int units) { - NSVGcoordinate coord = {v, units}; + NSVGcoordinate coord ; + coord.value = v; + coord.units = units; return coord; } diff --git a/src/nanosvgrast.h b/src/nanosvgrast.h index b740c316..88205ec5 100644 --- a/src/nanosvgrast.h +++ b/src/nanosvgrast.h @@ -855,6 +855,7 @@ static int nsvg__cmpEdge(const void *p, const void *q) static NSVGactiveEdge* nsvg__addActive(NSVGrasterizer* r, NSVGedge* e, float startPoint) { NSVGactiveEdge* z; + float dxdy; if (r->freelist != NULL) { // Restore from freelist. @@ -866,7 +867,7 @@ static NSVGactiveEdge* nsvg__addActive(NSVGrasterizer* r, NSVGedge* e, float sta if (z == NULL) return NULL; } - float dxdy = (e->x1 - e->x0) / (e->y1 - e->y0); + dxdy = (e->x1 - e->x0) / (e->y1 - e->y0); // STBTT_assert(e->y0 <= start_point); // round dx down to avoid going too far if (dxdy < 0)