GNU bug report logs - #8839
[PATCH] uses of XVECTOR in nsmenu.m in v23 need to be changed

Previous Next

Package: emacs;

Reported by: Alp Aker <alp.tekin.aker <at> gmail.com>

Date: Sun, 12 Jun 2011 02:03:02 UTC

Severity: normal

Tags: patch

Found in version 23.3

Fixed in version 24.1

Done: David Reitter <david.reitter <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 8839 in the body.
You can then email your comments to 8839 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8839; Package emacs. (Sun, 12 Jun 2011 02:03:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Alp Aker <alp.tekin.aker <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 12 Jun 2011 02:03:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Alp Aker <alp.tekin.aker <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] uses of XVECTOR in nsmenu.m in v23 need to be changed
Date: Sun, 12 Jun 2011 01:26:32 +0000 (UTC)
Uses of XVECTOR in nsmenu.m were recently removed in the trunk (by Paul Eggert, 
rev. no. 104024).  The same changes also need to made to nsmenu.m in the 
emacs-23 branch in order to build on Nextstep.  The following patch does what's 
necessary.

=== modified file 'src/ChangeLog'
--- a/src/ChangeLog	2011-06-02 16:56:04 +0000
+++ b/src/ChangeLog	2011-06-12 01:05:36 +0000
@@ -1,3 +1,8 @@
+2011-06-11  Alp Aker  <alp.tekin.aker <at> gmail.com>
+
+	* nsmenu.m (ns_update_menubar, ns_menu_show): Replace uses of
+	XVECTOR with ASIZE and AREF.
+
 2011-06-02  Dan Nicolaescu  <dann <at> ics.uci.edu>
 
 	* emacs.c (main): Warn when starting a GTK emacs in daemon mode.

=== modified file 'src/nsmenu.m'
--- a/src/nsmenu.m	2011-01-02 23:50:46 +0000
+++ b/src/nsmenu.m	2011-06-12 00:33:14 +0000
@@ -219,7 +219,7 @@
 
       /* Save the frame's previous menu bar contents data */
       if (previous_menu_items_used)
