]> OCCT Git - occt-copy.git/commitdiff
0026171: Coding rules - eliminate -Wshorten-64-to-32 CLang warnings CR26171
authorrkv <rkv@opencascade.com>
Fri, 30 Oct 2015 08:27:41 +0000 (11:27 +0300)
committerrkv <rkv@opencascade.com>
Fri, 30 Oct 2015 08:27:41 +0000 (11:27 +0300)
13 files changed:
src/Bnd/Bnd_BoundSortBox.cxx
src/ExprIntrp/lex.ExprIntrp.c
src/FSD/FSD_BinaryFile.cxx
src/Font/Font_FTFont.hxx
src/IntPatch/IntPatch_PrmPrmIntersection.cxx
src/IntPatch/IntPatch_PrmPrmIntersection_T3Bits.cxx
src/NCollection/NCollection_CellFilter.hxx
src/NCollection/NCollection_UtfIterator.hxx [changed mode: 0755->0644]
src/NCollection/NCollection_UtfIterator.lxx [changed mode: 0755->0644]
src/OSD/OSD_Disk.cxx
src/OSD/OSD_File.cxx
src/OSD/OSD_FileNode.cxx
src/Standard/Standard_UUID.hxx

index 497ab1dfed0b471e39897da752d435e0da80ec8d..498d015e0154ac92d49cceadbc1e62ed43908b8c 100644 (file)
@@ -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(Standard_Integer t) { int o=t&31;    int k=t>>5;    p[k]|=_P2[o];          }
+  unsigned long Val(Standard_Integer 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]);      }
   
   Standard_Integer NbAxisX(const Standard_Integer i) {   return(axisX[0][i]);   }
   Standard_Integer NbAxisY(const Standard_Integer i) {   return(axisY[0][i]);   }
@@ -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);
+               Standard_Integer 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);
+           Standard_Integer 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);
+       Standard_Integer t=Map->GrilleInteger(i,j,k);
        if(Map->Val(t)) { 
          touch = Standard_True;
        }
index fa1f37beb155db5115adb7815536ec527ed93a22..9fda0e99631a327124eec4822c9ea19d85065596 100644 (file)
@@ -2207,7 +2207,7 @@ YY_MALLOC_DECL
  */
 #ifndef YY_INPUT
 #define YY_INPUT(buf,result,max_size) \
-       if ( (result = read( fileno(yyin), (char *) buf, max_size )) < 0 ) \
+       if ( (result = (int)read( fileno(yyin), (char *) buf, max_size )) < 0 ) \
                YY_FATAL_ERROR( "input in flex scanner failed" );
 #endif
 
@@ -2827,7 +2827,7 @@ static int input()
 
                else
                        { /* need more input */
-                       int offset = yy_c_buf_p - yytext_ptr;
+                       long offset = yy_c_buf_p - yytext_ptr;
                        ++yy_c_buf_p;
 
                        switch ( yy_get_next_buffer() )
index 70e24b9f217f35b991d765229b037a9b923677fa..5d5b2350e56fc3c1f5fc887fec6c5d3a1008537c 100644 (file)
@@ -437,7 +437,7 @@ Storage_Error FSD_BinaryFile::BeginWriteInfoSection()
               myStream))
     Storage_StreamWriteError::Raise();
   
-  myHeader.binfo = ftell(myStream);
+  myHeader.binfo = (Standard_Integer)ftell(myStream);
   WriteHeader();
 
   return Storage_VSOk;
