emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 76fea1e: Fix misuses of NULL when talking about the


From: Stefan Monnier
Subject: [Emacs-diffs] master 76fea1e: Fix misuses of NULL when talking about the NUL character
Date: Thu, 21 Mar 2019 23:55:48 -0400 (EDT)

branch: master
commit 76fea1eba1332440eab2e3daecce053daccd3782
Author: Stefan Monnier <address@hidden>
Commit: Stefan Monnier <address@hidden>

    Fix misuses of NULL when talking about the NUL character
    
    * lisp/subr.el (inhibit-null-byte-detection): Make it an obsolete alias.
    
    * src/coding.c (setup_coding_system): Use new name.
    (detect_coding): Rename null_byte_found => nul_byte_found.
    (detect_coding_system): Use new name.
    Rename null_byte_found => nul_byte_found.
    (Fdefine_coding_system_internal): Use new name.
    (syms_of_coding): Rename inhibit-null-byte-detection to
    inhibit-nul-byte-detection.
    * src/w16select.c (get_clipboard_data): null_char => nul_char.
    * src/json.c (check_string_without_embedded_nuls): Rename from
    check_string_without_embedded_nulls.
    (Fjson_parse_string): Adjust accordingly.
    * src/coding.h (enum define_coding_undecided_arg_index)
    (enum coding_attr_index): ...null_byte... => ...nul_byte....
    * lisp/info.el (info-insert-file-contents, Info-insert-dir):
    * lisp/international/mule.el (define-coding-system):
    * lisp/vc/vc-git.el (vc-git--call):
    * doc/lispref/nonascii.texi (Lisp and Coding Systems): Use the new name.
---
 doc/lispref/files.texi     |  2 +-
 doc/lispref/nonascii.texi  |  2 +-
 doc/lispref/processes.texi |  2 +-
 etc/NEWS                   |  3 +++
 lisp/info.el               |  6 ++---
 lisp/international/mule.el | 10 ++++----
 lisp/subr.el               |  2 ++
 lisp/vc/vc-git.el          |  4 ++--
 src/alloc.c                |  2 +-
 src/bidi.c                 |  4 ++--
 src/bignum.c               |  4 ++--
 src/callint.c              |  2 +-
 src/coding.c               | 60 +++++++++++++++++++++++-----------------------
 src/coding.h               |  6 ++---
 src/dired.c                |  2 +-
 src/dispextern.h           |  2 +-
 src/doc.c                  |  2 +-
 src/doprnt.c               |  4 ++--
 src/editfns.c              |  2 +-
 src/emacs-module.c         |  2 +-
 src/emacs.c                |  2 +-
 src/fileio.c               |  2 +-
 src/filelock.c             |  2 +-
 src/fns.c                  |  2 +-
 src/font.c                 |  6 ++---
 src/insdel.c               |  2 +-
 src/json.c                 | 18 +++++++-------
 src/keyboard.c             |  5 ++--
 src/lisp.h                 | 14 +++++------
 src/lread.c                |  2 +-
 src/module-env-25.h        |  4 ++--
 src/syntax.c               |  5 +---
 src/sysdep.c               |  6 ++---
 src/termcap.c              |  8 +++----
 src/timefns.c              |  6 ++---
 src/unexmacosx.c           |  2 +-
 src/w16select.c            | 16 ++++++-------
 src/w32.c                  | 12 +++++-----
 src/w32fns.c               |  4 ++--
 src/w32proc.c              | 10 ++++----
 src/w32select.c            |  2 +-
 src/xdisp.c                | 10 ++++----
 src/xfont.c                |  2 +-
 43 files changed, 134 insertions(+), 131 deletions(-)

diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi
index 7bc1cc4..af16b1c 100644
--- a/doc/lispref/files.texi
+++ b/doc/lispref/files.texi
@@ -550,7 +550,7 @@ the functions in the list 
@code{after-insert-file-functions}.
 (@pxref{Coding Systems}) used for decoding the file's contents,
 including end-of-line conversion.  However, if the file contains null
 bytes, it is by default visited without any code conversions.
address@hidden and Coding Systems, inhibit-null-byte-detection}.
address@hidden and Coding Systems, inhibit-nul-byte-detection}.
 
 If @var{visit} is address@hidden, this function additionally marks the
 buffer as unmodified and sets up various fields in the buffer so that it
diff --git a/doc/lispref/nonascii.texi b/doc/lispref/nonascii.texi
index 11a77bd..9c64c3c 100644
--- a/doc/lispref/nonascii.texi
+++ b/doc/lispref/nonascii.texi
@@ -1378,7 +1378,7 @@ operates on the contents of @var{string} instead of bytes 
in the buffer.
 @end defun
 
 @cindex null bytes, and decoding text
address@hidden inhibit-null-byte-detection
address@hidden inhibit-nul-byte-detection
 If this variable has a address@hidden value, null bytes are ignored
 when detecting the encoding of a region or a string.  This allows the
 encoding of text that contains null bytes to be correctly detected,
diff --git a/doc/lispref/processes.texi b/doc/lispref/processes.texi
index 7b02759..6be311b 100644
--- a/doc/lispref/processes.texi
+++ b/doc/lispref/processes.texi
@@ -1789,7 +1789,7 @@ system comes from @code{coding-system-for-read}, if that 
is
 address@hidden; or else from the defaulting mechanism (@pxref{Default
 Coding Systems}).  If the text output by a process contains null
 bytes, Emacs by default uses @code{no-conversion} for it; see
address@hidden and Coding Systems, inhibit-null-byte-detection}, for how to
address@hidden and Coding Systems, inhibit-nul-byte-detection}, for how to
 control this behavior.
 
   @strong{Warning:} Coding systems such as @code{undecided}, which
diff --git a/etc/NEWS b/etc/NEWS
index 372d3cd..3380be7 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1355,6 +1355,9 @@ Now, such rx expressions generate an error.
 * Lisp Changes in Emacs 27.1
 
 +++
+** inhibit-null-byte-detection is renamed to inhibit-nul-byte-detection
+
++++
 ** 'self-insert-command' takes the char to insert as (optional) argument.
 
 ** 'lookup-key' can take a list of keymaps as argument.
diff --git a/lisp/info.el b/lisp/info.el
index c650d88..f2a064a 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -642,14 +642,14 @@ Do the right thing if the file has been compressed or 
zipped."
          (insert-file-contents-literally fullname visit)
          (let ((inhibit-read-only t)
                (coding-system-for-write 'no-conversion)
-               (inhibit-null-byte-detection t) ; Index nodes include null bytes
+               (inhibit-nul-byte-detection t) ; Index nodes include null bytes
                (default-directory (or (file-name-directory fullname)
                                       default-directory)))
            (or (consp decoder)
                (setq decoder (list decoder)))
            (apply #'call-process-region (point-min) (point-max)
                   (car decoder) t t nil (cdr decoder))))
-      (let ((inhibit-null-byte-detection t)) ; Index nodes include null bytes
+      (let ((inhibit-nul-byte-detection t)) ; Index nodes include null bytes
        (insert-file-contents fullname visit)))
 
     ;; Clear the caches of modified Info files.
@@ -1377,7 +1377,7 @@ is non-nil)."
                          ;; Index nodes include null bytes.  DIR
                          ;; files should not have indices, but who
                          ;; knows...
