]> granicus.if.org Git - graphviz/commitdiff
expr: inline private state into 'Excc_t'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 5 Aug 2022 02:13:43 +0000 (19:13 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 6 Aug 2022 17:10:30 +0000 (10:10 -0700)
Now that `Excc_t` is encapsulated in excc.c and no longer considered an
extensible struct, we can stop playing macro tricks to give it extra fields and
just express these more naturally.

lib/expr/excc.c

index ce767956e514d6ff150b9e2b4dd0b6bf65cfb174..3d648fd45f9f8fce47fa55e6e1d22c246d33d688 100644 (file)
  * expression library C program generator
  */
 
-#define _EX_CC_PRIVATE_ \
-       char*           id;             /* prefix + _                   */ \
-       int             lastop;         /* last op                      */ \
-       int             tmp;            /* temp var index               */ \
-       Exccdisc_t*     ccdisc;         /* excc() discipline            */
-
 #include <cgraph/exit.h>
 #include <expr/exlib.h>
 #include <stddef.h>
@@ -43,11 +37,10 @@ struct Excc_s                               /* excc() state                 */
 {
        Expr_t*         expr;           /* exopen() state               */
        Exdisc_t*       disc;           /* exopen() discipline          */
-
-#ifdef _EX_CC_PRIVATE_
-       _EX_CC_PRIVATE_
-#endif
-
+       char*           id;             /* prefix + _                   */
+       int             lastop;         /* last op                      */
+       int             tmp;            /* temp var index               */
+       Exccdisc_t*     ccdisc;         /* excc() discipline            */
 };
 
 #define EX_CC_DUMP     0x8000