emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r110607: Port to OpenBSD 5.1.


From: Paul Eggert
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r110607: Port to OpenBSD 5.1.
Date: Sat, 20 Oct 2012 14:30:51 -0700
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 110607
committer: Paul Eggert <address@hidden>
branch nick: trunk
timestamp: Sat 2012-10-20 14:30:51 -0700
message:
  Port to OpenBSD 5.1.
  
  * frame.c (Fmouse_position, Fmouse_pixel_position):
  * xdisp.c (produce_stretch_glyph):
  Declare local vars only when they're needed.
  This is clearer and avoids a warning on OpenBSD about unused vars.
  * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
  This is safer, and avoids OpenBSD warnings about unused vars.
  * keyboard.c (record_menu_key): Remove unnecessary decl.
  (poll_timer): Define only if POLL_FOR_INPUT is defined.
  * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
  as our definition clashes with OpenBSD's.
  * xfaces.c (load_face_colors, check_lface_attrs)
  (get_lface_attributes_no_remap, get_lface_attributes)
  (lface_fully_specified_p, x_supports_face_attributes_p)
  (tty_supports_face_attributes_p, face_fontset, realize_face)
  (realize_x_face, realize_tty_face):
  Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
  merely Lisp_Object *.  This is more informative and avoids
  a warning on OpenBSD about accessing beyond an object's size.
modified:
  src/ChangeLog
  src/frame.c
  src/frame.h
  src/keyboard.c
  src/unexelf.c
  src/xdisp.c
  src/xfaces.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-10-20 12:50:49 +0000
+++ b/src/ChangeLog     2012-10-20 21:30:51 +0000
@@ -1,3 +1,25 @@
+2012-10-20  Paul Eggert  <address@hidden>
+
+       Port to OpenBSD 5.1.
+       * frame.c (Fmouse_position, Fmouse_pixel_position):
+       * xdisp.c (produce_stretch_glyph):
+       Declare local vars only when they're needed.
+       This is clearer and avoids a warning on OpenBSD about unused vars.
+       * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
+       This is safer, and avoids OpenBSD warnings about unused vars.
+       * keyboard.c (record_menu_key): Remove unnecessary decl.
+       (poll_timer): Define only if POLL_FOR_INPUT is defined.
+       * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
+       as our definition clashes with OpenBSD's.
+       * xfaces.c (load_face_colors, check_lface_attrs)
+       (get_lface_attributes_no_remap, get_lface_attributes)
+       (lface_fully_specified_p, x_supports_face_attributes_p)
+       (tty_supports_face_attributes_p, face_fontset, realize_face)
+       (realize_x_face, realize_tty_face):
+       Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
+       merely Lisp_Object *.  This is more informative and avoids
+       a warning on OpenBSD about accessing beyond an object's size.
+
 2012-10-20  Chong Yidong  <address@hidden>
 
        * lread.c (Fload): Doc fix (Bug#12592).

=== modified file 'src/frame.c'
--- a/src/frame.c       2012-10-09 17:58:18 +0000
+++ b/src/frame.c       2012-10-20 21:30:51 +0000
@@ -1501,10 +1501,7 @@
 {
   FRAME_PTR f;
   Lisp_Object lispy_dummy;
-  enum scroll_bar_part party_dummy;
   Lisp_Object x, y, retval;
-  int col, row;
-  Time long_dummy;
   struct gcpro gcpro1;
 
   f = SELECTED_FRAME ();
@@ -1513,14 +1510,19 @@
 #if defined (HAVE_MOUSE) || defined (HAVE_GPM)
   /* It's okay for the hook to refrain from storing anything.  */
   if (FRAME_TERMINAL (f)->mouse_position_hook)
-    (*FRAME_TERMINAL (f)->mouse_position_hook) (&f, -1,
-                                                &lispy_dummy, &party_dummy,
-                                                &x, &y,
-                                                &long_dummy);
+    {
+      enum scroll_bar_part party_dummy;
+      Time time_dummy;
+      (*FRAME_TERMINAL (f)->mouse_position_hook) (&f, -1,
+                                                 &lispy_dummy, &party_dummy,
+                                                 &x, &y,
+                                                 &time_dummy);
+    }
+
   if (! NILP (x))
     {
-      col = XINT (x);
-      row = XINT (y);
+      int col = XINT (x);
+      int row = XINT (y);
       pixel_to_glyph_coords (f, col, row, &col, &row, NULL, 1);
       XSETINT (x, col);
       XSETINT (y, row);
@@ -1547,9 +1549,7 @@
 {
   FRAME_PTR f;
   Lisp_Object lispy_dummy;
-  enum scroll_bar_part party_dummy;
   Lisp_Object x, y;
-  Time long_dummy;
 
   f = SELECTED_FRAME ();
   x = y = Qnil;
@@ -1557,10 +1557,15 @@
 #if defined (HAVE_MOUSE) || defined (HAVE_GPM)
   /* It's okay for the hook to refrain from storing anything.  */
   if (FRAME_TERMINAL (f)->mouse_position_hook)
-    (*FRAME_TERMINAL (f)->mouse_position_hook) (&f, -1,
-                                                &lispy_dummy, &party_dummy,
-                                                &x, &y,
-                                                &long_dummy);
+    {
+      enum scroll_bar_part party_dummy;
+      Time time_dummy;
+      (*FRAME_TERMINAL (f)->mouse_position_hook) (&f, -1,
+                                                 &lispy_dummy, &party_dummy,
+                                                 &x, &y,
+                                                 &time_dummy);
+    }
+
 #endif
   XSETFRAME (lispy_dummy, f);
   return Fcons (lispy_dummy, Fcons (x, y));

=== modified file 'src/frame.h'
--- a/src/frame.h       2012-10-07 22:31:58 +0000
+++ b/src/frame.h       2012-10-20 21:30:51 +0000
@@ -646,7 +646,7 @@
 #define FRAME_WINDOW_P(f) FRAME_NS_P(f)
 #endif
 #ifndef FRAME_WINDOW_P
-#define FRAME_WINDOW_P(f) (0)
+#define FRAME_WINDOW_P(f) ((void) (f), 0)
 #endif
 
 /* Return a pointer to the structure holding information about the

=== modified file 'src/keyboard.c'
--- a/src/keyboard.c    2012-10-10 20:09:47 +0000
+++ b/src/keyboard.c    2012-10-20 21:30:51 +0000
@@ -365,7 +365,6 @@
 static Lisp_Object Qextended_command_history;
 EMACS_TIME timer_check (void);
 
-static void record_menu_key (Lisp_Object c);
 static void echo_now (void);
 static ptrdiff_t echo_length (void);
 
@@ -1963,13 +1962,13 @@
 
 int poll_suppress_count;
 
+
+#ifdef POLL_FOR_INPUT
+
 /* Asynchronous timer for polling.  */
 
 static struct atimer *poll_timer;
 
-
-#ifdef POLL_FOR_INPUT
-
 /* Poll for input, so that we catch a C-g if it comes in.  This
    function is called from x_make_frame_visible, see comment
    there.  */

=== modified file 'src/unexelf.c'
--- a/src/unexelf.c     2012-05-21 15:36:54 +0000
+++ b/src/unexelf.c     2012-10-20 21:30:51 +0000
@@ -507,10 +507,12 @@
 
 #ifndef ElfW
 # define ElfBitsW(bits, type) Elf##bits##_##type
-# ifdef _LP64
-#  define ELFSIZE 64
-# else
-#  define ELFSIZE 32
+# ifndef ELFSIZE
+#  ifdef _LP64
+#   define ELFSIZE 64
+#  else
+#   define ELFSIZE 32
+#  endif
 # endif
   /* This macro expands `bits' before invoking ElfBitsW.  */
 # define ElfExpandBitsW(bits, type) ElfBitsW (bits, type)

=== modified file 'src/xdisp.c'
--- a/src/xdisp.c       2012-10-17 13:30:56 +0000
+++ b/src/xdisp.c       2012-10-20 21:30:51 +0000
@@ -24076,17 +24076,16 @@
   Lisp_Object prop, plist;
   int width = 0, height = 0, align_to = -1;
   int zero_width_ok_p = 0;
-  int ascent = 0;
   double tem;
-  struct face *face = NULL;
   struct font *font = NULL;
 
 #ifdef HAVE_WINDOW_SYSTEM
+  int ascent = 0;
   int zero_height_ok_p = 0;
 
   if (FRAME_WINDOW_P (it->f))
     {
-      face = FACE_FROM_ID (it->f, it->face_id);
+      struct face *face = FACE_FROM_ID (it->f, it->face_id);
       font = face->font ? face->font : FRAME_FONT (it->f);
       PREPARE_FACE_FOR_DISPLAY (it->f, face);
     }

=== modified file 'src/xfaces.c'
--- a/src/xfaces.c      2012-10-07 22:31:58 +0000
+++ b/src/xfaces.c      2012-10-20 21:30:51 +0000
@@ -1323,7 +1323,8 @@
    try to emulate gray colors with a stipple from Vface_default_stipple.  */
 
 static void
-load_face_colors (struct frame *f, struct face *face, Lisp_Object *attrs)
+load_face_colors (struct frame *f, struct face *face,
+                 Lisp_Object attrs[LFACE_VECTOR_SIZE])
 {
   Lisp_Object fg, bg;
 
@@ -1802,7 +1803,7 @@
 /* Check consistency of Lisp face attribute vector ATTRS.  */
 
 static void
-check_lface_attrs (Lisp_Object *attrs)
+check_lface_attrs (Lisp_Object attrs[LFACE_VECTOR_SIZE])
 {
   eassert (UNSPECIFIEDP (attrs[LFACE_FAMILY_INDEX])
           || IGNORE_DEFFACE_P (attrs[LFACE_FAMILY_INDEX])
@@ -2049,7 +2050,8 @@
 
 static int
 get_lface_attributes_no_remap (struct frame *f, Lisp_Object face_name,
-                              Lisp_Object *attrs, int signal_p)
+                              Lisp_Object attrs[LFACE_VECTOR_SIZE],
+                              int signal_p)
 {
   Lisp_Object lface;
 
@@ -2071,7 +2073,7 @@
 
 static int
 get_lface_attributes (struct frame *f, Lisp_Object face_name,
-                     Lisp_Object *attrs, int signal_p,
+                     Lisp_Object attrs[LFACE_VECTOR_SIZE], int signal_p,
                      struct named_merge_point *named_merge_points)
 {
   Lisp_Object face_remapping;
@@ -2108,7 +2110,7 @@
    specified, i.e. are non-nil.  */
 
 static int
-lface_fully_specified_p (Lisp_Object *attrs)
+lface_fully_specified_p (Lisp_Object attrs[LFACE_VECTOR_SIZE])
 {
   int i;
 
@@ -4760,7 +4762,8 @@
     \(2) `close in spirit' to what the attributes specify, if not exact.  */
 
 static int
-x_supports_face_attributes_p (struct frame *f, Lisp_Object *attrs,
+x_supports_face_attributes_p (struct frame *f,
+                             Lisp_Object attrs[LFACE_VECTOR_SIZE],
                              struct face *def_face)
 {
   Lisp_Object *def_attrs = def_face->lface;
@@ -4862,7 +4865,8 @@
    substitution of a `dim' face for italic.  */
 
 static int
-tty_supports_face_attributes_p (struct frame *f, Lisp_Object *attrs,
+tty_supports_face_attributes_p (struct frame *f,
+                               Lisp_Object attrs[LFACE_VECTOR_SIZE],
                                struct face *def_face)
 {
   int weight, slant;
@@ -5245,7 +5249,7 @@
    attribute of ATTRS doesn't name a fontset.  */
 
 static int
-face_fontset (Lisp_Object *attrs)
+face_fontset (Lisp_Object attrs[LFACE_VECTOR_SIZE])
 {
   Lisp_Object name;
 
@@ -5474,7 +5478,8 @@
    face.  Value is a pointer to the newly created realized face.  */
 
 static struct face *
-realize_face (struct face_cache *cache, Lisp_Object *attrs, int former_face_id)
+realize_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE],
+             int former_face_id)
 {
   struct face *face;
 
@@ -5551,7 +5556,7 @@
    created realized face.  */
 
 static struct face *
-realize_x_face (struct face_cache *cache, Lisp_Object *attrs)
+realize_x_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE])
 {
   struct face *face = NULL;
 #ifdef HAVE_WINDOW_SYSTEM
@@ -5878,7 +5883,8 @@
    Value is a pointer to the newly created realized face.  */
 
 static struct face *
-realize_tty_face (struct face_cache *cache, Lisp_Object *attrs)
+realize_tty_face (struct face_cache *cache,
+                 Lisp_Object attrs[LFACE_VECTOR_SIZE])
 {
   struct face *face;
   int weight, slant;


reply via email to

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