-                         (let ((inhibit-null-byte-detection t))
+                         (let ((inhibit-nul-byte-detection t))
                            (insert-file-contents file)
                            (setq Info-dir-file-name file)
                            (push (current-buffer) buffers)
diff --git a/lisp/international/mule.el b/lisp/international/mule.el
index 281e529..ba30fee 100644
--- a/lisp/international/mule.el
+++ b/lisp/international/mule.el
@@ -819,10 +819,10 @@ VALUE is a CCL program name defined by 
`define-ccl-program'.  The
 CCL program reads a character sequence and writes a byte sequence
 as an encoding result.
 
-`:inhibit-null-byte-detection'
+`:inhibit-nul-byte-detection'
 
 VALUE non-nil means Emacs ignore null bytes on code detection.
-See the variable `inhibit-null-byte-detection'.  This attribute
+See the variable `inhibit-nul-byte-detection'.  This attribute
 is meaningful only when `:coding-type' is `undecided'.
 
 `:inhibit-iso-escape-detection'
@@ -867,7 +867,7 @@ non-ASCII files.  This attribute is meaningful only when
                                      :ccl-encoder
                                      :valids))
                                   ((eq coding-type 'undecided)
-                                   '(:inhibit-null-byte-detection
+                                   '(:inhibit-nul-byte-detection
                                      :inhibit-iso-escape-detection
                                      :prefer-utf-8))))))
 
@@ -920,8 +920,8 @@ non-ASCII files.  This attribute is meaningful only when
          (cons :name (cons name (cons :docstring (cons (purecopy docstring)
                                                        props)))))
     (setcdr (assq :plist common-attrs) props)
-    (apply 'define-coding-system-internal
-          name (mapcar 'cdr (append common-attrs spec-attrs)))))
+    (apply #'define-coding-system-internal
+          name (mapcar #'cdr (append common-attrs spec-attrs)))))
 
 (defun coding-system-doc-string (coding-system)
   "Return the documentation string for CODING-SYSTEM."
diff --git a/lisp/subr.el b/lisp/subr.el
index 6c0ad00..f48ca54 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -1511,6 +1511,8 @@ be a list of the form returned by `event-start' and 
`event-end'."
 (make-obsolete-variable 'x-gtk-use-window-move nil "26.1")
 
 (defvaralias 'messages-buffer-max-lines 'message-log-max)
+(define-obsolete-variable-alias 'inhibit-null-byte-detection
+  'inhibit-nul-byte-detection "27.1")
 
 ;;;; Alternate names for functions - these are not being phased out.
 
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 6b8ed7e..0f8c9c8 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -1629,9 +1629,9 @@ The difference to vc-do-command is that this function 
always invokes
 (defun vc-git--call (buffer command &rest args)
   ;; We don't need to care the arguments.  If there is a file name, it
   ;; is always a relative one.  This works also for remote
-  ;; directories.  We enable `inhibit-null-byte-detection', otherwise
+  ;; directories.  We enable `inhibit-nul-byte-detection', otherwise
   ;; Tramp's eol conversion might be confused.
-  (let ((inhibit-null-byte-detection t)
+  (let ((inhibit-nul-byte-detection t)
        (coding-system-for-read
          (or coding-system-for-read vc-git-log-output-coding-system))
        (coding-system-for-write
diff --git a/src/alloc.c b/src/alloc.c
index 8fb514f..f929a37 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -1814,7 +1814,7 @@ static char const 
string_overrun_cookie[GC_STRING_OVERRUN_COOKIE_SIZE] =
 #define GC_STRING_EXTRA (GC_STRING_OVERRUN_COOKIE_SIZE)
 
 /* Exact bound on the number of bytes in a string, not counting the
-   terminating null.  A string cannot contain more bytes than
+   terminating NUL.  A string cannot contain more bytes than
    STRING_BYTES_BOUND, nor can it be so long that the size_t
    arithmetic in allocate_string_data would overflow while it is
    calculating a value to be passed to malloc.  */
diff --git a/src/bidi.c b/src/bidi.c
index a62b888..c530d49 100644
--- a/src/bidi.c
+++ b/src/bidi.c
@@ -2335,7 +2335,7 @@ bidi_resolve_weak (struct bidi_it *bidi_it)
                      and make it L right away, to avoid the
                      potentially costly loop below.  This is
                      important when the buffer has a long series of
-                     control characters, like binary nulls, and no
+                     control characters, like binary NULs, and no
                      R2L characters at all.  */
                   && new_level == 0
                   && !bidi_explicit_dir_char (bidi_it->ch)
@@ -2993,7 +2993,7 @@ bidi_resolve_neutral (struct bidi_it *bidi_it)
        }
       /* The next two "else if" clauses are shortcuts for the
         important special case when we have a long sequence of
-        neutral or WEAK_BN characters, such as whitespace or nulls or
+        neutral or WEAK_BN characters, such as whitespace or NULs or
         other control characters, on the base embedding level of the
         paragraph, and that sequence goes all the way to the end of
         the paragraph and follows a character whose resolved
diff --git a/src/bignum.c b/src/bignum.c
index 14c4cdb..4118601 100644
--- a/src/bignum.c
+++ b/src/bignum.c
@@ -271,7 +271,7 @@ bignum_to_uintmax (Lisp_Object x)
 
 /* Yield an upper bound on the buffer size needed to contain a C
    string representing the NUM in base BASE.  This includes any
-   preceding '-' and the terminating null.  */
+   preceding '-' and the terminating NUL.  */
 static ptrdiff_t
 mpz_bufsize (mpz_t const num, int base)
 {
@@ -336,7 +336,7 @@ bignum_to_string (Lisp_Object num, int base)
 
 /* Create a bignum by scanning NUM, with digits in BASE.
    NUM must consist of an optional '-', a nonempty sequence
-   of base-BASE digits, and a terminating null byte, and
+   of base-BASE digits, and a terminating NUL byte, and
    the represented number must not be in fixnum range.  */
 
 Lisp_Object
diff --git a/src/callint.c b/src/callint.c
index 9993e73..88a3c34 100644
--- a/src/callint.c
+++ b/src/callint.c
@@ -714,7 +714,7 @@ invoke it.  If KEYS is omitted or nil, the return value of
        default:
          {
            /* How many bytes are left unprocessed in the specs string?
-              (Note that this excludes the trailing null byte.)  */
+              (Note that this excludes the trailing NUL byte.)  */
            ptrdiff_t bytes_left = string_len - (tem - string);
            unsigned letter;
 
diff --git a/src/coding.c b/src/coding.c
index a216460..905c7ce 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -5719,7 +5719,7 @@ setup_coding_system (Lisp_Object coding_system, struct 
coding_system *coding)
       coding->common_flags |= CODING_REQUIRE_DETECTION_MASK;
       coding->spec.undecided.inhibit_nbd
        = (encode_inhibit_flag
-          (AREF (attrs, coding_attr_undecided_inhibit_null_byte_detection)));
+          (AREF (attrs, coding_attr_undecided_inhibit_nul_byte_detection)));
       coding->spec.undecided.inhibit_ied
        = (encode_inhibit_flag
           (AREF (attrs, coding_attr_undecided_inhibit_iso_escape_detection)));
@@ -6514,9 +6514,9 @@ detect_coding (struct coding_system *coding)
     {
       int c, i;
       struct coding_detection_info detect_info;
-      bool null_byte_found = 0, eight_bit_found = 0;
+      bool nul_byte_found = 0, eight_bit_found = 0;
       bool inhibit_nbd = inhibit_flag (coding->spec.undecided.inhibit_nbd,
-                                      inhibit_null_byte_detection);
+                                      inhibit_nul_byte_detection);
       bool inhibit_ied = inhibit_flag (coding->spec.undecided.inhibit_ied,
                                       inhibit_iso_escape_detection);
       bool prefer_utf_8 = coding->spec.undecided.prefer_utf_8;
@@ -6529,7 +6529,7 @@ detect_coding (struct coding_system *coding)
          if (c & 0x80)
            {
              eight_bit_found = 1;
-             if (null_byte_found)
+             if (nul_byte_found)
                break;
            }
          else if (c < 0x20)
@@ -6544,7 +6544,7 @@ detect_coding (struct coding_system *coding)
                      if (! (detect_info.rejected & CATEGORY_MASK_ISO_7_ELSE))
                        {
                          /* We didn't find an 8-bit code.  We may
-                            have found a null-byte, but it's very
+                            have found a NUL-byte, but it's very
                             rare that a binary file conforms to
                             ISO-2022.  */
                          src = src_end;
@@ -6556,7 +6556,7 @@ detect_coding (struct coding_system *coding)
                }
              else if (! c && !inhibit_nbd)
                {
-                 null_byte_found = 1;
+                 nul_byte_found = 1;
                  if (eight_bit_found)
                    break;
                }
@@ -6588,7 +6588,7 @@ detect_coding (struct coding_system *coding)
            coding->head_ascii++;
        }
 
-      if (null_byte_found || eight_bit_found
+      if (nul_byte_found || eight_bit_found
          || coding->head_ascii < coding->src_bytes
          || detect_info.found)
        {
@@ -6606,7 +6606,7 @@ detect_coding (struct coding_system *coding)
              }
          else
            {
-             if (null_byte_found)
+             if (nul_byte_found)
                {
                  detect_info.checked |= ~CATEGORY_MASK_UTF_16;
                  detect_info.rejected |= ~CATEGORY_MASK_UTF_16;
@@ -6679,7 +6679,7 @@ detect_coding (struct coding_system *coding)
              else
                found = CODING_ID_NAME (this->id);
            }
-         else if (null_byte_found)
+         else if (nul_byte_found)
            found = Qno_conversion;
          else if ((detect_info.rejected & CATEGORY_MASK_ANY)
                   == CATEGORY_MASK_ANY)
@@ -8448,7 +8448,7 @@ from_unicode (Lisp_Object str)
 Lisp_Object
 from_unicode_buffer (const wchar_t *wstr)
 {
-  /* We get one of the two final null bytes for free.  */
+  /* We get one of the two final NUL bytes for free.  */
   ptrdiff_t len = 1 + sizeof (wchar_t) * wcslen (wstr);
   AUTO_STRING_WITH_LEN (str, (char *) wstr, len);
   return from_unicode (str);
@@ -8461,7 +8461,7 @@ to_unicode (Lisp_Object str, Lisp_Object *buf)
   /* We need to make another copy (in addition to the one made by
      code_convert_string_norecord) to ensure that the final string is
      _doubly_ zero terminated --- that is, that the string is
-     terminated by two zero bytes and one utf-16le null character.
+     terminated by two zero bytes and one utf-16le NUL character.
      Because strings are already terminated with a single zero byte,
      we just add one additional zero. */
   str = make_uninit_string (SBYTES (*buf) + 1);
@@ -8577,7 +8577,7 @@ detect_coding_system (const unsigned char *src,
   ptrdiff_t id;
   struct coding_detection_info detect_info;
   enum coding_category base_category;
-  bool null_byte_found = 0, eight_bit_found = 0;
+  bool nul_byte_found = 0, eight_bit_found = 0;
 
   if (NILP (coding_system))
     coding_system = Qundecided;
@@ -8604,7 +8604,7 @@ detect_coding_system (const unsigned char *src,
       struct coding_system *this UNINIT;
       int c, i;
       bool inhibit_nbd = inhibit_flag (coding.spec.undecided.inhibit_nbd,
-                                      inhibit_null_byte_detection);
+                                      inhibit_nul_byte_detection);
       bool inhibit_ied = inhibit_flag (coding.spec.undecided.inhibit_ied,
                                       inhibit_iso_escape_detection);
       bool prefer_utf_8 = coding.spec.undecided.prefer_utf_8;
@@ -8616,7 +8616,7 @@ detect_coding_system (const unsigned char *src,
          if (c & 0x80)
            {
              eight_bit_found = 1;
-             if (null_byte_found)
+             if (nul_byte_found)
                break;
            }
          else if (c < 0x20)
@@ -8631,7 +8631,7 @@ detect_coding_system (const unsigned char *src,
                      if (! (detect_info.rejected & CATEGORY_MASK_ISO_7_ELSE))
                        {
                          /* We didn't find an 8-bit code.  We may
-                            have found a null-byte, but it's very
+                            have found a NUL-byte, but it's very
                             rare that a binary file confirm to
                             ISO-2022.  */
                          src = src_end;
@@ -8643,7 +8643,7 @@ detect_coding_system (const unsigned char *src,
                }
              else if (! c && !inhibit_nbd)
                {
-                 null_byte_found = 1;
+                 nul_byte_found = 1;
                  if (eight_bit_found)
                    break;
                }
@@ -8654,7 +8654,7 @@ detect_coding_system (const unsigned char *src,
            coding.head_ascii++;
        }
 
-      if (null_byte_found || eight_bit_found
+      if (nul_byte_found || eight_bit_found
          || coding.head_ascii < coding.src_bytes
          || detect_info.found)
        {
@@ -8669,7 +8669,7 @@ detect_coding_system (const unsigned char *src,
              }
          else
            {
-             if (null_byte_found)
+             if (nul_byte_found)
                {
                  detect_info.checked |= ~CATEGORY_MASK_UTF_16;
                  detect_info.rejected |= ~CATEGORY_MASK_UTF_16;
@@ -8716,7 +8716,7 @@ detect_coding_system (const unsigned char *src,
        }
 
       if ((detect_info.rejected & CATEGORY_MASK_ANY) == CATEGORY_MASK_ANY
-         || null_byte_found)
+         || nul_byte_found)
        {
          detect_info.found = CATEGORY_MASK_RAW_TEXT;
          id = CODING_SYSTEM_ID (Qno_conversion);
@@ -8818,7 +8818,7 @@ detect_coding_system (const unsigned char *src,
       {
        if (detect_info.found & ~CATEGORY_MASK_UTF_16)
          {
-           if (null_byte_found)
+           if (nul_byte_found)
              normal_eol = EOL_SEEN_LF;
            else
              normal_eol = detect_eol (coding.source, src_bytes,
@@ -10478,8 +10478,8 @@ usage: (define-coding-system-internal ...)  */)
     {
       if (nargs < coding_arg_undecided_max)
        goto short_args;
-      ASET (attrs, coding_attr_undecided_inhibit_null_byte_detection,
-           args[coding_arg_undecided_inhibit_null_byte_detection]);
+      ASET (attrs, coding_attr_undecided_inhibit_nul_byte_detection,
+           args[coding_arg_undecided_inhibit_nul_byte_detection]);
       ASET (attrs, coding_attr_undecided_inhibit_iso_escape_detection,
            args[coding_arg_undecided_inhibit_iso_escape_detection]);
       ASET (attrs, coding_attr_undecided_prefer_utf_8,
@@ -11234,18 +11234,18 @@ to explicitly specify some coding system that doesn't 
use ISO-2022
 escape sequence (e.g., `latin-1') on reading by 
\\[universal-coding-system-argument].  */);
   inhibit_iso_escape_detection = 0;
 
-  DEFVAR_BOOL ("inhibit-null-byte-detection",
-              inhibit_null_byte_detection,
-              doc: /* If non-nil, Emacs ignores null bytes on code detection.
+  DEFVAR_BOOL ("inhibit-nul-byte-detection",
+              inhibit_nul_byte_detection,
+              doc: /* If non-nil, Emacs ignores NUL bytes on code detection.
 By default, Emacs treats it as binary data, and does not attempt to
 decode it.  The effect is as if you specified `no-conversion' for
 reading that text.
 
-Set this to non-nil when a regular text happens to include null bytes.
-Examples are Index nodes of Info files and null-byte delimited output
-from GNU Find and GNU Grep.  Emacs will then ignore the null bytes and
+Set this to non-nil when a regular text happens to include NUL bytes.
+Examples are Index nodes of Info files and NUL-byte delimited output
+from GNU Find and GNU Grep.  Emacs will then ignore the NUL bytes and
 decode text as usual.  */);
-  inhibit_null_byte_detection = 0;
+  inhibit_nul_byte_detection = 0;
 
   DEFVAR_BOOL ("disable-ascii-optimization", disable_ascii_optimization,
               doc: /* If non-nil, Emacs does not optimize code decoder for 
ASCII files.
@@ -11304,7 +11304,7 @@ internal character representation.  */);
                                   "automatic conversion on decoding.");
   plist[15] = args[coding_arg_eol_type] = Qnil;
   args[coding_arg_plist] = CALLMANY (Flist, plist);
