aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog4
-rw-r--r--src/composite.c1
-rw-r--r--src/ftfont.c3
-rw-r--r--src/lisp.h10
4 files changed, 17 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index b0a461fb108..62d6a5b4a04 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,9 @@
12011-06-18 Paul Eggert <eggert@cs.ucla.edu> 12011-06-18 Paul Eggert <eggert@cs.ucla.edu>
2 2
3 * lisp.h (lint_assume): New macro.
4 * composite.c (composition_gstring_put_cache):
5 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
6
3 * editfns.c: Omit unnecessary forward decls, to simplify future changes. 7 * editfns.c: Omit unnecessary forward decls, to simplify future changes.
4 8
5 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths. 9 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
diff --git a/src/composite.c b/src/composite.c
index 1bc7b435e11..f494f454a9c 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -680,6 +680,7 @@ composition_gstring_put_cache (Lisp_Object gstring, EMACS_INT len)
680 len = j; 680 len = j;
681 } 681 }
682 682
683 lint_assume (len <= TYPE_MAXIMUM (EMACS_INT) - 2);
683 copy = Fmake_vector (make_number (len + 2), Qnil); 684 copy = Fmake_vector (make_number (len + 2), Qnil);
684 LGSTRING_SET_HEADER (copy, Fcopy_sequence (header)); 685 LGSTRING_SET_HEADER (copy, Fcopy_sequence (header));
685 for (i = 0; i < len; i++) 686 for (i = 0; i < len; i++)
diff --git a/src/ftfont.c b/src/ftfont.c
index d1effaa88a9..4e313a89021 100644
--- a/src/ftfont.c
+++ b/src/ftfont.c
@@ -2412,7 +2412,10 @@ ftfont_shape_by_flt (Lisp_Object lgstring, struct font *font,
2412 if (CHAR_VARIATION_SELECTOR_P (c)) 2412 if (CHAR_VARIATION_SELECTOR_P (c))
2413 with_variation_selector++; 2413 with_variation_selector++;
2414 } 2414 }
2415
2415 len = i; 2416 len = i;
2417 lint_assume (len <= TYPE_MAXIMUM (EMACS_INT) - 2);
2418
2416 if (with_variation_selector) 2419 if (with_variation_selector)
2417 { 2420 {
2418 setup_otf_gstring (len); 2421 setup_otf_gstring (len);
diff --git a/src/lisp.h b/src/lisp.h
index 1e3036344f5..0d51fc7be71 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -3608,11 +3608,19 @@ extern void init_system_name (void);
3608 ? 0 \ 3608 ? 0 \
3609 : (wrong_type_argument (Qlistp, (list))), 1)) 3609 : (wrong_type_argument (Qlistp, (list))), 1))
3610 3610
3611/* Use this to suppress gcc's `...may be used before initialized' warnings. */ 3611/* Use this to suppress gcc's warnings. */
3612#ifdef lint 3612#ifdef lint
3613
3614/* Use CODE only if lint checking is in effect. */
3613# define IF_LINT(Code) Code 3615# define IF_LINT(Code) Code
3616
3617/* Assume that the expression COND is true. This differs in intent
3618 from 'assert', as it is a message from the programmer to the compiler. */
3619# define lint_assume(cond) ((cond) ? (void) 0 : abort ())
3620
3614#else 3621#else
3615# define IF_LINT(Code) /* empty */ 3622# define IF_LINT(Code) /* empty */
3623# define lint_assume(cond) ((void) (0 && (cond)))
3616#endif 3624#endif
3617 3625
3618/* The ubiquitous min and max macros. */ 3626/* The ubiquitous min and max macros. */