Bug on testing Retain and Force flags fixed
authorlaurent
Fri, 11 Dec 2009 13:04:22 +0100
changeset 507 bf6f623d7450
parent 506 24629d4fc805
child 508 73ecb803d8af
Bug on testing Retain and Force flags fixed
targets/plc_debug.c
--- a/targets/plc_debug.c	Fri Dec 11 13:03:44 2009 +0100
+++ b/targets/plc_debug.c	Fri Dec 11 13:04:22 2009 +0100
@@ -65,7 +65,7 @@
 #define __BufferDebugDataIterator_case_p(TYPENAME)\
         case TYPENAME##_P_ENUM :\
             *flags = ((__IEC_##TYPENAME##_p *)varp)->flags;\
-            if (*flags && __IEC_FORCE_FLAG)\
+            if (*flags & __IEC_FORCE_FLAG)\
                *ptrvalue = &((__IEC_##TYPENAME##_p *)varp)->fvalue;\
             else\
                *ptrvalue = ((__IEC_##TYPENAME##_p *)varp)->value;\
@@ -90,7 +90,7 @@
     char flags = 0;
     UnpackVar(varp, vartype, &ptrvalue, &flags);
 
-    if(flags && __IEC_RETAIN_FLAG){
+    if(flags & __IEC_RETAIN_FLAG){
         USINT size = __get_type_enum_size(vartype);
         /* compute next cursor positon*/
         unsigned int next_retain_offset = retain_offset + size;