]> OCCT Git - occt.git/commitdiff
0026171: Coding rules - eliminate -Wshorten-64-to-32 CLang warnings
authorrkv <rkv@opencascade.com>
Wed, 10 Nov 2021 21:06:46 +0000 (00:06 +0300)
committerinv <inv@opencascade.com>
Sun, 21 Nov 2021 09:42:08 +0000 (12:42 +0300)
28 files changed:
adm/cmake/occt_defs_flags.cmake
adm/qmake/OccCppConfig.pri
src/Bnd/Bnd_BoundSortBox.cxx
src/Draw/Draw_Interpretor.cxx
src/Draw/Draw_Viewer.cxx
src/Draw/Draw_Window.cxx
src/Draw/Draw_Window.hxx
src/Draw/Draw_Window_1.mm
src/FSD/FSD_BinaryFile.cxx
src/Font/Font_FTFont.cxx
src/IntPatch/FILES
src/IntPatch/IntPatch_PrmPrmIntersection.cxx
src/IntPatch/IntPatch_PrmPrmIntersection_T3Bits.cxx
src/IntPatch/IntPatch_PrmPrmIntersection_T3Bits.hxx
src/IntPatch/IntPatch_PrmPrmIntersection_T3Bits.lxx [deleted file]
src/NCollection/NCollection_CellFilter.hxx
src/NCollection/NCollection_UBTreeFiller.hxx
src/NCollection/NCollection_UtfIterator.hxx
src/NCollection/NCollection_UtfIterator.lxx
src/OSD/OSD_Disk.cxx
src/OSD/OSD_File.cxx
src/OSD/OSD_FileNode.cxx
src/QABugs/QABugs_19.cxx
src/QABugs/QABugs_20.cxx
src/RWObj/RWObj_Reader.cxx
src/Standard/Standard_Strtod.cxx
src/Standard/Standard_UUID.hxx
src/StepSelect/StepSelect_WorkLibrary.cxx

