From bfe875d38a4765ed2426f08258f0650e6105ba39 Mon Sep 17 00:00:00 2001 From: Philipp Stephani Date: Tue, 25 Mar 2025 14:24:04 +0100 Subject: [PATCH] Rename 'buffer-too-small' to 'memory-buffer-too-small'. This clarifies that the error isn't talking about an editing buffer. * src/emacs-module.c (module_memory_buffer_too_small): Rename from 'module_buffer_too_small'. (module_copy_string_contents, module_extract_big_integer): Adapt callers. (syms_of_module): Rename symbol 'buffer-too-small' to 'memory-buffer-too-small'. (cherry picked from commit 0b1102a70413dabba082d822c200b014464de667) --- src/emacs-module.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/emacs-module.c b/src/emacs-module.c index 32b78b0d978..22590a23cb2 100644 --- a/src/emacs-module.c +++ b/src/emacs-module.c @@ -224,11 +224,11 @@ module_decode_utf_8 (const char *str, ptrdiff_t len) return s; } -/* Signal an error of type `buffer-too-small'. */ +/* Signal an error of type `memory-buffer-too-small'. */ static void -module_buffer_too_small (ptrdiff_t actual, ptrdiff_t required) +module_memory_buffer_too_small (ptrdiff_t actual, ptrdiff_t required) { - xsignal2 (Qbuffer_too_small, INT_TO_INTEGER (actual), + xsignal2 (Qmemory_buffer_too_small, INT_TO_INTEGER (actual), INT_TO_INTEGER (required)); } @@ -825,7 +825,7 @@ module_copy_string_contents (emacs_env *env, emacs_value value, char *buf, { ptrdiff_t actual = *len; *len = required_buf_size; - module_buffer_too_small (actual, required_buf_size); + module_memory_buffer_too_small (actual, required_buf_size); } *len = required_buf_size; @@ -1113,7 +1113,7 @@ module_extract_big_integer (emacs_env *env, emacs_value arg, int *sign, { ptrdiff_t actual = *count; *count = required; - module_buffer_too_small (actual, required); + module_memory_buffer_too_small (actual, required); } /* Set u = abs(x). See https://stackoverflow.com/a/17313717. */ if (0 < x) @@ -1147,7 +1147,7 @@ module_extract_big_integer (emacs_env *env, emacs_value arg, int *sign, { ptrdiff_t actual = *count; *count = required; - module_buffer_too_small (actual, required); + module_memory_buffer_too_small (actual, required); } size_t written; mpz_export (magnitude, &written, order, size, endian, nails, *x); @@ -1773,10 +1773,10 @@ syms_of_module (void) Fput (Qinvalid_arity, Qerror_message, build_string ("Invalid function arity")); - DEFSYM (Qbuffer_too_small, "buffer-too-small"); - Fput (Qbuffer_too_small, Qerror_conditions, - list2 (Qbuffer_too_small, Qerror)); - Fput (Qbuffer_too_small, Qerror_message, + DEFSYM (Qmemory_buffer_too_small, "memory-buffer-too-small"); + Fput (Qmemory_buffer_too_small, Qerror_conditions, + list2 (Qmemory_buffer_too_small, Qerror)); + Fput (Qmemory_buffer_too_small, Qerror_message, build_unibyte_string ("Memory buffer too small")); DEFSYM (Qmodule_function_p, "module-function-p"); -- 2.39.5