-  args[coding_arg_undecided_inhibit_null_byte_detection] = make_fixnum (0);
+  args[coding_arg_undecided_inhibit_nul_byte_detection] = make_fixnum (0);
   args[coding_arg_undecided_inhibit_iso_escape_detection] = make_fixnum (0);
   Fdefine_coding_system_internal (coding_arg_undecided_max, args);
 
diff --git a/src/coding.h b/src/coding.h
index 58e12d6..e38c0ee 100644
--- a/src/coding.h
+++ b/src/coding.h
@@ -82,7 +82,7 @@ enum define_coding_ccl_arg_index
 
 enum define_coding_undecided_arg_index
   {
-    coding_arg_undecided_inhibit_null_byte_detection = coding_arg_max,
+    coding_arg_undecided_inhibit_nul_byte_detection = coding_arg_max,
     coding_arg_undecided_inhibit_iso_escape_detection,
     coding_arg_undecided_prefer_utf_8,
     coding_arg_undecided_max
@@ -137,7 +137,7 @@ enum coding_attr_index
 
     coding_attr_emacs_mule_full,
 
-    coding_attr_undecided_inhibit_null_byte_detection,
+    coding_attr_undecided_inhibit_nul_byte_detection,
     coding_attr_undecided_inhibit_iso_escape_detection,
     coding_attr_undecided_prefer_utf_8,
 
@@ -351,7 +351,7 @@ struct emacs_mule_spec
 
 struct undecided_spec
 {
-  /* Inhibit null byte detection.  1 means always inhibit,
+  /* Inhibit NUL byte detection.  1 means always inhibit,
      -1 means do not inhibit, 0 means rely on user variable.  */
   int inhibit_nbd;
 
diff --git a/src/dired.c b/src/dired.c
index 17a21b0..4937582 100644
--- a/src/dired.c
+++ b/src/dired.c
@@ -930,7 +930,7 @@ file_attributes (int fd, char const *name,
   struct stat s;
 
   /* An array to hold the mode string generated by filemodestring,
-     including its terminating space and null byte.  */
+     including its terminating space and NUL byte.  */
   char modes[sizeof "-rwxr-xr-x "];
 
   char *uname = NULL, *gname = NULL;
diff --git a/src/dispextern.h b/src/dispextern.h
index 8947536..7947dc2 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -1937,7 +1937,7 @@ struct bidi_string_data {
   Lisp_Object lstring;         /* Lisp string to reorder, or nil */
   const unsigned char *s;      /* string data, or NULL if reordering buffer */
   ptrdiff_t schars;            /* the number of characters in the string,
-                                  excluding the terminating null */
+                                  excluding the terminating NUL */
   ptrdiff_t bufpos;            /* buffer position of lstring, or 0 if N/A */
   bool_bf from_disp_str : 1;   /* True means the string comes from a
                                   display property */
diff --git a/src/doc.c b/src/doc.c
index 3e43d6d..372e376 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -233,7 +233,7 @@ get_doc_string (Lisp_Object filepos, bool unibyte, bool 
definition)
     }
 
   /* Scan the text and perform quoting with ^A (char code 1).
-     ^A^A becomes ^A, ^A0 becomes a null char, and ^A_ becomes a ^_.  */
+     ^A^A becomes ^A, ^A0 becomes a NUL char, and ^A_ becomes a ^_.  */
   from = get_doc_string_buffer + offset;
   to = get_doc_string_buffer + offset;
   while (from != p)
diff --git a/src/doprnt.c b/src/doprnt.c
index d0c7033..5fb7063 100644
--- a/src/doprnt.c
+++ b/src/doprnt.c
@@ -35,7 +35,7 @@ along with GNU Emacs.  If not, see 
<https://www.gnu.org/licenses/>.  */
      sequence.
 
    . It accepts a pointer to the end of the format string, so the format string
-     could include embedded null characters.
+     could include embedded NUL characters.
 
    . It signals an error if the length of the formatted string is about to
      overflow ptrdiff_t or size_t, to avoid producing strings longer than what
@@ -123,7 +123,7 @@ along with GNU Emacs.  If not, see 
<https://www.gnu.org/licenses/>.  */
    to fit and return BUFSIZE - 1; if this truncates a multibyte
    sequence, store '\0' into the sequence's first byte.
    Returns the number of bytes stored into BUFFER, excluding
-   the terminating null byte.  Output is always null-terminated.
+   the terminating NUL byte.  Output is always NUL-terminated.
    String arguments are passed as C strings.
    Integers are passed as C integers.  */
 
diff --git a/src/editfns.c b/src/editfns.c
index d6ad747..ac9b871 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -3086,7 +3086,7 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool 
message)
                              : FLT_RADIX == 16 ? 4
                              : -1)),
 