index 200790c04850b2aaa21f0c2680eda59ebcc46fcc..d1c8172bdd88c894f5d4eb84c482f6583bf424d2 100644 (file)
@@ -115,6 +115,9 @@ if (MSVC)
   endif()
 elseif (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
+  if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wshorten-64-to-32")
+  endif()
   if (BUILD_SHARED_LIBS)
     if (APPLE)
       set (CMAKE_SHARED_LINKER_FLAGS "-lm ${CMAKE_SHARED_LINKER_FLAGS}")
index 07f0fdd00a59a059e130c65661672f55025d5c72..c9af8da42d5667bbdfe359557a3cc5373cfb4ea0 100644 (file)
@@ -39,6 +39,10 @@ win32 {
   DEFINES += _SCL_SECURE_NO_WARNINGS
 } else {
   CONFIG += c++11
+  clang {
+    QMAKE_CFLAGS_WARN_ON   += -Wshorten-64-to-32
+    QMAKE_CXXFLAGS_WARN_ON += -Wshorten-64-to-32
+  }
   QMAKE_CFLAGS   += -fexceptions
   QMAKE_CXXFLAGS += -fexceptions
   QMAKE_CXXFLAGS += -fvisibility=default
index 497ab1dfed0b471e39897da752d435e0da80ec8d..a9f1fd8ffec01103d40707cfe0e061552e42d537 100644 (file)
 #define DIMAXIS 20
 
 #if DEBUG
-static long unsigned   APPELREJECTION=0L;
-static long unsigned   REJECTNIV0=0L;
-static long unsigned   REJECTNIV1=0L;
-static long unsigned   NBCOMPARE=0L;
-static long unsigned   NBBOITES=0L;
-static long unsigned   NBBOITESATESTER=0L;
+static unsigned int APPELREJECTION=0L;
+static unsigned int REJECTNIV0=0L;
+static unsigned int REJECTNIV1=0L;
+static unsigned int NBCOMPARE=0L;
+static unsigned int NBBOITES=0L;
+static unsigned int NBBOITESATESTER=0L;
 #endif
 //=======================================================================
 static Standard_Integer  ComputeSize(const Standard_Integer n) { 
@@ -113,7 +113,7 @@ static Standard_Integer  ComputeSize(const Standard_Integer n) {
   return(8);
 }
 //=======================================================================
-static long unsigned _P2[32] = { 1,2,4,8,  16,32,64,128,  256,512,1024,2048,
+static unsigned int _P2[32] = { 1,2,4,8,  16,32,64,128,  256,512,1024,2048,
                                 4096,8192,16384,32768,
                                 65536,131072,262144,524288,
                                 1048576,2097152,4194304,8388608,
@@ -130,12 +130,12 @@ public:
   Standard_Integer _BASE;
   Standard_Integer _BASEM1;
   
-  long unsigned ind;
-  long unsigned Isize;
+  unsigned int ind;
+  unsigned int Isize;
   Standard_Integer ssize;
   Standard_Real Xmin,Xmax,Ymin,Ymax,Zmin,Zmax;
   
-  long unsigned *p;
+  unsigned int* p;
   Standard_Integer **axisX;
   Standard_Integer **axisY;
   Standard_Integer **axisZ;
@@ -152,9 +152,9 @@ public:
   void AppendAxisY(const Standard_Integer i,const Standard_Integer v);
   void AppendAxisZ(const Standard_Integer i,const Standard_Integer v);
 
-  void Add(long unsigned t) { int o=t&31;    int k=t>>5;    p[k]|=_P2[o];          }
-  int Val(long unsigned t)  { int o=t&31;    int k=t>>5;    return(p[k]&_P2[o]);   }
-  void Raz(long unsigned t) { int o=t&31;    int k=t>>5;    p[k]&= ~(_P2[o]);      }
+  void Add (unsigned int t) { int o=t&31;    int k=t>>5;    p[k]|=_P2[o];          }
+  int  Val (unsigned int t) { int o=t&31;    int k=t>>5;    return(p[k]&_P2[o]);   }
+  void Raz (unsigned int t) { int o=t&31;    int k=t>>5;    p[k]&= ~(_P2[o]);      }
   
   Standard_Integer NbAxisX(const Standard_Integer i) {   return(axisX[0][i]);   }
   Standard_Integer NbAxisY(const Standard_Integer i) {   return(axisY[0][i]);   }
@@ -220,10 +220,10 @@ BSB_T3Bits::BSB_T3Bits(int size)
   default : {  _DECAL=3;   _DECAL2= 6;   _BASE=  8;  _BASEM1=  7;  break; } 
   }
   Standard_Integer i ;    
-  long unsigned nb = (size*size*size)>>5;
+  unsigned int nb = (size*size*size)>>5;
   Isize = nb;
   ssize = size;
-  p = new long unsigned [nb];
+  p = new unsigned int[nb];
   do { p[--nb]=0; } while(nb);
 
   axisX = (Standard_Integer **) malloc((size+1)*sizeof(Standard_Integer *));
@@ -457,7 +457,7 @@ void Bnd_BoundSortBox::SortBoxes()
          for (lacaseX=firstcaseX; lacaseX<=lastcaseX; lacaseX++) {
            for (lacaseY=firstcaseY; lacaseY<=lastcaseY; lacaseY++) {
              for (lacaseZ=firstcaseZ; lacaseZ<=lastcaseZ; lacaseZ++) {
-               long unsigned t=Map->GrilleInteger(lacaseX-1,lacaseY-1,lacaseZ-1);
+                unsigned int t = Map->GrilleInteger(lacaseX-1,lacaseY-1,lacaseZ-1);
                Map->Add(t);
              }
            }
@@ -578,7 +578,7 @@ void Bnd_BoundSortBox::Add(const Bnd_Box& theBox,
       for (theGapX=firstGapX; theGapX<=lastGapX; theGapX++) {
        for (theGapY=firstGapY; theGapY<=lastGapY; theGapY++) {
          for (theGapZ=firstGapZ; theGapZ<=lastGapZ; theGapZ++) {
-           long unsigned t=Map->GrilleInteger(theGapX-1,theGapY-1,theGapZ-1);
+            unsigned int t = Map->GrilleInteger(theGapX-1,theGapY-1,theGapZ-1);
            Map->Add(t);
          }
        }
@@ -668,7 +668,7 @@ const TColStd_ListOfInteger& Bnd_BoundSortBox::Compare (const Bnd_Box& theBox)
   for(Standard_Integer i=i0; touch==Standard_False && i<=i1;i++) { 
     for(Standard_Integer j=j0; touch==Standard_False && j<=j1;j++) { 
       for(Standard_Integer k=k0;  touch==Standard_False && k<=k1;k++) {
-       long unsigned t=Map->GrilleInteger(i,j,k);
+        unsigned int t = Map->GrilleInteger(i,j,k);
        if(Map->Val(t)) { 
          touch = Standard_True;
        }
index a1aa0bf8d0d7cff9a59becd00251a91d9d9ae7af..04f8370815f71fb7ee3c3f8eeafe5ef5947fa1d9 100644 (file)
@@ -690,7 +690,7 @@ TCollection_AsciiString Draw_Interpretor::GetLog ()
   char buffer[BUFSIZE + 1];
   for (;;)
   {
-    int nbRead = read (myFDLog, buffer, BUFSIZE);
+    int nbRead = (int )read (myFDLog, buffer, BUFSIZE);
     if (nbRead <= 0)
     {
       break;
index ac13ec60dbabdeaee4000e817b256beb068c8922..578729cc8b64eef6917bf3242a61d7af1d6a42cc 100644 (file)
@@ -1084,7 +1084,7 @@ void Draw_Viewer::Select (Standard_Integer& theId,
   theId = MAXVIEW;
   while (theId >= MAXVIEW)
   {
-    Standard_Integer aWindowNumber = 0;
+    long aWindowNumber = 0;
     Draw_Window::GetNextEvent (theToWait, aWindowNumber, theX, theY, theButton);
     if (theY < 0)
     {
index 5b111edfe71269ab668a6ccb6f588c9d41406164..090fa69b5e60460deb915ab0e8da36214b6f2953 100644 (file)
@@ -853,7 +853,7 @@ void Draw_Window::DrawString (Standard_Integer theX, Standard_Integer theY,
   }
   ReleaseDC (myWindow, hDC);
 #elif defined(HAVE_XLIB)
-  XDrawString (Draw_WindowDisplay, GetDrawable(), myBase->gc, theX, theY, (char* )theText, strlen(theText));
+  XDrawString (Draw_WindowDisplay, GetDrawable(), myBase->gc, theX, theY, (char* )theText, (int )strlen(theText));
 #else
   (void )theX;
   (void )theY;
index 27eced584b65a5081ef5a8d34ffc2fb4f11f381b..a7c767f04eebdda2380c7944ffdf7915b60b0b0b 100644 (file)
@@ -249,10 +249,10 @@ public:
 
   void Wait (Standard_Boolean theToWait = Standard_True);
 #elif defined(__APPLE__)
-  Standard_Boolean IsEqualWindows (const Standard_Integer& theWindowNumber);
+  Standard_Boolean IsEqualWindows (const long theWindowNumber);
 
   static void GetNextEvent (Standard_Boolean  theWait,
-                            Standard_Integer& theWindowNumber,
+                            long&             theWindowNumber,
                             Standard_Integer& theX,
                             Standard_Integer& theY,
                             Standard_Integer& theButton);
index 47584124702d007fc679b2997c6926477228afcd..b2a194ac2f16c4084d54eafd04eef61f714d159c 100644 (file)
@@ -552,13 +552,13 @@ Standard_Boolean Draw_Window::Save (Standard_CString theFileName) const
   return isSuccess;
 }
 
-Standard_Boolean Draw_Window::IsEqualWindows (const Standard_Integer& theWindowNumber)
+Standard_Boolean Draw_Window::IsEqualWindows (const long theWindowNumber)
 {
   return ([myWindow windowNumber] == theWindowNumber);
 }
 
 void Draw_Window::GetNextEvent (Standard_Boolean  theWait,
-                                Standard_Integer& theWindowNumber,
+                                long&             theWindowNumber,
                                 Standard_Integer& theX,
                                 Standard_Integer& theY,
                                 Standard_Integer& theButton)
index e28344ade0d5ebf1f5c7274db3586477add8b759..d266956e4fc22c2bf458ac57372a98f66d089a4a 100644 (file)
@@ -507,7 +507,7 @@ Storage_Error FSD_BinaryFile::BeginWriteInfoSection()
               myStream))
     throw Storage_StreamWriteError();
   
-  myHeader.binfo = ftell(myStream);
+  myHeader.binfo = (Standard_Integer )ftell(myStream);
   WriteHeader();
 
   return Storage_VSOk;
@@ -590,8 +590,7 @@ Standard_Integer FSD_BinaryFile::WriteInfo (Standard_OStream&
 
 Storage_Error FSD_BinaryFile::EndWriteInfoSection() 
 {
-  myHeader.einfo = ftell(myStream);
-
+  myHeader.einfo = (Standard_Integer )ftell(myStream);
   return Storage_VSOk;
 }
 
@@ -602,7 +601,6 @@ Storage_Error FSD_BinaryFile::EndWriteInfoSection()
 Storage_Error FSD_BinaryFile::EndWriteInfoSection(Standard_OStream& theOStream) 
 {
   myHeader.einfo = (Standard_Integer)theOStream.tellp();
-
   return Storage_VSOk;
 }
 
@@ -795,7 +793,7 @@ Storage_Error FSD_BinaryFile::EndReadInfoSection()
 
 Storage_Error FSD_BinaryFile::BeginWriteCommentSection() 
 {
-  myHeader.bcomment = ftell(myStream);
+  myHeader.bcomment = (Standard_Integer )ftell(myStream);
   return Storage_VSOk;
 }
 
@@ -852,8 +850,7 @@ Standard_Integer FSD_BinaryFile::WriteComment (Standard_OStream&
 
 Storage_Error FSD_BinaryFile::EndWriteCommentSection() 
 {
-  myHeader.ecomment = ftell(myStream);
-
+  myHeader.ecomment = (Standard_Integer )ftell(myStream);
   return Storage_VSOk;
 }
 
@@ -931,8 +928,7 @@ Storage_Error FSD_BinaryFile::EndReadCommentSection()
 
 Storage_Error FSD_BinaryFile::BeginWriteTypeSection() 
 {
-  myHeader.btype = ftell(myStream);
-
+  myHeader.btype = (Standard_Integer )ftell(myStream);
   return Storage_VSOk;
 }
 
@@ -965,8 +961,7 @@ void FSD_BinaryFile::WriteTypeInformations(const Standard_Integer typeNum,
 
 Storage_Error FSD_BinaryFile::EndWriteTypeSection() 
 {
-  myHeader.etype = ftell(myStream);
-
+  myHeader.etype = (Standard_Integer )ftell(myStream);
   return Storage_VSOk;
 }
 
@@ -1046,8 +1041,7 @@ Storage_Error FSD_BinaryFile::EndReadTypeSection()
 
 Storage_Error FSD_BinaryFile::BeginWriteRootSection() 
 {
-  myHeader.broot = ftell(myStream);
-
+  myHeader.broot = (Standard_Integer )ftell(myStream);
   return Storage_VSOk;
 }
 
@@ -1080,8 +1074,7 @@ void FSD_BinaryFile::WriteRoot(const TCollection_AsciiString& rootName, const St
 
 Storage_Error FSD_BinaryFile::EndWriteRootSection() 
 {
-  myHeader.eroot = ftell(myStream);
-
+  myHeader.eroot = (Standard_Integer )ftell(myStream);
   return Storage_VSOk;
 }
 
@@ -1163,8 +1156,7 @@ Storage_Error FSD_BinaryFile::EndReadRootSection()
 
 Storage_Error FSD_BinaryFile::BeginWriteRefSection() 
 {
-  myHeader.bref = ftell(myStream);
-
+  myHeader.bref = (Standard_Integer )ftell(myStream);
   return Storage_VSOk;
 }
 
@@ -1196,8 +1188,7 @@ void FSD_BinaryFile::WriteReferenceType(const Standard_Integer reference,const S
 
 Storage_Error FSD_BinaryFile::EndWriteRefSection() 
 {
-  myHeader.eref = ftell(myStream);
-
+  myHeader.eref = (Standard_Integer )ftell(myStream);
   return Storage_VSOk;
 }
 
@@ -1278,8 +1269,7 @@ Storage_Error FSD_BinaryFile::EndReadRefSection()
 
 Storage_Error FSD_BinaryFile::BeginWriteDataSection() 
 {
-  myHeader.bdata = ftell(myStream);
-
+  myHeader.bdata = (Standard_Integer )ftell(myStream);
   return Storage_VSOk;
 }
 
@@ -1338,7 +1328,7 @@ void FSD_BinaryFile::EndWritePersistentObjectData()
 
 Storage_Error FSD_BinaryFile::EndWriteDataSection() 
 {
-  myHeader.edata = ftell(myStream);
+  myHeader.edata = (Standard_Integer )ftell(myStream);
   
   fseek(myStream,myHeader.binfo,SEEK_SET);
   WriteHeader();
index 5ae9899f0a3f49af45bea3998584a8bb20bbe7c5..bdd4f572f769bda6a68950faad9c58224f338880 100755 (executable)
@@ -653,7 +653,7 @@ float Font_FTFont::AdvanceY (Standard_Utf32Char theUCharNext) const
 Standard_Integer Font_FTFont::GlyphsNumber (bool theToIncludeFallback) const
 {
 #ifdef HAVE_FREETYPE
-  Standard_Integer aNbGlyphs = myFTFace->num_glyphs;
+  Standard_Integer aNbGlyphs = (Standard_Integer )myFTFace->num_glyphs;
   if (theToIncludeFallback)
   {
     for (Standard_Integer aFontIter = 0; aFontIter < Font_UnicodeSubset_NB; ++aFontIter)
index 1791573e82f29cdf889b0d41d9cf8c9d2efb4ff1..725ea816b8a5f4b72f917a6aa359de9de3fc1c9e 100755 (executable)
@@ -64,7 +64,6 @@ IntPatch_PrmPrmIntersection.hxx
 IntPatch_PrmPrmIntersection.lxx
 IntPatch_PrmPrmIntersection_T3Bits.cxx
 IntPatch_PrmPrmIntersection_T3Bits.hxx
-IntPatch_PrmPrmIntersection_T3Bits.lxx
 IntPatch_RLine.cxx
 IntPatch_RLine.hxx
 IntPatch_RLine.lxx
index 5a81a59c4c9b743bd3f6d4a0c8fd2bdbe8b3905d..3b328c07e6a772f2c66aaf9b121e58cd374d8e1f 100644 (file)
@@ -3308,7 +3308,7 @@ void IntPatch_PrmPrmIntersection::PointDepart(Handle(IntSurf_LineOn2S)& LineOn2S
           for(si=-1; si<= 1 && nb<LIM; si++) { 
             for(sj=-1; sj<= 1 && nb<LIM; sj++) { 
               for(sk=-1; sk<= 1 && nb<LIM; sk++) { 
-                long unsigned lu=GrilleInteger(i+si,j+sj,k+sk);
+                Standard_Integer lu = GrilleInteger(i+si,j+sj,k+sk);
                 if(M1.Val(lu) && M2.Val(lu)) { 
                   nb++;
                 }
@@ -3320,7 +3320,7 @@ void IntPatch_PrmPrmIntersection::PointDepart(Handle(IntSurf_LineOn2S)& LineOn2S
               for(sj=-1; sj<= 1; sj++) { 
                 for(sk=-1; sk<= 1; sk++) { 
                   if(si || sj || sk) { 
-                    long unsigned lu=GrilleInteger(i+si,j+sj,k+sk);
+                    Standard_Integer lu = GrilleInteger(i+si,j+sj,k+sk);
                     M1.Raz(lu);
                   }
                 }
index db9a37945a28b5f2efb747fb6aaf00197cd1c189..21b37aec00716951ac1cebceb9c3e9d023808832 100644 (file)
@@ -14,7 +14,6 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-
 #include <IntPatch_PrmPrmIntersection_T3Bits.hxx>
 
 IntPatch_PrmPrmIntersection_T3Bits::IntPatch_PrmPrmIntersection_T3Bits(const Standard_Integer size)
@@ -23,12 +22,12 @@ IntPatch_PrmPrmIntersection_T3Bits::IntPatch_PrmPrmIntersection_T3Bits(const Sta
   Standard_Integer nb = (size*size*size)>>5;
   Isize = nb;
   p = new Standard_Integer [nb];
-  do { ((Standard_Integer *) p)[--nb]=0; } while(nb);
+  do { p[--nb] = 0; } while(nb);
 }
 
-void IntPatch_PrmPrmIntersection_T3Bits::Destroy()
+IntPatch_PrmPrmIntersection_T3Bits::~IntPatch_PrmPrmIntersection_T3Bits()
 {
-  if(p) { delete[] ((Standard_Integer*)p); p=NULL; }
+  if (p) { delete[] p; p = NULL; }
 }
 
 void IntPatch_PrmPrmIntersection_T3Bits::ResetAnd()
@@ -42,10 +41,10 @@ Standard_Integer IntPatch_PrmPrmIntersection_T3Bits::And(IntPatch_PrmPrmIntersec
   int k=indice>>5;
   while(k<Isize)
   {
-    Standard_Integer r=((Standard_Integer *) p)[k] & ((Standard_Integer *) Oth.p)[k];
+    Standard_Integer r = p[k] & Oth.p[k];
     if(r)
     {
-      unsigned long int c=0;
+      unsigned int c = 0;
       do
       {
         if(r&1)
index eacb6e8d6f66ff590e2e0231c854973a80cf6ab0..6da6277e09ce69410c5e2189bb50bcdd09a58f0e 100644 (file)
 #include <Standard_Address.hxx>
 #include <Standard_Integer.hxx>
 
-
-
 class IntPatch_PrmPrmIntersection_T3Bits 
 {
 public:
 
   DEFINE_STANDARD_ALLOC
 
-  
   Standard_EXPORT IntPatch_PrmPrmIntersection_T3Bits(const Standard_Integer size);
-  
-  Standard_EXPORT void Destroy();
-~IntPatch_PrmPrmIntersection_T3Bits()
-{
-  Destroy();
-}
-  
-    void Add (const Standard_Integer t);
-  
-    Standard_Integer Val (const Standard_Integer t) const;
-  
-    void Raz (const Standard_Integer t);
-  
-  Standard_EXPORT void ResetAnd();
-  
-  Standard_EXPORT Standard_Integer And (IntPatch_PrmPrmIntersection_T3Bits& Oth, Standard_Integer& indiceprecedent);
-
-
 
+  Standard_EXPORT ~IntPatch_PrmPrmIntersection_T3Bits();
 
-protected:
-
+  void Add (const Standard_Integer t)
+  {
+    p[t>>5] |= (1<<(((unsigned int)t)&31));
+  }
 
+  Standard_Integer Val (const Standard_Integer t) const
+  {
+    return (p[t>>5] & (1<<(((unsigned int)t)&31)));
+  }
 
+  void Raz (const Standard_Integer t)
+  {
+    p[t>>5] &= ~(1<<(((unsigned int)t)&31));
+  }
 
+  Standard_EXPORT void ResetAnd();
+  
+  Standard_EXPORT Standard_Integer And (IntPatch_PrmPrmIntersection_T3Bits& Oth, Standard_Integer& indiceprecedent);
 
 private:
 
-
-
-  Standard_Address p;
+  Standard_Integer* p;
   Standard_Integer Isize;
 
-
 };
 
-
-#include <IntPatch_PrmPrmIntersection_T3Bits.lxx>
-
-
-
-
-
 #endif // _IntPatch_PrmPrmIntersection_T3Bits_HeaderFile
diff --git a/src/IntPatch/IntPatch_PrmPrmIntersection_T3Bits.lxx b/src/IntPatch/IntPatch_PrmPrmIntersection_T3Bits.lxx
deleted file mode 100644 (file)
index 75ab832..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-// Created on: 1999-12-16
-// Created by: Atelier CAS2000
-// Copyright (c) 1999-1999 Matra Datavision
-// Copyright (c) 1999-2014 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-inline void IntPatch_PrmPrmIntersection_T3Bits::Add(const Standard_Integer t)
-{
-  ((Standard_Integer *) p)[t>>5] |= (1<<(((unsigned int)t)&31));
-}
-
-inline Standard_Integer IntPatch_PrmPrmIntersection_T3Bits::Val(const Standard_Integer t) const
-{
-  return (((Standard_Integer *) p)[t>>5] & (1<<(((unsigned int)t)&31)));
-}
-
-inline void IntPatch_PrmPrmIntersection_T3Bits::Raz(const Standard_Integer t)
-{
-  ((Standard_Integer *) p)[t>>5] &= ~(1<<(((unsigned int)t)&31));
-}
index 63d98d8e2cf10c3707a12902a459fceccde615ac..856cccb91f03079b769153f82b6ec75e6604171f 100644 (file)
@@ -253,6 +253,9 @@ protected:
     ListNode *Next;
   };
 
+  //! Cell index type.
+  typedef Standard_Integer Cell_IndexType;
+
   /**
    * Auxiliary structure representing a cell in the space.
    * Cells are stored in the map, each cell contains list of objects 
@@ -270,14 +273,14 @@ protected:
     {
       for (int i = 0; i < theCellSize.Size(); i++)
       {
-          Standard_Real val = (Standard_Real)(Inspector::Coord(i, thePnt) / theCellSize(theCellSize.Lower() + i));
+          Standard_Real aVal = (Standard_Real)(Inspector::Coord(i, thePnt) / theCellSize(theCellSize.Lower() + i));
           //If the value of index is greater than
           //INT_MAX it is decreased correspondingly for the value of INT_MAX. If the value
           //of index is less than INT_MIN it is increased correspondingly for the absolute
           //value of INT_MIN.
-          index[i] = long((val > INT_MAX - 1) ? fmod(val, (Standard_Real) INT_MAX) 
-                                               : (val < INT_MIN + 1) ? fmod(val, (Standard_Real) INT_MIN)
-                                                                     : val);
+          index[i] = Cell_IndexType((aVal > INT_MAX - 1) ? fmod(aVal, (Standard_Real) INT_MAX)
+                                                         : (aVal < INT_MIN + 1) ? fmod(aVal, (Standard_Real) INT_MIN)
+                                                                                : aVal);
       }
     }
 
@@ -324,19 +327,19 @@ protected:
     {
       // number of bits per each dimension in the hash code
       const std::size_t aDim       = index.Size();
-      const std::size_t aShiftBits = (BITS (long) - 1) / aDim;
-      unsigned int      aCode      = 0;
+      const std::size_t aShiftBits = (BITS (Cell_IndexType) - 1) / aDim;
+      std::size_t       aCode      = 0;
 
       for (std::size_t i = 0; i < aDim; ++i)
       {
-        aCode = (aCode << aShiftBits) ^ index[i];
+        aCode = (aCode << aShiftBits) ^ std::size_t(index[i]);
       }
 
       return ::HashCode(aCode, theUpperBound);
     }
 
   public:
-    NCollection_LocalArray<long, 10> index;
+    NCollection_LocalArray<Cell_IndexType, 10> index;
     ListNode *Objects;
   };
   
@@ -383,14 +386,19 @@ protected:
                   const Cell& theCellMin, const Cell& theCellMax, 
                    const Target& theTarget)
   {
-    int start = theCellMin.index[idim];
-    int end   = theCellMax.index[idim];
-    for (int i=start; i <= end; i++) {
+    const Cell_IndexType aStart = theCellMin.index[idim];
+    const Cell_IndexType anEnd  = theCellMax.index[idim];
+    for (Cell_IndexType i = aStart; i <= anEnd; ++i)
+    {
       theCell.index[idim] = i;
       if ( idim ) // recurse
+      {
         iterateAdd (idim-1, theCell, theCellMin, theCellMax, theTarget);
+      }
       else // add to this cell
+      {
         add (theCell, theTarget);
+      }
     }
   }
   
@@ -426,14 +434,19 @@ protected:
                       const Cell& theCellMin, const Cell& theCellMax, 
                       const Target& theTarget)
   {
-    int start = theCellMin.index[idim];
-    int end   = theCellMax.index[idim];
-    for (int i=start; i <= end; i++) {
+    const Cell_IndexType aStart = theCellMin.index[idim];
+    const Cell_IndexType anEnd  = theCellMax.index[idim];
+    for (Cell_IndexType i = aStart; i <= anEnd; ++i)
+    {
       theCell.index[idim] = i;
       if ( idim ) // recurse
+      {
         iterateRemove (idim-1, theCell, theCellMin, theCellMax, theTarget);
+      }
       else // remove from this cell
+      {
         remove (theCell, theTarget);
+      }
     }
   }
 
@@ -469,14 +482,19 @@ protected:
                       const Cell& theCellMin, const Cell& theCellMax, 
                        Inspector& theInspector) 
   {
-    int start = theCellMin.index[idim];
-    int end   = theCellMax.index[idim];
-    for (int i=start; i <= end; i++) {
+    const Cell_IndexType aStart = theCellMin.index[idim];
+    const Cell_IndexType anEnd  = theCellMax.index[idim];
+    for (Cell_IndexType i = aStart; i <= anEnd; ++i)
+    {
       theCell.index[idim] = i;
       if ( idim ) // recurse
+      {
         iterateInspect (idim-1, theCell, theCellMin, theCellMax, theInspector);
+      }
       else // inspect this cell
+      {
         inspect (theCell, theInspector);
+      }
     }
   }
 
index 401d666f8ff6f8061eaaf415fd419a292e2dce66..2b616bc54d958fe9a2c915179a5fddb37378b5f7 100644 (file)
@@ -145,21 +145,27 @@ Standard_Integer NCollection_UBTreeFiller<TheObjType,TheBndType>::Fill ()
   Standard_Integer i, nbAdd = mySeqPtr.Length();
   // Fisher-Yates randomization
   if (myIsFullRandom)
-    for (i = nbAdd; i > 0; i--) { 
-      unsigned int ind = myRandGen();
+  {
+    for (i = nbAdd; i > 0; i--)
+    {
+      unsigned int ind = (unsigned int )myRandGen();
       ind = ind % i;
       const ObjBnd& aObjBnd = mySeqPtr(ind);
       myTree.Add (aObjBnd.myObj, aObjBnd.myBnd);
       mySeqPtr(ind) = mySeqPtr(i-1);
     }
+  }
   else
-    for (i = nbAdd; i > 0; i--) { 
-      unsigned int ind = myRandGen();
+  {
+    for (i = nbAdd; i > 0; i--)
+    {
+      unsigned int ind = (unsigned int )myRandGen();
       ind = i - (ind % i) - 1;
       const ObjBnd& aObjBnd = mySeqPtr(ind);
       myTree.Add (aObjBnd.myObj, aObjBnd.myBnd);
       mySeqPtr(ind) = mySeqPtr(i-1);
     }
+  }
   mySeqPtr.Clear();
   return nbAdd;
 }
index ec033a2492dd58d51ae62eb1cd980ce16a5fb217..35436398461715a30f25055b6646da303c78d111 100755 (executable)
@@ -216,20 +216,20 @@ private:
 
 private: //! @name unicode magic numbers
 
-  static const unsigned char UTF8_BYTES_MINUS_ONE[256];
-  static const unsigned long offsetsFromUTF8[6];
-  static const unsigned char UTF8_FIRST_BYTE_MARK[7];
-  static const unsigned long UTF8_BYTE_MASK;
-  static const unsigned long UTF8_BYTE_MARK;
-  static const unsigned long UTF16_SURROGATE_HIGH_START;
-  static const unsigned long UTF16_SURROGATE_HIGH_END;
-  static const unsigned long UTF16_SURROGATE_LOW_START;
-  static const unsigned long UTF16_SURROGATE_LOW_END;
-  static const unsigned long UTF16_SURROGATE_HIGH_SHIFT;
-  static const unsigned long UTF16_SURROGATE_LOW_BASE;
-  static const unsigned long UTF16_SURROGATE_LOW_MASK;
-  static const unsigned long UTF32_MAX_BMP;
-  static const unsigned long UTF32_MAX_LEGAL;
+  static const unsigned char      UTF8_BYTES_MINUS_ONE[256];
+  static const Standard_Utf32Char offsetsFromUTF8[6];
+  static const unsigned char      UTF8_FIRST_BYTE_MARK[7];
+  static const Standard_Utf32Char UTF8_BYTE_MASK;
+  static const Standard_Utf32Char UTF8_BYTE_MARK;
+  static const Standard_Utf32Char UTF16_SURROGATE_HIGH_START;
+  static const Standard_Utf32Char UTF16_SURROGATE_HIGH_END;
+  static const Standard_Utf32Char UTF16_SURROGATE_LOW_START;
+  static const Standard_Utf32Char UTF16_SURROGATE_LOW_END;
+  static const Standard_Utf32Char UTF16_SURROGATE_HIGH_SHIFT;
+  static const Standard_Utf32Char UTF16_SURROGATE_LOW_BASE;
+  static const Standard_Utf32Char UTF16_SURROGATE_LOW_MASK;
+  static const Standard_Utf32Char UTF32_MAX_BMP;
+  static const Standard_Utf32Char UTF32_MAX_LEGAL;
 
 private: //! @name private fields
 
index a3a22547682d64d6fbad7a8fd375979e5c6b1c12..3bee669fccb457d2c2a41c6c638c90160c254d15 100755 (executable)
@@ -54,7 +54,7 @@ const unsigned char NCollection_UtfIterator<Type>::UTF8_BYTES_MINUS_ONE[256] =
 //! This table contains as many values as there might be trailing bytes
 //! in a UTF-8 sequence.
 template<typename Type>
-const unsigned long NCollection_UtfIterator<Type>::offsetsFromUTF8[6] =
+const Standard_Utf32Char NCollection_UtfIterator<Type>::offsetsFromUTF8[6] =
 {
   0x00000000UL, 0x00003080UL, 0x000E2080UL,
   0x03C82080UL, 0xFA082080UL, 0x82082080UL
@@ -95,17 +95,17 @@ inline void NCollection_UtfIterator<Type>::readUTF8()
 }
 
 // magic numbers
-template<typename Type> const unsigned long NCollection_UtfIterator<Type>::UTF8_BYTE_MASK = 0xBF;
-template<typename Type> const unsigned long NCollection_UtfIterator<Type>::UTF8_BYTE_MARK = 0x80;
-template<typename Type> const unsigned long NCollection_UtfIterator<Type>::UTF16_SURROGATE_HIGH_START = 0xD800;
-template<typename Type> const unsigned long NCollection_UtfIterator<Type>::UTF16_SURROGATE_HIGH_END   = 0xDBFF;
-template<typename Type> const unsigned long NCollection_UtfIterator<Type>::UTF16_SURROGATE_LOW_START  = 0xDC00;
-template<typename Type> const unsigned long NCollection_UtfIterator<Type>::UTF16_SURROGATE_LOW_END    = 0xDFFF;
-template<typename Type> const unsigned long NCollection_UtfIterator<Type>::UTF16_SURROGATE_HIGH_SHIFT = 10;
-template<typename Type> const unsigned long NCollection_UtfIterator<Type>::UTF16_SURROGATE_LOW_BASE   = 0x0010000UL;
-template<typename Type> const unsigned long NCollection_UtfIterator<Type>::UTF16_SURROGATE_LOW_MASK   = 0x3FFUL;
-template<typename Type> const unsigned long NCollection_UtfIterator<Type>::UTF32_MAX_BMP   = 0x0000FFFFUL;
-template<typename Type> const unsigned long NCollection_UtfIterator<Type>::UTF32_MAX_LEGAL = 0x0010FFFFUL;
+template<typename Type> const Standard_Utf32Char NCollection_UtfIterator<Type>::UTF8_BYTE_MASK = 0xBF;
+template<typename Type> const Standard_Utf32Char NCollection_UtfIterator<Type>::UTF8_BYTE_MARK = 0x80;
+template<typename Type> const Standard_Utf32Char NCollection_UtfIterator<Type>::UTF16_SURROGATE_HIGH_START = 0xD800;
+template<typename Type> const Standard_Utf32Char NCollection_UtfIterator<Type>::UTF16_SURROGATE_HIGH_END   = 0xDBFF;
+template<typename Type> const Standard_Utf32Char NCollection_UtfIterator<Type>::UTF16_SURROGATE_LOW_START  = 0xDC00;
+template<typename Type> const Standard_Utf32Char NCollection_UtfIterator<Type>::UTF16_SURROGATE_LOW_END    = 0xDFFF;
+template<typename Type> const Standard_Utf32Char NCollection_UtfIterator<Type>::UTF16_SURROGATE_HIGH_SHIFT = 10;
+template<typename Type> const Standard_Utf32Char NCollection_UtfIterator<Type>::UTF16_SURROGATE_LOW_BASE   = 0x0010000UL;
+template<typename Type> const Standard_Utf32Char NCollection_UtfIterator<Type>::UTF16_SURROGATE_LOW_MASK   = 0x3FFUL;
+template<typename Type> const Standard_Utf32Char NCollection_UtfIterator<Type>::UTF32_MAX_BMP   = 0x0000FFFFUL;
+template<typename Type> const Standard_Utf32Char NCollection_UtfIterator<Type>::UTF32_MAX_LEGAL = 0x0010FFFFUL;
 
 // =======================================================================
 // function : readUTF16
index ef37014bf8026676327262e4166800b21fb48908..ab779b9e59afbab51bbd8efee82e0f5f417d4c02 100644 (file)
@@ -187,11 +187,11 @@ Standard_Integer OSD_Disk::DiskSize()
   ULONGLONG aSize = aNbTotalBytes.QuadPart / 512;
   return (Standard_Integer )aSize; // may be an overflow
 #else
-  struct statvfs buffer;
-  if (statvfs (myDiskName.ToCString(), &buffer) == 0)
+  struct statvfs aBuffer;
+  if (statvfs (myDiskName.ToCString(), &aBuffer) == 0)
   {
-    int BSize512 = buffer.f_frsize / 512;
-    return buffer.f_blocks * BSize512;
+    unsigned long aBSize512 = aBuffer.f_frsize / 512;
+    return Standard_Integer(aBuffer.f_blocks * aBSize512);
   }
   myError.SetValue (errno, Iam, "OSD_Disk: statvfs failed.");
   return 0;
@@ -219,11 +219,11 @@ Standard_Integer OSD_Disk::DiskFree()
   ULONGLONG aSize = aNbFreeAvailableBytes.QuadPart / 512;
   return (Standard_Integer )aSize; // may be an overflow
 #else
-  struct statvfs buffer;
-  if (statvfs (myDiskName.ToCString(), &buffer) == 0)
+  struct statvfs aBuffer;
+  if (statvfs (myDiskName.ToCString(), &aBuffer) == 0)
   {
-    int BSize512 = buffer.f_frsize / 512;
-    return buffer.f_bavail * BSize512;
+    unsigned long aBSize512 = aBuffer.f_frsize / 512;
+    return Standard_Integer(aBuffer.f_bavail * aBSize512);
   }
   myError.SetValue (errno, Iam, "OSD_Disk: statvfs failed.");
   return 0;
index b8c0abc43b048c4efadcc01a6455ea7aa6e9e460..967a7c7e7d21206d2d27c6e5e002cb608cc34d20 100644 (file)
@@ -782,7 +782,7 @@ void OSD_File::Read (TCollection_AsciiString& theBuffer,
 #ifdef _WIN32
   Read (&aBuffer.ChangeFirst(), theNbBytes, aNbBytesRead);
 #else
-  aNbBytesRead = read (myFileChannel, &aBuffer.ChangeFirst(), theNbBytes);
+  aNbBytesRead = (Standard_Integer )read (myFileChannel, &aBuffer.ChangeFirst(), theNbBytes);
   if (aNbBytesRead == -1)
   {
     aNbBytesRead = 0;
@@ -1078,7 +1078,7 @@ void OSD_File::Read (const Standard_Address  theBuffer,
   theNbReadBytes = (Standard_Integer )aNbReadBytes;
 #else
   theNbReadBytes = 0;
-  int aNbReadBytes = read (myFileChannel, (char* )theBuffer, theNbBytes);
+  int aNbReadBytes = (Standard_Integer )read (myFileChannel, (char* )theBuffer, theNbBytes);
   if (aNbReadBytes == -1)
   {
     myError.SetValue (errno, Iam, "Read");
@@ -1131,7 +1131,7 @@ void OSD_File::Write (const Standard_Address theBuffer,
     _osd_wnt_set_error (myError, OSD_WFile);
   }
 #else
-  const int aNbWritten = write (myFileChannel, (const char* )theBuffer, theNbBytes);
+  const int aNbWritten = (Standard_Integer )write (myFileChannel, (const char* )theBuffer, theNbBytes);
   if (aNbWritten == -1)
   {
     myError.SetValue (errno, Iam, "Write");
index 352d24e606b8edeb3d287651d07fb5b0db3b8686..66ff85a1ac21c38882b8cc2c568194c074f21fde 100644 (file)
@@ -183,11 +183,15 @@ int static copy_file( const char* src, const char* trg )
   const int BUFSIZE=4096;
   char buf[BUFSIZE];
   int n=0;
-  while ( ( n = read ( fds, buf, BUFSIZE )) >0 )
+  while ((n = (int )read (fds, buf, BUFSIZE)) > 0)
   {
-    if ( write ( fdo, buf, n ) != n ) { // writing error
-      if ( ! errno )
+    if ( write ( fdo, buf, n ) != n )
+    {
+      // writing error
+      if (!errno)
+      {
         errno = ENOSPC;
+      }
       break;
     }
   }
index cf168485bd3ce48ea21dee697100d7b9e419b437..5a7648de1ed32e57839efd443ee4df81868ea138 100644 (file)
@@ -1368,7 +1368,7 @@ static Standard_Integer OCC24137 (Draw_Interpretor& theDI, Standard_Integer theN
   const TopoDS_Shape aShapeV = DBRep::Get (aVertName);
   const Standard_Real aUFrom = Atof (theArgv[anArgIter++]);
   const Standard_Real aVFrom = Atof (theArgv[anArgIter++]);
-  const Standard_Integer aNbIts = (anArgIter < theNArg) ? atol (theArgv[anArgIter++]) : 100;
+  const Standard_Integer aNbIts = (anArgIter < theNArg) ? Draw::Atoi (theArgv[anArgIter++]) : 100;
   if (aShapeF.IsNull() || aShapeF.ShapeType() != TopAbs_FACE)
     {
       std::cout << "Error: " << aFaceName << " shape is null / not a face" << std::endl;
index d6dfa3974a206e72e3718625ceac012e942a0ed8..227b295fe28f1dc54b457d9f314cd6a86a968a1b 100644 (file)
@@ -3104,6 +3104,7 @@ static Standard_Integer OCC30391(Draw_Interpretor& theDI,
 #include <TDF_ChildIterator.hxx>
 #include <TDocStd_PathParser.hxx>
 #include <OSD.hxx>
+#include <OSD_Parallel.hxx>
 #include <OSD_Thread.hxx>
 #include <OSD_Environment.hxx>
 typedef NCollection_Sequence <TCollection_AsciiString> SequenceOfDocNames;
@@ -3193,31 +3194,6 @@ void* threadFunction(void* theArgs)
   return args->res;
 }
 
-int getNumCores()
-{
-#ifdef WIN32
-  SYSTEM_INFO sysinfo;
-  GetSystemInfo(&sysinfo);
-  return sysinfo.dwNumberOfProcessors;
-#elif MACOS
-  int nm[2];
-  size_t len = 4;
-  uint32_t count;
-
-  nm[0] = CTL_HW; nm[1] = HW_AVAILCPU;
-  sysctl(nm, 2, &count, &len, NULL, 0);
-
-  if (count < 1) {
-    nm[1] = HW_NCPU;
-    sysctl(nm, 2, &count, &len, NULL, 0);
-    if (count < 1) { count = 1; }
-  }
-  return count;
-#else
-  return sysconf(_SC_NPROCESSORS_ONLN);
-#endif
-}
-
 //=======================================================================
 //function : OCC29195
 //purpose  : 
@@ -3231,7 +3207,7 @@ static Standard_Integer OCC29195(Draw_Interpretor&, Standard_Integer theArgC, co
     std::cout << "\ndocN - names (5 in each group) of OCAF documents names (3 input files, 2 output)\n" << std::endl;
     return 1;
   }
-  int iThread(0), nbThreads(0), off(0);
+  int iThread(0), off(0);
   if (TCollection_AsciiString(theArgV[1]).IsIntegerValue())
   {
     nbREP = TCollection_AsciiString(theArgV[1]).IntegerValue();
@@ -3243,7 +3219,7 @@ static Standard_Integer OCC29195(Draw_Interpretor&, Standard_Integer theArgC, co
     return 0;
   }
   Standard_Integer aNbFiles = (theArgC - off - 1) / 5;
-  nbThreads = getNumCores();
+  int nbThreads = OSD_Parallel::NbLogicalProcessors();
   if (aNbFiles < nbThreads)
   {
     nbThreads = aNbFiles;
index 1b7c61f201c720cfbbc38fd6bce3fd69b1c17aae..331e100598ea77e022f4a7c7c118d5a6b59968dd 100644 (file)
@@ -329,7 +329,7 @@ void RWObj_Reader::pushIndices (const char* thePos)
   for (Standard_Integer aNode = 0;; ++aNode)
   {
     Graphic3d_Vec3i a3Indices (-1, -1, -1);
-    a3Indices[0] = strtol (thePos, &aNext, 10) - 1;
+    a3Indices[0] = int(strtol (thePos, &aNext, 10) - 1);
     if (aNext == thePos)
     {
       break;
@@ -340,14 +340,14 @@ void RWObj_Reader::pushIndices (const char* thePos)
     if (*thePos == '/')
     {
       ++thePos;
-      a3Indices[1] = strtol (thePos, &aNext, 10) - 1;
+      a3Indices[1] = int(strtol (thePos, &aNext, 10) - 1);
       thePos = aNext;
 
       // parse Normal index
       if (*thePos == '/')
       {
         ++thePos;
-        a3Indices[2] = strtol (thePos, &aNext, 10) - 1;
+        a3Indices[2] = int(strtol (thePos, &aNext, 10) - 1);
         thePos = aNext;
       }
     }
index 002ee6826f639faccd0a69e12f178c6447a7180d..018961925668c3d571b2c07f25320ab62e2c4bef 100644 (file)
@@ -1720,7 +1720,7 @@ multadd(Bigint *b, int m, int a MTd)      /* multiply by m and add a */
                        Bfree(b MTa);
                        b = b1;
                        }
-               b->x[wds++] = carry;
+                b->x[wds++] = (ULong )carry;
                b->wds = wds;
                }
        return b;
@@ -1889,7 +1889,7 @@ mult(Bigint *a, Bigint *b MTd)
                                *xc++ = z & FFFFFFFF;
                                }
                                while(x < xae);
-                       *xc = carry;
+                        *xc = (ULong )carry;
                        }
                }
 #else
@@ -2704,7 +2704,7 @@ rshift(Bigint *b, int k)
                        while(x < xe)
                                *x1++ = *x++;
                }
-       if ((b->wds = x1 - b->x) == 0)
+        if ((b->wds = int(x1 - b->x)) == 0)
                b->x[0] = 0;
        }
 
@@ -2913,7 +2913,7 @@ gethex( const char **sp, U *rvp, int rounding, int sign MTd)
                word1(rvp) = Big1;
                return;
                }
-       n = s1 - s0 - 1;
+        n = int(s1 - s0 - 1);
        for(k = 0; n > (1 << (kshift-2)) - 1; n >>= 1)
                k++;
        b = Balloc(k MTa);
@@ -2942,7 +2942,7 @@ gethex( const char **sp, U *rvp, int rounding, int sign MTd)
                n += 4;
                }
        *x++ = L;
-       b->wds = n = x - b->x;
+        b->wds = n = int(x - b->x);
        n = ULbits*n - hi0bits(L);
        nbits = Nbits;
        lostbits = 0;
@@ -3559,7 +3559,7 @@ Strtod(const char *s00, char **se)
                        z = 10*z + c - '0';
 #endif
        nd0 = nd;
-       bc.dp0 = bc.dp1 = s - s0;
+        bc.dp0 = bc.dp1 = int(s - s0);
        for(s1 = s; s1 > s0 && *--s1 == '0'; )
                ++nz1;
 #ifdef USE_LOCALE
@@ -3583,13 +3583,13 @@ Strtod(const char *s00, char **se)
 #endif
        if (c == '.') {
                c = *++s;
-               bc.dp1 = s - s0;
+                bc.dp1 = int(s - s0);
                bc.dplen = bc.dp1 - bc.dp0;
                if (!nd) {
                        for(; c == '0'; c = *++s)
                                nz++;
                        if (c > '0' && c <= '9') {
-                               bc.dp0 = s0 - s;
+                                bc.dp0 = int(s0 - s);
                                bc.dp1 = bc.dp0 + bc.dplen;
                                s0 = s;
                                nf += nz;
@@ -4126,14 +4126,14 @@ Strtod(const char *s00, char **se)
                        yz /= 10;
                        e1 += 1;
                        }
-               y = yz / 100000000;
+                y = ULong(yz / 100000000);
                }
        else if (nd > 9) {
                i = nd - 9;
-               y = (yz >> i) / pfive[i-1];
+                y = ULong((yz >> i) / pfive[i-1]);
                }
        else
-               y = yz;
+                y = ULong(yz);
        dval(&rv) = yz;
 #endif /*}*/
 
index 9a863ec4c7e5ad8f5769f7e73922b7cca37331ab..56212480d9636d621314f5b6f2a35847314ba15b 100644 (file)
 
 #include <Standard_Type.hxx>
 
-#ifdef _WIN32
-#include <windows.h>
-#else
-typedef struct {
-  unsigned long Data1 ;
-  unsigned short Data2 ;
-  unsigned short Data3 ;
-  unsigned char Data4[8] ;
-} GUID ;
-#endif
-
-typedef GUID Standard_UUID ;
+struct Standard_UUID
+{
+  uint32_t Data1;
+  uint16_t Data2;
+  uint16_t Data3;
+  uint8_t  Data4[8];
+};
 
 #endif
-
-
index 4d9f58934a80a489de694310582df44c82a9aa6a..a7a99ded57b90a9c4eb1a0a9091a688758e26571 100644 (file)
@@ -67,13 +67,12 @@ Standard_Integer  StepSelect_WorkLibrary::ReadFile
    Handle(Interface_InterfaceModel)& model,
    const Handle(Interface_Protocol)& protocol) const
 {
-  long status = 1;
   DeclareAndCast(StepData_Protocol,stepro,protocol);
   if (stepro.IsNull()) return 1;
   Handle(StepData_StepModel) stepmodel  = new StepData_StepModel;
   model  = stepmodel;
-  status = StepFile_Read(name, 0, stepmodel, stepro);
-  return status;
+  Standard_Integer aStatus = StepFile_Read(name, 0, stepmodel, stepro);
+  return aStatus;
 }
 
 Standard_Integer  StepSelect_WorkLibrary::ReadStream (const Standard_CString theName,
@@ -81,13 +80,12 @@ Standard_Integer  StepSelect_WorkLibrary::ReadStream (const Standard_CString the
                                                       Handle(Interface_InterfaceModel)& model,
                                                       const Handle(Interface_Protocol)& protocol) const
 {
-  long status = 1;
   DeclareAndCast(StepData_Protocol, stepro, protocol);
   if (stepro.IsNull()) return 1;
   Handle(StepData_StepModel) stepmodel = new StepData_StepModel;
   model = stepmodel;
-  status = StepFile_Read(theName, &theIStream, stepmodel, stepro);
-  return status;
+  Standard_Integer aStatus = StepFile_Read(theName, &theIStream, stepmodel, stepro);
+  return aStatus;
 }