Skip to content

Commit

Permalink
gcc-4.4.7 complained here that obs1 was possibly uninitialized. It's …
Browse files Browse the repository at this point in the history
…wrong, but I can see why it thought that... minor rearrangement makes the variable unambiguously initialized, causing the warning to go away
  • Loading branch information
Bill-Gray committed Apr 13, 2024
1 parent a59933b commit 7d1bfdc
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions orb_func.cpp
Expand Up @@ -1235,6 +1235,8 @@ int extended_orbit_fit( double *orbit, OBSERVE *obs, int n_obs,
for( i = n_selected = 0; i < n_obs; i++)
if( obs[i].flags & OBS_IS_SELECTED)
n_selected++;
obs1 = obs[0];
obs2 = obs[n_obs - 1];
if( n_selected == 2)
{
for( i = n_selected = 0; i < n_obs; i++)
Expand All @@ -1247,11 +1249,6 @@ int extended_orbit_fit( double *orbit, OBSERVE *obs, int n_obs,
n_selected++;
}
}
else
{
obs1 = obs[0];
obs2 = obs[n_obs - 1];
}
memcpy( torbit, orbit, n_orbit_params * sizeof( double));
rval = integrate_orbit( torbit, epoch, obs1.jd);
if( rval)
Expand Down

0 comments on commit 7d1bfdc

Please sign in to comment.