--- a/lib/accessor.h Fri Dec 09 10:01:48 2011 +0100
+++ b/lib/accessor.h Fri Dec 09 10:03:37 2011 +0100
@@ -73,15 +73,15 @@
#define __GET_VAR(name, ...)\
name.value __VA_ARGS__
#define __GET_EXTERNAL(name, ...)\
- ((name.flags & __IEC_FORCE_FLAG) ? name.fvalue __VA_ARGS__ : *(name.value) __VA_ARGS__)
+ ((name.flags & __IEC_FORCE_FLAG) ? name.fvalue __VA_ARGS__ : (*(name.value)) __VA_ARGS__)
#define __GET_LOCATED(name, ...)\
- ((name.flags & __IEC_FORCE_FLAG) ? name.fvalue __VA_ARGS__ : *(name.value) __VA_ARGS__)
+ ((name.flags & __IEC_FORCE_FLAG) ? name.fvalue __VA_ARGS__ : (*(name.value)) __VA_ARGS__)
#define __GET_VAR_BY_REF(name, ...)\
((name.flags & __IEC_FORCE_FLAG) ? &(name.fvalue __VA_ARGS__) : &(name.value __VA_ARGS__))
#define __GET_EXTERNAL_BY_REF(name, ...)\
- ((name.flags & __IEC_FORCE_FLAG) ? &(name.fvalue __VA_ARGS__) : &(*(name.value) __VA_ARGS__))
+ ((name.flags & __IEC_FORCE_FLAG) ? &(name.fvalue __VA_ARGS__) : &((*(name.value)) __VA_ARGS__))
#define __GET_LOCATED_BY_REF(name, ...)\
- ((name.flags & __IEC_FORCE_FLAG) ? &(name.fvalue __VA_ARGS__) : &(*(name.value) __VA_ARGS__))
+ ((name.flags & __IEC_FORCE_FLAG) ? &(name.fvalue __VA_ARGS__) : &((*(name.value)) __VA_ARGS__))
// variable setting macros
#define __SET_VAR(prefix, name, new_value, ...)\
--- a/lib/iec_types_all.h Fri Dec 09 10:01:48 2011 +0100
+++ b/lib/iec_types_all.h Fri Dec 09 10:03:37 2011 +0100
@@ -97,6 +97,7 @@
typedef struct {\
type *value;\
IEC_BYTE flags;\
+ type fvalue;\
} __IEC_##type##_p;
#define __DECLARE_ENUMERATED_TYPE(type, ...)\