Commit 3d5ee10a authored by Paul Eggert's avatar Paul Eggert

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.
parent 068922a2
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
......
......@@ -102,8 +102,7 @@ wrong_type_argument (register Lisp_Object predicate, register Lisp_Object value)
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
......
......@@ -117,21 +117,29 @@ static Lisp_Object apply_lambda (Lisp_Object fun, Lisp_Object args);
/* 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)
......@@ -139,7 +147,8 @@ EXTERN_INLINE struct specbinding *backtrace_top (void)
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)
......@@ -1925,7 +1934,7 @@ grow_specpdl (void)
specpdl_ptr = specpdl + count;
}
LISP_INLINE void
void
record_in_backtrace (Lisp_Object function, Lisp_Object *args, ptrdiff_t nargs)
{
eassert (nargs >= UNEVALLED);
......
......@@ -114,7 +114,7 @@ Lisp_Object Qface_set_after_frame_default;
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 *);
......@@ -167,7 +167,7 @@ struct frame *
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;
......@@ -4138,6 +4138,8 @@ selected frame. This is useful when `make-pointer-invisible' is set. */)
#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)
{
......@@ -4146,6 +4148,7 @@ free_monitors (struct MonitorInfo *monitors, int n_monitors)
xfree (monitors[i].name);
xfree (monitors);
}
# endif
Lisp_Object
make_monitor_attribute_list (struct MonitorInfo *monitors,
......
......@@ -1198,8 +1198,6 @@ extern Lisp_Object Qdisplay;
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. */
......
......@@ -4361,7 +4361,7 @@ Needs to be here because ns_initialize_display_info () uses AppKit classes.
[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 ();
......@@ -5600,7 +5600,7 @@ - (NSSize)windowWillResize: (NSWindow *)sender toSize: (NSSize)frameSize
#ifdef NS_IMPL_GNUSTEP
gsextra = 3;
#endif
NSTRACE (windowWillResize);
/*fprintf (stderr,"Window will resize: %.0f x %.0f\n",frameSize.width,frameSize.height); */
......@@ -5666,7 +5666,7 @@ - (NSSize)windowWillResize: (NSWindow *)sender toSize: (NSSize)frameSize
- (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
......@@ -6115,7 +6115,7 @@ - (void)updateCollectionBehaviour
}
}
#endif
- (void)toggleFullScreen: (id)sender
{
NSWindow *w, *fw;
......
......@@ -7029,14 +7029,15 @@ integer or floating point values.
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
}
......
......@@ -217,6 +217,8 @@ extern void add_read_fd (int fd, fd_callback func, void *data);
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
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