-   /* Maximum number of bytes (including terminating null) generated
+   /* Maximum number of bytes (including terminating NUL) generated
       by any format, if precision is no more than USEFUL_PRECISION_MAX.
       On all practical hosts, %Lf is the worst case.  */
    SPRINTF_BUFSIZE = (sizeof "-." + (LDBL_MAX_10_EXP + 1)
diff --git a/src/emacs-module.c b/src/emacs-module.c
index 4e2411c..530a8eb 100644
--- a/src/emacs-module.c
+++ b/src/emacs-module.c
@@ -584,7 +584,7 @@ module_make_string (emacs_env *env, const char *str, 
ptrdiff_t length)
   MODULE_FUNCTION_BEGIN (module_nil);
   if (! (0 <= length && length <= STRING_BYTES_BOUND))
     overflow_error ();
-  /* FIXME: AUTO_STRING_WITH_LEN requires STR to be null-terminated,
+  /* FIXME: AUTO_STRING_WITH_LEN requires STR to be NUL-terminated,
      but we shouldn't require that.  */
   AUTO_STRING_WITH_LEN (lstr, str, length);
   return lisp_to_value (env,
diff --git a/src/emacs.c b/src/emacs.c
index e16e230..68835ca 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -2639,7 +2639,7 @@ decode_env_path (const char *evarname, const char 
*defalt, bool empty)
              }
          }
        else if (cnv_result != 0 && d > path_utf8)
