Changeset 865a39d3 in tol


Ignore:
Timestamp:
Aug 3, 2015, 2:59:16 PM (11 years ago)
Author:
Jorge Pérez <josp.jorge@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
54e903c
Parents:
05325a3
Message:

refs #1866, resolviendo quejas de valgrind en tol 64 bits

...

==6545== Conditional jump or move depends on uninitialised value(s)
==6545==    at 0xAC53A37: vfprintf (in /usr/lib64/libc-2.18.so)
==6545==    by 0xAC7869A: vsprintf (in /usr/lib64/libc-2.18.so)
==6545==    by 0x5FF9FCB: BZipStream::Print(char const*, ...) (oisstream_zip.cpp:406)
==6545==    by 0x6004F5F: BOisCreator::WriteHeader() (oisxml.cpp:221)

...

==6545==  Uninitialised value was created by a stack allocation
==6545==    at 0x6003233: BOisCreator::WriteHeader() (oisxml.cpp:40)
==6545== 

...

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

Location:
tol/OIS
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • tol/OIS/oisxml.cpp

    r05325a3 r865a39d3  
    4545
    4646  header_->Print("<xmlParam>\n");
    47   header_->Print("<maxXmlStrLen>%ld</maxXmlStrLen>\n",            xmlParam_.maxXmlStrLen_);
     47  header_->Print("<maxXmlStrLen>%d</maxXmlStrLen>\n",            xmlParam_.maxXmlStrLen_);
    4848  header_->Print("</xmlParam>\n");
    4949
    … …  
    115115
    116116  header_->Print("<tolSourceSearchPaths>\n");
    117   header_->Print("<entries>%ld</entries>\n", options_.tolSourceSearchPaths_.Size());
     117  header_->Print("<entries>%d</entries>\n", options_.tolSourceSearchPaths_.Size());
    118118  for(n=0; n<options_.tolSourceSearchPaths_.Size(); n++)
    119119  {
    120120    options_.tolSourceSearchPaths_[n].value_ = GetStandardAbsolutePath(options_.tolSourceSearchPaths_[n].value_);
    121     header_->Print("<root_%ld><alias>%s</alias><path>%s</path></root_%ld>\n",
     121    header_->Print("<root_%d><alias>%s</alias><path>%s</path></root_%d>\n",
    122122            n+1,
    123123            options_.tolSourceSearchPaths_[n].alias_.String(),
    … …  
    169169        value += Text(tolEnvironment_[n]);
    170170      }
    171       header_->Print("<var_%ld><type>%s</type><name>%s</name><value>%s</value></var_%ld>\n",
     171      header_->Print("<var_%d><type>%s</type><name>%s</name><value>%s</value></var_%d>\n",
    172172              n+1,
    173173              tolEnvironment_[n]->Grammar()->Name().String(),
    … …  
    214214        }
    215215      }
    216       header_->Print("<file_%ld><path>%s</path><release>%s</release><size>%"_LLD64_"</size></file_%ld>\n",
     216      header_->Print("<file_%d><path>%s</path><release>%s</release><size>%"_LLD64_"</size></file_%d>\n",
    217217                     n+1,
    218218                     path.String(),
    … …  
    229229  {
    230230    BText name = packages_[n];
    231     header_->Print("<package_%ld>%s</package_%ld>\n",
     231    header_->Print("<package_%d>%s</package_%d>\n",
    232232                   n+1,
    233233                   name.String(),
  • tol/OIS/tol_oiscreator.h

    r05325a3 r865a39d3  
    6767  bool Write(const          BINT64&  x, BStream* stream);
    6868  bool Write(const unsigned BINT64&  x, BStream* stream);
     69  // REVIEW: for compatibility size_t will be written/read as 4 bytes
     70  bool Write(const          size_t&  x, BStream* stream)
     71  {
     72    unsigned int _x = (unsigned int)x;
     73    return this->Write( _x, stream );
     74  }
    6975  bool Write(const          float&   x, BStream* stream);
    7076  bool Write(const          double&  x, BStream* stream);
  • tol/OIS/tol_oisloader.h

    r05325a3 r865a39d3  
    102102  bool Read(         BINT64&  x, BStream* stream);
    103103  bool Read(unsigned BINT64&  x, BStream* stream);
     104  // REVIEW: for compatibility size_t will be written/read as 4 bytes
     105  bool Read(size_t &     x, BStream* stream)
     106  {
     107    unsigned int _x;
     108    bool ok = this->Read( _x, stream );
     109    if( ok )
     110      {
     111      x = _x;
     112      }
     113    return ok;
     114  }
    104115  bool Read(         float&   x, BStream* stream);
    105116  bool Read(         double&  x, BStream* stream);
Note: See TracChangeset for help on using the changeset viewer.