[PATCH 06/14] AVIS: Modified date time serialization to include flags


Frank Quinn <fquinn.ni@...>
 

This was done with a simple assignment. Will need revised if MAMA
ever decide to change their datetime format.

Signed-off-by: Frank Quinn <fquinn.ni@...>
---
 mama/c_cpp/src/c/payload/avismsg/avismsgimpl.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/mama/c_cpp/src/c/payload/avismsg/avismsgimpl.c b/mama/c_cpp/src/c/payload/avismsg/avismsgimpl.c
index b179dbf..0e01966 100644
--- a/mama/c_cpp/src/c/payload/avismsg/avismsgimpl.c
+++ b/mama/c_cpp/src/c/payload/avismsg/avismsgimpl.c
@@ -973,11 +973,11 @@ mama_status avisValue_getDateTime(const Value* pValue, mamaDateTime result)
     if (!pValue) return MAMA_STATUS_NULL_ARG;
     switch (pValue->type)
     {
-        case TYPE_STRING:  mamaDateTime_setFromString (result, pValue->value.str); break;
-        case TYPE_REAL64:  mamaDateTime_setEpochTimeF64 (result, pValue->value.real64); break;
-        case TYPE_INT64:  mamaDateTime_setEpochTimeMilliseconds (result, pValue->value.int64); break;
-        default: return MAMA_STATUS_WRONG_FIELD_TYPE; break;
-}
+        case TYPE_STRING: mamaDateTime_setFromString (result, pValue->value.str); break;
+        case TYPE_REAL64: mamaDateTime_setEpochTimeF64 (result, pValue->value.real64); break;
+        case TYPE_INT64:  *result = pValue->value.int64; break;
+        default: return MAMA_STATUS_WRONG_FIELD_TYPE; break;
+    }
     return MAMA_STATUS_OK;
 }
 
@@ -988,9 +988,7 @@ avisMsg_setDateTime(
         mama_fid_t          fid,
         const mamaDateTime  value)
 {
-    uint64_t tempu64;
-    mamaDateTime_getEpochTimeMicroseconds(value, &tempu64);
-    return avisMsg_setU64(attributes, name, fid, tempu64);
+    return avisMsg_setU64(attributes, name, fid, *value);
 }
 
 mama_status
--
2.4.3