Correct a comment.
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Wed, 9 Nov 2011 21:38:39 +0000 (21:38 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Wed, 9 Nov 2011 21:38:39 +0000 (21:38 +0000)
I had wrongly believed my TYPECHECK macro double-evaluated one of its
arguments and hence would cause side effects to happen twice. But in
fact I've just realised that although it double-_expands_ the
argument, it doesn't double-_evaluate_ it: the two expansions occur in
mutually exclusive branches of a ?:, and hence cannot both be
executed.

So I've removed the comment that says my macro is rubbish. My macro is
in fact great :-)

git-svn-id: svn://svn.tartarus.org/sgt/charset@9328 cda61777-01e9-0310-a592-d414129be87e

iso2022.c

index 56c4b1d..6e527dd 100644 (file)
--- a/iso2022.c
+++ b/iso2022.c
@@ -81,8 +81,7 @@ typedef int (*to_dbcs_planar_t)(long int, int *, int *, int *);
  * 
  * We are permitted to use ?:, however, and that works quite well
  * since the actual result of the sizeof expression _is_ evaluable
- * at compile time. So here's my final answer, with the unfortunate
- * remaining problem of evaluating its arguments multiple times:
+ * at compile time. So here's my final answer:
  */
 #define TYPECHECK(x,y) ( sizeof((x)) == sizeof((x)) ? (y) : (y) )
 #define DEPLANARISE(x) TYPECHECK((x) == (to_dbcs_planar_t)NULL, (to_dbcs_t)(x))