-         d[-1] = '\0'; /* remove last semi-colon and null-terminate PATH */
+         d[-1] = '\0'; /* remove last semi-colon and NUL-terminate PATH */
       } while (q);
       path_copy = path_utf8;
 #else  /* MSDOS */
diff --git a/src/fileio.c b/src/fileio.c
index 7b9446c..4ee125d 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -1639,7 +1639,7 @@ file_name_absolute_p (const char *filename)
 }
 
 /* Put into BUF the concatenation of DIR and FILE, with an intervening
-   directory separator if needed.  Return a pointer to the null byte
+   directory separator if needed.  Return a pointer to the NUL byte
    at the end of the concatenated string.  */
 char *
 splice_dir_file (char *buf, char const *dir, char const *file)
diff --git a/src/filelock.c b/src/filelock.c
index 64310f5..5cec199 100644
--- a/src/filelock.c
+++ b/src/filelock.c
@@ -296,7 +296,7 @@ typedef struct
 
 /* Write the name of the lock file for FNAME into LOCKNAME.  Length
    will be that of FNAME plus two more for the leading ".#", plus one
-   for the null.  */
+   for the NUL.  */
 #define MAKE_LOCK_NAME(lockname, fname) \
   (lockname = SAFE_ALLOCA (SBYTES (fname) + 2 + 1), \
    fill_in_lock_file_name (lockname, fname))
diff --git a/src/fns.c b/src/fns.c
index 6573124..b97b132 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -412,7 +412,7 @@ Symbols are also allowed; their print names are used 
instead.  */)
 
   while ((cmp = filevercmp (p1, p2)) == 0)
     {
-      /* If the strings are identical through their first null bytes,
+      /* If the strings are identical through their first NUL bytes,
         skip past identical prefixes and try again.  */
       ptrdiff_t size = strlen (p1) + 1;
       p1 += size;
diff --git a/src/font.c b/src/font.c
index 9220fb1..5ca89c9 100644
--- a/src/font.c
+++ b/src/font.c
@@ -1007,7 +1007,7 @@ font_expand_wildcards (Lisp_Object *field, int n)
 }
 
 
-/* Parse NAME (null terminated) as XLFD and store information in FONT
+/* Parse NAME (NUL terminated) as XLFD and store information in FONT
    (font-spec or font-entity).  Size property of FONT is set as
    follows:
        specified XLFD fields           FONT property
@@ -1353,7 +1353,7 @@ font_unparse_xlfd (Lisp_Object font, int pixel_size, char 
*name, int nbytes)
   return len < nbytes ? len : -1;
 }
 
-/* Parse NAME (null terminated) and store information in FONT
+/* Parse NAME (NUL terminated) and store information in FONT
    (font-spec or font-entity).  NAME is supplied in either the
    Fontconfig or GTK font name format.  If NAME is successfully
    parsed, return 0.  Otherwise return -1.
@@ -1725,7 +1725,7 @@ font_unparse_fcname (Lisp_Object font, int pixel_size, 
char *name, int nbytes)
 
 #endif
 
-/* Parse NAME (null terminated) and store information in FONT
+/* Parse NAME (NUL terminated) and store information in FONT
    (font-spec or font-entity).  If NAME is successfully parsed, return
    0.  Otherwise return -1.  */
 
diff --git a/src/insdel.c b/src/insdel.c
index fd725ac..1231bb2 100644
--- a/src/insdel.c
+++ b/src/insdel.c
@@ -708,7 +708,7 @@ insert_char (int c)
   insert ((char *) str, len);
 }
 
-/* Insert the null-terminated string S before point.  */
+/* Insert the NUL-terminated string S before point.  */
 
 void
 insert_string (const char *s)
diff --git a/src/json.c b/src/json.c
index b5fb3fe..5e1439f 100644
--- a/src/json.c
+++ b/src/json.c
@@ -229,7 +229,7 @@ json_make_string (const char *data, ptrdiff_t size)
                               Qutf_8_unix, Qt, false, true, true);
 }
 
-/* Create a multibyte Lisp string from the null-terminated UTF-8
+/* Create a multibyte Lisp string from the NUL-terminated UTF-8
    string beginning at DATA.  If the string is not a valid UTF-8
    string, an unspecified string is returned.  Note that all callers
    below either pass only value UTF-8 strings or use this function for
@@ -301,10 +301,10 @@ json_release_object (void *object)
 }
 
 /* Signal an error if OBJECT is not a string, or if OBJECT contains
-   embedded null characters.  */
+   embedded NUL characters.  */
 
 static void
