allow readobjnam arg to be nonnull

Have it key on &do_random_str instead of NULL,
and modify makewish() in zap.c for the new protocol.
This commit is contained in:
nhmall
2023-12-16 19:30:34 -05:00
parent 3e83d23b19
commit 10f29a9760
5 changed files with 8 additions and 8 deletions

View File

@@ -1156,6 +1156,7 @@ struct const_globals {
extern const struct const_globals cg;
extern struct obj hands_obj;
extern char do_random_str;
#endif /* DECL_H */

View File

@@ -2125,10 +2125,7 @@ extern char *bare_artifactname(struct obj *) NONNULLARG1;
that leads to impossible(), preventing NONNULLARG1 */
extern char *makeplural(const char *) NO_NONNULLS;
extern char *makesingular(const char *) NO_NONNULLS;
/* readobjnam() allows a NULL to trigger code path for random; if it
and its caller were modifed to look for/provide a particular address
to use as a trigger instead, it could be declared NONNULLARG1 */
extern struct obj *readobjnam(char *, struct obj *) NO_NONNULLS;
extern struct obj *readobjnam(char *, struct obj *) NONNULLARG1;
extern int rnd_class(int, int);
/* discover_object() passes NULL arg2 to Japanese_item_name(),
* preventing NONNULLARG2 */