From 2a0213a6d0a9e36a388994445837e051d0bbe5f9 Mon Sep 17 00:00:00 2001 From: Dmitry Antipov Date: Tue, 10 Jul 2012 12:43:46 +0400 Subject: Optimize pure C strings initialization. * lisp.h (make_pure_string): Fix prototype. (build_pure_c_string): New function, defined as static inline. This provides a better opportunity to optimize away calls to strlen when the function is called with compile-time constant argument. * alloc.c (make_pure_c_string): Fix comment. Change to add nchars argument, adjust users accordingly. Use build_pure_c_string where appropriate. * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c, * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c, * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate. --- src/dbusbind.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/dbusbind.c') diff --git a/src/dbusbind.c b/src/dbusbind.c index 203a25c151a..86013d92c07 100644 --- a/src/dbusbind.c +++ b/src/dbusbind.c @@ -1712,7 +1712,7 @@ syms_of_dbusbind (void) Fput (Qdbus_error, Qerror_conditions, list2 (Qdbus_error, Qerror)); Fput (Qdbus_error, Qerror_message, - make_pure_c_string ("D-Bus error")); + build_pure_c_string ("D-Bus error")); DEFSYM (QCdbus_system_bus, ":system"); DEFSYM (QCdbus_session_bus, ":session"); @@ -1744,7 +1744,7 @@ syms_of_dbusbind (void) Vdbus_compiled_version, doc: /* The version of D-Bus Emacs is compiled against. */); #ifdef DBUS_VERSION_STRING - Vdbus_compiled_version = make_pure_c_string (DBUS_VERSION_STRING); + Vdbus_compiled_version = build_pure_c_string (DBUS_VERSION_STRING); #else Vdbus_compiled_version = Qnil; #endif -- cgit v1.2.1