From 957d6601bdd4b4b50f7a774f85676f3b7eb685ed Mon Sep 17 00:00:00 2001 From: John Tytgat Date: Mon, 11 Jun 2007 20:47:18 +0000 Subject: - Reduced compiler warnings: - got rid of aliasing warnings by introducing an extra (void *) casting. - format specifier for 'size_t' type has now 'z' attribute - Injected const attributes (also changing public type rufl_family_list @ rufl.h) - makefile: - support for GCCSDK 3.4 (AOF) and GCCSDK 4 (ELF) based on AB_ELFBUILD (= a variable also used in GCCSDK Autobuilder). - changed the library name from rufl.o to librufl.a. Needed for GCCSDK 4 but if you're using -L -lrufl in your link line, this rename make that this works for both GCCSDK 3.4 and GCCSDK 4. [ Also changes for the Norcroft case which haven't been verified and probably no longer working. ] svn path=/trunk/rufl/; revision=3343 --- rufl_decompose.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'rufl_decompose.c') diff --git a/rufl_decompose.c b/rufl_decompose.c index 5889a7b..edf9748 100644 --- a/rufl_decompose.c +++ b/rufl_decompose.c @@ -72,6 +72,7 @@ rufl_code rufl_decompose_glyph(const char *font_family, { int *buf, *p, *ep; int buf_size; + char *buf_end; rufl_code err; /* Get required buffer size */ @@ -92,14 +93,14 @@ rufl_code rufl_decompose_glyph(const char *font_family, return err; } - rufl_fm_error = xfont_switch_output_to_buffer(0, 0, - (char **)&buf_size); + rufl_fm_error = xfont_switch_output_to_buffer(0, NULL, &buf_end); if (rufl_fm_error) { LOG("xfont_switch_output_to_buffer: 0x%x: %s", rufl_fm_error->errnum, rufl_fm_error->errmess); return rufl_FONT_MANAGER_ERROR; } + buf_size = buf_end - (char *)NULL; /* Allocate and initialise buffer */ buf = malloc(buf_size); @@ -130,7 +131,7 @@ rufl_code rufl_decompose_glyph(const char *font_family, return err; } - rufl_fm_error = xfont_switch_output_to_buffer(0, 0, (char **)&ep); + rufl_fm_error = xfont_switch_output_to_buffer(0, 0, &buf_end); if (rufl_fm_error) { LOG("xfont_switch_output_to_buffer: 0x%x: %s", rufl_fm_error->errnum, @@ -138,6 +139,7 @@ rufl_code rufl_decompose_glyph(const char *font_family, free(buf); return rufl_FONT_MANAGER_ERROR; } + ep = (int *)(void *)buf_end; /* Parse buffer, calling callbacks as required */ for (p = buf; p < ep;) { -- cgit v1.2.3