]> granicus.if.org Git - nethack/commitdiff
raw_print() usage
authorPatR <rankin@nethack.org>
Thu, 3 Mar 2022 13:38:34 +0000 (05:38 -0800)
committerPatR <rankin@nethack.org>
Thu, 3 Mar 2022 13:38:34 +0000 (05:38 -0800)
Get rid of a couple of mis-formatted casts in lock_file().  raw_print()
is declared as void so casting its result to (void) was pointless.
Presumeably at one point it has used printf() or fprintf(stderr,...)
where the cast would have been useful to pacify 'lint'.

src/files.c

index 628f6f58fdf336850e0ee48eeef029ee1a5565b7..715d7fa40ee648f4794642f296b0f022c8ae9c33 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.7 files.c $NHDT-Date: 1646255374 2022/03/02 21:09:34 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.345 $ */
+/* NetHack 3.7 files.c $NHDT-Date: 1646314650 2022/03/03 13:37:30 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.346 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /*-Copyright (c) Derek S. Ray, 2015. */
 /* NetHack may be freely redistributed.  See license for details. */
@@ -1805,7 +1805,7 @@ lock_file(const char *filename, int whichprefix, int retryct)
                            filename, retryct);
             sleep(1);
         } else {
-            HUP(void) raw_print("I give up.  Sorry.");
+            HUP raw_print("I give up.  Sorry.");
             HUP raw_printf("Some other process has an unnatural grip on %s.",
                            filename);
             g.nesting--;
@@ -1817,15 +1817,14 @@ lock_file(const char *filename, int whichprefix, int retryct)
         switch (errnosv) { /* George Barbanis */
         case EEXIST:
             if (retryct--) {
-                HUP raw_printf(
-                    "Waiting for access to %s.  (%d retries left).", filename,
-                    retryct);
+                HUP raw_printf("Waiting for access to %s.  (%d retries left).",
+                               filename, retryct);
 #if defined(SYSV) || defined(ULTRIX) || defined(VMS)
                 (void)
 #endif
                     sleep(1);
             } else {
-                HUP(void) raw_print("I give up.  Sorry.");
+                HUP raw_print("I give up.  Sorry.");
                 HUP raw_printf("Perhaps there is an old %s around?",
                                lockname);
                 g.nesting--;