21.5
>>>> "Jerry" == Jerry James
<james(a)xemacs.org> writes:
Jerry> APPROVE COMMIT 21.5
Jerry> Andrey Slusar <anrays(a)gmail.com> wrote:
> This patch fixed build with gcc 2.95 when use option
> --with-xft.
Jerry> That's good C++ and good C99,
C99 sux, C99 sux, C99 sux. What's "good" about C99? Is there
anything "good" about C99 that reverting to C89 (or even K&R) won't
fix?
Jerry> but it ain't good C89. Thanks for the fix, Andrey. I have
Jerry> committed this patch.
That may have looked like a misplaced declaration, but actually it's
an inlined function with multiple return values that's only used in
one place :-), and I want it to stay that way since that's something
I'm *coff* *coff* actively working on. So I'm going to revert it and
create a scope with an explicit block, instead.
Can't test gcc 2.95 on this box (and maybe not at all, freetype
bitches about "Unsupported size" of integer types, but that could be
Apple or DarwinPorts breakage), so I'm waiting on tests to commit.
I'll be trying on other boxes later.
Nor does CFLAGS=--std=c89 pick up the breakage. GCC sux, GCC sux, GCC
sux.
Almost all of the patch below is insignificant whitespace changes; all
it really does is add an open brace and a clarifying comment before
the problematic declaration, and a close brace just before the
ASSERT_ASCTEXT_ASCII.
dh237% cvs diff src
Index: src/ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/ChangeLog,v
retrieving revision 1.968
diff -u -r1.968 ChangeLog
--- src/ChangeLog 24 May 2006 16:30:28 -0000 1.968
+++ src/ChangeLog 25 May 2006 01:24:05 -0000
@@ -0,0 +1,5 @@
+2006-05-25 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * objects-x.c (x_find_charset_font): Keep local names local; wrap
+ the spurious declaration in a block, don't move it.
+
Index: src/objects-x.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/objects-x.c,v
retrieving revision 1.41
diff -u -r1.41 objects-x.c
--- src/objects-x.c 24 May 2006 16:30:32 -0000 1.41
+++ src/objects-x.c 25 May 2006 01:24:05 -0000
@@ -1215,7 +1215,6 @@
stderr_out ("Failed fontconfig initialization\n");
else
{
- struct charset_reporter *cr;
FcPattern *fontxft; /* long-lived, freed at end of this block */
FcResult fcresult;
FcConfig *fcc;
@@ -1303,34 +1302,40 @@
Optimization: cache the generated FcCharSet in the Mule charset.
Don't forget to destroy it if the Mule charset gets deallocated. */
- for (cr = charset_table;
- cr->charset && !EQ (*(cr->charset), charset);
- cr++)
- ;
-
- if (cr->rfc3066)
- {
- DECLARE_DEBUG_FONTNAME (name);
- CHECKING_LANG (0, eidata(name), cr->language);
- lang = cr->rfc3066;
- }
- else if (cr->charset)
- {
- /* what the hey, build 'em on the fly */
- /* #### in the case of error this could return NULL! */
- fccs = mule_to_fc_charset (charset);
- lang = XSTRING_DATA (XSYMBOL (XCHARSET_NAME (charset))-> name);
- }
- else
- {
- /* OK, we fell off the end of the table */
- warn_when_safe_lispobj (intern ("xft"), intern ("alert"),
- list2 (build_string ("unchecked charset"),
- charset));
+ {
+ /* This block possibly should be a function, but it generates
+ multiple values. I find the "pass an address to return the
+ value in" idiom opaque, so prefer a block. */
+ struct charset_reporter *cr;
+ for (cr = charset_table;
+ cr->charset && !EQ (*(cr->charset), charset);
+ cr++)
+ ;
+
+ if (cr->rfc3066)
+ {
+ DECLARE_DEBUG_FONTNAME (name);
+ CHECKING_LANG (0, eidata(name), cr->language);
+ lang = cr->rfc3066;
+ }
+ else if (cr->charset)
+ {
+ /* what the hey, build 'em on the fly */
+ /* #### in the case of error this could return NULL! */
+ fccs = mule_to_fc_charset (charset);
+ lang = XSTRING_DATA (XSYMBOL (XCHARSET_NAME (charset))-> name);
+ }
+ else
+ {
+ /* OK, we fell off the end of the table */
+ warn_when_safe_lispobj (intern ("xft"), intern ("alert"),
+ list2 (build_string ("unchecked charset"),
+ charset));
+ }
/* default to "en"
#### THIS IS WRONG, WRONG, WRONG!!
It is why we never fall through to XLFD-checking. */
- }
+ }
ASSERT_ASCTEXT_ASCII(lang);
--
School of Systems and Information Engineering
http://turnbull.sk.tsukuba.ac.jp
University of Tsukuba Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
Ask not how you can "do" free software business;
ask what your business can "do for" free software.