@@ -483,7 +483,7 @@ void FSD_BinaryFile::WriteInfo(const Standard_Integer nbObj,
 
 Storage_Error FSD_BinaryFile::EndWriteInfoSection() 
 {
-  myHeader.einfo = ftell(myStream);
+  myHeader.einfo = (Standard_Integer)ftell(myStream);
 
   return Storage_VSOk;
 }
@@ -565,7 +565,7 @@ Storage_Error FSD_BinaryFile::EndReadInfoSection()
 
 Storage_Error FSD_BinaryFile::BeginWriteCommentSection() 
 {
-  myHeader.bcomment = ftell(myStream);
+  myHeader.bcomment = (Standard_Integer)ftell(myStream);
   return Storage_VSOk;
 }
 
@@ -592,7 +592,7 @@ void FSD_BinaryFile::WriteComment(const TColStd_SequenceOfExtendedString& aCom)
 
 Storage_Error FSD_BinaryFile::EndWriteCommentSection() 
 {
-  myHeader.ecomment = ftell(myStream);
+  myHeader.ecomment = (Standard_Integer)ftell(myStream);
 
   return Storage_VSOk;
 }
@@ -643,7 +643,7 @@ Storage_Error FSD_BinaryFile::EndReadCommentSection()
 
 Storage_Error FSD_BinaryFile::BeginWriteTypeSection() 
 {
-  myHeader.btype = ftell(myStream);
+  myHeader.btype = (Standard_Integer)ftell(myStream);
 
   return Storage_VSOk;
 }
@@ -677,7 +677,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;
 }
@@ -736,7 +736,7 @@ Storage_Error FSD_BinaryFile::EndReadTypeSection()
 
 Storage_Error FSD_BinaryFile::BeginWriteRootSection() 
 {
-  myHeader.broot = ftell(myStream);
+  myHeader.broot = (Standard_Integer)ftell(myStream);
 
   return Storage_VSOk;
 }
@@ -770,7 +770,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;
 }
@@ -830,7 +830,7 @@ Storage_Error FSD_BinaryFile::EndReadRootSection()
 
 Storage_Error FSD_BinaryFile::BeginWriteRefSection() 
 {
-  myHeader.bref = ftell(myStream);
+  myHeader.bref = (Standard_Integer)ftell(myStream);
 
   return Storage_VSOk;
 }
@@ -863,7 +863,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;
 }
@@ -923,7 +923,7 @@ Storage_Error FSD_BinaryFile::EndReadRefSection()
 
 Storage_Error FSD_BinaryFile::BeginWriteDataSection() 
 {
-  myHeader.bdata = ftell(myStream);
+  myHeader.bdata = (Standard_Integer)ftell(myStream);
 
   return Storage_VSOk;
 }
@@ -983,7 +983,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 d7ea03b0316c73717fa2e292ee5b1c1d6156a2d1..d23811e51fc0078de6ac7cca84523c44176a3b70 100755 (executable)
@@ -182,7 +182,7 @@ public:
   //! @return glyphs number in this font.
   inline Standard_Integer GlyphsNumber() const
   {
-    return myFTFace->num_glyphs;
+    return (Standard_Integer)myFTFace->num_glyphs;
   }
 
   //! Retrieve glyph bitmap rectangle
index c68e8d5a868a3b5da8b2d00266e36d12204cf084..eadd84ab59c4391ae1b5d06874e3c8385f2da67d 100644 (file)
@@ -3241,7 +3241,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++;
                 }
