Constify functions taking char *
[bpt/emacs.git] / src / emacs.c
index 92d8b82..180b227 100644 (file)
@@ -90,8 +90,6 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 const char emacs_copyright[] = "Copyright (C) 2010 Free Software Foundation, Inc.";
 const char emacs_version[] = "24.0.50";
 
-extern void malloc_warning (char *);
-extern void set_time_zone_rule (char *);
 #ifdef HAVE_INDEX
 extern char *index (const char *, int);
 #endif
@@ -2344,17 +2342,16 @@ synchronize_system_messages_locale ()
 #endif
 
 Lisp_Object
-decode_env_path (evarname, defalt)
-     char *evarname, *defalt;
+decode_env_path (const char *evarname, const char *defalt)
 {
-  register char *path, *p;
+  const char *path, *p;
   Lisp_Object lpath, element, tem;
 
   /* It's okay to use getenv here, because this function is only used
      to initialize variables when Emacs starts up, and isn't called
      after that.  */
   if (evarname != 0)
-    path = (char *) getenv (evarname);
+    path = getenv (evarname);
   else
     path = 0;
   if (!path)
@@ -2363,18 +2360,18 @@ decode_env_path (evarname, defalt)
   /* Ensure values from the environment use the proper directory separator.  */
   if (path)
     {
-      p = alloca (strlen (path) + 1);
-      strcpy (p, path);
-      path = p;
-
-      dostounix_filename (path);
+      char *path_copy = alloca (strlen (path) + 1);
+      strcpy (path_copy, path);
+      dostounix_filename (path_copy);
+      path = path_copy;
     }
 #endif
   lpath = Qnil;
   while (1)
     {
       p = index (path, SEPCHAR);
-      if (!p) p = path + strlen (path);
+      if (!p)
+       p = path + strlen (path);
       element = (p - path ? make_string (path, p - path)
                 : build_string ("."));