[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] scratch/record 1682496 06/12: Use sizeof to get length of
From: |
Lars Brinkhoff |
Subject: |
[Emacs-diffs] scratch/record 1682496 06/12: Use sizeof to get length of cl-struct prefix. |
Date: |
Sun, 19 Mar 2017 16:04:20 -0400 (EDT) |
branch: scratch/record
commit 16824969c66c5f4ae68a102ae4ce6a146f8ca399
Author: Lars Brinkhoff <address@hidden>
Commit: Lars Brinkhoff <address@hidden>
Use sizeof to get length of cl-struct prefix.
Also replace a `0' with `false'.
---
src/data.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/src/data.c b/src/data.c
index 5a91d92..0e7f4b4 100644
--- a/src/data.c
+++ b/src/data.c
@@ -201,8 +201,7 @@ DEFUN ("null", Fnull, Snull, 1, 1, 0,
return Qnil;
}
-static const char *old_struct_prefix = "cl-struct-";
-static int old_struct_prefix_length;
+static const char old_struct_prefix[] = "cl-struct-";
static int
vector_struct_p (Lisp_Object object)
@@ -214,7 +213,7 @@ vector_struct_p (Lisp_Object object)
return SYMBOLP (type)
&& strncmp (SDATA (SYMBOL_NAME (type)),
old_struct_prefix,
- old_struct_prefix_length) == 0;
+ sizeof old_struct_prefix - 1) == 0;
}
static Lisp_Object
@@ -3899,8 +3898,7 @@ syms_of_data (void)
DEFVAR_BOOL ("old-struct-compat", old_struct_compat,
doc: /* Non-nil means hack for old structs is in effect. */);
- old_struct_compat = 0;
- old_struct_prefix_length = strlen (old_struct_prefix);
+ old_struct_compat = false;
DEFSYM (Qwatchers, "watchers");
DEFSYM (Qmakunbound, "makunbound");
- [Emacs-diffs] branch scratch/record created (now f23d5d7), Lars Brinkhoff, 2017/03/19
- [Emacs-diffs] scratch/record 88e7f6f 07/12: Better doc string for `old-struct-compat'., Lars Brinkhoff, 2017/03/19
- [Emacs-diffs] scratch/record 445db82 05/12: Backward compatibility with pre-existing struct instances., Lars Brinkhoff, 2017/03/19
- [Emacs-diffs] scratch/record 1682496 06/12: Use sizeof to get length of cl-struct prefix.,
Lars Brinkhoff <=
- [Emacs-diffs] scratch/record 2068bed 01/12: Add record objects with user-defined types., Lars Brinkhoff, 2017/03/19
- [Emacs-diffs] scratch/record 27b4a7b 04/12: Test cases., Lars Brinkhoff, 2017/03/19
- [Emacs-diffs] scratch/record 869239a 02/12: Update cl-defstruct to use records., Lars Brinkhoff, 2017/03/19
- [Emacs-diffs] scratch/record e8ec4b7 10/12: Fix cl-print-object to find the object class the new way., Lars Brinkhoff, 2017/03/19
- [Emacs-diffs] scratch/record e4a5289 09/12: Make it possible to compare records with `equal'., Lars Brinkhoff, 2017/03/19
- [Emacs-diffs] scratch/record c235473 11/12: Make a note that CHECK_RECORD_TYPE is a work in progress., Lars Brinkhoff, 2017/03/19
- [Emacs-diffs] scratch/record 46d5ea1 08/12: Better doc strings for `make-record', `record', and `copy-record'., Lars Brinkhoff, 2017/03/19
- [Emacs-diffs] scratch/record f23d5d7 12/12: Signal errors from APIs., Lars Brinkhoff, 2017/03/19
- [Emacs-diffs] scratch/record b84c1ad 03/12: Make EIEIO use records., Lars Brinkhoff, 2017/03/19