diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 47 | ||||
| -rw-r--r-- | src/eval.c | 2 | ||||
| -rw-r--r-- | src/keyboard.c | 3 | ||||
| -rw-r--r-- | src/nsfont.m | 5 | ||||
| -rw-r--r-- | src/nsterm.m | 7 | ||||
| -rw-r--r-- | src/xdisp.c | 46 |
6 files changed, 72 insertions, 38 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 24161dbda1e..c7d14843bcd 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,7 @@ 2011-04-05 Paul Eggert <eggert@cs.ucla.edu> + Fix more problems found by GCC 4.6.0's static checks. + * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int. This avoids several warnings with gcc -Wstrict-overflow. (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code @@ -14,8 +16,6 @@ * composite.c (composition_gstring_put_cache): Use unsigned integer. -2011-04-04 Paul Eggert <eggert@cs.ucla.edu> - * composite.h, composite.c (composition_gstring_put_cache): Use EMACS_INT, not int, for length. @@ -53,8 +53,6 @@ * font.c (font_list_entities): Redo for clarity, so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX. -2011-04-03 Paul Eggert <eggert@cs.ucla.edu> - * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars. (font_score): Avoid potential overflow in diff calculation. @@ -79,8 +77,6 @@ * fileio.c (Finsert_file_contents): Make EOF condition clearer. -2011-04-02 Paul Eggert <eggert@cs.ucla.edu> - * fileio.c (Finsert_file_contents): Avoid signed integer overflow. (Finsert_file_contents): Remove unnecessary code checking fd. @@ -109,8 +105,6 @@ * xselect.c (x_get_local_selection, x_handle_property_notify): Remove vars that are set but not used. -2011-04-01 Paul Eggert <eggert@cs.ucla.edu> - * xfns.c (x_create_tip_frame): Remove var that is set but not used. (make_invisible_cursor): Initialize a possibly-uninitialized variable. @@ -149,6 +143,43 @@ * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on ../lib/careadlinkat.h. +2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca> + + * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the + first non-nil return value). + +2011-04-03 Jan Djärv <jan.h.d@swipnet.se> + + * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6 + if not defined (Bug#8403). + +2011-04-02 Juanma Barranquero <lekktu@gmail.com> + + * xdisp.c (display_count_lines): Remove parameter `start', + unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed. + (get_char_face_and_encoding): Remove parameter `multibyte_p', + unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed. + (fill_stretch_glyph_string): Remove parameters `row' and `area', + unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk + and thereabouts. All callers changed. + (get_per_char_metric): Remove parameter `f', unused since + 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed. + +2011-04-02 Jim Meyering <meyering@redhat.com> + + do not dereference NULL upon failed strdup + * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup. + (ns_get_family): Likewise. + +2011-04-02 Juanma Barranquero <lekktu@gmail.com> + + * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment. + +2011-04-02 Jan Djärv <jan.h.d@swipnet.se> + + * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or + later (Bug#8403). + 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca> Add lexical binding. diff --git a/src/eval.c b/src/eval.c index 25afe7677f7..d1a63a76767 100644 --- a/src/eval.c +++ b/src/eval.c @@ -1297,7 +1297,7 @@ unwind_to_catch (struct catchtag *catch, Lisp_Object value) byte_stack_list = catch->byte_stack; gcprolist = catch->gcpro; #ifdef DEBUG_GCPRO - gcpro_level = gcprolist ? gcprolist->level + 1 : gcpro_level = 0; + gcpro_level = gcprolist ? gcprolist->level + 1 : 0; #endif backtrace_list = catch->backlist; lisp_eval_depth = catch->lisp_eval_depth; diff --git a/src/keyboard.c b/src/keyboard.c index f38c1c88a7e..ae4fddb2c89 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -1870,7 +1870,8 @@ safe_run_hook_funcall (size_t nargs, Lisp_Object *args) else Vinhibit_quit = Fcons (Vinhibit_quit, args[0]); - return internal_condition_case (safe_run_hooks_1, Qt, safe_run_hooks_error); + internal_condition_case (safe_run_hooks_1, Qt, safe_run_hooks_error); + return Qnil; } /* If we get an error while running the hook, cause the hook variable diff --git a/src/nsfont.m b/src/nsfont.m index 68cd19da70e..48d40223553 100644 --- a/src/nsfont.m +++ b/src/nsfont.m @@ -100,7 +100,7 @@ ns_get_family (Lisp_Object font_spec) return nil; else { - char *tmp = strdup (SDATA (SYMBOL_NAME (tem))); + char *tmp = xstrdup (SDATA (SYMBOL_NAME (tem))); NSString *family; ns_unescape_name (tmp); family = [NSString stringWithUTF8String: tmp]; @@ -176,7 +176,7 @@ ns_descriptor_to_entity (NSFontDescriptor *desc, if (family == nil) family = [[NSFont userFixedPitchFontOfSize: 0] familyName]; - escapedFamily = strdup ([family UTF8String]); + escapedFamily = xstrdup ([family UTF8String]); ns_escape_name (escapedFamily); ASET (font_entity, FONT_TYPE_INDEX, Qns); @@ -1526,4 +1526,3 @@ syms_of_nsfont (void) DEFVAR_LISP ("ns-reg-to-script", Vns_reg_to_script, doc: /* Internal use: maps font registry to unicode script. */); } - diff --git a/src/nsterm.m b/src/nsterm.m index 91f0cbba585..c4756dc83cd 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -583,6 +583,11 @@ ns_menu_bar_should_be_hidden (void) static void ns_update_auto_hide_menu_bar (void) { +#ifndef MAC_OS_X_VERSION_10_6 +#define MAC_OS_X_VERSION_10_6 1060 +#endif +#ifdef NS_IMPL_COCOA +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 BLOCK_INPUT; NSTRACE (ns_update_auto_hide_menu_bar); @@ -615,6 +620,8 @@ ns_update_auto_hide_menu_bar (void) } UNBLOCK_INPUT; +#endif +#endif } diff --git a/src/xdisp.c b/src/xdisp.c index 3c9d38536bb..e6a7f4254ef 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -824,8 +824,7 @@ static int display_mode_element (struct it *, int, int, int, Lisp_Object, Lisp_O static int store_mode_line_string (const char *, Lisp_Object, int, int, int, Lisp_Object); static const char *decode_mode_spec (struct window *, int, int, Lisp_Object *); static void display_menu_bar (struct window *); -static int display_count_lines (EMACS_INT, EMACS_INT, EMACS_INT, int, - EMACS_INT *); +static int display_count_lines (EMACS_INT, EMACS_INT, int, EMACS_INT *); static int display_string (const char *, Lisp_Object, Lisp_Object, EMACS_INT, EMACS_INT, struct it *, int, int, int, int); static void compute_line_metrics (struct it *); @@ -19481,7 +19480,7 @@ decode_mode_spec (struct window *w, register int c, int field_width, } /* Count lines from base line to window start position. */ - nlines = display_count_lines (linepos, linepos_byte, + nlines = display_count_lines (linepos_byte, startpos_byte, startpos, &junk); @@ -19510,7 +19509,7 @@ decode_mode_spec (struct window *w, register int c, int field_width, limit_byte = CHAR_TO_BYTE (limit); } - nlines = display_count_lines (startpos, startpos_byte, + nlines = display_count_lines (startpos_byte, limit_byte, - (height * 2 + 30), &position); @@ -19529,7 +19528,7 @@ decode_mode_spec (struct window *w, register int c, int field_width, } /* Now count lines from the start pos to point. */ - nlines = display_count_lines (startpos, startpos_byte, + nlines = display_count_lines (startpos_byte, PT_BYTE, PT, &junk); /* Record that we did display the line number. */ @@ -19699,14 +19698,14 @@ decode_mode_spec (struct window *w, register int c, int field_width, } -/* Count up to COUNT lines starting from START / START_BYTE. +/* Count up to COUNT lines starting from START_BYTE. But don't go beyond LIMIT_BYTE. Return the number of lines thus found (always nonnegative). Set *BYTE_POS_PTR to 1 if we found COUNT lines, 0 if we hit LIMIT. */ static int -display_count_lines (EMACS_INT start, EMACS_INT start_byte, +display_count_lines (EMACS_INT start_byte, EMACS_INT limit_byte, int count, EMACS_INT *byte_pos_ptr) { @@ -20470,16 +20469,15 @@ append_glyph_string (struct glyph_string **head, struct glyph_string **tail, } -/* Get face and two-byte form of character C in face FACE_ID on frame - F. The encoding of C is returned in *CHAR2B. MULTIBYTE_P non-zero - means we want to display multibyte text. DISPLAY_P non-zero means +/* Get face and two-byte form of character C in face FACE_ID on frame F. + The encoding of C is returned in *CHAR2B. DISPLAY_P non-zero means make sure that X resources for the face returned are allocated. Value is a pointer to a realized face that is ready for display if DISPLAY_P is non-zero. */ static INLINE struct face * get_char_face_and_encoding (struct frame *f, int c, int face_id, - XChar2b *char2b, int multibyte_p, int display_p) + XChar2b *char2b, int display_p) { struct face *face = FACE_FROM_ID (f, face_id); @@ -20599,7 +20597,7 @@ fill_composite_glyph_string (struct glyph_string *s, struct face *base_face, -1, Qnil); face = get_char_face_and_encoding (s->f, c, face_id, - s->char2b + i, 1, 1); + s->char2b + i, 1); if (face) { if (! s->face) @@ -20798,15 +20796,13 @@ fill_image_glyph_string (struct glyph_string *s) /* Fill glyph string S from a sequence of stretch glyphs. - ROW is the glyph row in which the glyphs are found, AREA is the - area within the row. START is the index of the first glyph to - consider, END is the index of the last + 1. + START is the index of the first glyph to consider, + END is the index of the last + 1. Value is the index of the first glyph not in S. */ static int -fill_stretch_glyph_string (struct glyph_string *s, struct glyph_row *row, - enum glyph_row_area area, int start, int end) +fill_stretch_glyph_string (struct glyph_string *s, int start, int end) { struct glyph *glyph, *last; int voffset, face_id; @@ -20840,7 +20836,7 @@ fill_stretch_glyph_string (struct glyph_string *s, struct glyph_row *row, } static struct font_metrics * -get_per_char_metric (struct frame *f, struct font *font, XChar2b *char2b) +get_per_char_metric (struct font *font, XChar2b *char2b) { static struct font_metrics metrics; unsigned code = (XCHAR2B_BYTE1 (char2b) << 8) | XCHAR2B_BYTE2 (char2b); @@ -20868,7 +20864,7 @@ x_get_glyph_overhangs (struct glyph *glyph, struct frame *f, int *left, int *rig struct font_metrics *pcm; face = get_glyph_face_and_encoding (f, glyph, &char2b, NULL); - if (face->font && (pcm = get_per_char_metric (f, face->font, &char2b))) + if (face->font && (pcm = get_per_char_metric (face->font, &char2b))) { if (pcm->rbearing > pcm->width) *right = pcm->rbearing - pcm->width; @@ -21102,7 +21098,7 @@ compute_overhangs_and_x (struct glyph_string *s, int x, int backward_p) { \ s = (struct glyph_string *) alloca (sizeof *s); \ INIT_GLYPH_STRING (s, NULL, w, row, area, START, HL); \ - START = fill_stretch_glyph_string (s, row, area, START, END); \ + START = fill_stretch_glyph_string (s, START, END); \ append_glyph_string (&HEAD, &TAIL, s); \ s->x = (X); \ } \ @@ -22475,7 +22471,7 @@ x_produce_glyphs (struct it *it) if (get_char_glyph_code (it->char_to_display, font, &char2b)) { - pcm = get_per_char_metric (it->f, font, &char2b); + pcm = get_per_char_metric (font, &char2b); if (pcm->width == 0 && pcm->rbearing == 0 && pcm->lbearing == 0) pcm = NULL; @@ -22777,8 +22773,8 @@ x_produce_glyphs (struct it *it) if (! font_not_found_p) { get_char_face_and_encoding (it->f, c, it->face_id, - &char2b, it->multibyte_p, 0); - pcm = get_per_char_metric (it->f, font, &char2b); + &char2b, 0); + pcm = get_per_char_metric (font, &char2b); } /* Initialize the bounding box. */ @@ -22838,8 +22834,8 @@ x_produce_glyphs (struct it *it) else { get_char_face_and_encoding (it->f, ch, face_id, - &char2b, it->multibyte_p, 0); - pcm = get_per_char_metric (it->f, font, &char2b); + &char2b, 0); + pcm = get_per_char_metric (font, &char2b); } if (! pcm) cmp->offsets[i * 2] = cmp->offsets[i * 2 + 1] = 0; |
