Fix compile warnings on OSX

The following warnings were fixed:
* implicit conversion of NULL constant to 'bool'
* enumeration value '...' not handled in switch
This commit is contained in:
John-Philip Johansson 2016-05-28 12:16:21 +02:00 committed by Viktor Chlumský
parent 8a0388dadf
commit dc2bf4479d
3 changed files with 11 additions and 2 deletions

View File

@ -235,6 +235,7 @@ bool writeShapeDescription(FILE *output, const Shape &shape) {
case MAGENTA: colorCode = 'm'; break;
case CYAN: colorCode = 'c'; break;
case WHITE: colorCode = 'w'; break;
default: break;
}
{
const LinearSegment *e = dynamic_cast<const LinearSegment *>(&**edge);

View File

@ -94,10 +94,10 @@ bool loadGlyph(Shape &output, FontHandle *font, int unicode, double *advance) {
};
if (!font)
return NULL;
return false;
FT_Error error = FT_Load_Char(font->face, unicode, FT_LOAD_NO_SCALE);
if (error)
return NULL;
return false;
output.contours.clear();
output.inverseYAxis = false;
if (advance)

View File

@ -221,6 +221,8 @@ static const char * writeOutput(const Bitmap<T> &bitmap, const char *filename, F
fclose(file);
return NULL;
}
default:
break;
}
} else {
if (format == AUTO || format == TEXT)
@ -597,6 +599,8 @@ int main(int argc, const char * const *argv) {
fclose(file);
break;
}
default:
break;
}
// Validate and normalize shape
@ -695,6 +699,8 @@ int main(int argc, const char * const *argv) {
generateMSDF(msdf, shape, range, scale, translate, edgeThreshold);
break;
}
default:
break;
}
// Save output
@ -747,6 +753,8 @@ int main(int argc, const char * const *argv) {
ABORT("Failed to write test render file.");
}
break;
default:
break;
}
return 0;