lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lynx-dev lynx2.8.2dev.18 UCdomap.c on OS/390


From: pg
Subject: Re: lynx-dev lynx2.8.2dev.18 UCdomap.c on OS/390
Date: Fri, 5 Mar 1999 13:07:50 -0700 (MST)

In a recent note, Leonid Pauzner said:

> Date: Fri,  5 Mar 1999 20:28:51 +0300 (MSK)
> 
> >> * chartrans: old-style declarations of charsets which do not have Unicode
> >>   tables (CJK, x-transparent, also UTF-8) now moved from LYCharSets.c to
> >>   UCdomap.h and now included with UCInit() in UCdomap.c in a standard way 
> >> - LP
> >>   (Please re-test CJK and UTF-8)
> 
> These are lines like
> 
> #define UC_CHARSET_SETUP_euc_cn UC_Charset_Setup("euc-cn","Chinese",\
>        NULL,NULL,0,(struct unimapdesc_str){0,NULL,0,1},\
>        128,UCT_ENC_CJK,0)
> 
Got it.  According to ANSI:

o 3.3.4 the type name shall specify scalar type and the operand shall
  have scalar type.  This means no casts to (struct).

o 3.5.7 the thing in the braces is an "initializer".  I find no basis
  to use a brace-enclosed initializer in an expression outside a
  declaration.

Patch attached.

I suspect these CHARSET_SETUP things are generally created by
the make process, not by hand, so I may be compounding a
predecessor's transgression.

-- gil
====================================================================
* Remove non-ANSI (struct unimapdesc_str) cast and use of
  initializers in expressions from UCdomap.h - PG

%%% Created Fri Mar  5 12:52:21 MST 1999 by target lynx.patch. %%%
diff -bru orig/lynx2-8-2/src/UCdomap.h lynx2-8-2/src/UCdomap.h
--- orig/lynx2-8-2/src/UCdomap.h        Thu Mar  4 03:39:45 1999
+++ lynx2-8-2/src/UCdomap.h     Fri Mar  5 12:50:21 1999
@@ -77,30 +77,34 @@
    *  from Unicode mechanism).  For now we use the MIME name that describes
    *  what is output to the terminal. - KW
    */
+static CONST struct unimapdesc_str dfont_replacedesc_Asian = {0,NULL,0,1};
+ 
 #define UC_CHARSET_SETUP_euc_cn UC_Charset_Setup("euc-cn","Chinese",\
-       NULL,NULL,0,(struct unimapdesc_str){0,NULL,0,1},\
+       NULL,NULL,0,dfont_replacedesc_Asian,\
        128,UCT_ENC_CJK,0)
 #define UC_CHARSET_SETUP_euc_jp UC_Charset_Setup("euc-jp","Japanese (EUC-JP)",\
-       NULL,NULL,0,(struct unimapdesc_str){0,NULL,0,1},\
+       NULL,NULL,0,dfont_replacedesc_Asian,\
        128,UCT_ENC_CJK,0)
 #define UC_CHARSET_SETUP_shift_jis UC_Charset_Setup("shift_jis","Japanese 
(Shift_JIS)",\
-       NULL,NULL,0,(struct unimapdesc_str){0,NULL,0,1},\
+       NULL,NULL,0,dfont_replacedesc_Asian,\
        128,UCT_ENC_CJK,0)
 #define UC_CHARSET_SETUP_euc_kr UC_Charset_Setup("euc-kr","Korean",\
-       NULL,NULL,0,(struct unimapdesc_str){0,NULL,0,1},\
+       NULL,NULL,0,dfont_replacedesc_Asian,\
        128,UCT_ENC_CJK,0)
 #define UC_CHARSET_SETUP_big5 UC_Charset_Setup("big5","Taipei (Big5)",\
-       NULL,NULL,0,(struct unimapdesc_str){0,NULL,0,1},\
+       NULL,NULL,0,dfont_replacedesc_Asian,\
        128,UCT_ENC_CJK,0)
   /*
    *  Placeholder for non-translation mode. - FM
    */
+static CONST struct unimapdesc_str dfont_replacedesc_trans = {0,NULL,0,0};
+ 
 #define UC_CHARSET_SETUP_x_transparent 
UC_Charset_Setup("x-transparent","Transparent",\
-       NULL,NULL,0,(struct unimapdesc_str){0,NULL,0,0},\
+       NULL,NULL,0,dfont_replacedesc_trans,\
        128,1,0)
 
 #define UC_CHARSET_SETUP_utf_8 UC_Charset_Setup("utf-8","UNICODE (UTF-8)",\
-       NULL,NULL,0,(struct unimapdesc_str){0,NULL,0,0},\
+       NULL,NULL,0,dfont_replacedesc_trans,\
        128,UCT_ENC_UTF8,0)
 
 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]