Simplify eta_calc(): drop pointer parameter, return value instead
This commit is contained in:
parent
cdff437772
commit
ec1d91a34f
1 changed files with 7 additions and 6 deletions
|
@ -284,14 +284,14 @@ orde(void)
|
||||||
return RET_OK;
|
return RET_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static int
|
||||||
eta_calc(struct shpstr *sp, int len, int *nupdates)
|
eta_calc(struct shpstr *sp, int len)
|
||||||
{
|
{
|
||||||
double mobcost, mobil;
|
double mobcost, mobil;
|
||||||
int i;
|
int i, nupdates;
|
||||||
|
|
||||||
i = len;
|
i = len;
|
||||||
*nupdates = 1;
|
nupdates = 1;
|
||||||
|
|
||||||
mobcost = shp_mobcost(sp);
|
mobcost = shp_mobcost(sp);
|
||||||
mobil = sp->shp_mobil;
|
mobil = sp->shp_mobil;
|
||||||
|
@ -301,9 +301,10 @@ eta_calc(struct shpstr *sp, int len, int *nupdates)
|
||||||
i--;
|
i--;
|
||||||
} else {
|
} else {
|
||||||
mobil += (ship_mob_scale * (float)etu_per_update);
|
mobil += (ship_mob_scale * (float)etu_per_update);
|
||||||
(*nupdates)++;
|
nupdates++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return nupdates;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -440,7 +441,7 @@ sorde(void)
|
||||||
else {
|
else {
|
||||||
/* distance to destination */
|
/* distance to destination */
|
||||||
len = strlen(c);
|
len = strlen(c);
|
||||||
eta_calc(&ship, len, &updates);
|
updates = eta_calc(&ship, len);
|
||||||
pr(" %3d %4d", len, updates);
|
pr(" %3d %4d", len, updates);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue