summaryrefslogtreecommitdiff
path: root/src/frame.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2012-07-07 12:23:41 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2012-07-07 12:23:41 -0700
commit6045c4fdb88ee6bd84afcaac4a0b7e8a96f23050 (patch)
tree86959a892e16b2947b794a6ad993f0090387fab3 /src/frame.c
parent41f9404e0cb421fcea07538bbd686d54200ed92d (diff)
downloademacs-6045c4fdb88ee6bd84afcaac4a0b7e8a96f23050.tar.gz
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.c19
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
used. */)
(Lisp_Object frame)
{
- struct frame *f;
-
if (NILP (frame))
frame = selected_frame;
CHECK_FRAME (frame);
- f = XFRAME (frame);
#ifdef FRAME_TOOLBAR_WIDTH
- if (FRAME_WINDOW_P (f))
- return make_number (FRAME_TOOLBAR_WIDTH (f));
+ if (FRAME_WINDOW_P (XFRAME (frame)))
+ return make_number (FRAME_TOOLBAR_WIDTH (XFRAME (frame)));
#endif
return make_number (0);
}
@@ -3158,8 +3155,11 @@ x_set_screen_gamma (struct frame *f, Lisp_Object new_value, Lisp_Object old_valu
void
x_set_font (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
- Lisp_Object font_object, font_param = Qnil;
+ Lisp_Object font_object;
int fontset = -1;
+#ifdef HAVE_X_WINDOWS
+ Lisp_Object font_param = arg;
+#endif
/* Set the frame parameter back to the old value because we may
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)
never fail. */
if (STRINGP (arg))
{
- font_param = arg;
fontset = fs_query_fontset (arg, 0);
if (fontset < 0)
{
@@ -3201,12 +3200,16 @@ x_set_font (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
error ("Unknown fontset: %s", SDATA (XCAR (arg)));
font_object = XCDR (arg);
arg = AREF (font_object, FONT_NAME_INDEX);
+#ifdef HAVE_X_WINDOWS
font_param = Ffont_get (font_object, QCname);
+#endif
}
else if (FONT_OBJECT_P (arg))
{
font_object = arg;
+#ifdef HAVE_X_WINDOWS
font_param = Ffont_get (font_object, QCname);
+#endif
/* This is to store the XLFD font name in the frame parameter for
backward compatibility. We should store the font-object
itself in the future. */
@@ -3902,7 +3905,7 @@ On Nextstep, this just calls `ns-parse-geometry'. */)
(Lisp_Object string)
{
#ifdef HAVE_NS
- call1 (Qns_parse_geometry, string);
+ return call1 (Qns_parse_geometry, string);
#else
int geometry, x, y;
unsigned int width, height;