Worked Around GCC 4.6.3's Bool issue
authorErich Keane <erich.keane@intel.com>
Tue, 11 Aug 2015 18:40:19 +0000 (11:40 -0700)
committerErich Keane <erich.keane@intel.com>
Tue, 11 Aug 2015 20:57:25 +0000 (20:57 +0000)
GCC 4.6.3 converted bools improperly, I believe this to be a bug in the
compiler, however this work around forces the conversion to happen correctly.

Signed-off-by: Erich Keane <erich.keane@intel.com>
Change-Id: I30bbe9807593075a2518018f268d6e14a8dfa47a
Reviewed-on: https://gerrit.iotivity.org/gerrit/2170
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
resource/src/OCRepresentation.cpp

index df11e3c..01969fc 100644 (file)
@@ -374,10 +374,11 @@ namespace OC
                     OCRepPayloadSetPropInt(root, val.attrname().c_str(), static_cast<int>(val));
                     break;
                 case AttributeType::Double:
-                    OCRepPayloadSetPropDouble(root, val.attrname().c_str(), val);
+                    OCRepPayloadSetPropDouble(root, val.attrname().c_str(),
+                            val.getValue<double>());
                     break;
                 case AttributeType::Boolean:
-                    OCRepPayloadSetPropBool(root, val.attrname().c_str(), val);
+                    OCRepPayloadSetPropBool(root, val.attrname().c_str(), val.getValue<bool>());
                     break;
                 case AttributeType::String:
                     OCRepPayloadSetPropString(root, val.attrname().c_str(),