Commit f2ed8a70 authored by Paul Eggert's avatar Paul Eggert

* lisp.h (lint_assume): New macro.

* composite.c (composition_gstring_put_cache):
* ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
parent e1528d01
2011-06-18 Paul Eggert <eggert@cs.ucla.edu>
* lisp.h (lint_assume): New macro.
* composite.c (composition_gstring_put_cache):
* ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
* editfns.c: Omit unnecessary forward decls, to simplify future changes.
* ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
......
......@@ -680,6 +680,7 @@ composition_gstring_put_cache (Lisp_Object gstring, EMACS_INT len)
len = j;
}
lint_assume (len <= TYPE_MAXIMUM (EMACS_INT) - 2);
copy = Fmake_vector (make_number (len + 2), Qnil);
LGSTRING_SET_HEADER (copy, Fcopy_sequence (header));
for (i = 0; i < len; i++)
......
......@@ -2412,7 +2412,10 @@ ftfont_shape_by_flt (Lisp_Object lgstring, struct font *font,
if (CHAR_VARIATION_SELECTOR_P (c))
with_variation_selector++;
}
len = i;
lint_assume (len <= TYPE_MAXIMUM (EMACS_INT) - 2);
if (with_variation_selector)
{
setup_otf_gstring (len);
......
......@@ -3608,11 +3608,19 @@ extern void init_system_name (void);
? 0 \
: (wrong_type_argument (Qlistp, (list))), 1))
/* Use this to suppress gcc's `...may be used before initialized' warnings. */
/* Use this to suppress gcc's warnings. */
#ifdef lint
/* Use CODE only if lint checking is in effect. */
# define IF_LINT(Code) Code
/* Assume that the expression COND is true. This differs in intent
from 'assert', as it is a message from the programmer to the compiler. */
# define lint_assume(cond) ((cond) ? (void) 0 : abort ())
#else
# define IF_LINT(Code) /* empty */
# define lint_assume(cond) ((void) (0 && (cond)))
#endif
/* The ubiquitous min and max macros. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment