Clean up poorly chosen loop control variable names
Calling a counting loop's control variable q or z is tasteless bordering on actively misleading.
This commit is contained in:
parent
3ce3b2e387
commit
05b56fa942
2 changed files with 13 additions and 15 deletions
|
@ -61,7 +61,7 @@ buy(void)
|
|||
struct trdstr tmpt;
|
||||
struct ichrstr *ip;
|
||||
int qty;
|
||||
int o, n, q;
|
||||
int o, n;
|
||||
coord x, y;
|
||||
char *p;
|
||||
float bid;
|
||||
|
@ -115,13 +115,13 @@ buy(void)
|
|||
would make him go broke. Ken, I ought to skin you alive for making me code
|
||||
this part up.*/
|
||||
tally = 0.0;
|
||||
for (q = 0; gettrade(q, &tmpt); q++) {
|
||||
for (n = 0; gettrade(n, &tmpt); n++) {
|
||||
if (tmpt.trd_maxbidder == player->cnum &&
|
||||
tmpt.trd_unitid >= 0 && tmpt.trd_owner != player->cnum) {
|
||||
tally += tmpt.trd_price * tradetax;
|
||||
}
|
||||
}
|
||||
for (q = 0; getcomm(q, &comt); q++) {
|
||||
for (n = 0; getcomm(n, &comt); n++) {
|
||||
if (comt.com_maxbidder == player->cnum &&
|
||||
comt.com_owner != 0 && comt.com_owner != player->cnum) {
|
||||
tally += comt.com_price * comt.com_amount * buytax;
|
||||
|
|
|
@ -92,11 +92,10 @@ ground_interdict(coord x, coord y, natid victim, char *s)
|
|||
int cn;
|
||||
int dam = 0, newdam, rel;
|
||||
struct genlist mi[MAXNOC];
|
||||
int z;
|
||||
|
||||
memset(mi, 0, sizeof(mi));
|
||||
for (z = 1; z < MAXNOC; z++)
|
||||
emp_initque((struct emp_qelem *)&mi[z]);
|
||||
for (cn = 1; cn < MAXNOC; cn++)
|
||||
emp_initque((struct emp_qelem *)&mi[cn]);
|
||||
|
||||
build_mission_list(mi, x, y, MI_INTERDICT, victim);
|
||||
|
||||
|
@ -174,12 +173,11 @@ unit_interdict(coord x, coord y, natid victim, char *s, int hardtarget,
|
|||
int cn;
|
||||
int dam = 0, newdam;
|
||||
struct genlist mi[MAXNOC];
|
||||
int z;
|
||||
int osubs;
|
||||
|
||||
memset(mi, 0, sizeof(mi));
|
||||
for (z = 1; z < MAXNOC; z++)
|
||||
emp_initque((struct emp_qelem *)&mi[z]);
|
||||
for (cn = 1; cn < MAXNOC; cn++)
|
||||
emp_initque((struct emp_qelem *)&mi[cn]);
|
||||
|
||||
build_mission_list(mi, x, y, mission, victim);
|
||||
|
||||
|
@ -220,11 +218,11 @@ off_support(coord x, coord y, natid victim, natid actee)
|
|||
{
|
||||
int dam = 0;
|
||||
struct genlist mi[MAXNOC];
|
||||
int z;
|
||||
int cn;
|
||||
|
||||
memset(mi, 0, sizeof(mi));
|
||||
for (z = 1; z < MAXNOC; z++)
|
||||
emp_initque((struct emp_qelem *)&mi[z]);
|
||||
for (cn = 1; cn < MAXNOC; cn++)
|
||||
emp_initque((struct emp_qelem *)&mi[cn]);
|
||||
|
||||
build_mission_list(mi, x, y, MI_SUPPORT, victim);
|
||||
build_mission_list(mi, x, y, MI_OSUPPORT, victim);
|
||||
|
@ -241,11 +239,11 @@ def_support(coord x, coord y, natid victim, natid actee)
|
|||
{
|
||||
int dam = 0;
|
||||
struct genlist mi[MAXNOC];
|
||||
int z;
|
||||
int cn;
|
||||
|
||||
memset(mi, 0, sizeof(mi));
|
||||
for (z = 1; z < MAXNOC; z++)
|
||||
emp_initque((struct emp_qelem *)&mi[z]);
|
||||
for (cn = 1; cn < MAXNOC; cn++)
|
||||
emp_initque((struct emp_qelem *)&mi[cn]);
|
||||
|
||||
build_mission_list(mi, x, y, MI_SUPPORT, victim);
|
||||
build_mission_list(mi, x, y, MI_DSUPPORT, victim);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue