From 64c58011b7a626dabbb2bc302cd25769f039e3ed Mon Sep 17 00:00:00 2001 From: Po Lu Date: Sat, 30 Sep 2023 08:30:59 +0800 Subject: [PATCH 1/5] Fix last change * src/search.c (Fre__describe_compiled): Correct typos and pointer signedness missmatch. --- src/search.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/search.c b/src/search.c index 014fd97d423..e9b29bb7179 100644 --- a/src/search.c +++ b/src/search.c @@ -3391,13 +3391,13 @@ If RAW is non-nil, just return the actual bytecode. */) !NILP (BVAR (current_buffer, enable_multibyte_characters))); if (!NILP (raw)) - return make_unibyte_string (cache_entry->buf.buffer, + return make_unibyte_string ((char *) cache_entry->buf.buffer, cache_entry->buf.used); else { /* FIXME: Why ENABLE_CHECKING? */ -#if !ENABLE_CHECKING +#if !defined ENABLE_CHECKING error ("Not available: rebuild with --enable-checking"); -#elsif HAVE_OPEN_MEMSTREAM +#elif HAVE_OPEN_MEMSTREAM char *buffer = NULL; size_t size = 0; FILE* f = open_memstream (&buffer, &size); @@ -3410,10 +3410,10 @@ If RAW is non-nil, just return the actual bytecode. */) Lisp_Object description = make_unibyte_string (buffer, size); free (buffer); return description; -#else +#else /* ENABLE_CHECKING && !HAVE_OPEN_MEMSTREAM */ print_compiled_pattern (stderr, &cache_entry->buf); return build_string ("Description was sent to standard error"); -#endif +#endif /* !ENABLE_CHECKING */ } } From 9a3523e7d839fd45180e553c10d2f22475fa30c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerd=20M=C3=B6llmann?= Date: Sat, 30 Sep 2023 07:41:19 +0200 Subject: [PATCH 2/5] ; Fix a glob in .clangd --- .clangd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.clangd b/.clangd index 131d0af5843..469d33dfd03 100644 --- a/.clangd +++ b/.clangd @@ -1,5 +1,5 @@ --- If: - PathMatch: "src/.*\.c" + PathMatch: "src/*.c" CompileFlags: Add: [-Wno-unused-macros, -include=config.h] From cdc653d68f44a253a7a06f7eed981a7fd1c7e785 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Sat, 30 Sep 2023 15:36:49 +0800 Subject: [PATCH 3/5] Update Android port * src/androidmenu.c (android_menu_show): Properly encode pane names before deriving Java strings from them. * src/sfntfont.c (sfnt_parse_style, sfntfont_list_1): Intern adstyles. --- src/androidmenu.c | 19 +++++++++++++------ src/sfntfont.c | 7 ++++++- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/androidmenu.c b/src/androidmenu.c index 3b34f032c35..ed26bdafa85 100644 --- a/src/androidmenu.c +++ b/src/androidmenu.c @@ -248,7 +248,6 @@ android_menu_show (struct frame *f, int x, int y, int menuflags, jobject title_string, help_string, temp; size_t i; Lisp_Object pane_name, prefix; - const char *pane_string; specpdl_ref count, count1; Lisp_Object item_name, enable, def, tem, entry, type, selected; Lisp_Object help; @@ -357,13 +356,21 @@ android_menu_show (struct frame *f, int x, int y, int menuflags, /* Now figure out the title of this pane. */ pane_name = AREF (menu_items, i + MENU_ITEMS_PANE_NAME); prefix = AREF (menu_items, i + MENU_ITEMS_PANE_PREFIX); - pane_string = (NILP (pane_name) - ? "" : SSDATA (pane_name)); - if ((menuflags & MENU_KEYMAPS) && !NILP (prefix)) - pane_string++; + + /* PANE_NAME may be nil, in which case it must be set to an + empty string. */ + + if (NILP (pane_name)) + pane_name = empty_unibyte_string; + + /* Remove the leading prefix character if need be. */ + + if ((menuflags & MENU_KEYMAPS) && !NILP (prefix) + && SCHARS (prefix)) + pane_name = Fsubstring (pane_name, make_fixnum (1), Qnil); /* Add the pane. */ - temp = (*env)->NewStringUTF (env, pane_string); + temp = android_build_string (pane_name); android_exception_check (); (*env)->CallNonvirtualVoidMethod (env, current_context_menu, diff --git a/src/sfntfont.c b/src/sfntfont.c index d556092db12..3506742a92b 100644 --- a/src/sfntfont.c +++ b/src/sfntfont.c @@ -545,6 +545,11 @@ sfnt_parse_style (Lisp_Object style_name, struct sfnt_font_desc *desc) continue; } + /* The adstyle must be a symbol, so intern it if it is set. */ + + if (!NILP (desc->adstyle)) + desc->adstyle = Fintern (desc->adstyle, Qnil); + SAFE_FREE (); } @@ -1655,7 +1660,7 @@ sfntfont_list_1 (struct sfnt_font_desc *desc, Lisp_Object spec, if (NILP (desc->instances)) { tem = AREF (spec, FONT_ADSTYLE_INDEX); - if (!NILP (tem) && NILP (Fequal (tem, desc->adstyle))) + if (!NILP (tem) && !EQ (tem, desc->adstyle)) return 0; if (FONT_WIDTH_NUMERIC (spec) != -1 From ec6e7f7c013697dadfbf9bba51b97ef2405f3ba3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Engdeg=C3=A5rd?= Date: Sat, 30 Sep 2023 10:38:48 +0200 Subject: [PATCH 4/5] ; Make configure work on Solaris after last change * configure.ac: Solaris /bin/sh doesn't have `test -e`. --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index f63eb870ffb..e406863178d 100644 --- a/configure.ac +++ b/configure.ac @@ -1664,7 +1664,7 @@ AC_ARG_ENABLE([gcc-warnings], # however, if there is also a .tarball-version file it is probably # just a release imported into Git for patch management. gl_gcc_warnings=no - if test -e "$srcdir"/.git && test ! -f "$srcdir"/.tarball-version; then + if test -d "$srcdir"/.git -o -f "$srcdir"/.git && test ! -f "$srcdir"/.tarball-version; then # Clang typically identifies itself as GCC 4.2 or something similar # even if it is recent enough to accept the warnings we enable. AS_IF([test "$emacs_cv_clang" = yes], From 8db48d247b7fedab0aa1b2d8573ccc2b950ad545 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Sat, 30 Sep 2023 19:39:54 +0800 Subject: [PATCH 5/5] Eschew non-portable constructs in configure.ac * configure.ac (gl_gcc_warnings): Delete `test -o' and simplify long test condition correspondingly. --- configure.ac | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/configure.ac b/configure.ac index e406863178d..895d25a7f13 100644 --- a/configure.ac +++ b/configure.ac @@ -1664,13 +1664,13 @@ AC_ARG_ENABLE([gcc-warnings], # however, if there is also a .tarball-version file it is probably # just a release imported into Git for patch management. gl_gcc_warnings=no - if test -d "$srcdir"/.git -o -f "$srcdir"/.git && test ! -f "$srcdir"/.tarball-version; then - # Clang typically identifies itself as GCC 4.2 or something similar - # even if it is recent enough to accept the warnings we enable. - AS_IF([test "$emacs_cv_clang" = yes], - [gl_gcc_warnings=warn-only], - [gl_GCC_VERSION_IFELSE([5], [3], [gl_gcc_warnings=warn-only])]) - fi]) + AS_IF([test -d "$srcdir"/.git || test -f "$srcdir"/.git], + [AS_IF([test -f "$srcdir"/.tarball-version], [], + # Clang typically identifies itself as GCC 4.2 or something similar + # even if it is recent enough to accept the warnings we enable. + [AS_IF([test "$emacs_cv_clang" = yes], + [gl_gcc_warnings=warn-only], + [gl_GCC_VERSION_IFELSE([5], [3], [gl_gcc_warnings=warn-only])])])])]) NATIVE_COMPILATION_AOT=no AC_ARG_WITH([native-compilation],