Skip to content

Commit

Permalink
Fix some errors produced by clang
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfy1339 authored and jacob1 committed Apr 4, 2018
1 parent f812d71 commit 31fcb1b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/simulation/Air.cpp
Expand Up @@ -240,7 +240,7 @@ void Air::update_air(void)
if ((dx*advDistanceMult>1.0f || dy*advDistanceMult>1.0f) && (tx>=2 && tx<XRES/CELL-2 && ty>=2 && ty<YRES/CELL-2))
{
// Trying to take velocity from far away, check whether there is an intervening wall. Step from current position to desired source location, looking for walls, with either the x or y step size being 1 cell
if (abs(dx)>abs(dy))
if (std::abs(dx)>std::abs(dy))
{
stepX = (dx<0.0f) ? 1 : -1;
stepY = -dy/fabsf(dx);
Expand Down
2 changes: 1 addition & 1 deletion src/simulation/elements/LIGH.cpp
Expand Up @@ -239,7 +239,7 @@ int Element_LIGH::LIGH_nearest_part(Simulation * sim, int ci, int max_d)
{
if (sim->parts[i].type && sim->parts[i].life && i!=ci && sim->parts[i].type!=PT_LIGH && sim->parts[i].type!=PT_THDR && sim->parts[i].type!=PT_NEUT && sim->parts[i].type!=PT_PHOT)
{
ndistance = abs(cx-sim->parts[i].x)+abs(cy-sim->parts[i].y);// Faster but less accurate Older: sqrt(pow(cx-parts[i].x, 2)+pow(cy-parts[i].y, 2));
ndistance = std::abs(cx-sim->parts[i].x)+std::abs(cy-sim->parts[i].y);// Faster but less accurate Older: sqrt(pow(cx-parts[i].x, 2)+pow(cy-parts[i].y, 2));
if (ndistance<distance)
{
distance = ndistance;
Expand Down

0 comments on commit 31fcb1b

Please sign in to comment.