@@ -3253,7 +3253,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..82554b34cc9d643460d59a82944f3261fe3be1e9 100644 (file)
@@ -45,7 +45,7 @@ Standard_Integer IntPatch_PrmPrmIntersection_T3Bits::And(IntPatch_PrmPrmIntersec
     Standard_Integer r=((Standard_Integer *) p)[k] & ((Standard_Integer *) Oth.p)[k];
     if(r)
     {
-      unsigned long int c=0;
+      unsigned int c=0;
       do
       {
         if(r&1)
index fdc923cbcbf9dd03bc66cc4799c88b280d488423..b7b6898cc85c4d59e2bdba06960d2061c740af2f 100644 (file)
@@ -371,9 +371,9 @@ 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++) {
+    long start = theCellMin.index[idim];
+    long end   = theCellMax.index[idim];
+    for (long i=start; i <= end; i++) {
       theCell.index[idim] = i;
       if ( idim ) // recurse
         iterateAdd (idim-1, theCell, theCellMin, theCellMax, theTarget);
@@ -414,9 +414,9 @@ 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++) {
+    long start = theCellMin.index[idim];
+    long end   = theCellMax.index[idim];
+    for (long i=start; i <= end; i++) {
       theCell.index[idim] = i;
       if ( idim ) // recurse
         iterateRemove (idim-1, theCell, theCellMin, theCellMax, theTarget);
@@ -457,9 +457,9 @@ 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++) {
+    long start = theCellMin.index[idim];
+    long end   = theCellMax.index[idim];
+    for (long i=start; i <= end; i++) {
       theCell.index[idim] = i;
       if ( idim ) // recurse
         iterateInspect (idim-1, theCell, theCellMin, theCellMax, theInspector);
old mode 100755 (executable)
new mode 100644 (file)
index 1923e14..f236031
@@ -170,20 +170,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
 
old mode 100755 (executable)
new mode 100644 (file)
index 9c66c05..aa61a2a
@@ -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
@@ -90,17 +90,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
@@ -119,8 +119,8 @@ void NCollection_UtfIterator<Type>::readUTF16()
     if (aChar2 >= UTF16_SURROGATE_LOW_START
      && aChar2 <= UTF16_SURROGATE_LOW_END)
     {
-      aChar = ((aChar - UTF16_SURROGATE_HIGH_START) << UTF16_SURROGATE_HIGH_SHIFT)
-            + (aChar2 - UTF16_SURROGATE_LOW_START)   + UTF16_SURROGATE_LOW_BASE;
+      aChar = ((aChar - (Standard_Utf32Char)UTF16_SURROGATE_HIGH_START) << (Standard_Utf32Char)UTF16_SURROGATE_HIGH_SHIFT)
+            + (aChar2 - (Standard_Utf32Char)UTF16_SURROGATE_LOW_START)   + (Standard_Utf32Char)UTF16_SURROGATE_LOW_BASE;
       ++myPosNext;
     }
   }
index 912581253380086abdc66788fa1c74dedf74c2bf..d8dd59e0befd4c928feeb1a762e5643d2277f2ad 100644 (file)
@@ -71,7 +71,7 @@ Standard_Integer OSD_Disk::DiskSize(){
 struct statvfs buffer;
 
   if ( statvfs(DiskName.ToCString(),&buffer) == 0 ){
-    int BSize512 = buffer.f_frsize / 512 ;
+    int BSize512 = (int)(buffer.f_frsize / 512) ;
     return buffer.f_blocks * BSize512 ;
   }
   else {
@@ -84,7 +84,7 @@ Standard_Integer OSD_Disk::DiskFree(){
 
 struct statvfs buffer;
   if ( statvfs (DiskName.ToCString(),&buffer) == 0 ){
-    int BSize512 = buffer.f_frsize / 512 ;
+    int BSize512 = (int)(buffer.f_frsize / 512) ;
     return buffer.f_bavail * BSize512 ;
   }
   else {
index 01e986ed53952bd289866b31397bf52fb2530a8f..5702e5af94accdc80c05906f6d0f2a72299eae11 100644 (file)
@@ -284,7 +284,6 @@ OSD_File OSD_File::BuildTemporary(){
 void  OSD_File::Read(TCollection_AsciiString& Buffer, 
                      const Standard_Integer Nbyte){
  Standard_PCharacter readbuf;
- int status;
 
   if ( OSD_File::KindOfFile ( ) == OSD_DIRECTORY ) { 
     Standard_ProgramError::Raise("OSD_File::Read : it is a directory");
@@ -304,7 +303,7 @@ void  OSD_File::Read(TCollection_AsciiString& Buffer,
  TCollection_AsciiString transfert(Nbyte,' ');
  readbuf = (Standard_PCharacter)transfert.ToCString();  
 
- status = read (myFileChannel, readbuf, Nbyte);
+ ssize_t status = read (myFileChannel, readbuf, Nbyte);
  //
  Buffer = transfert;  // Copy transfert to Buffer
 
@@ -391,8 +390,6 @@ void  OSD_File::Read(      Standard_Address&  Buffer,
                      const Standard_Integer   Nbyte,
                            Standard_Integer&  Readbyte)
 {
-  int status;
-  
   Readbyte = 0;
   if ( OSD_File::KindOfFile ( ) == OSD_DIRECTORY ) { 
     Standard_ProgramError::Raise("OSD_File::Read : it is a directory");
@@ -412,12 +409,12 @@ void  OSD_File::Read(      Standard_Address&  Buffer,
   if (Buffer == NULL)
     Standard_ProgramError::Raise("OSD_File::Read : Buffer is null");
   
-  status = read (myFileChannel, (char*) Buffer, Nbyte);
+  ssize_t status = read (myFileChannel, (char*) Buffer, Nbyte);
   
   if (status == -1) myError.SetValue (errno, Iam, "Read");
   else{
     if ( status < Nbyte ) myIO = EOF;
-    Readbyte = status;
+    Readbyte = (Standard_Integer)status;
   }
 }
 
@@ -427,8 +424,6 @@ void  OSD_File::Write(const TCollection_AsciiString &Buffer,
                       const Standard_Integer Nbyte){
 
  Standard_CString writebuf;
- int status;
-
  if ( OSD_File::KindOfFile ( ) == OSD_DIRECTORY ) { 
    Standard_ProgramError::Raise("OSD_File::Write : it is a directory");
  }
@@ -446,7 +441,7 @@ void  OSD_File::Write(const TCollection_AsciiString &Buffer,
 
  writebuf = Buffer.ToCString();
 
- status = write (myFileChannel, writebuf, Nbyte);
+ ssize_t status = write (myFileChannel, writebuf, Nbyte);
 
  if ( status == -1) myError.SetValue (errno, Iam, "Write");
  else
@@ -457,9 +452,6 @@ void  OSD_File::Write(const TCollection_AsciiString &Buffer,
 void  OSD_File::Write(const Standard_Address   Buffer, 
                       const Standard_Integer   Nbyte)
 {
-
-  int status;
-  
   if (myFileChannel == -1)
     Standard_ProgramError::Raise("OSD_File::Write : file is not open");
   
@@ -471,7 +463,7 @@ void  OSD_File::Write(const Standard_Address   Buffer,
   if (Nbyte <= 0)
     Standard_ProgramError::Raise("OSD_File::Write : Nbyte is null");
   
-  status = write (myFileChannel, (const char *)Buffer, Nbyte);
+  ssize_t status = write (myFileChannel, (const char *)Buffer, Nbyte);
   
   if ( status == -1) myError.SetValue (errno, Iam, "Write");
   else
index ebf969456d331385a698c9b8be30efa41c987b5e..b8492f05be97077e552847d9f71d12df9f2772db 100644 (file)
@@ -182,8 +182,8 @@ 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 )
+  ssize_t n=0;
+  while ( ( n = (int)read ( fds, buf, BUFSIZE )) >0 )
   {
     if ( write ( fdo, buf, n ) != n ) { // writing error
       if ( ! errno )
index 9a863ec4c7e5ad8f5769f7e73922b7cca37331ab..5748b4f1ecd8ef811c30e6688f887cad51f2bcb1 100644 (file)
 #include <Standard_Type.hxx>
 
 #ifdef _WIN32
-#include <windows.h>
+  #include <windows.h>
 #else
-typedef struct {
-  unsigned long Data1 ;
-  unsigned short Data2 ;
-  unsigned short Data3 ;
-  unsigned char Data4[8] ;
-} GUID ;
+  typedef struct
+  {
+    unsigned int   Data1;
+    unsigned short Data2;
+    unsigned short Data3;
+    unsigned char  Data4[8];
+  } GUID;
 #endif
 
-typedef GUID Standard_UUID ;
+typedef GUID Standard_UUID;
 
 #endif
-
-