summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/freetype/src/tools/ftrandom
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/freetype/src/tools/ftrandom')
-rw-r--r--src/3rdparty/freetype/src/tools/ftrandom/README2
-rw-r--r--src/3rdparty/freetype/src/tools/ftrandom/ftrandom.c38
2 files changed, 27 insertions, 13 deletions
diff --git a/src/3rdparty/freetype/src/tools/ftrandom/README b/src/3rdparty/freetype/src/tools/ftrandom/README
index c093f15e81..71bf05323d 100644
--- a/src/3rdparty/freetype/src/tools/ftrandom/README
+++ b/src/3rdparty/freetype/src/tools/ftrandom/README
@@ -43,6 +43,6 @@ Arguments are:
--rasterize Call FT_Render_Glyph as well as loading it.
--result <dir> This is the directory in which test files are
placed.
- --test <file> Run a single test on a pre-generated testcase.
+ --test <file> Run a single test on a pre-generated testcase.
Done in the current process so it can be debugged
more easily.
diff --git a/src/3rdparty/freetype/src/tools/ftrandom/ftrandom.c b/src/3rdparty/freetype/src/tools/ftrandom/ftrandom.c
index 4daac0dc1d..9a5b632673 100644
--- a/src/3rdparty/freetype/src/tools/ftrandom/ftrandom.c
+++ b/src/3rdparty/freetype/src/tools/ftrandom/ftrandom.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005, 2007, 2008 by George Williams */
+/* Copyright (C) 2005, 2007, 2008, 2013 by George Williams */
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -184,7 +184,6 @@
{
FT_Library context;
FT_Face face;
- int i, num;
if ( FT_Init_FreeType( &context ) )
@@ -203,6 +202,9 @@
TestFace( face );
else
{
+ int i, num;
+
+
num = face->num_faces;
FT_Done_Face( face );
@@ -327,12 +329,9 @@
FindFonts( char** fontdirs,
char** extensions )
{
- DIR* examples;
- struct dirent* ent;
-
- int i, max;
- char buffer[1025];
- struct stat statb;
+ int i, max;
+ char buffer[1025];
+ struct stat statb;
max = 0;
@@ -340,6 +339,10 @@
for ( i = 0; fontdirs[i] != NULL; ++i )
{
+ DIR* examples;
+ struct dirent* ent;
+
+
examples = opendir( fontdirs[i] );
if ( examples == NULL )
{
@@ -446,9 +449,9 @@
fseek( new, getRandom( 0, item->len - 1 ), SEEK_SET );
if ( item->isbinary )
- putc( getRandom( 0, 0xff ), new );
+ putc( getRandom( 0, 0xFF ), new );
else if ( item->isascii )
- putc( getRandom( 0x20, 0x7e ), new );
+ putc( getRandom( 0x20, 0x7E ), new );
else
{
int hex = getRandom( 0, 15 );
@@ -555,7 +558,6 @@
char** argv )
{
char **dirs, **exts;
- char *pt, *end;
int dcnt = 0, ecnt = 0, rset = false, allexts = false;
int i;
time_t now;
@@ -567,7 +569,10 @@
for ( i = 1; i < argc; ++i )
{
- pt = argv[i];
+ char* pt = argv[i];
+ char* end;
+
+
if ( pt[0] == '-' && pt[1] == '-' )
++pt;
@@ -633,12 +638,21 @@
}
if ( allexts )
+ {
+ free( exts );
exts = NULL;
+ }
else if ( ecnt == 0 )
+ {
+ free( exts );
exts = default_ext_list;
+ }
if ( dcnt == 0 )
+ {
+ free( dirs );
dirs = default_dir_list;
+ }
if ( testfile != NULL )
ExecuteTest( testfile ); /* This should never return */