[MPlayer-dev-eng] [PATCH] fix compile with clang r150242

Nicolas George nicolas.george at normalesup.org
Sat Feb 25 10:02:12 CET 2012


Le sextidi 6 ventôse, an CCXX, compn a écrit :
> sub/sub_cc.c:68:19: error: illegal character encoding in character literal
>   chartbl[0x2a] = 'á';

As a matter of curiosity: what compiler and environment?

> Index: sub/sub_cc.c
> ===================================================================
> --- sub/sub_cc.c	(revision 34760)
> +++ sub/sub_cc.c	(working copy)
> @@ -65,16 +65,16 @@
>    for (i = 0; i < 128; i++)
>      chartbl[i] = (char) i;
>    /* now the special codes */
> -  chartbl[0x2a] = 'á';
> -  chartbl[0x5c] = 'é';
> -  chartbl[0x5e] = 'í';
> -  chartbl[0x5f] = 'ó';
> -  chartbl[0x60] = 'ú';
> -  chartbl[0x7b] = 'ç';
> -  chartbl[0x7c] = '÷';
> -  chartbl[0x7d] = 'Ñ';
> -  chartbl[0x7e] = 'ñ';
> -  chartbl[0x7f] = '¤';    /* FIXME: this should be a solid block */
> +  chartbl[0x2a] = 0xe1;
> +  chartbl[0x5c] = 0xe9;
> +  chartbl[0x5e] = 0xed;
> +  chartbl[0x5f] = 0xf3;
> +  chartbl[0x60] = 0xfa;
> +  chartbl[0x7b] = 0xe7;
> +  chartbl[0x7c] = 0xf7;
> +  chartbl[0x7d] = 0xd1;
> +  chartbl[0x7e] = 0xf1;
> +  chartbl[0x7f] = 0xa4;    /* FIXME: this should be a solid block */
>  }

Assuming the original code was right and supposed to be ISO-8859-1, the
change seems fine. I would like it even better with:

+  chartbl[0x2a] = 0xe1; /* á */
+  chartbl[0x5c] = 0xe9; /* é */
+  chartbl[0x5e] = 0xed; /* í */
+  chartbl[0x5f] = 0xf3; /* ó */
+  chartbl[0x60] = 0xfa; /* ú */
+  chartbl[0x7b] = 0xe7; /* ç */
+  chartbl[0x7c] = 0xf7; /* ÷ */
+  chartbl[0x7d] = 0xd1; /* Ñ */
+  chartbl[0x7e] = 0xf1; /* ñ */
+  chartbl[0x7f] = 0xa4; /* ¤ FIXME: this should be a solid block */

The compiler should not choke on non-ASCII in comments.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20120225/4ab9880d/attachment.asc>


More information about the MPlayer-dev-eng mailing list