OSDN Git Service

[Refactor] #37353 コメント整理。 / Refactor comments.
[hengband/hengband.git] / src / z-form.c
index de5f5c8..ce2b3de 100644 (file)
@@ -11,7 +11,6 @@
 /* Purpose: Low level text formatting -BEN- */
 
 #include "z-form.h"
-
 #include "z-util.h"
 #include "z-virt.h"
 
  *   Append the character "c".
  *   Do not use the "+" or "0" flags.
  *
- * Format("%s", cptr s)
+ * Format("%s", concptr s)
  *   Append the string "s".
  *   Do not use the "+" or "0" flags.
  *   Note that a "NULL" value of "s" is converted to the empty string.
 /*
  * The "type" of the "user defined print routine" pointer
  */
-typedef uint (*vstrnfmt_aux_func)(char *buf, uint max, cptr fmt, vptr arg);
+typedef uint (*vstrnfmt_aux_func)(char *buf, uint max, concptr fmt, vptr arg);
 
 /*
  * The "default" user defined print routine.  Ignore the "fmt" string.
  */
-static uint vstrnfmt_aux_dflt(char *buf, uint max, cptr fmt, vptr arg)
+static uint vstrnfmt_aux_dflt(char *buf, uint max, concptr fmt, vptr arg)
 {
        uint len;
        char tmp[32];
@@ -232,9 +231,9 @@ static vstrnfmt_aux_func vstrnfmt_aux = vstrnfmt_aux_dflt;
  * the given buffer to a length of zero, and return a "length" of zero.
  * The contents of "buf", except for "buf[0]", may then be undefined.
  */
-uint vstrnfmt(char *buf, uint max, cptr fmt, va_list vp)
+uint vstrnfmt(char *buf, uint max, concptr fmt, va_list vp)
 {
-       cptr s;
+       concptr s;
 
        /* The argument is "long" */
        bool do_long;
@@ -282,8 +281,6 @@ uint vstrnfmt(char *buf, uint max, cptr fmt, va_list vp)
 
                        /* Save the character */
                        buf[n++] = *s++;
-
-                       /* Continue */
                        continue;
                }
 
@@ -301,8 +298,6 @@ uint vstrnfmt(char *buf, uint max, cptr fmt, va_list vp)
 
                        /* Skip the "%" */
                        s++;
-
-                       /* Continue */
                        continue;
                }
 
@@ -319,8 +314,6 @@ uint vstrnfmt(char *buf, uint max, cptr fmt, va_list vp)
 
                        /* Skip the "n" */
                        s++;
-
-                       /* Continue */
                        continue;
                }
 
@@ -332,8 +325,6 @@ uint vstrnfmt(char *buf, uint max, cptr fmt, va_list vp)
 
                        /* Skip the "r" */
                        s++;
-
-                       /* Continue */
                        continue;
                }
 
@@ -556,11 +547,11 @@ uint vstrnfmt(char *buf, uint max, cptr fmt, va_list vp)
                        /* String */
                        case 's':
                        {
-                               cptr arg;
+                               concptr arg;
                                char arg2[1024];
 
                                /* Access next argument */
-                               arg = va_arg(vp, cptr);
+                               arg = va_arg(vp, concptr);
 
                                /* Hack -- convert NULL to EMPTY */
                                if (!arg) arg = "";
@@ -647,7 +638,7 @@ uint vstrnfmt(char *buf, uint max, cptr fmt, va_list vp)
  * Do a vstrnfmt (see above) into a (growable) static buffer.
  * This buffer is usable for very short term formatting of results.
  */
-char *vformat(cptr fmt, va_list vp)
+char *vformat(concptr fmt, va_list vp)
 {
        static char *format_buf = NULL;
        static huge format_len = 0;
@@ -688,7 +679,7 @@ char *vformat(cptr fmt, va_list vp)
 /*
  * Do a vstrnfmt (see above) into a buffer of a given size.
  */
-uint strnfmt(char *buf, uint max, cptr fmt, ...)
+uint strnfmt(char *buf, uint max, concptr fmt, ...)
 {
        uint len;
 
@@ -712,7 +703,7 @@ uint strnfmt(char *buf, uint max, cptr fmt, ...)
  * Do a vstrnfmt (see above) into a buffer of unknown size.
  * Since the buffer size is unknown, the user better verify the args.
  */
-uint strfmt(char *buf, cptr fmt, ...)
+uint strfmt(char *buf, concptr fmt, ...)
 {
        uint len;
 
@@ -740,7 +731,7 @@ uint strfmt(char *buf, cptr fmt, ...)
  * Note that the buffer is (technically) writable, but only up to
  * the length of the string contained inside it.
  */
-char *format(cptr fmt, ...)
+char *format(concptr fmt, ...)
 {
        char *res;
        va_list vp;
@@ -764,7 +755,7 @@ char *format(cptr fmt, ...)
 /*
  * Vararg interface to plog()
  */
-void plog_fmt(cptr fmt, ...)
+void plog_fmt(concptr fmt, ...)
 {
        char *res;
        va_list vp;
@@ -787,7 +778,7 @@ void plog_fmt(cptr fmt, ...)
 /*
  * Vararg interface to quit()
  */
-void quit_fmt(cptr fmt, ...)
+void quit_fmt(concptr fmt, ...)
 {
        char *res;
        va_list vp;
@@ -810,7 +801,7 @@ void quit_fmt(cptr fmt, ...)
 /*
  * Vararg interface to core()
  */
-void core_fmt(cptr fmt, ...)
+void core_fmt(concptr fmt, ...)
 {
        char *res;
        va_list vp;