emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r112838: Fix minor problems found by


From: Paul Eggert
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r112838: Fix minor problems found by static checking.
Date: Mon, 03 Jun 2013 11:29:30 -0700
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 112838
committer: Paul Eggert <address@hidden>
branch nick: trunk
timestamp: Mon 2013-06-03 11:29:30 -0700
message:
  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.
modified:
  src/ChangeLog
  src/data.c
  src/eval.c
  src/frame.c
  src/frame.h
  src/nsterm.m
  src/process.c
  src/process.h
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2013-06-03 17:15:44 +0000
+++ b/src/ChangeLog     2013-06-03 18:29:30 +0000
@@ -1,3 +1,25 @@
+2013-06-03  Paul Eggert  <address@hidden>
+
+       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  <address@hidden>
 
        * w32.c (gettimeofday): Make the signature identical to prototype

=== modified file 'src/data.c'
--- a/src/data.c        2013-06-03 15:18:18 +0000
+++ b/src/data.c        2013-06-03 18:29:30 +0000
@@ -102,8 +102,7 @@
 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

=== modified file 'src/eval.c'
--- a/src/eval.c        2013-06-03 15:18:18 +0000
+++ b/src/eval.c        2013-06-03 18:29:30 +0000
@@ -117,21 +117,29 @@
 
 /* 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 @@
   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 @@
   specpdl_ptr = specpdl + count;
 }
 
-LISP_INLINE void
+void
 record_in_backtrace (Lisp_Object function, Lisp_Object *args, ptrdiff_t nargs)
 {
   eassert (nargs >= UNEVALLED);

=== modified file 'src/frame.c'
--- a/src/frame.c       2013-05-25 11:14:38 +0000
+++ b/src/frame.c       2013-06-03 18:29:30 +0000
@@ -114,7 +114,7 @@
 
 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 @@
 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 @@
 
 #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 @@
     xfree (monitors[i].name);
   xfree (monitors);
 }
+# endif
 
 Lisp_Object
 make_monitor_attribute_list (struct MonitorInfo *monitors,

=== modified file 'src/frame.h'
--- a/src/frame.h       2013-05-25 11:14:38 +0000
+++ b/src/frame.h       2013-06-03 18:29:30 +0000
@@ -1198,8 +1198,6 @@
 
 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.  */

=== modified file 'src/nsterm.m'
--- a/src/nsterm.m      2013-06-02 19:14:25 +0000
+++ b/src/nsterm.m      2013-06-03 18:29:30 +0000
@@ -4361,7 +4361,7 @@
   [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 @@
 #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 @@
 
 - (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 @@
     }
 }
 #endif
- 
+
 - (void)toggleFullScreen: (id)sender
 {
   NSWindow *w, *fw;

=== modified file 'src/process.c'
--- a/src/process.c     2013-06-02 19:14:25 +0000
+++ b/src/process.c     2013-06-03 18:29:30 +0000
@@ -7029,14 +7029,15 @@
   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
 }
 
 

=== modified file 'src/process.h'
--- a/src/process.h     2013-06-02 19:14:25 +0000
+++ b/src/process.h     2013-06-03 18:29:30 +0000
@@ -217,6 +217,8 @@
 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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]