From fb8a73581a67d11ec3c468e83dd81d8c604ff1ca Mon Sep 17 00:00:00 2001 From: Pawel Date: Thu, 12 Jul 2012 17:24:03 +0200 Subject: [PATCH 1/1] 0023274: MSVC++ warnings issued during compilation for 64bits Replacing Standard_Integer with Standard_Size to avoid warnings. --- src/Dico/Dico_Dictionary.cdl | 12 ++-- src/Dico/Dico_Dictionary.gxx | 60 ++++++++++++------- src/Dico/Dico_Iterator.gxx | 6 +- src/FSD/FSD_BinaryFile.cdl | 2 +- src/FSD/FSD_BinaryFile.cxx | 8 +-- src/FSD/FSD_CmpFile.cdl | 2 +- src/FSD/FSD_CmpFile.cxx | 12 ++-- src/FSD/FSD_File.cdl | 2 +- src/FSD/FSD_File.cxx | 8 +-- .../NCollection_SparseArrayBase.hxx | 2 +- src/Units/Units_Sentence.cxx | 3 +- 11 files changed, 67 insertions(+), 50 deletions(-) diff --git a/src/Dico/Dico_Dictionary.cdl b/src/Dico/Dico_Dictionary.cdl index a54d94f7e9..06ef58c86d 100755 --- a/src/Dico/Dico_Dictionary.cdl +++ b/src/Dico/Dico_Dictionary.cdl @@ -33,7 +33,7 @@ generic class Dictionary from Dico (TheItem as any) inherits TShared -- size of TheItem class if it is not identified by Handle) : if -- this size is big, it can cause problems of memory spending -uses OStream, Integer, Boolean, Character, AsciiString --, Iterator +uses Size, OStream, Integer, Boolean, Character, AsciiString --, Iterator raises NoSuchObject @@ -275,14 +275,14 @@ is SetNext (me : mutable; acell : mutable Dictionary) is static private; ---Purpose : Defines next cell - SearchCell (me; name : CString; lmax : Integer; - car : Character; level : Integer; - acell : out mutable Dictionary; reslev : out Integer; + SearchCell (me; name : CString; lmax : Size; + car : Character; level : Size; + acell : out mutable Dictionary; reslev : out Size; stat : out Integer) is static private; ---Purpose : Internal method used to get an entry from a given name - NewCell (me : mutable; name : CString; namlen : Integer; - acell : in out mutable Dictionary; reslev,stat : Integer) + NewCell (me : mutable; name : CString; namlen : Size; + acell : in out mutable Dictionary; reslev : Size; stat : Integer) is static private; ---Purpose : Internal method used to create a new entry for a name diff --git a/src/Dico/Dico_Dictionary.gxx b/src/Dico/Dico_Dictionary.gxx index 999cda098a..c3e029b0c4 100755 --- a/src/Dico/Dico_Dictionary.gxx +++ b/src/Dico/Dico_Dictionary.gxx @@ -53,7 +53,8 @@ Dico_Dictionary::Dico_Dictionary () (const Standard_CString name, const Standard_Boolean exact) const { Handle(Dico_Dictionary) acell; - Standard_Integer reslev,stat; + Standard_Integer stat; + Standard_Size reslev; SearchCell (name,strlen(name),name[0],1, acell,reslev,stat); if (stat != 0 || reslev != 0) return Standard_False; if (acell->HasIt()) return Standard_True; @@ -65,7 +66,8 @@ Dico_Dictionary::Dico_Dictionary () (const TCollection_AsciiString& name, const Standard_Boolean exact) const { Handle(Dico_Dictionary) acell; - Standard_Integer reslev,stat; + Standard_Integer stat; + Standard_Size reslev; SearchCell (name.ToCString(),name.Length(),name.Value(1),1, acell,reslev,stat); if (stat != 0 || reslev != 0) return Standard_False; if (acell->HasIt()) return Standard_True; @@ -79,7 +81,8 @@ Dico_Dictionary::Dico_Dictionary () (const Standard_CString name, const Standard_Boolean exact) const { Handle(Dico_Dictionary) acell; - Standard_Integer reslev,stat; + Standard_Integer stat; + Standard_Size reslev; SearchCell (name,strlen(name),name[0],1, acell,reslev,stat); if (stat != 0 || reslev != 0) Standard_NoSuchObject::Raise("Dictionary : Item"); @@ -93,7 +96,8 @@ Dico_Dictionary::Dico_Dictionary () (const TCollection_AsciiString& name, const Standard_Boolean exact) const { Handle(Dico_Dictionary) acell; - Standard_Integer reslev,stat; + Standard_Integer stat; + Standard_Size reslev; SearchCell (name.ToCString(),name.Length(),name.Value(1),1, acell,reslev,stat); if (stat != 0 || reslev != 0) Standard_NoSuchObject::Raise("Dictionary : Item"); @@ -110,7 +114,8 @@ Dico_Dictionary::Dico_Dictionary () TheItem& anitem, const Standard_Boolean exact) const { Handle(Dico_Dictionary) acell; - Standard_Integer reslev,stat; + Standard_Integer stat; + Standard_Size reslev; SearchCell (name,strlen(name),name[0],1, acell,reslev,stat); if (stat != 0 || reslev != 0) return Standard_False; if (acell->HasIt()) { anitem = acell->It(); return Standard_True; } @@ -124,7 +129,8 @@ Dico_Dictionary::Dico_Dictionary () TheItem& anitem, const Standard_Boolean exact) const { Handle(Dico_Dictionary) acell; - Standard_Integer reslev,stat; + Standard_Integer stat; + Standard_Size reslev; SearchCell (name.ToCString(),name.Length(),name.Value(1),1, acell,reslev,stat); if (stat != 0 || reslev != 0) return Standard_False; if (acell->HasIt()) { anitem = acell->It(); return Standard_True; } @@ -140,8 +146,9 @@ Dico_Dictionary::Dico_Dictionary () const TheItem& anitem, const Standard_Boolean exact) { Handle(Dico_Dictionary) acell; - Standard_Integer reslev,stat; - Standard_Integer namlen = strlen(name); + Standard_Integer stat; + Standard_Size reslev; + Standard_Size namlen = strlen(name); SearchCell (name,namlen,name[0],1, acell,reslev,stat); if (!exact && !acell->HasIt()) { if (acell->Complete(acell)) { acell->SetIt(anitem); return; } } @@ -156,7 +163,8 @@ Dico_Dictionary::Dico_Dictionary () const TheItem& anitem, const Standard_Boolean exact) { Handle(Dico_Dictionary) acell; - Standard_Integer reslev,stat; + Standard_Integer stat; + Standard_Size reslev; Standard_CString namval = name.ToCString(); Standard_Integer namlen = name.Length(); SearchCell (namval,namlen,name.Value(1),1, acell,reslev,stat); @@ -175,8 +183,9 @@ Dico_Dictionary::Dico_Dictionary () Standard_Boolean& isvalued, const Standard_Boolean exact) { Handle(Dico_Dictionary) acell; - Standard_Integer reslev,stat; - Standard_Integer namlen = strlen(name); + Standard_Integer stat; + Standard_Size reslev; + Standard_Size namlen = strlen(name); SearchCell (name,namlen,name[0],1, acell,reslev,stat); if (stat == 0 && reslev == 0) { isvalued = acell->HasIt(); // ancien statut @@ -200,7 +209,8 @@ Dico_Dictionary::Dico_Dictionary () Standard_Boolean& isvalued, const Standard_Boolean exact) { Handle(Dico_Dictionary) acell; - Standard_Integer reslev,stat; + Standard_Integer stat; + Standard_Size reslev; Standard_Integer namlen = name.Length(); Standard_CString namval = name.ToCString(); SearchCell (namval,namlen,name.Value(1),1, acell,reslev,stat); @@ -227,7 +237,8 @@ Dico_Dictionary::Dico_Dictionary () const Standard_Boolean cln, const Standard_Boolean exact) { Handle(Dico_Dictionary) acell; - Standard_Integer reslev,stat; + Standard_Integer stat; + Standard_Size reslev; SearchCell (name,strlen(name),name[0],1, acell,reslev,stat); // if (stat != 0) { cout<<"Dictionary : RemoveItem not found"< thecars[0]) { if (thecars[3] == '\0') { acell = this; stat = 1; return; } else { // ici, HasNext if (thecars[3] > car) { acell = this; stat = 1; return; } - Standard_Integer lev2,stat2; + Standard_Integer stat2; + Standard_Size lev2; thenext->SearchCell (name,lmax,car,level,acell,lev2,stat2); if (stat2 < 0) { acell = this; stat = 1; return; } else { stat = stat2; reslev = lev2; return; } @@ -360,7 +373,8 @@ Dico_Dictionary::Dico_Dictionary () else { Standard_Character carsub = name[level]; // caractere no (level+1); if (thecars[2] > carsub) { acell = this; stat = 0; return; } - Standard_Integer lev2,stat2; + Standard_Integer stat2; + Standard_Size lev2; thesub->SearchCell (name,lmax,carsub,level+1,acell,lev2,stat2); if (stat2 < 0) { acell = this; stat = 0; return; } else { stat = stat2; reslev = lev2; return; } @@ -373,11 +387,11 @@ Dico_Dictionary::Dico_Dictionary () // .... NewCell .... void Dico_Dictionary::NewCell - (const Standard_CString name, const Standard_Integer namlen, + (const Standard_CString name, const Standard_Size namlen, Handle(Dico_Dictionary)& acell, - const Standard_Integer reslev, const Standard_Integer stat) + const Standard_Size reslev, const Standard_Integer stat) { - Standard_Integer level = namlen - reslev; + Standard_Size level = namlen - reslev; if (stat > 0) { // Creer une cellule next Handle(Dico_Dictionary) newcell = new Dico_Dictionary; newcell->SetChar( name[level-1] ); // caractere no level @@ -386,7 +400,7 @@ Dico_Dictionary::Dico_Dictionary () acell = newcell; } // A present, voir les sous-niveaux - for (Standard_Integer i = level+1; i <= namlen; i ++) { + for (Standard_Size i = level+1; i <= namlen; i ++) { Handle(Dico_Dictionary) newcell = new Dico_Dictionary; newcell->SetChar(name[i-1]); if (acell->HasSub()) newcell->SetNext(acell->Sub()); diff --git a/src/Dico/Dico_Iterator.gxx b/src/Dico/Dico_Iterator.gxx index 82ccc1dde3..cb77d8c2e2 100755 --- a/src/Dico/Dico_Iterator.gxx +++ b/src/Dico/Dico_Iterator.gxx @@ -38,7 +38,8 @@ Dico_Iterator::Dico_Iterator (const Handle(Dico_Dictionary)& acell) thebase = acell; } else { thename = basename; - Standard_Integer reslev,stat; + Standard_Integer stat; + Standard_Size reslev; acell->SearchCell(basename.ToCString(),basename.Length(),basename.Value(1), 1, thebase,reslev,stat); if (stat != 0 || reslev != 0) thebase.Nullify(); // loupe @@ -57,7 +58,8 @@ Dico_Iterator::Dico_Iterator (const Handle(Dico_Dictionary)& acell) thebase = acell; } else { thename.AssignCat(basename); - Standard_Integer reslev,stat; + Standard_Integer stat; + Standard_Size reslev; acell->SearchCell (basename,thename.Length(),basename[0],1, thebase,reslev,stat); if (stat != 0 || reslev != 0) thebase.Nullify(); // loupe diff --git a/src/FSD/FSD_BinaryFile.cdl b/src/FSD/FSD_BinaryFile.cdl index 96538aeecc..f1df6fda05 100755 --- a/src/FSD/FSD_BinaryFile.cdl +++ b/src/FSD/FSD_BinaryFile.cdl @@ -306,7 +306,7 @@ is returns CString from Standard is private; ---C++: return const - ReadChar(me : in out; buffer : in out AsciiString from TCollection; rsize : Integer from Standard) is protected; + ReadChar(me : in out; buffer : in out AsciiString from TCollection; rsize : Size from Standard) is protected; ---Purpose: read character from the current position. ReadString(me : in out; buffer : in out AsciiString from TCollection) is protected; diff --git a/src/FSD/FSD_BinaryFile.cxx b/src/FSD/FSD_BinaryFile.cxx index 83a1a7a509..fb2742200c 100755 --- a/src/FSD/FSD_BinaryFile.cxx +++ b/src/FSD/FSD_BinaryFile.cxx @@ -61,7 +61,7 @@ Storage_Error FSD_BinaryFile::IsGoodFileType(const TCollection_AsciiString& aNam if (s == Storage_VSOk) { TCollection_AsciiString l; - Standard_Integer len = strlen(FSD_BinaryFile::MagicNumber()); + Standard_Size len = strlen(FSD_BinaryFile::MagicNumber()); f.ReadChar(l,len); @@ -156,10 +156,10 @@ const Standard_CString FSD_BinaryFile::MagicNumber() //purpose : read character from the current position. //======================================================================= -void FSD_BinaryFile::ReadChar(TCollection_AsciiString& buffer, const Standard_Integer rsize) +void FSD_BinaryFile::ReadChar(TCollection_AsciiString& buffer, const Standard_Size rsize) { char c; - Standard_Integer ccount = 0; + Standard_Size ccount = 0; buffer.Clear(); @@ -487,7 +487,7 @@ Storage_Error FSD_BinaryFile::BeginReadInfoSection() { Storage_Error s = Storage_VSOk; TCollection_AsciiString l; - Standard_Integer len = strlen(FSD_BinaryFile::MagicNumber()); + Standard_Size len = strlen(FSD_BinaryFile::MagicNumber()); ReadChar(l,len); diff --git a/src/FSD/FSD_CmpFile.cdl b/src/FSD/FSD_CmpFile.cdl index 077b4c0857..417d10d247 100755 --- a/src/FSD/FSD_CmpFile.cdl +++ b/src/FSD/FSD_CmpFile.cdl @@ -313,7 +313,7 @@ is WriteExtendedLine(me : in out; buffer : ExtendedString from TCollection) is protected; ---Purpose: write from the current position to the end of line. - ReadChar(me : in out; buffer : in out AsciiString from TCollection; rsize : Integer from Standard) is protected; + ReadChar(me : in out; buffer : in out AsciiString from TCollection; rsize : Size from Standard) is protected; ---Purpose: read character from the current position. ReadString(me : in out; buffer : in out AsciiString from TCollection) is protected; diff --git a/src/FSD/FSD_CmpFile.cxx b/src/FSD/FSD_CmpFile.cxx index b1590c8410..e753323544 100755 --- a/src/FSD/FSD_CmpFile.cxx +++ b/src/FSD/FSD_CmpFile.cxx @@ -68,7 +68,7 @@ Storage_Error FSD_CmpFile::IsGoodFileType(const TCollection_AsciiString& aName) if (s == Storage_VSOk) { TCollection_AsciiString l; - Standard_Integer len = strlen(FSD_CmpFile::MagicNumber()); + Standard_Size len = strlen(FSD_CmpFile::MagicNumber()); f.ReadChar(l,len); @@ -215,7 +215,7 @@ void FSD_CmpFile::ReadLine(TCollection_AsciiString& buffer) Buffer[0] = '\0'; //myStream.get(Buffer,8192,'\n'); myStream.getline(Buffer,8192,'\n'); - for (Standard_Integer lv = (strlen(Buffer)- 1); lv > 1 && (Buffer[lv] == '\r' || Buffer[lv] == '\n') ;lv--) { + for (Standard_Size lv = (strlen(Buffer)- 1); lv > 1 && (Buffer[lv] == '\r' || Buffer[lv] == '\n') ;lv--) { Buffer[lv] = '\0'; } @@ -332,10 +332,10 @@ void FSD_CmpFile::ReadExtendedLine(TCollection_ExtendedString& buffer) //purpose : read character from the current position. //======================================================================= -void FSD_CmpFile::ReadChar(TCollection_AsciiString& buffer, const Standard_Integer rsize) +void FSD_CmpFile::ReadChar(TCollection_AsciiString& buffer, const Standard_Size rsize) { char c; - Standard_Integer ccount = 0; + Standard_Size ccount = 0; buffer.Clear(); @@ -363,7 +363,7 @@ void FSD_CmpFile::ReadString(TCollection_AsciiString& buffer) Buffer[0] = '\0'; //myStream.get(Buffer,8192,'\n'); myStream.getline(Buffer,8192,'\n'); - for (Standard_Integer lv = (strlen(Buffer)- 1); lv > 1 && (Buffer[lv] == '\r' || Buffer[lv] == '\n') ;lv--) { + for (Standard_Size lv = (strlen(Buffer)- 1); lv > 1 && (Buffer[lv] == '\r' || Buffer[lv] == '\n') ;lv--) { Buffer[lv] = '\0'; } bpos = Buffer; @@ -792,7 +792,7 @@ Storage_Error FSD_CmpFile::BeginReadInfoSection() { Storage_Error s; TCollection_AsciiString l; - Standard_Integer len = strlen(FSD_CmpFile::MagicNumber()); + Standard_Size len = strlen(FSD_CmpFile::MagicNumber()); ReadChar(l,len); diff --git a/src/FSD/FSD_File.cdl b/src/FSD/FSD_File.cdl index 4cb9a13c15..fb49459d4d 100755 --- a/src/FSD/FSD_File.cdl +++ b/src/FSD/FSD_File.cdl @@ -328,7 +328,7 @@ is WriteExtendedLine(me : in out; buffer : ExtendedString from TCollection) is protected; ---Purpose: write from the current position to the end of line. - ReadChar(me : in out; buffer : in out AsciiString from TCollection; rsize : Integer from Standard) is protected; + ReadChar(me : in out; buffer : in out AsciiString from TCollection; rsize : Size from Standard) is protected; ---Purpose: read character from the current position. ReadString(me : in out; buffer : in out AsciiString from TCollection) is protected; diff --git a/src/FSD/FSD_File.cxx b/src/FSD/FSD_File.cxx index 252999b514..fe71914e21 100755 --- a/src/FSD/FSD_File.cxx +++ b/src/FSD/FSD_File.cxx @@ -50,7 +50,7 @@ Storage_Error FSD_File::IsGoodFileType(const TCollection_AsciiString& aName) if (s == Storage_VSOk) { TCollection_AsciiString l; - Standard_Integer len = strlen(FSD_File::MagicNumber()); + Standard_Size len = strlen(FSD_File::MagicNumber()); f.ReadChar(l,len); @@ -267,10 +267,10 @@ void FSD_File::ReadExtendedLine(TCollection_ExtendedString& buffer) //purpose : read character from the current position. //======================================================================= -void FSD_File::ReadChar(TCollection_AsciiString& buffer, const Standard_Integer rsize) +void FSD_File::ReadChar(TCollection_AsciiString& buffer, const Standard_Size rsize) { char c; - Standard_Integer ccount = 0; + Standard_Size ccount = 0; buffer.Clear(); @@ -707,7 +707,7 @@ Storage_Error FSD_File::BeginReadInfoSection() { Storage_Error s; TCollection_AsciiString l; - Standard_Integer len = strlen(FSD_File::MagicNumber()); + Standard_Size len = strlen(FSD_File::MagicNumber()); ReadChar(l,len); diff --git a/src/NCollection/NCollection_SparseArrayBase.hxx b/src/NCollection/NCollection_SparseArrayBase.hxx index ba60e4dbd8..45fe38bfca 100755 --- a/src/NCollection/NCollection_SparseArrayBase.hxx +++ b/src/NCollection/NCollection_SparseArrayBase.hxx @@ -42,7 +42,7 @@ public: Standard_EXPORT void Clear (); //! Returns number of currently contained items - Standard_Integer Size () const { return mySize; } + Standard_Size Size () const { return mySize; } //! Check whether the value at given index is set Standard_EXPORT Standard_Boolean HasValue (const Standard_Integer theIndex) const; diff --git a/src/Units/Units_Sentence.cxx b/src/Units/Units_Sentence.cxx index 432d789acd..e2272cf8f7 100755 --- a/src/Units/Units_Sentence.cxx +++ b/src/Units/Units_Sentence.cxx @@ -58,7 +58,8 @@ Units_Sentence::Units_Sentence(const Handle(Units_Lexicon)& alexicon, const Standard_CString astring) { Standard_Integer index; - Standard_Integer i,k,l,limchain; + Standard_Integer k,l; + Standard_Size i,limchain; char chain[255]; Handle(Units_Token) token; Handle(Units_Token) referencetoken; -- 2.20.1