Markos Zaharioudakis has proposed merging 
lp:~zorba-coders/zorba/no-expr-serialization into lp:zorba.

Requested reviews:
  Markos Zaharioudakis (markos-za)
Related bugs:
  Bug #1014975 in Zorba: "Reworked Plan serializer"
  https://bugs.launchpad.net/zorba/+bug/1014975

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/no-expr-serialization/+merge/112246

replaced serialize_long() method with operator
-- 
https://code.launchpad.net/~zorba-coders/zorba/no-expr-serialization/+merge/112246
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'src/compiler/expression/var_expr.cpp'
--- src/compiler/expression/var_expr.cpp	2012-06-18 10:06:47 +0000
+++ src/compiler/expression/var_expr.cpp	2012-06-26 23:25:23 +0000
@@ -142,7 +142,7 @@
 
   SERIALIZE_ENUM(var_kind, theVarKind);
 
-  serialize_ulong(ar, theUniqueId);
+  ar & theUniqueId;
 
   ar & theName;
   ar & theDeclaredType;

=== modified file 'src/runtime/booleans/BooleanImpl.cpp'
--- src/runtime/booleans/BooleanImpl.cpp	2012-06-21 09:10:57 +0000
+++ src/runtime/booleans/BooleanImpl.cpp	2012-06-26 23:25:23 +0000
@@ -350,7 +350,7 @@
   SERIALIZE_ENUM(CompareConsts::CompareType, theCompType)
   ar & theIsGeneralComparison;
   SERIALIZE_TYPEMANAGER(TypeManager, theTypeManager);
-  serialize_long(ar, theTimezone);
+  ar & theTimezone;
   ar & theCollation;
 }
 
@@ -1027,7 +1027,7 @@
   (NaryBaseIterator<TypedValueCompareIterator<ATC>, PlanIteratorState>*)this);
 
   SERIALIZE_ENUM(CompareConsts::CompareType, theCompType);
-  serialize_long(ar, theTimezone);
+  ar & theTimezone;
   ar & theCollation;
 }
 
@@ -1178,7 +1178,7 @@
   (BinaryBaseIterator<AtomicValuesEquivalenceIterator, PlanIteratorState>*)this);
 
   SERIALIZE_TYPEMANAGER(TypeManager, theTypeManager);
-  serialize_long(ar, theTimezone);
+  ar & theTimezone;
   ar & theCollation;
 }
 

=== modified file 'src/runtime/core/gflwor/window_iterator.cpp'
--- src/runtime/core/gflwor/window_iterator.cpp	2012-06-18 10:06:47 +0000
+++ src/runtime/core/gflwor/window_iterator.cpp	2012-06-26 23:25:23 +0000
@@ -614,7 +614,7 @@
   ar & theEndClause;
   ar & theLazyEval;
 
-  serialize_ulong(ar, theMaxNeededHistory);
+  ar & theMaxNeededHistory;
 }
 
 

=== modified file 'src/runtime/core/var_iterators.cpp'
--- src/runtime/core/var_iterators.cpp	2012-06-18 10:06:47 +0000
+++ src/runtime/core/var_iterators.cpp	2012-06-26 23:25:23 +0000
@@ -82,7 +82,7 @@
   serialize_baseclass(ar,
   (NaryBaseIterator<CtxVarDeclareIterator, PlanIteratorState>*)this);
 
-  serialize_ulong(ar, theVarId);
+  ar & theVarId;
   ar & theVarName;
   ar & theIsExternal;
   ar & theSingleItem;
@@ -148,7 +148,7 @@
   serialize_baseclass(ar,
   (UnaryBaseIterator<CtxVarAssignIterator, PlanIteratorState>*)this);
 
-  serialize_ulong(ar, theVarId);
+  ar & theVarId;
 
   ar & theVarName;
   ar & theIsLocal;
@@ -211,7 +211,7 @@
   serialize_baseclass(ar,
   (NoaryBaseIterator<CtxVarIsSetIterator, PlanIteratorState>*)this);
 
-  serialize_ulong(ar, theVarId);
+  ar & theVarId;
 
   ar & theVarName;
 }
@@ -286,7 +286,7 @@
   serialize_baseclass(ar,
   (NoaryBaseIterator<CtxVarIterator, CtxVarState>*)this);
 
-  serialize_ulong(ar, theVarId);
+  ar & theVarId;
 
   ar & theVarName;
   ar & theIsLocal;

=== modified file 'src/zorbaserialization/serialize_basic_types.cpp'
--- src/zorbaserialization/serialize_basic_types.cpp	2012-06-22 15:19:14 +0000
+++ src/zorbaserialization/serialize_basic_types.cpp	2012-06-26 23:25:23 +0000
@@ -37,50 +37,6 @@
 /*******************************************************************************
 
 ********************************************************************************/
-void serialize_long_long(Archiver& ar, long long& obj)
-{
-  assert(sizeof(long long) == 8);
-
-  if (ar.is_serializing_out())
-  {
-    int64_t int64v = obj;
-    ar.add_simple_temp_field(TYPE_INT64, &int64v);
-  }
-  else
-  {
-    int64_t int64v;
-    ar.read_next_simple_temp_field(TYPE_INT64, &int64v);
-
-    obj = static_cast<long long>(int64v);
-  }
-}
-
-
-/*******************************************************************************
-
-********************************************************************************/
-void serialize_ulong_long(Archiver& ar, unsigned long long& obj)
-{
-  assert(sizeof(unsigned long long) == 8);
-
-  if (ar.is_serializing_out())
-  {
-    uint64_t uint64v = obj;
-    ar.add_simple_temp_field(TYPE_UINT64, &uint64v);
-  }
-  else
-  {
-    uint64_t uint64v;
-    ar.read_next_simple_temp_field(TYPE_UINT64, &uint64v);
-
-    obj = static_cast<unsigned long long>(uint64v);
-  }
-}
-
-
-/*******************************************************************************
-
-********************************************************************************/
 void operator&(Archiver& ar, int64_t& obj)
 {
   if (ar.is_serializing_out())
@@ -113,68 +69,6 @@
 /*******************************************************************************
 
 ********************************************************************************/
-void serialize_long(Archiver& ar, long& obj)
-{
-  if (ar.is_serializing_out())
-  {
-    int64_t int64v = obj;
-    ar.add_simple_temp_field(TYPE_INT64, &int64v);
-  }
-  else
-  {
-    int64_t int64v;
-    ar.read_next_simple_temp_field(TYPE_INT64, &int64v);
-
-    obj = static_cast<long>(int64v);
-  }
-}
-
-
-/*******************************************************************************
-
-********************************************************************************/
-void serialize_ulong(Archiver& ar, ulong& obj)
-{
-  if (ar.is_serializing_out())
-  {
-    uint64_t uint64v = obj;
-    ar.add_simple_temp_field(TYPE_UINT64, &uint64v);
-  }
-  else
-  {
-    uint64_t uint64v;
-    ar.read_next_simple_temp_field(TYPE_UINT64, &uint64v);
-
-    obj = static_cast<ulong>(uint64v);
-  }
-}
-
-
-/*******************************************************************************
-
-********************************************************************************/
-void serialize_csize(Archiver& ar, csize& obj)
-{
-  assert(sizeof(csize) <= 8);
-
-  if (ar.is_serializing_out())
-  {
-    uint64_t uint64v = obj;
-    ar.add_simple_temp_field(TYPE_UINT64, &uint64v);
-  }
-  else
-  {
-    uint64_t uint64v;
-    ar.read_next_simple_temp_field(TYPE_UINT64, &uint64v);
-
-    obj = static_cast<csize>(uint64v);
-  }
-}
-
-
-/*******************************************************************************
-
-********************************************************************************/
 void operator&(Archiver& ar, int32_t& obj)
 {
   if (ar.is_serializing_out())
@@ -207,22 +101,6 @@
 /*******************************************************************************
 
 ********************************************************************************/
-void serialize_enum(Archiver& ar, uint32_t& obj)
-{
-  if (ar.is_serializing_out())
-  {
-    ar.add_simple_temp_field(TYPE_ENUM, &obj);
-  }
-  else
-  {
-    ar.read_next_simple_temp_field(TYPE_ENUM, &obj);
-  }
-}
-
-
-/*******************************************************************************
-
-********************************************************************************/
 void operator&(Archiver& ar, int16_t& obj)
 {
   if (ar.is_serializing_out())
@@ -255,6 +133,128 @@
 /*******************************************************************************
 
 ********************************************************************************/
+void operator&(Archiver& ar, long& obj)
+{
+  if (ar.is_serializing_out())
+  {
+    int64_t int64v = obj;
+    ar.add_simple_temp_field(TYPE_INT64, &int64v);
+  }
+  else
+  {
+    int64_t int64v;
+    ar.read_next_simple_temp_field(TYPE_INT64, &int64v);
+
+    obj = static_cast<long>(int64v);
+  }
+}
+
+
+/*******************************************************************************
+
+********************************************************************************/
+void operator&(Archiver& ar, ulong& obj)
+{
+  if (ar.is_serializing_out())
+  {
+    uint64_t uint64v = obj;
+    ar.add_simple_temp_field(TYPE_UINT64, &uint64v);
+  }
+  else
+  {
+    uint64_t uint64v;
+    ar.read_next_simple_temp_field(TYPE_UINT64, &uint64v);
+
+    obj = static_cast<ulong>(uint64v);
+  }
+}
+
+
+/*******************************************************************************
+
+********************************************************************************/
+void serialize_long_long(Archiver& ar, long long& obj)
+{
+  assert(sizeof(long long) == 8);
+
+  if (ar.is_serializing_out())
+  {
+    int64_t int64v = obj;
+    ar.add_simple_temp_field(TYPE_INT64, &int64v);
+  }
+  else
+  {
+    int64_t int64v;
+    ar.read_next_simple_temp_field(TYPE_INT64, &int64v);
+
+    obj = static_cast<long long>(int64v);
+  }
+}
+
+
+/*******************************************************************************
+
+********************************************************************************/
+void serialize_ulong_long(Archiver& ar, unsigned long long& obj)
+{
+  assert(sizeof(unsigned long long) == 8);
+
+  if (ar.is_serializing_out())
+  {
+    uint64_t uint64v = obj;
+    ar.add_simple_temp_field(TYPE_UINT64, &uint64v);
+  }
+  else
+  {
+    uint64_t uint64v;
+    ar.read_next_simple_temp_field(TYPE_UINT64, &uint64v);
+
+    obj = static_cast<unsigned long long>(uint64v);
+  }
+}
+
+
+/*******************************************************************************
+
+********************************************************************************/
+void serialize_csize(Archiver& ar, csize& obj)
+{
+  assert(sizeof(csize) <= 8);
+
+  if (ar.is_serializing_out())
+  {
+    uint64_t uint64v = obj;
+    ar.add_simple_temp_field(TYPE_UINT64, &uint64v);
+  }
+  else
+  {
+    uint64_t uint64v;
+    ar.read_next_simple_temp_field(TYPE_UINT64, &uint64v);
+
+    obj = static_cast<csize>(uint64v);
+  }
+}
+
+
+/*******************************************************************************
+
+********************************************************************************/
+void serialize_enum(Archiver& ar, uint32_t& obj)
+{
+  if (ar.is_serializing_out())
+  {
+    ar.add_simple_temp_field(TYPE_ENUM, &obj);
+  }
+  else
+  {
+    ar.read_next_simple_temp_field(TYPE_ENUM, &obj);
+  }
+}
+
+
+/*******************************************************************************
+
+********************************************************************************/
 void operator&(Archiver& ar, char& obj)
 {
   if (ar.is_serializing_out())

=== modified file 'src/zorbaserialization/serialize_basic_types.h'
--- src/zorbaserialization/serialize_basic_types.h	2012-06-22 15:19:14 +0000
+++ src/zorbaserialization/serialize_basic_types.h	2012-06-26 23:25:23 +0000
@@ -43,26 +43,26 @@
 
 void operator&(Archiver& ar, uint64_t& obj);
 
-void serialize_long(Archiver& ar, long& obj);
+void operator&(Archiver& ar, int32_t& obj);
+
+void operator&(Archiver& ar, uint32_t& obj);
+
+void operator&(Archiver& ar, int16_t& obj);
+
+void operator&(Archiver& ar, uint16_t& obj);
+
+void operator&(Archiver& ar, long& obj);
+
+void operator&(Archiver& ar, ulong& obj);
 
 void serialize_long_long(Archiver& ar, long long& obj);
 
 void serialize_ulong_long(Archiver& ar, unsigned long long& obj);
 
-void serialize_ulong(Archiver& ar, ulong& obj);
-
 void serialize_csize(Archiver& ar, csize& obj);
 
-void operator&(Archiver& ar, int32_t& obj);
-
-void operator&(Archiver& ar, uint32_t& obj);
-
 void serialize_enum(Archiver& ar, uint32_t& obj);
 
-void operator&(Archiver& ar, int16_t& obj);
-
-void operator&(Archiver& ar, uint16_t& obj);
-
 void operator&(Archiver& ar, char& obj);
 
 void operator&(Archiver& ar, unsigned char& obj);

=== modified file 'src/zorbaserialization/serialize_zorba_types.cpp'
--- src/zorbaserialization/serialize_zorba_types.cpp	2012-06-22 15:19:14 +0000
+++ src/zorbaserialization/serialize_zorba_types.cpp	2012-06-26 23:25:23 +0000
@@ -119,13 +119,13 @@
 {
   SERIALIZE_ENUM(DateTime::FACET_TYPE, obj.facet);
 
-  serialize_long(ar, obj.data[0]);
-  serialize_long(ar, obj.data[1]);
-  serialize_long(ar, obj.data[2]);
-  serialize_long(ar, obj.data[3]);
-  serialize_long(ar, obj.data[4]);
-  serialize_long(ar, obj.data[5]);
-  serialize_long(ar, obj.data[6]);
+  ar & obj.data[0];
+  ar & obj.data[1];
+  ar & obj.data[2];
+  ar & obj.data[3];
+  ar & obj.data[4];
+  ar & obj.data[5];
+  ar & obj.data[6];
 
   ar & obj.the_time_zone;
 }
@@ -139,13 +139,13 @@
   SERIALIZE_ENUM(Duration::FACET_TYPE, obj.facet);
   ar & obj.is_negative;
 
-  serialize_long(ar, obj.data[0]);
-  serialize_long(ar, obj.data[1]);
-  serialize_long(ar, obj.data[2]);
-  serialize_long(ar, obj.data[3]);
-  serialize_long(ar, obj.data[4]);
-  serialize_long(ar, obj.data[5]);
-  serialize_long(ar, obj.data[6]);
+  ar & obj.data[0];
+  ar & obj.data[1];
+  ar & obj.data[2];
+  ar & obj.data[3];
+  ar & obj.data[4];
+  ar & obj.data[5];
+  ar & obj.data[6];
 }
 
 

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to     : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp

Reply via email to