save and restore lint cleanup (trunk only)
Fix a couple of signed vs unsigned and unused paramater warnings
that pointed to actual bugs. uid values were being handled as int, even
though "modern" systems use type uid_t which could be bigger and is almost
certainly unsigned. There haven't been any reports of nethack falsely
claiming that the wrong user is trying to restore, so in practice this
hasn't mattered, but switch from int to unsigned long to make the chance
of problems be even smaller.
The code to save message history was ignoring the 'mode' argument so
would have attepted to write even when asked to free memory instead. It
isn't currently called by freedynamicdata() so the problem was theoretical
rather than real.
The 'UNUSED' macro is inadequate to handle parameters which are used
by some conditional configurations and unused by others, so there are
still several warnings about unused parameters from save.c and restore.c.
This commit is contained in:
+1
-1
@@ -891,7 +891,7 @@ long ttl;
|
||||
boolean
|
||||
expire_gas_cloud(p1, p2)
|
||||
genericptr_t p1;
|
||||
genericptr_t p2; /* unused here */
|
||||
genericptr_t p2 UNUSED;
|
||||
{
|
||||
NhRegion *reg;
|
||||
int damage;
|
||||
|
||||
Reference in New Issue
Block a user