emacs-diffs
[Top][All Lists]
Advanced

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

master 63ddbcc0225 5/5: Merge remote-tracking branch 'refs/remotes/origi


From: Stefan Monnier
Subject: master 63ddbcc0225 5/5: Merge remote-tracking branch 'refs/remotes/origin/master'
Date: Sat, 30 Sep 2023 09:42:19 -0400 (EDT)

branch: master
commit 63ddbcc0225bb888a82a3759abb7a5c64513e752
Merge: f7fd21b0686 8db48d247b7
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>

    Merge remote-tracking branch 'refs/remotes/origin/master'
---
 .clangd           |  2 +-
 configure.ac      | 14 +++++++-------
 src/androidmenu.c | 19 +++++++++++++------
 src/search.c      | 10 +++++-----
 src/sfntfont.c    |  7 ++++++-
 5 files changed, 32 insertions(+), 20 deletions(-)

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]
diff --git a/configure.ac b/configure.ac
index 6eb6d297987..9ae0dec3867 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 -e "$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],
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/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 */
     }
 }
 
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



reply via email to

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