Skip to content

Commit

Permalink
Merge pull request #3510 from opensim-org/fix_initialization-order-error
Browse files Browse the repository at this point in the history
Fix init order error found by libASAN's check_initialization_order
  • Loading branch information
adamkewley authored Jul 19, 2023
2 parents e6a1b25 + f201e74 commit be3ef2e
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions OpenSim/Simulation/Wrap/WrapCylinderObst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,6 @@ static const char* wrapTypeName = "cylinderObst";
static const double TwoPi = 2.0*SimTK::Pi;
static const double max_wrap_pts_circle_ang = (5.0/360.0)*TwoPi;

// The following variables could be used for speedy wrap_pts definitions (NOT CURRENTLY USED)
static const int num_circle_wrap_pts = 36; // Number of circle points in 360 degrees
static double circle_wrap_pts_sin[num_circle_wrap_pts];
static double circle_wrap_pts_cos[num_circle_wrap_pts];
static bool circle_wrap_pts_inited = false;

//=============================================================================
// CONSTRUCTOR(S) AND DESTRUCTOR
//=============================================================================
Expand Down Expand Up @@ -68,12 +62,7 @@ WrapCylinderObst::~WrapCylinderObst()
//_____________________________________________________________________________
/** Initialize static data variables used for speedy definition of wrap_pts (for graphics mainly) */
void WrapCylinderObst::initCircleWrapPts()
{ int i; double q;
for(i=0; i<num_circle_wrap_pts; i++) {
q = TwoPi*(double)(i)/(double)(num_circle_wrap_pts);
circle_wrap_pts_sin[i] = sin(q);
circle_wrap_pts_cos[i] = cos(q);
} circle_wrap_pts_inited = true;
{
}

//_____________________________________________________________________________
Expand Down

0 comments on commit be3ef2e

Please sign in to comment.