From c21af385e413bc181037c408859b4a027f79f326 Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Mon, 20 Jun 2005 17:02:46 +0000 Subject: [PATCH] compile fixes for sgi compilers --- Common/Timer.cpp | 3 ++- Geo/StepGeomDatabase.cpp | 7 +++---- Mesh/2D_Mesh_Aniso.cpp | 7 +++---- Mesh/3D_Extrude_Old.cpp | 6 +----- Mesh/Read_Mesh.cpp | 7 +------ Parallel/ParUtil.cpp | 3 ++- Plugin/OctreeInternals.cpp | 6 +++--- 7 files changed, 15 insertions(+), 24 deletions(-) diff --git a/Common/Timer.cpp b/Common/Timer.cpp index 65cca67bff..689a47b102 100644 --- a/Common/Timer.cpp +++ b/Common/Timer.cpp @@ -1,4 +1,4 @@ -// $Id: Timer.cpp,v 1.13 2005-01-01 19:35:27 geuzaine Exp $ +// $Id: Timer.cpp,v 1.14 2005-06-20 17:02:45 geuzaine Exp $ // // Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle // @@ -19,6 +19,7 @@ // // Please report all bugs and problems to <gmsh@geuz.org>. +#include <time.h> // FIXME: for sgi and maybe others #include <sys/time.h> #include <unistd.h> diff --git a/Geo/StepGeomDatabase.cpp b/Geo/StepGeomDatabase.cpp index c0abda9de3..38eaee6769 100644 --- a/Geo/StepGeomDatabase.cpp +++ b/Geo/StepGeomDatabase.cpp @@ -1,4 +1,4 @@ -// $Id: StepGeomDatabase.cpp,v 1.17 2005-01-01 19:35:29 geuzaine Exp $ +// $Id: StepGeomDatabase.cpp,v 1.18 2005-06-20 17:02:45 geuzaine Exp $ // // Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle // @@ -607,8 +607,7 @@ void Resolve_BREP(void) Step_Axis2_Placement3D_t *axs; Step_Closed_Shell_t cs; List_T *ListInt, *ListIntBis; - double ubeg, uend, n[3], t[3], p[3], XMIN = 0., XMAX = 0., YMIN = 0., YMAX = - 0., ZMIN = 0., ZMAX = 0., L; + double ubeg, uend, n[3], t[3], p[3], XMIN = 0., XMAX = 0., YMIN = 0., YMAX = 0., ZMIN = 0., ZMAX = 0.; int fob; ListInt = List_Create(2, 2, sizeof(int)); @@ -633,7 +632,7 @@ void Resolve_BREP(void) ZMIN = MIN(cp.Pos.Z, ZMIN); } } - CTX.lc = L = sqrt(SQR(XMIN - XMAX) + SQR(YMIN - YMAX) + SQR(ZMIN - ZMAX)); + CTX.lc = sqrt(SQR(XMIN - XMAX) + SQR(YMIN - YMAX) + SQR(ZMIN - ZMAX)); // resolving cartesian_points for(i = 0; i < List_Nbr(BREP->AllCartesian_Points); i++) { diff --git a/Mesh/2D_Mesh_Aniso.cpp b/Mesh/2D_Mesh_Aniso.cpp index 27b1beff2b..eb2b2ecbf9 100644 --- a/Mesh/2D_Mesh_Aniso.cpp +++ b/Mesh/2D_Mesh_Aniso.cpp @@ -1,4 +1,4 @@ -// $Id: 2D_Mesh_Aniso.cpp,v 1.44 2005-01-01 19:35:30 geuzaine Exp $ +// $Id: 2D_Mesh_Aniso.cpp,v 1.45 2005-06-20 17:02:45 geuzaine Exp $ // // Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle // @@ -537,7 +537,6 @@ int recur_bowyer_2D(Simplex * s) bool draw_simplex2d(Surface * sur, Simplex * s, bool nouv) { - double x[3], y[3], z[3]; Vertex v1, v2, v3; if(!CTX.mesh.interactive) @@ -550,6 +549,8 @@ bool draw_simplex2d(Surface * sur, Simplex * s, bool nouv) v2 = InterpolateSurface(sur->Support, s->V[1]->Pos.X, s->V[1]->Pos.Y, 0, 0); v3 = InterpolateSurface(sur->Support, s->V[2]->Pos.X, s->V[2]->Pos.Y, 0, 0); +#if defined(HAVE_FLTK) + double x[3], y[3], z[3]; x[0] = v1.Pos.X; x[1] = v2.Pos.X; x[2] = v3.Pos.X; @@ -559,8 +560,6 @@ bool draw_simplex2d(Surface * sur, Simplex * s, bool nouv) z[0] = v1.Pos.Z; z[1] = v2.Pos.Z; z[2] = v3.Pos.Z; - -#if defined(HAVE_FLTK) void draw_polygon_2d(double r, double g, double b, int n, double *x, double *y, double *z); if(nouv) diff --git a/Mesh/3D_Extrude_Old.cpp b/Mesh/3D_Extrude_Old.cpp index e0724aa609..dcba7a8893 100644 --- a/Mesh/3D_Extrude_Old.cpp +++ b/Mesh/3D_Extrude_Old.cpp @@ -1,4 +1,4 @@ -// $Id: 3D_Extrude_Old.cpp,v 1.35 2005-06-10 22:50:49 geuzaine Exp $ +// $Id: 3D_Extrude_Old.cpp,v 1.36 2005-06-20 17:02:45 geuzaine Exp $ // // Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle // @@ -56,7 +56,6 @@ extern Context_T CTX; extern Mesh *LOCAL, *THEM; static Tree_T *Tree_Ares, *Tree_Swaps; -static Surface *THES; static Volume *THEV; static int TEST_IS_ALL_OK, NbLayer; static int NbElmLayer[MAXLAYERS]; @@ -474,7 +473,6 @@ static void Extrude_Surface1(void *data, void *dum) if(!NbLayer) return; Surface *s = *(Surface **) data; - THES = s; Tree_Action(s->Vertices, Extrude_Vertex); @@ -487,7 +485,6 @@ static void Extrude_Surface2(void *data, void *dum) if(!NbLayer) return; Surface *s = *(Surface **) data; - THES = s; Tree_Action(s->Simplexes, Extrude_Simplex_Phase2); } @@ -498,7 +495,6 @@ static void Extrude_Surface3(void *data, void *dum) return; Surface *s = *(Surface **) data; - THES = s; Msg(INFO, "Extruding Surface %d", s->Num); for(int i = 0; i < NbLayer; i++) { diff --git a/Mesh/Read_Mesh.cpp b/Mesh/Read_Mesh.cpp index cdd76cd7ee..334b3d0f83 100644 --- a/Mesh/Read_Mesh.cpp +++ b/Mesh/Read_Mesh.cpp @@ -1,4 +1,4 @@ -// $Id: Read_Mesh.cpp,v 1.92 2005-06-10 22:50:49 geuzaine Exp $ +// $Id: Read_Mesh.cpp,v 1.93 2005-06-20 17:02:46 geuzaine Exp $ // // Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle // @@ -764,24 +764,19 @@ void Read_Mesh_SMS(Mesh * m, FILE * in) if(GEntityId) { fscanf(in, "%d %d", &GEntityType, &NbEdgesOnFace); - List_T *Lists[4] = { 0, 0, 0, 0 }; - if(NbEdgesOnFace == 3) { fscanf(in, "%d %d %d %d", &Edge1, &Edge2, &Edge3, &nbPts); List_Read(AllEdges, abs(Edge1) - 1, &e); - Lists[0] = e.Points; if(Edge1 > 0) v1 = e.V[0]; else v1 = e.V[1]; List_Read(AllEdges, abs(Edge2) - 1, &e); - Lists[1] = e.Points; if(Edge2 > 0) v2 = e.V[0]; else v2 = e.V[1]; List_Read(AllEdges, abs(Edge3) - 1, &e); - Lists[2] = e.Points; if(Edge3 > 0) v3 = e.V[0]; else diff --git a/Parallel/ParUtil.cpp b/Parallel/ParUtil.cpp index 0d85a2a5ee..fe037af62a 100644 --- a/Parallel/ParUtil.cpp +++ b/Parallel/ParUtil.cpp @@ -1,4 +1,4 @@ -// $Id: ParUtil.cpp,v 1.11 2005-01-01 19:35:32 geuzaine Exp $ +// $Id: ParUtil.cpp,v 1.12 2005-06-20 17:02:46 geuzaine Exp $ // // Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle // @@ -26,6 +26,7 @@ #ifdef HAVE_PARALLEL #include "mpi.h" #else +#include <time.h> // FIXME: for sgi and maybe others #include <sys/time.h> #endif diff --git a/Plugin/OctreeInternals.cpp b/Plugin/OctreeInternals.cpp index 4a8a1de26d..3518d48b3a 100644 --- a/Plugin/OctreeInternals.cpp +++ b/Plugin/OctreeInternals.cpp @@ -1,4 +1,4 @@ -// $Id: OctreeInternals.cpp,v 1.4 2005-01-01 19:35:39 geuzaine Exp $ +// $Id: OctreeInternals.cpp,v 1.5 2005-06-20 17:02:46 geuzaine Exp $ // // Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle // @@ -52,7 +52,7 @@ int initializeOctantBuckets(double *_orig, double *_size, int _maxElem, for (i = 0; i < 3; i++) error[i]= _size[i]*0.01; - initial_buckets_num = (int)pow(8, p); // it is actually 8 + initial_buckets_num = (int)pow(8., p); // it is actually 8 (*globalPara) = new globalInfo; (*globalPara)->maxPrecision = 1; @@ -95,7 +95,7 @@ int initializeOctantBuckets(double *_orig, double *_size, int _maxElem, buckets[i].precision = 1; } - tmp1 = (int)(pow(2, p)); + tmp1 = (int)(pow(2., p)); for (i = 0; i < 3; i++) { tmp[i] = (double)(_size[i]+2*error[i])/tmp1; } -- GitLab