Browse Source

Merge pull request #295 from nhojb/master

Fixing clang compiler warnings.
shared-context
Mikko Mononen GitHub 8 years ago
parent
commit
cc3897359a
2 changed files with 7 additions and 3 deletions
  1. +6
    -2
      src/fontstash.h
  2. +1
    -1
      src/nanovg.c

+ 6
- 2
src/fontstash.h View File

@@ -202,7 +202,7 @@ int fons__tt_buildGlyphBitmap(FONSttFontImpl *font, int glyph, float size, float
ftError = FT_Get_Advance(font->font, glyph, FT_LOAD_NO_SCALE, (FT_Fixed*)advance);
if (ftError) return 0;
ftGlyph = font->font->glyph;
*lsb = ftGlyph->metrics.horiBearingX;
*lsb = (int)ftGlyph->metrics.horiBearingX;
*x0 = ftGlyph->bitmap_left;
*x1 = *x0 + ftGlyph->bitmap.width;
*y0 = -ftGlyph->bitmap_top;
@@ -233,7 +233,7 @@ int fons__tt_getGlyphKernAdvance(FONSttFontImpl *font, int glyph1, int glyph2)
{
FT_Vector ftKerning;
FT_Get_Kerning(font->font, glyph1, glyph2, FT_KERNING_DEFAULT, &ftKerning);
return ftKerning.x;
return (int)ftKerning.x;
}

#else
@@ -421,6 +421,8 @@ struct FONScontext
void* errorUptr;
};

#ifdef STB_TRUETYPE_IMPLEMENTATION

static void* fons__tmpalloc(size_t size, void* up)
{
unsigned char* ptr;
@@ -446,6 +448,8 @@ static void fons__tmpfree(void* ptr, void* up)
// empty
}

#endif // STB_TRUETYPE_IMPLEMENTATION

// Copyright (c) 2008-2010 Bjoern Hoehrmann <bjoern@hoehrmann.de>
// See http://bjoern.hoehrmann.de/utf-8/decoder/dfa/ for details.



+ 1
- 1
src/nanovg.c View File

@@ -386,7 +386,7 @@ NVGcolor nvgLerpRGBA(NVGcolor c0, NVGcolor c1, float u)
{
int i;
float oneminu;
NVGcolor cint;
NVGcolor cint = {0};

u = nvg__clampf(u, 0.0f, 1.0f);
oneminu = 1.0f - u;


Loading…
Cancel
Save