+2013-06-03 Paul Eggert <eggert@cs.ucla.edu>
+
+ Fix minor problems found by static checking.
+ * data.c (pure_write_error):
+ Use xsignal2, not Fsignal, as Fsignal might return.
+ * eval.c (set_backtrace_debug_on_exit): Now static.
+ (backtrace_p, backtrace_top, backtrace_next, record_in_backtrace):
+ No longer inline. EXTERN_INLINE is needed only for functions
+ defined in .h files. Reindent function header as per GNU style.
+ (backtrace_p, backtrace_top, backtrace_next):
+ Mark EXTERNALLY_VISIBLE so they don't get optimized away by the
+ compiler or linker. Add extern decls to pacify gcc -Wall.
+ * frame.c, frame.h (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource):
+ Now static.
+ * frame.c (free_monitors): Define only on platforms that need it.
+ * nsterm.m (ns_term_init):
+ * process.c (catch_child_signal):
+ Don't worry about whether SIGCHLD is defined, as SIGCHLD is
+ defined on all porting targets these days.
+ * process.c, process.h (catch_child_signal):
+ Make it extern only if NS_IMPL_GNUSTEP is defined.
+
2013-06-03 Eli Zaretskii <eliz@gnu.org>
* w32.c (gettimeofday): Make the signature identical to prototype
void
pure_write_error (Lisp_Object obj)
{
- Fsignal (Qerror, Fcons (build_string ("Attempt to modify read-only object"),
- Fcons (obj, Qnil)));
+ xsignal2 (Qerror, build_string ("Attempt to modify read-only object"), obj);
}
void
/* Functions to modify slots of backtrace records. */
-static void set_backtrace_args (struct specbinding *pdl, Lisp_Object *args)
+static void
+set_backtrace_args (struct specbinding *pdl, Lisp_Object *args)
{ eassert (pdl->kind == SPECPDL_BACKTRACE); pdl->v.bt.args = args; }
-static void set_backtrace_nargs (struct specbinding *pdl, ptrdiff_t n)
+static void
+set_backtrace_nargs (struct specbinding *pdl, ptrdiff_t n)
{ eassert (pdl->kind == SPECPDL_BACKTRACE); pdl->v.bt.nargs = n; }
-void set_backtrace_debug_on_exit (struct specbinding *pdl, bool doe)
+static void
+set_backtrace_debug_on_exit (struct specbinding *pdl, bool doe)
{ eassert (pdl->kind == SPECPDL_BACKTRACE); pdl->v.bt.debug_on_exit = doe; }
/* Helper functions to scan the backtrace. */
-EXTERN_INLINE bool backtrace_p (struct specbinding *pdl)
+bool backtrace_p (struct specbinding *) EXTERNALLY_VISIBLE;
+struct specbinding *backtrace_top (void) EXTERNALLY_VISIBLE;
+struct specbinding *backtrace_next (struct specbinding *pdl) EXTERNALLY_VISIBLE;
+
+bool backtrace_p (struct specbinding *pdl)
{ return pdl >= specpdl; }
-EXTERN_INLINE struct specbinding *backtrace_top (void)
+struct specbinding *
+backtrace_top (void)
{
struct specbinding *pdl = specpdl_ptr - 1;
while (backtrace_p (pdl) && pdl->kind != SPECPDL_BACKTRACE)
return pdl;
}
-EXTERN_INLINE struct specbinding *backtrace_next (struct specbinding *pdl)
+struct specbinding *
+backtrace_next (struct specbinding *pdl)
{
pdl--;
while (backtrace_p (pdl) && pdl->kind != SPECPDL_BACKTRACE)
specpdl_ptr = specpdl + count;
}
-LISP_INLINE void
+void
record_in_backtrace (Lisp_Object function, Lisp_Object *args, ptrdiff_t nargs)
{
eassert (nargs >= UNEVALLED);
static Lisp_Object Qdelete_frame_functions;
-Lisp_Object Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource;
+static Lisp_Object Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource;
#ifdef HAVE_WINDOW_SYSTEM
static void x_report_frame_params (struct frame *, Lisp_Object *);
decode_window_system_frame (Lisp_Object frame)
{
struct frame *f = decode_live_frame (frame);
-
+
if (!window_system_available (f))
error ("Window system frame should be used");
return f;
#ifdef HAVE_WINDOW_SYSTEM
+# if (defined HAVE_NS \
+ || (!defined USE_GTK && (defined HAVE_XINERAMA || defined HAVE_XRANDR)))
void
free_monitors (struct MonitorInfo *monitors, int n_monitors)
{
xfree (monitors[i].name);
xfree (monitors);
}
+# endif
Lisp_Object
make_monitor_attribute_list (struct MonitorInfo *monitors,
extern Lisp_Object Qrun_hook_with_args;
-extern Lisp_Object Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource;
-
#ifdef HAVE_WINDOW_SYSTEM
/* The class of this X application. */
[NSApp run];
ns_do_open_file = YES;
-#if defined (NS_IMPL_GNUSTEP) && defined (SIGCHLD)
+#ifdef NS_IMPL_GNUSTEP
/* GNUstep steals SIGCHLD for use in NSTask, but we don't use NSTask.
We must re-catch it so subprocess works. */
catch_child_signal ();
#ifdef NS_IMPL_GNUSTEP
gsextra = 3;
#endif
-
+
NSTRACE (windowWillResize);
/*fprintf (stderr,"Window will resize: %.0f x %.0f\n",frameSize.width,frameSize.height); */
- (void)windowDidResize: (NSNotification *)notification
{
- if (! [self fsIsNative])
+ if (! [self fsIsNative])
{
NSWindow *theWindow = [notification object];
/* We can get notification on the non-FS window when in
}
}
#endif
-
+
- (void)toggleFullScreen: (id)sender
{
NSWindow *w, *fw;
return system_process_attributes (pid);
}
+#ifndef NS_IMPL_GNUSTEP
+static
+#endif
void
catch_child_signal (void)
{
-#ifdef SIGCHLD
struct sigaction action;
emacs_sigaction_init (&action, deliver_child_signal);
sigaction (SIGCHLD, &action, 0);
-#endif
}
\f
extern void delete_read_fd (int fd);
extern void add_write_fd (int fd, fd_callback func, void *data);
extern void delete_write_fd (int fd);
+#ifdef NS_IMPL_GNUSTEP
extern void catch_child_signal (void);
+#endif
INLINE_HEADER_END