Skip to content

Commit

Permalink
use std and size_t for counts
Browse files Browse the repository at this point in the history
  • Loading branch information
naheedsa committed May 20, 2024
1 parent de1f8df commit d3e4c96
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions indi-nexdome/nex_dome.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -443,10 +443,10 @@ bool NexDome::ISNewNumber(const char *dev, const char *name, double values[], ch
{
std::vector<double> currentSettings(RotatorSettingsNP.count());
std::vector<bool> rc(RotatorSettingsNP.count(), true);
for (int i = 0; i < RotatorSettingsNP.count(); i++)
for (size_t i = 0; i < RotatorSettingsNP.count(); i++)
currentSettings[i] = RotatorSettingsNP[i].getValue();

for (int i = 0; i < RotatorSettingsNP.count(); i++)
for (size_t i = 0; i < RotatorSettingsNP.count(); i++)
{
if (std::fabs(values[i] - currentSettings[i]) > 0)
{
Expand Down Expand Up @@ -474,7 +474,7 @@ bool NexDome::ISNewNumber(const char *dev, const char *name, double values[], ch
}

bool result = true;
for (int i = 0; i < RotatorSettingsNP.count(); i++)
for (size_t i = 0; i < RotatorSettingsNP.count(); i++)
result &= rc[i];

if (result)
Expand Down Expand Up @@ -1032,7 +1032,7 @@ bool NexDome::processEvent(const std::string &event)
{
// 153 = full_steps_circumference / 360 = 55080 / 360
double newAngle = range360(std::stoi(value) / StepsPerDegree);
if (std::fabs(DomeAbsPosNP[0].getValue() - newAngle) > 0.001)
if (std::abs(DomeAbsPosNP[0].getValue() - newAngle) > 0.001)
{
DomeAbsPosNP[0].setValue(newAngle);
DomeAbsPosNP.apply();
Expand Down

0 comments on commit d3e4c96

Please sign in to comment.