Change struct empfile callback onresize() to return void
ef_open() handles onresize() failing incorrectly. Instead of fixing that, drop the failure mode. It's not really used: unit_onresize() fails only when used incorrectly. It isn't. If it ever is, ignoring the failure is safe.
This commit is contained in:
parent
45c7337e70
commit
a485084777
5 changed files with 15 additions and 17 deletions
|
@ -276,14 +276,14 @@ unit_cargo_init(void)
|
|||
* Return 0 on success, -1 on error.
|
||||
* This is the struct empfile onresize callback for units.
|
||||
*/
|
||||
int
|
||||
void
|
||||
unit_onresize(int type)
|
||||
{
|
||||
int n, i;
|
||||
struct clink *cl;
|
||||
|
||||
if (CANT_HAPPEN(type < EF_SHIP || type > EF_NUKE))
|
||||
return -1;
|
||||
return;
|
||||
|
||||
n = ef_nelem(type);
|
||||
cl = realloc(clink[type], n * sizeof(*clink[type]));
|
||||
|
@ -295,7 +295,6 @@ unit_onresize(int type)
|
|||
nclink[type] = n;
|
||||
if (ef_flags(type) & EFF_MEM)
|
||||
clink_check(type);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue