0026547: Configuration - fix compilation errors on VS2015
authorkgv <kgv@opencascade.com>
Thu, 13 Aug 2015 10:10:49 +0000 (13:10 +0300)
committerski <ski@opencascade.com>
Thu, 13 Aug 2015 10:11:29 +0000 (13:11 +0300)
Interface_STAT.cxx - rename local variable 'stat' to 'myStat' to avoid name collision.
OSD_FileNode.cxx - pass correct argument to va_start().
STEPConstruct_AP203Context::DefaultDateAndTime() - use _get_timezone() instead of global variable timezone on msvc.
Graphic3d_ArrayOfPrimitives::VertexColor() - fix reinterpret_cast() argument.

Small correction: OCC26481-linesarc.brep is equal to bug26296_linesarc.brep

src/Graphic3d/Graphic3d_ArrayOfPrimitives.lxx
src/Interface/Interface_STAT.cxx
src/OSD/OSD_FileNode.cxx
src/STEPConstruct/STEPConstruct_AP203Context.cxx

index bf7f77e3d6a43976c630c915cc67680ee7d7ca89..79e140c2ef4b582e08358b3290f1a7c51b563c0b 100644 (file)
@@ -288,7 +288,7 @@ inline void Graphic3d_ArrayOfPrimitives::VertexColor (const Standard_Integer the
   }
   Standard_Integer aColorInt = 0;
   VertexColor (theIndex, aColorInt);
-  const Graphic3d_Vec4ub& aColor = *reinterpret_cast<const Graphic3d_Vec4ub* >(aColorInt);
+  const Graphic3d_Vec4ub& aColor = *reinterpret_cast<const Graphic3d_Vec4ub* >(&aColorInt);
   theR = Standard_Real(aColor.r()) / 255.0;
   theG = Standard_Real(aColor.g()) / 255.0;
   theB = Standard_Real(aColor.b()) / 255.0;
index 107cdbaaf2b43e965cb1ce5f7fb7db883c5cc291..24ad2109bb79f77ee25541ae0865d0b471adf9e1 100644 (file)
@@ -150,15 +150,15 @@ static struct zestat {
   nbitc,  // nb items cycle en cours
   numst,  // n0 etape en cours / cycle
   numitem; // nb items deja passes / etape courante
-} stat;
+} TheStat;
 
 
     void  Interface_STAT::Start
   (const Standard_Integer items, const Standard_Integer cycles) const
 {
   statact = *this;
-  statact.Description (stat.nbph,stat.otal,stat.itle);
-  stat.oldph = stat.phw = 0.;  stat.numph = 0;
+  statact.Description (TheStat.nbph, TheStat.otal, TheStat.itle);
+  TheStat.oldph = TheStat.phw = 0.;  TheStat.numph = 0;
   NextPhase (items,cycles);
 }
 
@@ -173,68 +173,68 @@ static struct zestat {
   (const Standard_Integer items, const Standard_Integer cycles)
 {
 //  On cumule la phase precedente au total, on efface les donnees "locales"
-  stat.numcyc  = stat.numst = stat.olditp = 0;  stat.oldst = stat.stw = 0.;
-  if (stat.numph >= stat.nbph) {  End();  return;  }
+       TheStat.numcyc  = TheStat.numst = TheStat.olditp = 0;  TheStat.oldst = TheStat.stw = 0.;
+  if (TheStat.numph >= TheStat.nbph) {  End();  return;  }
 
-  stat.numph ++;  stat.oldph += stat.phw;   // cumule sur cette phase
-  stat.nbitp = items;  stat.nbcyc = cycles;
-  statact.Phase(stat.numph, stat.n0,stat.n1,stat.phw,stat.name);
-  stat.otph = (stat.n1 > 1 ? statact.Step (stat.n0) : 1.);
+  TheStat.numph ++;  TheStat.oldph += TheStat.phw;   // cumule sur cette phase
+  TheStat.nbitp = items;  TheStat.nbcyc = cycles;
+  statact.Phase(TheStat.numph, TheStat.n0, TheStat.n1, TheStat.phw, TheStat.name);
+  TheStat.otph = (TheStat.n1 > 1 ? statact.Step (TheStat.n0) : 1.);
 //   si un seul cycle, on le demarre; sinon, attendre NextCycle
-  stat.nbitc = 0;
+  TheStat.nbitc = 0;
   if (cycles == 1) NextCycle (items);
 }
 
     void  Interface_STAT::SetPhase
   (const Standard_Integer items, const Standard_Integer cycles)
-      {  stat.nbitp = items;  stat.nbcyc = cycles;  }
+      {  TheStat.nbitp = items;  TheStat.nbcyc = cycles;  }
 
     void  Interface_STAT::NextCycle (const Standard_Integer items)
 {
 //  cumul de ce cycle sur les cycles deja passes, raz etapes
-  stat.numcyc ++;  stat.olditp += stat.nbitc;
+  TheStat.numcyc ++;  TheStat.olditp += TheStat.nbitc;
 //  if (stat.olditem > stat.nbitp) return;
-  stat.numst = 1;
-  stat.oldst = 0.;
-  stat.stw   = (stat.n1 > 1 ? statact.Step(stat.n0 + 1) : stat.otph);
-  stat.nbitc = items;  stat.numitem = 0;
+  TheStat.numst = 1;
+  TheStat.oldst = 0.;
+  TheStat.stw   = (TheStat.n1 > 1 ? statact.Step(TheStat.n0 + 1) : TheStat.otph);
+  TheStat.nbitc = items;  TheStat.numitem = 0;
 }
 
     void  Interface_STAT::NextStep ()
 {
-  if (stat.numst >= stat.n1) return;
-  stat.numst ++;  stat.oldst += stat.stw;
-  stat.numitem = 0;
-  stat.stw = statact.Step (stat.n0 + stat.numst);
+  if (TheStat.numst >= TheStat.n1) return;
+  TheStat.numst ++;  TheStat.oldst += TheStat.stw;
+  TheStat.numitem = 0;
+  TheStat.stw = statact.Step (TheStat.n0 + TheStat.numst);
 }
 
     void  Interface_STAT::NextItem (const Standard_Integer nbitems)
-      {  stat.numitem += nbitems;  }
+      {  TheStat.numitem += nbitems;  }
 
     void  Interface_STAT::End ()
-{  stat.oldph = stat.otal;  stat.phw = stat.stw = 0.;  stat.itle = stat.name = voidname;  }
+{  TheStat.oldph = TheStat.otal;  TheStat.phw = TheStat.stw = 0.;  TheStat.itle = TheStat.name = voidname;  }
 
 // ###########  QUERY  ############
 
     Standard_CString  Interface_STAT::Where   (const Standard_Boolean phase)
-      {  return (phase ? stat.name : stat.itle);  }
+      {  return (phase ? TheStat.name : TheStat.itle);  }
 
     Standard_Integer  Interface_STAT::Percent (const Standard_Boolean phase)
 {
-  if (stat.numitem > stat.nbitc) stat.numitem = stat.nbitc;
+  if (TheStat.numitem > TheStat.nbitc) TheStat.numitem = TheStat.nbitc;
 //  on compte les items deja passes
   Standard_Real enphase =
-    stat.olditp  * stat.otph  +  // cycles complets passes
-    stat.nbitc   * stat.oldst +  // cycle courant, etapes completes passees
-    stat.numitem * stat.stw;     // etape courante
+    TheStat.olditp  * TheStat.otph  +  // cycles complets passes
+    TheStat.nbitc   * TheStat.oldst +  // cycle courant, etapes completes passees
+    TheStat.numitem * TheStat.stw;     // etape courante
 //  proportion pour cette phase
-  Standard_Real prophase = enphase / (stat.nbitp * stat.otph);
+  Standard_Real prophase = enphase / (TheStat.nbitp * TheStat.otph);
   Standard_Integer res = Standard_Integer (prophase*100.);
   if (phase) return res;
 
 //  voila pour cette phase
 //  comptage dans les phases
-  Standard_Real encours = (stat.oldph + stat.phw * prophase) / stat.otal;
+  Standard_Real encours = (TheStat.oldph + TheStat.phw * prophase) / TheStat.otal;
   res = Standard_Integer (encours * 100.);
   return res;
 }
index 37d6a9e8362dcdaae3b1668e65c39efdd93a99e8..e30439846c1d79a6e1a563dcf1d607e49cfb1a9d 100644 (file)
@@ -931,7 +931,7 @@ void _osd_wnt_set_error ( OSD_Error& err, OSD_WhoAmI who, ... ) {
  Standard_Character buffer[ 2048 ];
  va_list            arg_ptr;
 
- va_start ( arg_ptr, err );
+ va_start ( arg_ptr, who);
 
  errCode = GetLastError ();
 
index 3129fbc648255c0c95d4a0c9639b1c085cdb3099..ce615a09bd6d6e5eef43adac15020743765dea7d 100644 (file)
@@ -123,7 +123,12 @@ Handle(StepBasic_DateAndTime) STEPConstruct_AP203Context::DefaultDateAndTime ()
 
     Handle(StepBasic_CoordinatedUniversalTimeOffset) zone = 
       new StepBasic_CoordinatedUniversalTimeOffset;
+  #if defined(_MSC_VER) && _MSC_VER >= 1600
+    long shift = 0;
+    _get_timezone (&shift);
+  #else
     Standard_Integer shift = Standard_Integer(timezone);
+  #endif
     Standard_Integer shifth = abs ( shift ) / 3600;
     Standard_Integer shiftm = ( abs ( shift ) - shifth * 3600 ) / 60;
     StepBasic_AheadOrBehind sense = ( shift >0 ? StepBasic_aobBehind :