OSDN Git Service

[Refactor] #37353 コメント整理 / Refactor comments.
[hengband/hengband.git] / src / util.c
index 4276aef..e1972e3 100644 (file)
@@ -558,18 +558,6 @@ errr my_fputs(FILE *fff, cptr buf, huge n)
 
 
 /*
- * Code Warrior is a little weird about some functions
- */
-#ifdef BEN_HACK
-extern int open(const char *, int, ...);
-extern int close(int);
-extern int read(int, void *, unsigned int);
-extern int write(int, const void *, unsigned int);
-extern long lseek(int, long, int);
-#endif /* BEN_HACK */
-
-
-/*
  * The Macintosh is a little bit brain-dead sometimes
  */
 #ifdef MACINTOSH
@@ -678,16 +666,8 @@ errr fd_copy(cptr file, cptr what)
 
 /*
  * Hack -- attempt to open a file descriptor (create file)
- *
  * This function should fail if the file already exists
- *
  * Note that we assume that the file should be "binary"
- *
- * The horrible "BEN_HACK" code is for compiling under
- * the CodeWarrior compiler, in which case, for some reason, none
- * of the "O_*" flags are defined, and we must fake the definition
- * of "O_RDONLY", "O_WRONLY", and "O_RDWR" in "A-win-h", and then
- * we must simulate the effect of the proper "open()" call below.
  */
 int fd_make(cptr file, BIT_FLAGS mode)
 {
@@ -696,19 +676,6 @@ int fd_make(cptr file, BIT_FLAGS mode)
        /* Hack -- Try to parse the path */
        if (path_parse(buf, 1024, file)) return (-1);
 
-#ifdef BEN_HACK
-
-       /* Check for existance */
-       /* if (fd_close(fd_open(file, O_RDONLY | O_BINARY))) return (1); */
-
-       /* Mega-Hack -- Create the file */
-       (void)my_fclose(my_fopen(file, "wb"));
-
-       /* Re-open the file for writing */
-       return (open(buf, O_WRONLY | O_BINARY, mode));
-
-#else /* BEN_HACK */
-
 #if defined(MAC_MPW) || defined(MACH_O_CARBON)
        {
                int fdes;
@@ -719,12 +686,11 @@ int fd_make(cptr file, BIT_FLAGS mode)
                /* Return the descriptor */
                return (fdes);
        }
-# else
+#else
        /* Create the file, fail if exists, write-only, binary */
        return (open(buf, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, mode));
-# endif
+#endif
 
-#endif /* BEN_HACK */
 
 }
 
@@ -1900,7 +1866,6 @@ static char inkey_aux(void)
                        /* Excessive delay */
                        if (w >= 10) break;
 
-                       /* Delay */
                        Term_xtra(TERM_XTRA_DELAY, w);
                }
        }
@@ -2219,7 +2184,6 @@ char inkey(void)
                                        /* Excessive delay */
                                        if (w >= 100) break;
 
-                                       /* Delay */
                                        Term_xtra(TERM_XTRA_DELAY, w);
                                }
                        }
@@ -2237,8 +2201,6 @@ char inkey(void)
                {
                        /* Strip this key */
                        ch = 0;
-
-                       /* Continue */
                        continue;
                }
 
@@ -2832,7 +2794,6 @@ void msg_print(cptr msg)
        /* Hack -- flush when requested or needed */
        if (p && (!msg || ((p + n) > 72)))
        {
-               /* Flush */
                msg_flush(p);
 
                /* Forget it */
@@ -4539,8 +4500,6 @@ void request_command(int shopping)
                                {
                                        /* Clear count */
                                        command_arg = 0;
-
-                                       /* Continue */
                                        continue;
                                }
                        }
@@ -4577,8 +4536,6 @@ void request_command(int shopping)
 
                        /* Start using the buffer */
                        inkey_next = request_command_buffer;
-
-                       /* Continue */
                        continue;
                }