aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/ChangeLog16
-rw-r--r--src/image.c33
-rw-r--r--src/nsmenu.m2
-rw-r--r--src/nsterm.h4
-rw-r--r--src/nsterm.m4
-rw-r--r--src/regex.c4
-rw-r--r--src/xfaces.c1
-rw-r--r--src/xgselect.c5
-rw-r--r--src/xgselect.h4
9 files changed, 47 insertions, 26 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index bece374f080..01f3093b6dd 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,19 @@
12013-08-26 Paul Eggert <eggert@cs.ucla.edu>
2
3 Fix minor problems found by static checking.
4 * image.c (XGetPixel, XPutPixel) [HAVE_NS]: Now static.
5 (expect): Avoid nested-if warning.
6 (x_build_heuristic_mask) [HAVE_NS]: Avoid unused-var warning.
7 * nsmenu.m (fillWithWidgetValue:): Avoid type warning.
8 * nsterm.h, nsterm.m (ns_select):
9 * xgselect.c, xgselect.h (xg_select):
10 Adjust signature to better match pselect's.
11 * nsterm.m (ns_select):
12 Don't set *TIMEOUT, since pselect doesn't.
13 * regex.c (whitespace_regexp): Now const_re_char *, to avoid
14 diagnostic about assigning const char * to it.
15 * xfaces.c (x_display_info) [HAVE_NS]: Remove; unused.
16
12013-08-26 Stefan Monnier <monnier@iro.umontreal.ca> 172013-08-26 Stefan Monnier <monnier@iro.umontreal.ca>
2 18
3 * lread.c (substitute_object_recurse): Handle hash-tables as well 19 * lread.c (substitute_object_recurse): Handle hash-tables as well
diff --git a/src/image.c b/src/image.c
index 2db44d07c81..59347161576 100644
--- a/src/image.c
+++ b/src/image.c
@@ -145,7 +145,7 @@ static Lisp_Object QCmax_width, QCmax_height;
145 145
146#ifdef HAVE_NS 146#ifdef HAVE_NS
147/* Use with images created by ns_image_for_XPM. */ 147/* Use with images created by ns_image_for_XPM. */
148unsigned long 148static unsigned long
149XGetPixel (XImagePtr ximage, int x, int y) 149XGetPixel (XImagePtr ximage, int x, int y)
150{ 150{
151 return ns_get_pixel (ximage, x, y); 151 return ns_get_pixel (ximage, x, y);
@@ -153,7 +153,7 @@ XGetPixel (XImagePtr ximage, int x, int y)
153 153
154/* Use with images created by ns_image_for_XPM; alpha set to 1; 154/* Use with images created by ns_image_for_XPM; alpha set to 1;
155 pixel is assumed to be in RGB form. */ 155 pixel is assumed to be in RGB form. */
156void 156static void
157XPutPixel (XImagePtr ximage, int x, int y, unsigned long pixel) 157XPutPixel (XImagePtr ximage, int x, int y, unsigned long pixel)
158{ 158{
159 ns_put_pixel (ximage, x, y, pixel); 159 ns_put_pixel (ximage, x, y, pixel);
@@ -2713,10 +2713,13 @@ xbm_read_bitmap_data (struct frame *f, unsigned char *contents, unsigned char *e
2713 LA1 = xbm_scan (&s, end, buffer, &value) 2713 LA1 = xbm_scan (&s, end, buffer, &value)
2714 2714
2715#define expect(TOKEN) \ 2715#define expect(TOKEN) \
2716 if (LA1 != (TOKEN)) \ 2716 do \
2717 goto failure; \ 2717 { \
2718 else \ 2718 if (LA1 != (TOKEN)) \
2719 match () 2719 goto failure; \
2720 match (); \
2721 } \
2722 while (0)
2720 2723
2721#define expect_ident(IDENT) \ 2724#define expect_ident(IDENT) \
2722 if (LA1 == XBM_TK_IDENT && strcmp (buffer, (IDENT)) == 0) \ 2725 if (LA1 == XBM_TK_IDENT && strcmp (buffer, (IDENT)) == 0) \
@@ -3976,10 +3979,13 @@ xpm_load_image (struct frame *f,
3976 LA1 = xpm_scan (&s, end, &beg, &len) 3979 LA1 = xpm_scan (&s, end, &beg, &len)
3977 3980
3978#define expect(TOKEN) \ 3981#define expect(TOKEN) \
3979 if (LA1 != (TOKEN)) \ 3982 do \
3980 goto failure; \ 3983 { \
3981 else \ 3984 if (LA1 != (TOKEN)) \
3982 match () 3985 goto failure; \
3986 match (); \
3987 } \
3988 while (0)
3983 3989
3984#define expect_ident(IDENT) \ 3990#define expect_ident(IDENT) \
3985 if (LA1 == XPM_TK_IDENT \ 3991 if (LA1 == XPM_TK_IDENT \
@@ -4932,7 +4938,7 @@ x_build_heuristic_mask (struct frame *f, struct image *img, Lisp_Object how)
4932 int row_width; 4938 int row_width;
4933#endif /* HAVE_NTGUI */ 4939#endif /* HAVE_NTGUI */
4934 int x, y; 4940 int x, y;
4935 bool rc, use_img_background; 4941 bool use_img_background;
4936 unsigned long bg = 0; 4942 unsigned long bg = 0;
4937 4943
4938 if (img->mask) 4944 if (img->mask)
@@ -4941,9 +4947,8 @@ x_build_heuristic_mask (struct frame *f, struct image *img, Lisp_Object how)
4941#ifndef HAVE_NTGUI 4947#ifndef HAVE_NTGUI
4942#ifndef HAVE_NS 4948#ifndef HAVE_NS
4943 /* Create an image and pixmap serving as mask. */ 4949 /* Create an image and pixmap serving as mask. */
4944 rc = image_create_x_image_and_pixmap (f, img, img->width, img->height, 1, 4950 if (! image_create_x_image_and_pixmap (f, img, img->width, img->height, 1,
4945 &mask_img, 1); 4951 &mask_img, 1))
4946 if (!rc)
4947 return; 4952 return;
4948#endif /* !HAVE_NS */ 4953#endif /* !HAVE_NS */
4949#else 4954#else
diff --git a/src/nsmenu.m b/src/nsmenu.m
index 5af813ac758..7fe84343f1c 100644
--- a/src/nsmenu.m
+++ b/src/nsmenu.m
@@ -730,7 +730,7 @@ extern NSString *NSMenuDidBeginTrackingNotification;
730 730
731- (void)fillWithWidgetValue: (void *)wvptr 731- (void)fillWithWidgetValue: (void *)wvptr
732{ 732{
733 [self fillWithWidgetValue: wvptr frame:nil]; 733 [self fillWithWidgetValue: wvptr frame: (struct frame *)nil];
734} 734}
735 735
736- (void)fillWithWidgetValue: (void *)wvptr frame: (struct frame *)f 736- (void)fillWithWidgetValue: (void *)wvptr frame: (struct frame *)f
diff --git a/src/nsterm.h b/src/nsterm.h
index c34067991f6..a3174ade07b 100644
--- a/src/nsterm.h
+++ b/src/nsterm.h
@@ -874,8 +874,8 @@ extern int x_display_pixel_width (struct ns_display_info *);
874/* This in nsterm.m */ 874/* This in nsterm.m */
875extern void x_destroy_window (struct frame *f); 875extern void x_destroy_window (struct frame *f);
876extern int ns_select (int nfds, fd_set *readfds, fd_set *writefds, 876extern int ns_select (int nfds, fd_set *readfds, fd_set *writefds,
877 fd_set *exceptfds, EMACS_TIME *timeout, 877 fd_set *exceptfds, EMACS_TIME const *timeout,
878 sigset_t *sigmask); 878 sigset_t const *sigmask);
879extern unsigned long ns_get_rgb_color (struct frame *f, 879extern unsigned long ns_get_rgb_color (struct frame *f,
880 float r, float g, float b, float a); 880 float r, float g, float b, float a);
881extern NSPoint last_mouse_motion_position; 881extern NSPoint last_mouse_motion_position;
diff --git a/src/nsterm.m b/src/nsterm.m
index 287c119ba73..f7cc5933a53 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -3540,7 +3540,8 @@ ns_read_socket (struct terminal *terminal, struct input_event *hold_quit)
3540 3540
3541int 3541int
3542ns_select (int nfds, fd_set *readfds, fd_set *writefds, 3542ns_select (int nfds, fd_set *readfds, fd_set *writefds,
3543 fd_set *exceptfds, EMACS_TIME *timeout, sigset_t *sigmask) 3543 fd_set *exceptfds, EMACS_TIME const *timeout,
3544 sigset_t const *sigmask)
3544/* -------------------------------------------------------------------------- 3545/* --------------------------------------------------------------------------
3545 Replacement for select, checking for events 3546 Replacement for select, checking for events
3546 -------------------------------------------------------------------------- */ 3547 -------------------------------------------------------------------------- */
@@ -3666,7 +3667,6 @@ ns_select (int nfds, fd_set *readfds, fd_set *writefds,
3666 pthread_mutex_lock (&select_mutex); 3667 pthread_mutex_lock (&select_mutex);
3667 if (readfds) *readfds = select_readfds; 3668 if (readfds) *readfds = select_readfds;
3668 if (writefds) *writefds = select_writefds; 3669 if (writefds) *writefds = select_writefds;
3669 if (timeout) *timeout = select_timeout;
3670 pthread_mutex_unlock (&select_mutex); 3670 pthread_mutex_unlock (&select_mutex);
3671 result = t; 3671 result = t;
3672 } 3672 }
diff --git a/src/regex.c b/src/regex.c
index 06a9db2c55c..2363fe2a290 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -1238,12 +1238,12 @@ re_set_syntax (reg_syntax_t syntax)
1238WEAK_ALIAS (__re_set_syntax, re_set_syntax) 1238WEAK_ALIAS (__re_set_syntax, re_set_syntax)
1239 1239
1240/* Regexp to use to replace spaces, or NULL meaning don't. */ 1240/* Regexp to use to replace spaces, or NULL meaning don't. */
1241static re_char *whitespace_regexp; 1241static const_re_char *whitespace_regexp;
1242 1242
1243void 1243void
1244re_set_whitespace_regexp (const char *regexp) 1244re_set_whitespace_regexp (const char *regexp)
1245{ 1245{
1246 whitespace_regexp = (re_char *) regexp; 1246 whitespace_regexp = (const_re_char *) regexp;
1247} 1247}
1248WEAK_ALIAS (__re_set_syntax, re_set_syntax) 1248WEAK_ALIAS (__re_set_syntax, re_set_syntax)
1249 1249
diff --git a/src/xfaces.c b/src/xfaces.c
index b76f9d24180..a55ac90086d 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -236,7 +236,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
236#ifdef HAVE_NS 236#ifdef HAVE_NS
237#undef FRAME_X_DISPLAY_INFO 237#undef FRAME_X_DISPLAY_INFO
238#define FRAME_X_DISPLAY_INFO FRAME_NS_DISPLAY_INFO 238#define FRAME_X_DISPLAY_INFO FRAME_NS_DISPLAY_INFO
239#define x_display_info ns_display_info
240#define GCGraphicsExposures 0 239#define GCGraphicsExposures 0
241#endif /* HAVE_NS */ 240#endif /* HAVE_NS */
242#endif /* HAVE_WINDOW_SYSTEM */ 241#endif /* HAVE_WINDOW_SYSTEM */
diff --git a/src/xgselect.c b/src/xgselect.c
index 4d90298a9d9..97f53373b63 100644
--- a/src/xgselect.c
+++ b/src/xgselect.c
@@ -29,10 +29,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
29 29
30int 30int
31xg_select (int fds_lim, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds, 31xg_select (int fds_lim, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds,
32 EMACS_TIME *timeout, sigset_t *sigmask) 32 EMACS_TIME const *timeout, sigset_t const *sigmask)
33{ 33{
34 SELECT_TYPE all_rfds, all_wfds; 34 SELECT_TYPE all_rfds, all_wfds;
35 EMACS_TIME tmo, *tmop = timeout; 35 EMACS_TIME tmo;
36 EMACS_TIME const *tmop = timeout;
36 37
37 GMainContext *context; 38 GMainContext *context;
38 int have_wfds = wfds != NULL; 39 int have_wfds = wfds != NULL;
diff --git a/src/xgselect.h b/src/xgselect.h
index f142e85d877..21c8acf1016 100644
--- a/src/xgselect.h
+++ b/src/xgselect.h
@@ -28,7 +28,7 @@ extern int xg_select (int max_fds,
28 SELECT_TYPE *rfds, 28 SELECT_TYPE *rfds,
29 SELECT_TYPE *wfds, 29 SELECT_TYPE *wfds,
30 SELECT_TYPE *efds, 30 SELECT_TYPE *efds,
31 EMACS_TIME *timeout, 31 EMACS_TIME const *timeout,
32 sigset_t *sigmask); 32 sigset_t const *sigmask);
33 33
34#endif /* XGSELECT_H */ 34#endif /* XGSELECT_H */