(bzero, bcopy): Obsolete BSDisms; remove. Remove some calls without
effect. Replace calls by struct assignment where possible. Replace clear buffer, copy string to buffer by strncpy(). Use assignment to clear when that's clearer. Replace overlapping copy through bounce buffer by memmove(). Replace rest by standard memset() and memcpy(). Also use sizeof() instead of literal array sizes for robustness, and instead of symbolic array sizes for clarity.
This commit is contained in:
parent
2910da23ea
commit
4ae9c417b3
79 changed files with 172 additions and 256 deletions
|
@ -523,7 +523,7 @@ ship_bomb(struct emp_qelem *list, struct sctstr *target)
|
|||
int gun;
|
||||
int shell;
|
||||
|
||||
bzero((s_char *)&head, sizeof(struct shiplook));
|
||||
memset(&head, 0, sizeof(struct shiplook));
|
||||
head.uid = -1;
|
||||
onsea = (target->sct_type == SCT_WATER) ? 1 : 0;
|
||||
for (qp = list->q_forw; qp != list && !player->aborted;
|
||||
|
@ -536,7 +536,7 @@ ship_bomb(struct emp_qelem *list, struct sctstr *target)
|
|||
free(s2);
|
||||
}
|
||||
}
|
||||
bzero((s_char *)&head, sizeof(struct shiplook));
|
||||
memset(&head, 0, sizeof(struct shiplook));
|
||||
head.uid = -1;
|
||||
plp = (struct plist *)qp;
|
||||
if ((plp->pcp->pl_flags & P_C) && (!(plp->pcp->pl_flags & P_T)))
|
||||
|
@ -963,7 +963,7 @@ pinflak_planedamage(struct plnstr *pp, struct plchrstr *pcp, natid from,
|
|||
eff = pp->pln_effic;
|
||||
if (dam <= 0)
|
||||
return 0;
|
||||
bzero(dmess, 255);
|
||||
memset(dmess, 0, sizeof(dmess));
|
||||
eff -= dam;
|
||||
if (eff < 0)
|
||||
eff = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue