]> code.delx.au - gnu-emacs/commitdiff
Fix minor module problems found by static checking
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 19 Nov 2015 19:49:27 +0000 (11:49 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 19 Nov 2015 19:50:16 +0000 (11:50 -0800)
* src/dynlib.c (dynlib_close): #ifdef out for now, as it’s not used.
* src/eval.c, src/lisp.h (lisp_eval_depth): Now static.
* src/module.c (Fmodule_load): Fix pointer signedness bug.
(Fmodule_call): Tell GCC that the default case is unreachable.

src/dynlib.c
src/eval.c
src/lisp.h
src/module.c

index 491a08e0787bcb87744a5a33546ba0915448c552..ed4f157d0fe417feeb00d918312a437ce4dc184c 100644 (file)
@@ -103,11 +103,15 @@ dynlib_error (void)
   return dlerror ();
 }
 
+/* FIXME: Currently there is no way to unload a module, so this
+   function is never used.  */
+#if false
 int
 dynlib_close (dynlib_handle_ptr h)
 {
   return dlclose (h) == 0;
 }
+#endif
 
 #else
 
index 396ca84a71dc51fecf7e62b6a9c722ef412ae0e2..9c171473b43596a64b047c56b00963e840326e8e 100644 (file)
@@ -61,7 +61,7 @@ union specbinding *specpdl_ptr;
 
 /* Depth in Lisp evaluations and function calls.  */
 
-EMACS_INT lisp_eval_depth;
+static EMACS_INT lisp_eval_depth;
 
 /* The value of num_nonmacro_input_events as of the last time we
    started to enter the debugger.  If we decide to enter the debugger
index ce5a6d2aea8d8affc5cd1e93a984b391da403185..f953ceb582f503391da13d2085053b068dafb06b 100644 (file)
@@ -3837,7 +3837,6 @@ intern_c_string (const char *str)
 }
 
 /* Defined in eval.c.  */
-extern EMACS_INT lisp_eval_depth;
 extern Lisp_Object Vautoload_queue;
 extern Lisp_Object Vrun_hooks;
 extern Lisp_Object Vsignaling_function;
index 35a9f48eb126658af0dbf04d855e9df736ae0a32..98264df35a98e49fae333537832068dcabde4e69 100644 (file)
@@ -697,7 +697,7 @@ DEFUN ("module-load", Fmodule_load, Smodule_load, 1, 1, 0,
   void *gpl_sym;
 
   CHECK_STRING (file);
-  handle = dynlib_open (SDATA (file));
+  handle = dynlib_open (SSDATA (file));
   if (!handle)
     error ("Cannot load file %s: %s", SDATA (file), dynlib_error ());
 
@@ -789,6 +789,8 @@ ARGLIST is a list of arguments passed to SUBRPTR.  */)
         finalize_environment (&env);
         Fthrow (tag, value);
       }
+    default:
+      eassume (false);
     }
 }