XEmacs 21.4.6 "Common Lisp".
[chise/xemacs-chise.git.1] / src / editfns.c
index 36417c0..a5f4275 100644 (file)
@@ -637,7 +637,8 @@ On Unix it is obtained from TMPDIR, with /tmp as the default.
        {
          mkdir(path, 0700);    /* ignore retval -- checked next anyway. */
        }
-      if (lstat(path, &st) == 0 && st.st_uid == myuid && S_ISDIR(st.st_mode))
+      if (lstat(path, &st) == 0 && st.st_uid == (uid_t) myuid &&
+         S_ISDIR(st.st_mode))
        {
          tmpdir = path;
        }
@@ -824,7 +825,7 @@ value of `user-full-name' is returned.
 #endif
   tem = ((!NILP (user) && !pw)
         ? Qnil
-        : make_ext_string ((Extbyte *) p, (q ? q - p : strlen (p)),
+        : make_ext_string ((Extbyte *) p, (q ? q - p : (int) strlen (p)),
                            Qnative));
 
 #ifdef AMPERSAND_FULL_NAME
@@ -1175,6 +1176,15 @@ ZONE is an integer indicating the number of seconds east of Greenwich.
 
 static void set_time_zone_rule (char *tzstring);
 
+/* from GNU Emacs 21, per Simon Josefsson, modified by stephen
+   The slight inefficiency is justified since negative times are weird. */
+Lisp_Object
+make_time (time_t time)
+{
+  return list2 (make_int (time < 0 ? time / 0x10000 : time >> 16),
+               make_int (time & 0xFFFF));
+}
+
 DEFUN ("encode-time", Fencode_time, 6, MANY, 0, /*
   Convert SECOND, MINUTE, HOUR, DAY, MONTH, YEAR and ZONE to internal time.
 This is the reverse operation of `decode-time', which see.
@@ -1248,7 +1258,7 @@ If you want them to stand for years in this century, you must do that yourself.
   if (the_time == (time_t) -1)
     error ("Specified time is not representable");
 
-  return wasteful_word_to_lisp (the_time);
+  return make_time (the_time);
 }
 
 DEFUN ("current-time-string", Fcurrent_time_string, 0, 1, 0, /*