# HG changeset patch # User Paul Eggert # Date 1295292276 28800 # Node ID 28ca83ef112823aac099b3aa3d5b2f76e8f6b035 # Parent f6578f2bd1194467a92499a111d3a0a6664b7ae8# Parent 4249a8552fafa3e218f25632d70d696f7c786674 Merge from mainline. diff -r f6578f2bd119 -r 28ca83ef1128 src/ChangeLog --- a/src/ChangeLog Mon Jan 17 11:20:37 2011 -0800 +++ b/src/ChangeLog Mon Jan 17 11:24:36 2011 -0800 @@ -33,6 +33,34 @@ ($(lib)/libgnu.a): New rule. (temacs$(EXEEXT)): Also link $(lib)/libgnu.a. + * xfns.c (x_real_positions): Fix signedness of local var 'ign'. + XGetGeometry wants unsigned int *, not int *, for its last 4 args, + so change the type of 'ign' to unsigned int from int. + + * regex.c (analyse_first): Remove unreachable 'continue' statement. + + * xterm.h (struct x_display_info): Remove stray semicolon. + The extra semicolon didn't conform to the C standard. + Problem reported by Sun cc. + + * lisp.h: Redo flags and XSET slightly to avoid overflow diagnostics. + These changes make compilation easier to follow with Sun cc. + (ARRAY_MARK_FLAG): Make it signed, so that it can be assigned to + EMACS_INT values without provoking overflow diagnostics. + (PSEUDOVECTOR_FLAG): Likewise, for consistency. + (XSET) [! USE_LSB_TAG]: Use unsigned left shift to avoid overflow + diagnostic with signed left shift. + + * fileio.c (make_temp_name): Remove unreachable code. + + * fontset.c (free_realized_fontset): Mark unreachable code with if (0). + Previously it was marked by preceding it with "return;", but + Sun cc complains about this. + + * coding.c (decode_coding_emacs_mule): Remove unreachable code. + This is a typo left over from revno 95090 dated 2009-03-06, + which fixed Bug#2370. Caught by Sun cc. + 2011-01-15 Martin Rudalics * window.c (inhibit_point_swap): New variable. diff -r f6578f2bd119 -r 28ca83ef1128 src/coding.c --- a/src/coding.c Mon Jan 17 11:20:37 2011 -0800 +++ b/src/coding.c Mon Jan 17 11:24:36 2011 -0800 @@ -2631,10 +2631,6 @@ } continue; - src = src_base; - consumed_chars = consumed_chars_base; - continue; - invalid_code: EMACS_MULE_MAYBE_FINISH_COMPOSITION (); src = src_base; @@ -10901,4 +10897,3 @@ } #endif /* emacs */ - diff -r f6578f2bd119 -r 28ca83ef1128 src/fileio.c --- a/src/fileio.c Mon Jan 17 11:20:37 2011 -0800 +++ b/src/fileio.c Mon Jan 17 11:24:36 2011 -0800 @@ -737,17 +737,13 @@ as bad as (and in many cases worse than) throwing the error, or to ignore the error, which will likely result in looping through 225307 stat's, which is not only - dog-slow, but also useless since it will fallback to - the errow below, anyway. */ + dog-slow, but also useless since eventually nil would + have to be returned anyway. */ report_file_error ("Cannot create temporary name for prefix", Fcons (prefix, Qnil)); /* not reached */ } } - - error ("Cannot create temporary name for prefix `%s'", - SDATA (prefix)); - return Qnil; } @@ -5229,7 +5225,7 @@ static Lisp_Object do_auto_save_unwind (Lisp_Object arg) /* used as unwind-protect function */ - + { FILE *stream = (FILE *) XSAVE_VALUE (arg)->pointer; auto_saving = 0; @@ -5244,7 +5240,7 @@ static Lisp_Object do_auto_save_unwind_1 (Lisp_Object value) /* used as unwind-protect function */ - + { minibuffer_auto_raise = XINT (value); return Qnil; @@ -5870,4 +5866,3 @@ defsubr (&Sunix_sync); #endif } - diff -r f6578f2bd119 -r 28ca83ef1128 src/fontset.c --- a/src/fontset.c Mon Jan 17 11:20:37 2011 -0800 +++ b/src/fontset.c Mon Jan 17 11:24:36 2011 -0800 @@ -849,12 +849,12 @@ { Lisp_Object tail; - return; - for (tail = FONTSET_OBJLIST (fontset); CONSP (tail); tail = XCDR (tail)) - { - xassert (FONT_OBJECT_P (XCAR (tail))); - font_close_object (f, XCAR (tail)); - } + if (0) + for (tail = FONTSET_OBJLIST (fontset); CONSP (tail); tail = XCDR (tail)) + { + xassert (FONT_OBJECT_P (XCAR (tail))); + font_close_object (f, XCAR (tail)); + } } /* Free fontset of FACE defined on frame F. Called from @@ -2263,4 +2263,3 @@ defsubr (&Sfontset_list_all); #endif } - diff -r f6578f2bd119 -r 28ca83ef1128 src/lisp.h --- a/src/lisp.h Mon Jan 17 11:20:37 2011 -0800 +++ b/src/lisp.h Mon Jan 17 11:24:36 2011 -0800 @@ -327,13 +327,14 @@ #define LISP_MAKE_RVALUE(o) (0+(o)) #endif /* USE_LISP_UNION_TYPE */ -/* In the size word of a vector, this bit means the vector has been marked. */ - -#define ARRAY_MARK_FLAG ((EMACS_UINT) 1 << (BITS_PER_EMACS_INT - 1)) +/* In the size word of a vector, this bit means the vector has been marked. + (Shift -1 left, not 1, to avoid provoking overflow diagnostics.) */ + +#define ARRAY_MARK_FLAG ((EMACS_INT) -1 << (BITS_PER_EMACS_INT - 1)) /* In the size word of a struct Lisp_Vector, this bit means it's really some other vector-like object. */ -#define PSEUDOVECTOR_FLAG ((ARRAY_MARK_FLAG >> 1)) +#define PSEUDOVECTOR_FLAG ((EMACS_INT) 1 << (BITS_PER_EMACS_INT - 2)) /* In a pseudovector, the size field actually contains a word with one PSEUDOVECTOR_FLAG bit set, and exactly one of the following bits to @@ -437,8 +438,9 @@ ((((EMACS_INT) (N)) & VALMASK) | ((EMACS_INT) Lisp_Int) << VALBITS) #endif -#define XSET(var, type, ptr) \ - ((var) = ((EMACS_INT)(type) << VALBITS) + ((EMACS_INT) (ptr) & VALMASK)) +#define XSET(var, type, ptr) \ + ((var) = ((EMACS_INT) ((EMACS_UINT) (type) << VALBITS) \ + + ((EMACS_INT) (ptr) & VALMASK))) #define XPNTR(a) ((EMACS_UINT) ((a) & VALMASK)) @@ -3671,4 +3673,3 @@ #endif /* EMACS_LISP_H */ - diff -r f6578f2bd119 -r 28ca83ef1128 src/regex.c --- a/src/regex.c Mon Jan 17 11:20:37 2011 -0800 +++ b/src/regex.c Mon Jan 17 11:24:36 2011 -0800 @@ -3997,7 +3997,6 @@ { case succeed: return 1; - continue; case duplicate: /* If the first character has to match a backreference, that means @@ -6733,4 +6732,3 @@ WEAK_ALIAS (__regfree, regfree) #endif /* not emacs */ - diff -r f6578f2bd119 -r 28ca83ef1128 src/xfns.c --- a/src/xfns.c Mon Jan 17 11:20:37 2011 -0800 +++ b/src/xfns.c Mon Jan 17 11:24:36 2011 -0800 @@ -626,7 +626,7 @@ if (rc == Success && actual_type == target_type && !x_had_errors_p (dpy) && actual_size == 4 && actual_format == 32) { - int ign; + unsigned int ign; Window rootw; long *fe = (long *)tmp_data; @@ -756,7 +756,7 @@ if (EQ (new_value, old_value)) return; #ifdef USE_GTK - if (xg_change_toolbar_position (f, new_value)) + if (xg_change_toolbar_position (f, new_value)) f->tool_bar_position = new_value; #endif } @@ -3510,7 +3510,7 @@ } BLOCK_INPUT; - + /* Set machine name and pid for the purpose of window managers. */ set_machine_and_pid_properties(f); @@ -5065,7 +5065,7 @@ #ifdef USE_GTK if (x_gtk_use_system_tooltips) { - int ok; + int ok; /* Hide a previous tip, if any. */ Fx_hide_tip (); @@ -6101,4 +6101,3 @@ } #endif /* HAVE_X_WINDOWS */ - diff -r f6578f2bd119 -r 28ca83ef1128 src/xterm.h --- a/src/xterm.h Mon Jan 17 11:20:37 2011 -0800 +++ b/src/xterm.h Mon Jan 17 11:24:36 2011 -0800 @@ -270,8 +270,8 @@ Atom Xatom_Scrollbar; /* Atom used in XEmbed client messages. */ - Atom Xatom_XEMBED, Xatom_XEMBED_INFO;; - + Atom Xatom_XEMBED, Xatom_XEMBED_INFO; + /* The frame (if any) which has the X window that has keyboard focus. Zero if none. This is examined by Ffocus_frame in xfns.c. Note that a mere EnterNotify event can set this; if you need to know the @@ -1112,4 +1112,3 @@ (nr).y = (ry), \ (nr).width = (rwidth), \ (nr).height = (rheight)) -