Skip to content

Commit

Permalink
Fixed compiling with Visual Studio
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Oct 22, 2017
1 parent c1ed3b6 commit 357c5f2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 2 additions & 0 deletions IMG_svg.c
Expand Up @@ -29,6 +29,8 @@

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <float.h>

/* Replace C runtime functions with SDL C runtime functions for building on Windows */
#define strtoll SDL_strtoll
Expand Down
4 changes: 2 additions & 2 deletions nanosvg.h 100644 → 100755
Expand Up @@ -1116,7 +1116,7 @@ static double nsvg__atof(const char* s)
// Parse integer part
if (nsvg__isdigit(*cur)) {
// Parse digit sequence
intPart = (double)strtoll(cur, &end, 10);
intPart = strtoll(cur, &end, 10);
if (cur != end) {
res = (double)intPart;
hasIntPart = 1;
Expand Down Expand Up @@ -2823,8 +2823,8 @@ static void nsvg__content(void* ud, const char* s)
static void nsvg__imageBounds(NSVGparser* p, float* bounds)
{
NSVGshape* shape;
shape = p->image->shapes;
int count = 0;
shape = p->image->shapes;

bounds[0] = FLT_MAX;
bounds[1] = FLT_MAX;
Expand Down
5 changes: 3 additions & 2 deletions nanosvgrast.h 100644 → 100755
Expand Up @@ -850,6 +850,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.
Expand All @@ -861,7 +862,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)
Expand Down Expand Up @@ -974,7 +975,7 @@ static unsigned int nsvg__applyOpacity(unsigned int c, float u)
return nsvg__RGBA((unsigned char)r, (unsigned char)g, (unsigned char)b, (unsigned char)a);
}

static inline int nsvg__div255(int x)
static int nsvg__div255(int x)
{
return ((x+1) * 257) >> 16;
}
Expand Down

0 comments on commit 357c5f2

Please sign in to comment.