diff options
| author | Paul Eggert | 2012-07-07 12:23:41 -0700 |
|---|---|---|
| committer | Paul Eggert | 2012-07-07 12:23:41 -0700 |
| commit | 6045c4fdb88ee6bd84afcaac4a0b7e8a96f23050 (patch) | |
| tree | 86959a892e16b2947b794a6ad993f0090387fab3 /src/frame.c | |
| parent | 41f9404e0cb421fcea07538bbd686d54200ed92d (diff) | |
| download | emacs-6045c4fdb88ee6bd84afcaac4a0b7e8a96f23050.tar.gz emacs-6045c4fdb88ee6bd84afcaac4a0b7e8a96f23050.zip | |
Improve static checking when configured --with-ns.
See Samuel Bronson's remarks in
<http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00146.html>.
* configure.in (WARN_CFLAGS): Omit -Wunreachable-code, as it's
a no-op with recent GCC and harmful in earlier ones.
Omit -Wsync-nand, as it's irrelevant to Emacs and provokes a
warning when compiling with ObjC. Always omit
-Wunsafe-loop-optimizations, as we don't mind when optimization is
being done correctly.
Fix some minor --with-ns problems found by static checking.
* src/frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
(x_set_font) [!HAVE_X_WINDOWS]:
* src/image.c (xpm_load_image) [HAVE_NS]:
(x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
(x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
Remove unused local.
(Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
(xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
* src/image.c (x_create_bitmap_from_file) [HAVE_NS]:
(xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
* src/nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
* src/xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
Fix pointer signedness problem.
* src/xfaces.c (FRAME_X_FONT_TABLE):
* src/xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
Diffstat (limited to 'src/frame.c')
| -rw-r--r-- | src/frame.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/frame.c b/src/frame.c index 8db943bd0a5..c0293f6c869 100644 --- a/src/frame.c +++ b/src/frame.c | |||
| @@ -2504,16 +2504,13 @@ or right side of FRAME. If FRAME is omitted, the selected frame is | |||
| 2504 | used. */) | 2504 | used. */) |
| 2505 | (Lisp_Object frame) | 2505 | (Lisp_Object frame) |
| 2506 | { | 2506 | { |
| 2507 | struct frame *f; | ||
| 2508 | |||
| 2509 | if (NILP (frame)) | 2507 | if (NILP (frame)) |
| 2510 | frame = selected_frame; | 2508 | frame = selected_frame; |
| 2511 | CHECK_FRAME (frame); | 2509 | CHECK_FRAME (frame); |
| 2512 | f = XFRAME (frame); | ||
| 2513 | 2510 | ||
| 2514 | #ifdef FRAME_TOOLBAR_WIDTH | 2511 | #ifdef FRAME_TOOLBAR_WIDTH |
| 2515 | if (FRAME_WINDOW_P (f)) | 2512 | if (FRAME_WINDOW_P (XFRAME (frame))) |
| 2516 | return make_number (FRAME_TOOLBAR_WIDTH (f)); | 2513 | return make_number (FRAME_TOOLBAR_WIDTH (XFRAME (frame))); |
| 2517 | #endif | 2514 | #endif |
| 2518 | return make_number (0); | 2515 | return make_number (0); |
| 2519 | } | 2516 | } |
| @@ -3158,8 +3155,11 @@ x_set_screen_gamma (struct frame *f, Lisp_Object new_value, Lisp_Object old_valu | |||
| 3158 | void | 3155 | void |
| 3159 | x_set_font (struct frame *f, Lisp_Object arg, Lisp_Object oldval) | 3156 | x_set_font (struct frame *f, Lisp_Object arg, Lisp_Object oldval) |
| 3160 | { | 3157 | { |
| 3161 | Lisp_Object font_object, font_param = Qnil; | 3158 | Lisp_Object font_object; |
| 3162 | int fontset = -1; | 3159 | int fontset = -1; |
| 3160 | #ifdef HAVE_X_WINDOWS | ||
| 3161 | Lisp_Object font_param = arg; | ||
| 3162 | #endif | ||
| 3163 | 3163 | ||
| 3164 | /* Set the frame parameter back to the old value because we may | 3164 | /* Set the frame parameter back to the old value because we may |
| 3165 | fail to use ARG as the new parameter value. */ | 3165 | fail to use ARG as the new parameter value. */ |
| @@ -3170,7 +3170,6 @@ x_set_font (struct frame *f, Lisp_Object arg, Lisp_Object oldval) | |||
| 3170 | never fail. */ | 3170 | never fail. */ |
| 3171 | if (STRINGP (arg)) | 3171 | if (STRINGP (arg)) |
| 3172 | { | 3172 | { |
| 3173 | font_param = arg; | ||
| 3174 | fontset = fs_query_fontset (arg, 0); | 3173 | fontset = fs_query_fontset (arg, 0); |
| 3175 | if (fontset < 0) | 3174 | if (fontset < 0) |
| 3176 | { | 3175 | { |
| @@ -3201,12 +3200,16 @@ x_set_font (struct frame *f, Lisp_Object arg, Lisp_Object oldval) | |||
| 3201 | error ("Unknown fontset: %s", SDATA (XCAR (arg))); | 3200 | error ("Unknown fontset: %s", SDATA (XCAR (arg))); |
| 3202 | font_object = XCDR (arg); | 3201 | font_object = XCDR (arg); |
| 3203 | arg = AREF (font_object, FONT_NAME_INDEX); | 3202 | arg = AREF (font_object, FONT_NAME_INDEX); |
| 3203 | #ifdef HAVE_X_WINDOWS | ||
| 3204 | font_param = Ffont_get (font_object, QCname); | 3204 | font_param = Ffont_get (font_object, QCname); |
| 3205 | #endif | ||
| 3205 | } | 3206 | } |
| 3206 | else if (FONT_OBJECT_P (arg)) | 3207 | else if (FONT_OBJECT_P (arg)) |
| 3207 | { | 3208 | { |
| 3208 | font_object = arg; | 3209 | font_object = arg; |
| 3210 | #ifdef HAVE_X_WINDOWS | ||
| 3209 | font_param = Ffont_get (font_object, QCname); | 3211 | font_param = Ffont_get (font_object, QCname); |
| 3212 | #endif | ||
| 3210 | /* This is to store the XLFD font name in the frame parameter for | 3213 | /* This is to store the XLFD font name in the frame parameter for |
| 3211 | backward compatibility. We should store the font-object | 3214 | backward compatibility. We should store the font-object |
| 3212 | itself in the future. */ | 3215 | itself in the future. */ |
| @@ -3902,7 +3905,7 @@ On Nextstep, this just calls `ns-parse-geometry'. */) | |||
| 3902 | (Lisp_Object string) | 3905 | (Lisp_Object string) |
| 3903 | { | 3906 | { |
| 3904 | #ifdef HAVE_NS | 3907 | #ifdef HAVE_NS |
| 3905 | call1 (Qns_parse_geometry, string); | 3908 | return call1 (Qns_parse_geometry, string); |
| 3906 | #else | 3909 | #else |
| 3907 | int geometry, x, y; | 3910 | int geometry, x, y; |
| 3908 | unsigned int width, height; | 3911 | unsigned int width, height; |