-	bcopy (XVECTOR (f->menu_bar_vector)->contents, previous_items,
+	memcpy (previous_items, &AREF (f->menu_bar_vector, 0),
 	       previous_menu_items_used * sizeof (Lisp_Object));
 
       /* parse stage 1: extract from lisp */
@@ -227,19 +227,19 @@
 
       menu_items = f->menu_bar_vector;
       menu_items_allocated = VECTORP (menu_items) ? ASIZE (menu_items) : 0;
-      submenu_start = (int *) alloca (XVECTOR (items)->size * sizeof (int *));
-      submenu_end = (int *) alloca (XVECTOR (items)->size * sizeof (int *));
-      submenu_n_panes = (int *) alloca (XVECTOR (items)->size * sizeof (int));
+      submenu_start = (int *) alloca (ASIZE (items) * sizeof (int *));
+      submenu_end = (int *) alloca (ASIZE (items) * sizeof (int *));
+      submenu_n_panes = (int *) alloca (ASIZE (items) * sizeof (int));
       submenu_top_level_items
-	= (int *) alloca (XVECTOR (items)->size * sizeof (int *));
+	= (int *) alloca (ASIZE (items) * sizeof (int *));
       init_menu_items ();
-      for (i = 0; i < XVECTOR (items)->size; i += 4)
+      for (i = 0; i < ASIZE (items); i += 4)
 	{
 	  Lisp_Object key, string, maps;
 
-	  key = XVECTOR (items)->contents[i];
-	  string = XVECTOR (items)->contents[i + 1];
-	  maps = XVECTOR (items)->contents[i + 2];
+	  key = AREF (items, i);
+	  string = AREF (items, i + 1);
+	  maps = AREF (items, i + 2);
 	  if (NILP (string))
 	    break;
 
@@ -312,11 +312,11 @@
             /* FIXME: this ALWAYS fails on Buffers menu items.. something
                  about their strings causes them to change every time, so we
                  double-check failures */
-            if (!EQ (previous_items[i], XVECTOR (menu_items)->contents[i]))
+            if (!EQ (previous_items[i], AREF (menu_items, i)))
               if (!(STRINGP (previous_items[i])
-                    && STRINGP (XVECTOR (menu_items)->contents[i])
+                    && STRINGP (AREF (menu_items, i))
                     && !strcmp (SDATA (previous_items[i]),
-                               SDATA (XVECTOR (menu_items)->contents[i]))))
+				SDATA (AREF (menu_items, i)))))
                   break;
           if (i == previous_menu_items_used)
             {
@@ -347,10 +347,10 @@
       /* Parse stage 2a: now GC cannot happen during the lifetime of the
          widget_value, so it's safe to store data from a Lisp_String */
       wv = first_wv->contents;
-      for (i = 0; i < XVECTOR (items)->size; i += 4)
+      for (i = 0; i < ASIZE (items); i += 4)
 	{
 	  Lisp_Object string;
-	  string = XVECTOR (items)->contents[i + 1];
+	  string = AREF (items, i + 1);
 	  if (NILP (string))
 	    break;
 /*           if (submenu && strcmp (submenuTitle, SDATA (string)))
@@ -408,7 +408,7 @@
 
 
       /* check if no change.. this mechanism is a bit rough, but ready */
-      n = XVECTOR (items)->size / 4;
+      n = ASIZE (items) / 4;
       if (f == last_f && n_previous_strings == n)
         {
           for (i = 0; i<n; i++)
@@ -435,9 +435,9 @@
         }
 
       [menu clear];
-      for (i = 0; i < XVECTOR (items)->size; i += 4)
+      for (i = 0; i < ASIZE (items); i += 4)
 	{
-	  string = XVECTOR (items)->contents[i + 1];
+	  string = AREF (items, i + 1);
 	  if (NILP (string))
 	    break;
 
@@ -809,7 +809,7 @@
   i = 0;
   while (i < menu_items_used)
     {
-      if (EQ (XVECTOR (menu_items)->contents[i], Qnil))
+      if (EQ (AREF (menu_items, i), Qnil))
 	{
 	  submenu_stack[submenu_depth++] = save_wv;
 	  save_wv = prev_wv;
@@ -817,21 +817,21 @@
 	  first_pane = 1;
 	  i++;
 	}
-      else if (EQ (XVECTOR (menu_items)->contents[i], Qlambda))
+      else if (EQ (AREF (menu_items, i), Qlambda))
 	{
 	  prev_wv = save_wv;
 	  save_wv = submenu_stack[--submenu_depth];
 	  first_pane = 0;
 	  i++;
 	}
-      else if (EQ (XVECTOR (menu_items)->contents[i], Qt)
+      else if (EQ (AREF (menu_items, i), Qt)
 	       && submenu_depth != 0)
 	i += MENU_ITEMS_PANE_LENGTH;
       /* Ignore a nil in the item list.
 	 It's meaningful only for dialog boxes.  */
-      else if (EQ (XVECTOR (menu_items)->contents[i], Qquote))
+      else if (EQ (AREF (menu_items, i), Qquote))
 	i += 1;
-      else if (EQ (XVECTOR (menu_items)->contents[i], Qt))
+      else if (EQ (AREF (menu_items, i), Qt))
 	{
 	  /* Create a new pane.  */
 	  Lisp_Object pane_name, prefix;
@@ -921,7 +921,7 @@
 	     make the call_data null so that it won't display a box
 	     when the mouse is on it.  */
 	  wv->call_data
-	      = !NILP (def) ? (void *) &XVECTOR (menu_items)->contents[i] : 0;
+	      = !NILP (def) ? (void *) &AREF (menu_items, i) : 0;
 	  wv->enabled = !NILP (enable);
 
 	  if (NILP (type))






bug Marked as found in versions 23.3. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Sun, 12 Jun 2011 02:05:02 GMT) Full text and rfc822 format available.

bug Marked as fixed in versions 24.1. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Sun, 12 Jun 2011 02:05:02 GMT) Full text and rfc822 format available.

Reply sent to David Reitter <david.reitter <at> gmail.com>:
You have taken responsibility. (Thu, 16 Jun 2011 16:32:02 GMT) Full text and rfc822 format available.

Notification sent to Alp Aker <alp.tekin.aker <at> gmail.com>:
bug acknowledged by developer. (Thu, 16 Jun 2011 16:32:02 GMT) Full text and rfc822 format available.

Message #14 received at 8839-done <at> debbugs.gnu.org (full text, mbox):

From: David Reitter <david.reitter <at> gmail.com>
To: Alp Aker <alp.tekin.aker <at> gmail.com>
Cc: Emacs devel <emacs-devel <at> gnu.org>
Subject: Re: 23 branch NS build failure - XVECTOR->size / nsmenu
Date: Thu, 16 Jun 2011 12:31:29 -0400
On Jun 15, 2011, at 3:29 PM, Alp Aker wrote:
> 
> But wouldn't it be unfortunate to leave emacs-23 in a state in 
> which it won't even compile on NS?

I agree.  I have made the change (rev 100598).  Please try it out.





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 15 Jul 2011 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 13 years and 344 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.