Removed some debugging output.
Wrapped some debugging output in #ifdef DEBUG. Cleaned up language of some debugging output. (Hey, it's a kids' program!)
This commit is contained in:
parent
80334fae04
commit
83007087b0
1 changed files with 21 additions and 13 deletions
|
|
@ -22,7 +22,7 @@
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
(See COPYING.txt)
|
(See COPYING.txt)
|
||||||
|
|
||||||
June 14, 2002 - October 14, 2005
|
June 14, 2002 - October 22, 2005
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -2026,8 +2026,8 @@ static void groupfonts(void)
|
||||||
parse_font_style(user_font_styles[i]);
|
parse_font_style(user_font_styles[i]);
|
||||||
|
|
||||||
qsort(user_font_styles, num_font_styles, sizeof user_font_styles[0], compar_fontgroup);
|
qsort(user_font_styles, num_font_styles, sizeof user_font_styles[0], compar_fontgroup);
|
||||||
printf("groupfonts() qsort(user_font_styles...)\n");
|
//printf("groupfonts() qsort(user_font_styles...)\n");
|
||||||
fflush(stdout);
|
//fflush(stdout);
|
||||||
|
|
||||||
for(;;)
|
for(;;)
|
||||||
{
|
{
|
||||||
|
|
@ -2058,8 +2058,8 @@ static void groupfonts(void)
|
||||||
user_font_styles = NULL; // just to catch bugs
|
user_font_styles = NULL; // just to catch bugs
|
||||||
|
|
||||||
qsort(user_font_families, num_font_families, sizeof user_font_families[0], compar_fontkiller);
|
qsort(user_font_families, num_font_families, sizeof user_font_families[0], compar_fontkiller);
|
||||||
printf(stderr, "groupfonts() qsort(user_font_families 1...)\n");
|
//printf(stderr, "groupfonts() qsort(user_font_families 1...)\n");
|
||||||
fflush(stdout);
|
//fflush(stdout);
|
||||||
low = 0;
|
low = 0;
|
||||||
for(;;)
|
for(;;)
|
||||||
{
|
{
|
||||||
|
|
@ -2077,10 +2077,10 @@ static void groupfonts(void)
|
||||||
low = high;
|
low = high;
|
||||||
}
|
}
|
||||||
qsort(user_font_families, num_font_families, sizeof user_font_families[0], compar_fontscore);
|
qsort(user_font_families, num_font_families, sizeof user_font_families[0], compar_fontscore);
|
||||||
printf("groupfonts() qsort(user_font_families 2...)\n");
|
//printf("groupfonts() qsort(user_font_families 2...)\n");
|
||||||
fflush(stdout);
|
//fflush(stdout);
|
||||||
if(user_font_families[0]->score < 0)
|
if(user_font_families[0]->score < 0)
|
||||||
printf("sorted the wrong way, or all fonts were crap\n");
|
printf("sorted the wrong way, or all fonts were unusable\n");
|
||||||
#if 0
|
#if 0
|
||||||
// THREADED_FONTS
|
// THREADED_FONTS
|
||||||
printf("Trim starting with %d families\n", num_font_families);
|
printf("Trim starting with %d families\n", num_font_families);
|
||||||
|
|
@ -2590,7 +2590,9 @@ int main(int argc, char * argv[])
|
||||||
|
|
||||||
CLOCK_ASM(time2);
|
CLOCK_ASM(time2);
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
printf("Start-up time: %.3f\n", (double)(time2-time1)/CLOCK_SPEED);
|
printf("Start-up time: %.3f\n", (double)(time2-time1)/CLOCK_SPEED);
|
||||||
|
#endif
|
||||||
|
|
||||||
// Let the user know we're (nearly) ready now
|
// Let the user know we're (nearly) ready now
|
||||||
|
|
||||||
|
|
@ -6412,7 +6414,7 @@ static int do_surfcmp(const SDL_Surface *const *const v1, const SDL_Surface *con
|
||||||
|
|
||||||
if(s1==s2)
|
if(s1==s2)
|
||||||
{
|
{
|
||||||
printf("WTF?\n");
|
printf("s1==s2?\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if(!s1 || !s2 || !s1->w || !s2->w || !s1->h || !s2->h || !s1->format || !s2->format)
|
if(!s1 || !s2 || !s1->w || !s2->w || !s1->h || !s2->h || !s1->format || !s2->format)
|
||||||
|
|
@ -6488,8 +6490,6 @@ static int charset_works(TTF_Font *font, const char *s)
|
||||||
surfs[count++] = tmp_surf;
|
surfs[count++] = tmp_surf;
|
||||||
}
|
}
|
||||||
was_bad_font = 0;
|
was_bad_font = 0;
|
||||||
printf("charset_works()\n");
|
|
||||||
fflush(stdout);
|
|
||||||
qsort(surfs, count, sizeof surfs[0], surfcmp);
|
qsort(surfs, count, sizeof surfs[0], surfcmp);
|
||||||
ret = !was_bad_font;
|
ret = !was_bad_font;
|
||||||
out:
|
out:
|
||||||
|
|
@ -6720,8 +6720,11 @@ static void loadfont_callback(const char *restrict const dir, unsigned dirlen, t
|
||||||
const char *restrict const family = TTF_FontFaceFamilyName(font);
|
const char *restrict const family = TTF_FontFaceFamilyName(font);
|
||||||
const char *restrict const style = TTF_FontFaceStyleName(font);
|
const char *restrict const style = TTF_FontFaceStyleName(font);
|
||||||
int numfaces = TTF_FontFaces(font);
|
int numfaces = TTF_FontFaces(font);
|
||||||
|
#ifdef DEBUG
|
||||||
if (numfaces != 1)
|
if (numfaces != 1)
|
||||||
printf("Found %d faces in %s, %s, %s\n", numfaces, files[i].str, family, style);
|
printf("Found %d faces in %s, %s, %s\n", numfaces, files[i].str, family, style);
|
||||||
|
#endif
|
||||||
|
|
||||||
if(strcmp("Zapfino",family) && strcmp("Elvish Ring NFI",family) && charset_works(font, gettext("jq")) && charset_works(font, gettext("JQ")))
|
if(strcmp("Zapfino",family) && strcmp("Elvish Ring NFI",family) && charset_works(font, gettext("jq")) && charset_works(font, gettext("JQ")))
|
||||||
{
|
{
|
||||||
if (num_font_styles==num_font_styles_max)
|
if (num_font_styles==num_font_styles_max)
|
||||||
|
|
@ -7354,7 +7357,9 @@ static void run_font_scanner(void)
|
||||||
size += 2; // for 2-byte font count
|
size += 2; // for 2-byte font count
|
||||||
buf = malloc(size);
|
buf = malloc(size);
|
||||||
walk = buf;
|
walk = buf;
|
||||||
|
#ifdef DEBUG
|
||||||
printf("Sending %u bytes with %u families.\n", size, num_font_families);
|
printf("Sending %u bytes with %u families.\n", size, num_font_families);
|
||||||
|
#endif
|
||||||
*walk++ = num_font_families & 0xffu;
|
*walk++ = num_font_families & 0xffu;
|
||||||
*walk++ = num_font_families >> 8u;
|
*walk++ = num_font_families >> 8u;
|
||||||
i = num_font_families;
|
i = num_font_families;
|
||||||
|
|
@ -7433,8 +7438,6 @@ static void receive_some_font_info(void)
|
||||||
unsigned i;
|
unsigned i;
|
||||||
family_info *fip;
|
family_info *fip;
|
||||||
|
|
||||||
printf("receive_some_font_info()\n");
|
|
||||||
|
|
||||||
fcntl(font_socket_fd, F_SETFL, O_NONBLOCK);
|
fcntl(font_socket_fd, F_SETFL, O_NONBLOCK);
|
||||||
for(;;)
|
for(;;)
|
||||||
{
|
{
|
||||||
|
|
@ -7444,7 +7447,10 @@ static void receive_some_font_info(void)
|
||||||
buf = realloc(buf, buf_size);
|
buf = realloc(buf, buf_size);
|
||||||
}
|
}
|
||||||
rc = read(font_socket_fd, buf+buf_fill, buf_size-buf_fill);
|
rc = read(font_socket_fd, buf+buf_fill, buf_size-buf_fill);
|
||||||
|
#ifdef DEBUG
|
||||||
printf("read: fd=%d buf_fill=%u buf_size=%u rc=%ld\n", font_socket_fd, buf_fill, buf_size, rc);
|
printf("read: fd=%d buf_fill=%u buf_size=%u rc=%ld\n", font_socket_fd, buf_fill, buf_size, rc);
|
||||||
|
#endif
|
||||||
|
|
||||||
if(rc==-1)
|
if(rc==-1)
|
||||||
{
|
{
|
||||||
switch(errno)
|
switch(errno)
|
||||||
|
|
@ -7482,7 +7488,9 @@ printf("read: fd=%d buf_fill=%u buf_size=%u rc=%ld\n", font_socket_fd, buf_fill,
|
||||||
walk = buf;
|
walk = buf;
|
||||||
num_font_families = *walk++;
|
num_font_families = *walk++;
|
||||||
num_font_families += *walk++ << 8u;
|
num_font_families += *walk++ << 8u;
|
||||||
|
#ifdef DEBUG
|
||||||
printf("Got %u bytes with %u families.\n", buf_fill, num_font_families);
|
printf("Got %u bytes with %u families.\n", buf_fill, num_font_families);
|
||||||
|
#endif
|
||||||
user_font_families = malloc(num_font_families * sizeof *user_font_families);
|
user_font_families = malloc(num_font_families * sizeof *user_font_families);
|
||||||
fip = malloc(num_font_families * sizeof **user_font_families);
|
fip = malloc(num_font_families * sizeof **user_font_families);
|
||||||
i = num_font_families;
|
i = num_font_families;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue