/[svn]/libgig/trunk/src/Serialization.cpp
ViewVC logotype

Diff of /libgig/trunk/src/Serialization.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3159 by schoenebeck, Mon May 8 21:15:16 2017 UTC revision 3168 by schoenebeck, Tue May 9 19:12:32 2017 UTC
# Line 38  namespace Serialization { Line 38  namespace Serialization {
38      // *      // *
39    
40      static UID _createNullUID() {      static UID _createNullUID() {
41          return (UID) { NULL, 0 };          const UID uid = { NULL, 0 };
42            return uid;
43      }      }
44    
45      const UID NO_UID = _createNullUID();      const UID NO_UID = _createNullUID();
# Line 460  namespace Serialization { Line 461  namespace Serialization {
461      };      };
462    
463      static _Blob _decodeBlob(const char* p, const char* end, bool bThrow = true) {      static _Blob _decodeBlob(const char* p, const char* end, bool bThrow = true) {
464          if (!bThrow && p >= end)          if (!bThrow && p >= end) {
465              return (_Blob) { p, end };              const _Blob blob =  { p, end };
466                return blob;
467            }
468          size_t sz = 0;          size_t sz = 0;
469          for (; true; ++p) {          for (; true; ++p) {
470              if (p >= end)              if (p >= end)
# Line 476  namespace Serialization { Line 479  namespace Serialization {
479          ++p;          ++p;
480          if (p + sz > end)          if (p + sz > end)
481              throw Exception("Decode Error: Premature end of blob");              throw Exception("Decode Error: Premature end of blob");
482          return (_Blob) { p, p + sz };          const _Blob blob = { p, p + sz };
483            return blob;
484      }      }
485    
486      template<typename T_int>      template<typename T_int>
# Line 580  namespace Serialization { Line 584  namespace Serialization {
584          const ID id = (ID) _popIntBlob<size_t>(p, end);          const ID id = (ID) _popIntBlob<size_t>(p, end);
585          const size_t size = _popIntBlob<size_t>(p, end);          const size_t size = _popIntBlob<size_t>(p, end);
586    
587          return (UID) { id, size };          const UID uid = { id, size };
588            return uid;
589      }      }
590    
591      static UIDChain _popUIDChainBlob(const char*& p, const char* end) {      static UIDChain _popUIDChainBlob(const char*& p, const char* end) {

Legend:
Removed from v.3159  
changed lines
  Added in v.3168

  ViewVC Help
Powered by ViewVC