Changeset 4006126 in tol


Ignore:
Timestamp:
Nov 7, 2009, 4:24:25 PM (17 years ago)
Author:
Víctor de Buen <vdebuen@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
0020b903
Parents:
e8916d6
Message:

Fixes #777

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@1623 be4846ae-f051-483a-831f-b64e7d08527f

Location:
tol/OIS
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • tol/OIS/oiscompress.cpp

    re8916d6 r4006126  
    350350  }
    351351  return(ok);
    352 
    353352};
    354353
  • tol/OIS/oiscreator.cpp

    re8916d6 r4006126  
    3636#include <tol/tol_bvmatgra.h>
    3737#include <tol/tol_bstruct.h>
     38#include "tol_ois_macros.h"
    3839
    3940       
    4041BTraceInit("oiscreator.cpp");
    4142
    42 //#define TRACE_OIS_HIERARCHY
    43 #ifdef TRACE_OIS_HIERARCHY
    44 static FILE* logHrchyWrite_ =
    45   fopen((BSys::TolAppData()+"syslog/OisHierarchyLogWrite.log").String(),"w");
    46 #endif
    4743
    4844
    … …  
    328324//--------------------------------------------------------------------
    329325{
    330   int sz = v.Size();
    331   EWrite(sz,stream);
    332   Ensure(Write((const void*)v.String(),1,sz, stream));
     326  TRACE_OIS_STREAM("WRITE",stream,"BText", v);
     327  int length = v.Length();
     328  EWrite(length,stream);
     329  Ensure(Write((const void*)v.String(),1,length, stream));
    333330  return(true);
    334331};
    … …  
    338335//--------------------------------------------------------------------
    339336{
     337  TRACE_OIS_STREAM("WRITE",stream,"BDat", BText("")<<v);
    340338  double x = v.Value();
    341339  EWrite(x, stream);
    … …  
    347345//--------------------------------------------------------------------
    348346{
     347  TRACE_OIS_STREAM("WRITE",stream,"BComplex", BText("")<<v);
    349348  EWrite(v.X(), stream);
    350349  EWrite(v.Y(), stream);
    … …  
    356355//--------------------------------------------------------------------
    357356{
     357  TRACE_OIS_STREAM("WRITE",stream,"BDate", BText("")<<v);
    358358  double h = v.Hash();
    359359  return(Write(h,stream));
    … …  
    364364//--------------------------------------------------------------------
    365365{
     366  TRACE_OIS_STREAM("WRITE",stream,"BDat*", BText("")<<s);
    366367  Ensure(Write(buf,sizeof(BDat),s,stream));
    367368  return(true);
    … …  
    372373//--------------------------------------------------------------------
    373374{
     375  TRACE_OIS_STREAM("WRITE",stream,"BPol", x.Name());
    374376  int s = x.Size();
    375377  EWrite(s, stream);
    … …  
    392394//--------------------------------------------------------------------
    393395{
    394   BMemberOwner::BClassByNameHash::const_iterator iterC;
    395396  int n = 0;
    396397  int s = x.size();
     398  TRACE_OIS_STREAM("WRITE",stream,"BMemberOwner", "");
     399  BMemberOwner::BClassByNameHash::const_iterator iterC;
    397400  EWrite(s,stream);
    398401  for(iterC=x.begin(); iterC!=x.end(); iterC++, n++)
    … …  
    407410//--------------------------------------------------------------------
    408411{
     412  TRACE_OIS_STREAM("WRITE",stream,"BClass", BText("")<<cls.FullName());
    409413  Ensure(Write(cls, *(cls.parentHash_), object_));
    410414  Ensure(Write(cls, *(cls.ascentHash_), object_));
    … …  
    863867  Ensure(Write(nb.Set()));
    864868  char hasClass = nb.Class()!=NULL;
    865   Ensure(Write(hasClass, object_));
     869  Ensure(Write(hasClass, set_));
    866870  if(hasClass)
    867871  {
    868     Ensure(Write(nb.Class()->FullName(), object_));
     872    BText className = nb.Class()->FullName();
     873    Ensure(Write(className, set_));
    869874  }
    870875  return(true);
  • tol/OIS/oisloader.cpp

    re8916d6 r4006126  
    4141#include <tol/tol_bnameblock.h>
    4242#include <tol/tol_bstruct.h>
     43#include "tol_ois_macros.h"
    4344
    4445BTraceInit("oisloader.cpp");
    4546
    46 
    47 //#define TRACE_OIS_HIERARCHY
    48 #ifdef TRACE_OIS_HIERARCHY
    49   static FILE* logHrchyRead_ =
    50   fopen((BSys::TolAppData()+"syslog/OisHierarchyLogRead.log").String,"w");
    51 #endif
    5247
    5348//--------------------------------------------------------------------
    … …  
    261256//--------------------------------------------------------------------
    262257{
     258  TRACE_OIS_STREAM("READ",stream,"BText", v);
    263259  static char aux_[65536];
    264   int sz;
    265   ERead(sz,stream);
    266   Ensure(Read(aux_,1,sz, stream));
    267   aux_[sz]=0;
    268   v.Copy(aux_);
     260  if(control_.oisEngine_.oisVersion_<"02.13")
     261  {
     262    int sz;
     263    ERead(sz,stream);
     264    Ensure(Read(aux_,1,sz, stream));
     265    aux_[sz]=0;
     266    v.Copy(aux_);
     267  }
     268  else
     269  {
     270    int length;
     271    ERead(length,stream);
     272    v.ReallocateBuffer(length+1);
     273    v.PutLength(length);
     274    Ensure(Read(v.Buffer(),1,length, stream));
     275  }
    269276  return(true);
    270277};
    … …  
    274281//--------------------------------------------------------------------
    275282{
     283  TRACE_OIS_STREAM("READ",stream,"BDat", BText("")<<v);
    276284  if(control_.typeSizes_.sizeof_BDat_==sizeof(BDatOld))
    277285  {
    … …  
    302310//--------------------------------------------------------------------
    303311{
     312  TRACE_OIS_STREAM("READ",stream,"BComplex", BText("")<<v);
    304313  BDat x, y;
    305314  ERead(x, stream);
    … …  
    313322//--------------------------------------------------------------------
    314323{
     324  TRACE_OIS_STREAM("READ",stream,"BDate", BText("")<<v);
    315325  double h;
    316326  ERead(h,stream);
    … …  
    323333//--------------------------------------------------------------------
    324334{
     335  TRACE_OIS_STREAM("READ",stream,"BDat*", BText("")<<s);
    325336  if(control_.typeSizes_.sizeof_BDat_==sizeof(BDatOld))
    326337  {
    … …  
    353364//--------------------------------------------------------------------
    354365{
     366  TRACE_OIS_STREAM("READ",stream,"BPol", x.Name());
    355367  int s, i;
    356368  bool ok = true;
    … …  
    396408//--------------------------------------------------------------------
    397409{
     410  TRACE_OIS_STREAM("READ",stream,"BMemberOwner", "");
    398411  BMemberOwner::BClassByNameHash::const_iterator iterC;
    399412  int n = 0;
    … …  
    422435//--------------------------------------------------------------------
    423436{
     437  TRACE_OIS_STREAM("READ",stream,"BClass", BText("")<<cls.FullName());
    424438  BMemberOwner::BClassByNameHash& parents = *cls.parentHash_;
    425439  Ensure(Read(cls,parents,stream));
    … …  
    11411155          {
    11421156            char hasClass;
    1143             Ensure(Read(hasClass, object_));
     1157            if(control_.oisEngine_.oisVersion_>="02.13")
     1158            {
     1159              Ensure(Read(hasClass, set_));
     1160            }
     1161            else
     1162            {
     1163              Ensure(Read(hasClass, object_));
     1164            }
    11441165            if(hasClass)
    11451166            {
    11461167              BText className;
    1147               Ensure(Read(className, object_));
     1168              if(control_.oisEngine_.oisVersion_>="02.13")
     1169              {
     1170                Ensure(Read(className, set_));
     1171              }
     1172              else
     1173              {
     1174                Ensure(Read(className, object_));
     1175              }
    11481176              if(control_.oisEngine_.oisVersion_<"02.09")
    11491177              {
  • tol/OIS/tol_ois.h

    re8916d6 r4006126  
    3939//read old OIS files. This will be called a hard change. Then a
    4040//traslation utility will be available.
    41 #define OIS_VERSION "02.12"
     41#define OIS_VERSION "02.13"
    4242
    4343#define OIS_Load_Mode_Header          0
Note: See TracChangeset for help on using the changeset viewer.