+2012-10-20 Paul Eggert <eggert@cs.ucla.edu>
+
+ 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 <cyd@gnu.org>
* lread.c (Fload): Doc fix (Bug#12592).
{
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 ();
#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);
{
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;
#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));
#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
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);
int poll_suppress_count;
-/* Asynchronous timer for polling. */
-static struct atimer *poll_timer;
+#ifdef POLL_FOR_INPUT
+/* Asynchronous timer for polling. */
-#ifdef POLL_FOR_INPUT
+static struct atimer *poll_timer;
/* 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
#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)
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);
}
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;
/* 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])
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;
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;
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;
\(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;
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;
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;
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;
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
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;