-check_string_without_embedded_nulls (Lisp_Object object)
+check_string_without_embedded_nuls (Lisp_Object object)
 {
   CHECK_STRING (object);
   CHECK_TYPE (memchr (SDATA (object), '\0', SBYTES (object)) == NULL,
@@ -381,8 +381,8 @@ lisp_to_json_toplevel_1 (Lisp_Object lisp,
           {
             Lisp_Object key = json_encode (HASH_KEY (h, i));
             /* We can't specify the length, so the string must be
-               null-terminated.  */
-            check_string_without_embedded_nulls (key);
+               NUL-terminated.  */
+            check_string_without_embedded_nuls (key);
             const char *key_str = SSDATA (key);
             /* Reject duplicate keys.  These are possible if the hash
                table test is not `equal'.  */
@@ -432,8 +432,8 @@ lisp_to_json_toplevel_1 (Lisp_Object lisp,
           CHECK_SYMBOL (key_symbol);
           Lisp_Object key = SYMBOL_NAME (key_symbol);
           /* We can't specify the length, so the string must be
-             null-terminated.  */
-          check_string_without_embedded_nulls (key);
+             NUL-terminated.  */
+          check_string_without_embedded_nuls (key);
           key_str = SSDATA (key);
           /* In plists, ensure leading ":" in keys is stripped.  It
              will be reconstructed later in `json_to_lisp'.*/
@@ -568,7 +568,7 @@ false values, t, numbers, strings, or other vectors 
hashtables, alists
 or plists.  t will be converted to the JSON true value.  Vectors will
 be converted to JSON arrays, whereas hashtables, alists and plists are
 converted to JSON objects.  Hashtable keys must be strings without
-embedded null characters and must be unique within each object.  Alist
+embedded NUL characters and must be unique within each object.  Alist
 and plist keys must be symbols; if a key is duplicate, the first
 instance is used.
 
@@ -945,7 +945,7 @@ usage: (json-parse-string STRING &rest ARGS) */)
 
   Lisp_Object string = args[0];
   Lisp_Object encoded = json_encode (string);
-  check_string_without_embedded_nulls (encoded);
+  check_string_without_embedded_nuls (encoded);
   struct json_configuration conf = {json_object_hashtable, QCnull, QCfalse};
   json_parse_args (nargs - 1, args + 1, &conf, true);
 
diff --git a/src/keyboard.c b/src/keyboard.c
index 362bd66..8fb6db9 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -737,7 +737,8 @@ void
 force_auto_save_soon (void)
 {
   last_auto_save = - auto_save_interval - 1;
-
+  /* FIXME: What's the relationship between forcing auto-save and adding
+     a buffer-switch event?  */
   record_asynch_buffer_change ();
 }
 #endif
@@ -6191,7 +6192,7 @@ parse_modifiers_uncached (Lisp_Object symbol, ptrdiff_t 
*modifier_end)
 static Lisp_Object
 apply_modifiers_uncached (int modifiers, char *base, int base_len, int 
base_len_byte)
 {
-  /* Since BASE could contain nulls, we can't use intern here; we have
+  /* Since BASE could contain NULs, we can't use intern here; we have
      to use Fintern, which expects a genuine Lisp_String, and keeps a
      reference to it.  */
   char new_mods[sizeof "A-C-H-M-S-s-up-down-drag-double-triple-"];
diff --git a/src/lisp.h b/src/lisp.h
index 8ec892f..c33c311 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -1530,11 +1530,11 @@ STRING_MULTIBYTE (Lisp_Object str)
 }
 
 /* An upper bound on the number of bytes in a Lisp string, not
-   counting the terminating null.  This a tight enough bound to
+   counting the terminating NUL.  This a tight enough bound to
    prevent integer overflow errors that would otherwise occur during
    string size calculations.  A string cannot contain more bytes than
    a fixnum can represent, nor can it be so long that C pointer
-   arithmetic stops working on the string plus its terminating null.
+   arithmetic stops working on the string plus its terminating NUL.
    Although the actual size limit (see STRING_BYTES_MAX in alloc.c)
    may be a bit smaller than STRING_BYTES_BOUND, calculating it here
    would expose alloc.c internal details that we'd rather keep
@@ -3045,7 +3045,7 @@ CHECK_INTEGER (Lisp_Object x)
 
 /* Define a built-in function for calling from Lisp.
  `lname' should be the name to give the function in Lisp,
-    as a null-terminated C string.
+    as a NUL-terminated C string.
  `fnname' should be the name of the function in C.
     By convention, it starts with F.
  `sname' should be the name for the C constant structure
@@ -4729,7 +4729,7 @@ extern char *xlispstrdup (Lisp_Object) ATTRIBUTE_MALLOC;
 extern void dupstring (char **, char const *);
 
 /* Make DEST a copy of STRING's data.  Return a pointer to DEST's terminating
-   null byte.  This is like stpcpy, except the source is a Lisp string.  */
+   NUL byte.  This is like stpcpy, except the source is a Lisp string.  */
 
 INLINE char *
 lispstpcpy (char *dest, Lisp_Object string)
@@ -4933,7 +4933,7 @@ enum
         : list4 (a, b, c, d))
 
 /* Declare NAME as an auto Lisp string if possible, a GC-based one if not.
-   Take its unibyte value from the null-terminated string STR,
+   Take its unibyte value from the NUL-terminated string STR,
    an expression that should not have side effects.
    STR's value is not necessarily copied.  The resulting Lisp string
    should not be modified or given text properties or made visible to
@@ -4943,8 +4943,8 @@ enum
   AUTO_STRING_WITH_LEN (name, str, strlen (str))
 
 /* Declare NAME as an auto Lisp string if possible, a GC-based one if not.
-   Take its unibyte value from the null-terminated string STR with length LEN.
-   STR may have side effects and may contain null bytes.
+   Take its unibyte value from the NUL-terminated string STR with length LEN.
+   STR may have side effects and may contain NUL bytes.
    STR's value is not necessarily copied.  The resulting Lisp string
    should not be modified or given text properties or made visible to
    user code.  */
diff --git a/src/lread.c b/src/lread.c
index 8b0d693..2d64b63 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -2659,7 +2659,7 @@ free_contents (void *p)
 static Lisp_Object
 read_integer (Lisp_Object readcharfun, EMACS_INT radix)
 {
-  /* Room for sign, leading 0, other digits, trailing null byte.
+  /* Room for sign, leading 0, other digits, trailing NUL byte.
      Also, room for invalid syntax diagnostic.  */
   size_t len = max (1 + 1 + UINTMAX_WIDTH + 1,
                    sizeof "integer, radix " + INT_STRLEN_BOUND (EMACS_INT));
diff --git a/src/module-env-25.h b/src/module-env-25.h
index 675010b..d8f8eb6 100644
--- a/src/module-env-25.h
+++ b/src/module-env-25.h
@@ -88,13 +88,13 @@
     EMACS_ATTRIBUTE_NONNULL(1);
 
   /* Copy the content of the Lisp string VALUE to BUFFER as an utf8
-     null-terminated string.
+     NUL-terminated string.
 
      SIZE must point to the total size of the buffer.  If BUFFER is
      NULL or if SIZE is not big enough, write the required buffer size
      to SIZE and return true.
 
-     Note that SIZE must include the last null byte (e.g. "abc" needs
+     Note that SIZE must include the last NUL byte (e.g. "abc" needs
      a buffer of size 4).
 
      Return true if the string was successfully copied.  */
diff --git a/src/syntax.c b/src/syntax.c
index 5c38e92..edfdae2 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -3477,10 +3477,7 @@ internalize_parse_state (Lisp_Object external, struct 
lisp_parse_state *state)
   else
     {
       tem = Fcar (external);
-      if (!NILP (tem))
-       state->depth = XFIXNUM (tem);
-      else
-       state->depth = 0;
+      state->depth = FIXNUMP (tem) ? XFIXNUM (tem) : 0;
 
       external = Fcdr (external);
       external = Fcdr (external);
diff --git a/src/sysdep.c b/src/sysdep.c
index fe5a44e..57ea822 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -257,12 +257,12 @@ get_current_dir_name_or_unreachable (void)
 
   char *pwd;
 
-  /* The maximum size of a directory name, including the terminating null.
+  /* The maximum size of a directory name, including the terminating NUL.
      Leave room so that the caller can append a trailing slash.  */
   ptrdiff_t dirsize_max = min (PTRDIFF_MAX, SIZE_MAX) - 1;
 
   /* The maximum size of a buffer for a file name, including the
-     terminating null.  This is bounded by MAXPATHLEN, if available.  */
+     terminating NUL.  This is bounded by MAXPATHLEN, if available.  */
   ptrdiff_t bufsize_max = dirsize_max;
 #ifdef MAXPATHLEN
   bufsize_max = min (bufsize_max, MAXPATHLEN);
@@ -3435,7 +3435,7 @@ system_process_attributes (Lisp_Object pid)
 
       if (nread)
        {
-         /* We don't want trailing null characters.  */
+         /* We don't want trailing NUL characters.  */
          for (p = cmdline + nread; cmdline < p && !p[-1]; p--)
            continue;
 
diff --git a/src/termcap.c b/src/termcap.c
index 9e081ba..7dc0d57 100644
--- a/src/termcap.c
+++ b/src/termcap.c
@@ -162,7 +162,7 @@ tgetst1 (char *ptr, char **area)
   else
     ret = *area;
 
-  /* Copy the string value, stopping at null or colon.
+  /* Copy the string value, stopping at NUL or colon.
      Also process ^ and \ abbreviations.  */
   p = ptr;
   r = ret;
@@ -424,7 +424,7 @@ tgetent (char *bp, const char *name)
     return -1;
 
   buf.size = BUFSIZE;
-  /* Add 1 to size to ensure room for terminating null.  */
+  /* Add 1 to size to ensure room for terminating NUL.  */
   buf.beg = xmalloc (buf.size + 1);
   term = indirect ? indirect : (char *)name;
 
@@ -480,7 +480,7 @@ tgetent (char *bp, const char *name)
       *bp1 = '\0';
 
       /* Does this entry refer to another terminal type's entry?
-        If something is found, copy it into heap and null-terminate it.  */
+        If something is found, copy it into heap and NUL-terminate it.  */
       tc_search_point = find_capability (tc_search_point, "tc");
       term = tgetst1 (tc_search_point, 0);
     }
@@ -618,7 +618,7 @@ gobble_line (int fd, register struct termcap_buffer *bufp, 
char *append_end)
            {
              ptrdiff_t ptr_offset = bufp->ptr - buf;
              ptrdiff_t append_end_offset = append_end - buf;
-             /* Add 1 to size to ensure room for terminating null.  */
+             /* Add 1 to size to ensure room for terminating NUL.  */
              ptrdiff_t size = bufp->size + 1;
              bufp->beg = buf = xpalloc (buf, &size, 1, -1, 1);
              bufp->size = size - 1;
diff --git a/src/timefns.c b/src/timefns.c
index 5beeaf5..514fa24 100644
--- a/src/timefns.c
+++ b/src/timefns.c
@@ -1133,7 +1133,7 @@ or (if you need time as a string) `format-time-string'.  
*/)
    determine how many bytes would be written, use NULL for S and
    ((size_t) -1) for MAXSIZE.
 
-   This function behaves like nstrftime, except it allows null
+   This function behaves like nstrftime, except it allows NUL
    bytes in FORMAT and it does not support nanoseconds.  */
 static size_t
 emacs_nmemftime (char *s, size_t maxsize, const char *format,
@@ -1141,8 +1141,8 @@ emacs_nmemftime (char *s, size_t maxsize, const char 
*format,
 {
   size_t total = 0;
 
-  /* Loop through all the null-terminated strings in the format
-     argument.  Normally there's just one null-terminated string, but
+  /* Loop through all the NUL-terminated strings in the format
+     argument.  Normally there's just one NUL-terminated string, but
      there can be arbitrarily many, concatenated together, if the
      format contains '\0' bytes.  nstrftime stops at the first
      '\0' byte so we must invoke it separately for each such string.  */
diff --git a/src/unexmacosx.c b/src/unexmacosx.c
index 53a30e3..a94c0cc 100644
--- a/src/unexmacosx.c
+++ b/src/unexmacosx.c
@@ -447,7 +447,7 @@ unexec_regions_recorder (task_t task, void *rr, unsigned 
type,
 
   while (num && num_unexec_regions < MAX_UNEXEC_REGIONS)
     {
-      /* Subtract the size of trailing null bytes from filesize.  It
+      /* Subtract the size of trailing NUL bytes from filesize.  It
         can be smaller than vmsize in segment commands.  In such a
         case, trailing bytes are initialized with zeros.  */
       for (p = ranges->address + ranges->size; p > ranges->address; p--)
diff --git a/src/w16select.c b/src/w16select.c
index b935b9f..3eb2199 100644
--- a/src/w16select.c
+++ b/src/w16select.c
@@ -220,7 +220,7 @@ set_clipboard_data (unsigned Format, void *Data, unsigned 
Size, int Raw)
   /* need to know final size after '\r' chars are inserted (the
      standard CF_OEMTEXT clipboard format uses CRLF line endings,
      while Emacs uses just LF internally).  */
-  truelen = Size + 1;          /* +1 for the terminating null */
+  truelen = Size + 1;          /* +1 for the terminating NUL */
 
   if (!Raw)
     {
@@ -243,7 +243,7 @@ set_clipboard_data (unsigned Format, void *Data, unsigned 
Size, int Raw)
     {
       dosmemput (Data, Size, xbuf_addr);
 
-      /* Terminate with a null, otherwise Windows does strange things
+      /* Terminate with a NUL, otherwise Windows does strange things
         when the text size is an integral multiple of 32 bytes. */
       _farpokeb (_dos_ds, xbuf_addr + Size, '\0');
     }
@@ -255,7 +255,7 @@ set_clipboard_data (unsigned Format, void *Data, unsigned 
Size, int Raw)
       while (Size--)
        {
          /* Don't allow them to put binary data into the clipboard, since
-            it will cause yanked data to be truncated at the first null.  */
+            it will cause yanked data to be truncated at the first NUL.  */
          if (*dp == '\0')
            return 2;
          if (*dp == '\n')
@@ -263,7 +263,7 @@ set_clipboard_data (unsigned Format, void *Data, unsigned 
Size, int Raw)
          _farnspokeb (buf_offset++, *dp++);
        }
 
-      /* Terminate with a null, otherwise Windows does strange things
+      /* Terminate with a NUL, otherwise Windows does strange things
         when the text size is an integral multiple of 32 bytes. */
       _farnspokeb (buf_offset, '\0');
     }
@@ -354,13 +354,13 @@ get_clipboard_data (unsigned Format, void *Data, unsigned 
Size, int Raw)
   __dpmi_int (0x2f, &regs);
   if (regs.x.ax != 0)
     {
-      unsigned char null_char = '\0';
+      unsigned char nul_char = '\0';
       unsigned long xbuf_beg = xbuf_addr;
 
       /* If last_clipboard_text is NULL, we don't want to slow down
         the next loop by an additional test.  */
       register unsigned char *lcdp =
-       last_clipboard_text == NULL ? &null_char : last_clipboard_text;
+       last_clipboard_text == NULL ? &nul_char : last_clipboard_text;
 
       /* Copy data from low memory, remove CR
         characters before LF if needed.  */
@@ -383,7 +383,7 @@ get_clipboard_data (unsigned Format, void *Data, unsigned 
Size, int Raw)
          /* Windows reportedly rounds up the size of clipboard data
             (passed in SIZE) to a multiple of 32, and removes trailing
             spaces from each line without updating SIZE.  We therefore
-            bail out when we see the first null character.  */
+            bail out when we see the first NUL character.  */
          else if (c == '\0')
            break;
        }
@@ -392,7 +392,7 @@ get_clipboard_data (unsigned Format, void *Data, unsigned 
Size, int Raw)
         last time set_clipboard_data was called, pretend there's no
         data in the clipboard.  This is so we don't pass our own text
         from the clipboard (which might be troublesome if the killed
-        text includes null characters).  */
+        text includes NUL characters).  */
       if (last_clipboard_text &&
          xbuf_addr - xbuf_beg == (long)(lcdp - last_clipboard_text))
        dp = (unsigned char *)Data + 1;
diff --git a/src/w32.c b/src/w32.c
index f3e88af..082a66b 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -5941,7 +5941,7 @@ is_symlink (const char *filename)
 
 /* If NAME identifies a symbolic link, copy into BUF the file name of
    the symlink's target.  Copy at most BUF_SIZE bytes, and do NOT
-   null-terminate the target name, even if it fits.  Return the number
+   NUL-terminate the target name, even if it fits.  Return the number
    of bytes copied, or -1 if NAME is not a symlink or any error was
    encountered while resolving it.  The file name copied into BUF is
    encoded in the current ANSI codepage.  */
@@ -6045,10 +6045,10 @@ readlink (const char *name, char *buf, size_t buf_size)
          size_t size_to_copy = buf_size;
 
          /* According to MSDN, PrintNameLength does not include the
-            terminating null character.  */
+            terminating NUL character.  */
          lwname = alloca ((lwname_len + 1) * sizeof(WCHAR));
          memcpy (lwname, lwname_src, lwname_len);
-         lwname[lwname_len/sizeof(WCHAR)] = 0; /* null-terminate */
+         lwname[lwname_len/sizeof(WCHAR)] = 0; /* NUL-terminate */
          filename_from_utf16 (lwname, resolved);
          dostounix_filename (resolved);
          lname_size = strlen (resolved) + 1;
@@ -9384,7 +9384,7 @@ w32_read_registry (HKEY rootkey, Lisp_Object lkey, 
Lisp_Object lname)
       /* Convert input strings to UTF-16.  */
       encoded_key = code_convert_string_norecord (lkey, Qutf_16le, 1);
       memcpy (key_w, SSDATA (encoded_key), SBYTES (encoded_key));
-      /* wchar_t strings need to be terminated by 2 null bytes.  */
+      /* wchar_t strings need to be terminated by 2 NUL bytes.  */
       key_w [SBYTES (encoded_key)/2] = L'\0';
       encoded_vname = code_convert_string_norecord (lname, Qutf_16le, 1);
       memcpy (value_w, SSDATA (encoded_vname), SBYTES (encoded_vname));
@@ -9476,7 +9476,7 @@ w32_read_registry (HKEY rootkey, Lisp_Object lkey, 
Lisp_Object lname)
       case REG_SZ:
        if (use_unicode)
          {
-           /* pvalue ends with 2 null bytes, but we need only one,
+           /* pvalue ends with 2 NUL bytes, but we need only one,
               and AUTO_STRING_WITH_LEN will add it.  */
            if (pvalue[vsize - 1] == '\0')
              vsize -= 2;
@@ -9485,7 +9485,7 @@ w32_read_registry (HKEY rootkey, Lisp_Object lkey, 
Lisp_Object lname)
          }
        else
          {
-           /* Don't waste a byte on the terminating null character,
+           /* Don't waste a byte on the terminating NUL character,
               since make_unibyte_string will add one anyway.  */
            if (pvalue[vsize - 1] == '\0')
              vsize--;
diff --git a/src/w32fns.c b/src/w32fns.c
index 1fbf327..25900c5 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -7965,7 +7965,7 @@ DEFUN ("system-move-file-to-trash", 
Fsystem_move_file_to_trash,
        {
          SHFILEOPSTRUCTW file_op_w;
          /* We need one more element beyond MAX_PATH because this is
-            a list of file names, with the last element double-null
+            a list of file names, with the last element double-NUL
             terminated. */
          wchar_t tmp_path_w[MAX_PATH + 1];
 
@@ -9724,7 +9724,7 @@ get_dll_version (const char *dll_name)
 /* Return the number of bytes in UTF-8 encoded string STR that
    corresponds to at most LIM characters.  If STR ends before LIM
    characters, return the number of bytes in STR including the
-   terminating null byte.  */
+   terminating NUL byte.  */
 static int
 utf8_mbslen_lim (const char *str, int lim)
 {
diff --git a/src/w32proc.c b/src/w32proc.c
index ab0bf0f..8e878e6 100644
--- a/src/w32proc.c
+++ b/src/w32proc.c
@@ -2002,9 +2002,9 @@ sys_spawnve (int mode, char *cmdname, char **argv, char 
**envp)
     }
 
   /* we have to do some conjuring here to put argv and envp into the
-     form CreateProcess wants...  argv needs to be a space separated/null
-     terminated list of parameters, and envp is a null
-     separated/double-null terminated list of parameters.
+     form CreateProcess wants...  argv needs to be a space separated/NUL
+     terminated list of parameters, and envp is a NUL
+     separated/double-NUL terminated list of parameters.
 
      Additionally, zero-length args and args containing whitespace or
      quote chars need to be wrapped in double quotes - for this to work,
@@ -3393,10 +3393,10 @@ If LCID (a 16-bit number) is not a valid locale, the 
result is nil.  */)
       got_full = GetLocaleInfo (XFIXNUM (lcid),
                                XFIXNUM (longform),
                                full_name, sizeof (full_name));
-      /* GetLocaleInfo's return value includes the terminating null
+      /* GetLocaleInfo's return value includes the terminating NUL
         character, when the returned information is a string, whereas
         make_unibyte_string needs the string length without the
-        terminating null.  */
+        terminating NUL.  */
       if (got_full)
        return make_unibyte_string (full_name, got_full - 1);
     }
diff --git a/src/w32select.c b/src/w32select.c
index 1c84cb4..af4f049 100644
--- a/src/w32select.c
+++ b/src/w32select.c
@@ -803,7 +803,7 @@ DEFUN ("w32-get-clipboard-data", Fw32_get_clipboard_data,
   (void) ignored;
 
   /* Don't pass our own text from the clipboard (which might be
-     troublesome if the killed text includes null characters).  */
+     troublesome if the killed text includes NUL characters).  */
   if (!NILP (current_text))
     return ret;
 
diff --git a/src/xdisp.c b/src/xdisp.c
index 3172b3b..a88fc69 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -10568,7 +10568,7 @@ message_log_check_duplicate (ptrdiff_t prev_bol_byte, 
ptrdiff_t this_bol_byte)
 
 
 /* Display an echo area message M with a specified length of NBYTES
-   bytes.  The string may include null characters.  If M is not a
+   bytes.  The string may include NUL characters.  If M is not a
    string, clear out any existing message, and let the mini-buffer
    text show through.
 
@@ -10672,7 +10672,7 @@ message3_nolog (Lisp_Object m)
 }
 
 
-/* Display a null-terminated echo area message M.  If M is 0, clear
+/* Display a NUL-terminated echo area message M.  If M is 0, clear
    out any existing message, and let the mini-buffer text show through.
 
    The buffer M must continue to exist until after the echo area gets
@@ -24272,7 +24272,7 @@ are the selected window and the WINDOW's buffer).  */)
   return unbind_to (count, str);
 }
 
-/* Write a null-terminated, right justified decimal representation of
+/* Write a NUL-terminated, right justified decimal representation of
    the positive integer D to BUF using a minimal field width WIDTH.  */
 
 static void
@@ -24302,7 +24302,7 @@ pint2str (register char *buf, register int width, 
register ptrdiff_t d)
     }
 }
 
-/* Write a null-terminated, right justified decimal and "human
+/* Write a NUL-terminated, right justified decimal and "human
    readable" representation of the nonnegative integer D to BUF using
    a minimal field width WIDTH.  D should be smaller than 999.5e24. */
 
@@ -24522,7 +24522,7 @@ decode_mode_spec (struct window *w, register int c, int 
field_width,
      produce strings from numerical values, so limit preposterously
      large values of FIELD_WIDTH to avoid overrunning the buffer's
      end.  The size of the buffer is enough for FRAME_MESSAGE_BUF_SIZE
-     bytes plus the terminating null.  */
+     bytes plus the terminating NUL.  */
   int width = min (field_width, FRAME_MESSAGE_BUF_SIZE (f));
   struct buffer *b = current_buffer;
 
diff --git a/src/xfont.c b/src/xfont.c
index e40a310..5ecbd6d 100644
--- a/src/xfont.c
+++ b/src/xfont.c
@@ -132,7 +132,7 @@ compare_font_names (const void *name1, const void *name2)
 
 /* Decode XLFD as iso-8859-1 into OUTPUT, and return the byte length
    of the decoding result.  LEN is the byte length of XLFD, or -1 if
-   XLFD is NULL terminated.  The caller must assure that OUTPUT is at
+   XLFD is NUL terminated.  The caller must assure that OUTPUT is at
    least twice (plus 1) as large as XLFD.  */
 
 static ptrdiff_t



reply via email to

[Prev in Thread] Current Thread [Next in Thread]