Protection of value in macro.
authorPeter Verthez <Peter.Verthez@advalvas.be>
Sun, 26 Jan 2003 18:06:59 +0000 (18:06 +0000)
committerPeter Verthez <Peter.Verthez@advalvas.be>
Sun, 26 Jan 2003 18:06:59 +0000 (18:06 +0000)
include/gedcom.h.in

index 8129975e38fce31ee121a57f45c608be419f97bb..6219def3d443e07562e74ad88d08c0800a8d2fc4 100644 (file)
@@ -435,12 +435,12 @@ extern struct age_value  def_age_val;
 extern struct xref_value def_xref_val;
 
 #define GV_CHECK_CAST(VAL, TYPE, MEMBER, DEFVAL)                              \
-   ((VAL->type == TYPE) ?                                                     \
-    VAL->value.MEMBER :                                                       \
-    (gedcom_cast_error(__FILE__,__LINE__, TYPE, VAL->type), DEFVAL))
+   (((VAL)->type == TYPE) ?                                                   \
+    (VAL)->value.MEMBER :                                                     \
+    (gedcom_cast_error(__FILE__,__LINE__, TYPE, (VAL)->type), DEFVAL))
 
 #define GV_IS_TYPE(VAL, TYPE)                                                 \
-   (VAL->type == TYPE)
+   ((VAL)->type == TYPE)
 
 /**************************************************************************/
 /***  Function interface                                                ***/