diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 22 | ||||
| -rw-r--r-- | src/callproc.c | 22 | ||||
| -rw-r--r-- | src/fns.c | 6 | ||||
| -rw-r--r-- | src/lisp.h | 10 | ||||
| -rw-r--r-- | src/msdos.c | 8 | ||||
| -rw-r--r-- | src/profiler.c | 2 | ||||
| -rw-r--r-- | src/xdisp.c | 3 |
7 files changed, 53 insertions, 20 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 46f872ba29d..05d69382855 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,25 @@ | |||
| 1 | 2013-02-09 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | Minor hashing refactoring. | ||
| 4 | * fns.c (SXHASH_REDUCE): Move to lisp.h. | ||
| 5 | (sxhash_float): Return EMACS_UINT, for consistency with the other | ||
| 6 | hash functions. | ||
| 7 | * lisp.h (INTMASK): Now a macro, since SXHASH_REDUCE is now a | ||
| 8 | non-static inline function and therefore can't use static vars. | ||
| 9 | (SXHASH_REDUCE): Move here from fns.c, and make it inline. | ||
| 10 | * profiler.c (hashfn_profiler): Use SXHASH_REDUCE, to be consistent | ||
| 11 | with the other hash functions. | ||
| 12 | |||
| 13 | 2013-02-09 Eli Zaretskii <eliz@gnu.org> | ||
| 14 | |||
| 15 | * callproc.c (Fcall_process_region) [WINDOWSNT]: Make sure the | ||
| 16 | XXXXXX part of the temporary file pattern is not downcased even | ||
| 17 | when w32-downcase-file-names is non-nil. (Bug#13661) | ||
| 18 | |||
| 19 | * xdisp.c (decode_mode_spec): Remove handling of %t. | ||
| 20 | |||
| 21 | * msdos.c (careadlinkatcwd): Remove. | ||
| 22 | |||
| 1 | 2013-02-08 Stefan Monnier <monnier@iro.umontreal.ca> | 23 | 2013-02-08 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 24 | ||
| 3 | * lread.c (skip_dyn_bytes): New function (bug#12598). | 25 | * lread.c (skip_dyn_bytes): New function (bug#12598). |
diff --git a/src/callproc.c b/src/callproc.c index ea79da7ff5a..cb11ee0cc53 100644 --- a/src/callproc.c +++ b/src/callproc.c | |||
| @@ -1016,8 +1016,26 @@ usage: (call-process-region START END PROGRAM &optional DELETE BUFFER DISPLAY &r | |||
| 1016 | { | 1016 | { |
| 1017 | USE_SAFE_ALLOCA; | 1017 | USE_SAFE_ALLOCA; |
| 1018 | Lisp_Object pattern = Fexpand_file_name (Vtemp_file_name_pattern, tmpdir); | 1018 | Lisp_Object pattern = Fexpand_file_name (Vtemp_file_name_pattern, tmpdir); |
| 1019 | Lisp_Object encoded_tem = ENCODE_FILE (pattern); | 1019 | Lisp_Object encoded_tem; |
| 1020 | char *tempfile = SAFE_ALLOCA (SBYTES (encoded_tem) + 1); | 1020 | char *tempfile; |
| 1021 | |||
| 1022 | #ifdef WINDOWSNT | ||
| 1023 | /* Cannot use the result of Fexpand_file_name, because it | ||
| 1024 | downcases the XXXXXX part of the pattern, and mktemp then | ||
| 1025 | doesn't recognize it. */ | ||
| 1026 | if (!NILP (Vw32_downcase_file_names)) | ||
| 1027 | { | ||
| 1028 | Lisp_Object dirname = Ffile_name_directory (pattern); | ||
| 1029 | |||
| 1030 | if (NILP (dirname)) | ||
| 1031 | pattern = Vtemp_file_name_pattern; | ||
| 1032 | else | ||
| 1033 | pattern = concat2 (dirname, Vtemp_file_name_pattern); | ||
| 1034 | } | ||
| 1035 | #endif | ||
| 1036 | |||
| 1037 | encoded_tem = ENCODE_FILE (pattern); | ||
| 1038 | tempfile = SAFE_ALLOCA (SBYTES (encoded_tem) + 1); | ||
| 1021 | memcpy (tempfile, SDATA (encoded_tem), SBYTES (encoded_tem) + 1); | 1039 | memcpy (tempfile, SDATA (encoded_tem), SBYTES (encoded_tem) + 1); |
| 1022 | coding_systems = Qt; | 1040 | coding_systems = Qt; |
| 1023 | 1041 | ||
| @@ -4045,10 +4045,6 @@ sweep_weak_hash_tables (void) | |||
| 4045 | 4045 | ||
| 4046 | #define SXHASH_MAX_LEN 7 | 4046 | #define SXHASH_MAX_LEN 7 |
| 4047 | 4047 | ||
| 4048 | /* Hash X, returning a value that fits into a Lisp integer. */ | ||
| 4049 | #define SXHASH_REDUCE(X) \ | ||
| 4050 | ((((X) ^ (X) >> (BITS_PER_EMACS_INT - FIXNUM_BITS))) & INTMASK) | ||
| 4051 | |||
| 4052 | /* Return a hash for string PTR which has length LEN. The hash value | 4048 | /* Return a hash for string PTR which has length LEN. The hash value |
| 4053 | can be any EMACS_UINT value. */ | 4049 | can be any EMACS_UINT value. */ |
| 4054 | 4050 | ||
| @@ -4081,7 +4077,7 @@ sxhash_string (char const *ptr, ptrdiff_t len) | |||
| 4081 | 4077 | ||
| 4082 | /* Return a hash for the floating point value VAL. */ | 4078 | /* Return a hash for the floating point value VAL. */ |
| 4083 | 4079 | ||
| 4084 | static EMACS_INT | 4080 | static EMACS_UINT |
| 4085 | sxhash_float (double val) | 4081 | sxhash_float (double val) |
| 4086 | { | 4082 | { |
| 4087 | EMACS_UINT hash = 0; | 4083 | EMACS_UINT hash = 0; |
diff --git a/src/lisp.h b/src/lisp.h index 787457b4872..997ef458ec5 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -227,7 +227,7 @@ enum enum_USE_LSB_TAG { USE_LSB_TAG = 0 }; | |||
| 227 | 227 | ||
| 228 | /* Lisp integers use 2 tags, to give them one extra bit, thus | 228 | /* Lisp integers use 2 tags, to give them one extra bit, thus |
| 229 | extending their range from, e.g., -2^28..2^28-1 to -2^29..2^29-1. */ | 229 | extending their range from, e.g., -2^28..2^28-1 to -2^29..2^29-1. */ |
| 230 | static EMACS_INT const INTMASK = EMACS_INT_MAX >> (INTTYPEBITS - 1); | 230 | #define INTMASK (EMACS_INT_MAX >> (INTTYPEBITS - 1)) |
| 231 | #define case_Lisp_Int case Lisp_Int0: case Lisp_Int1 | 231 | #define case_Lisp_Int case Lisp_Int0: case Lisp_Int1 |
| 232 | #define LISP_INT_TAG_P(x) (((x) & ~Lisp_Int1) == 0) | 232 | #define LISP_INT_TAG_P(x) (((x) & ~Lisp_Int1) == 0) |
| 233 | 233 | ||
| @@ -1309,6 +1309,14 @@ sxhash_combine (EMACS_UINT x, EMACS_UINT y) | |||
| 1309 | return (x << 4) + (x >> (BITS_PER_EMACS_INT - 4)) + y; | 1309 | return (x << 4) + (x >> (BITS_PER_EMACS_INT - 4)) + y; |
| 1310 | } | 1310 | } |
| 1311 | 1311 | ||
| 1312 | /* Hash X, returning a value that fits into a fixnum. */ | ||
| 1313 | |||
| 1314 | LISP_INLINE EMACS_UINT | ||
| 1315 | SXHASH_REDUCE (EMACS_UINT x) | ||
| 1316 | { | ||
| 1317 | return (x ^ x >> (BITS_PER_EMACS_INT - FIXNUM_BITS)) & INTMASK; | ||
| 1318 | } | ||
| 1319 | |||
| 1312 | /* These structures are used for various misc types. */ | 1320 | /* These structures are used for various misc types. */ |
| 1313 | 1321 | ||
| 1314 | struct Lisp_Misc_Any /* Supertype of all Misc types. */ | 1322 | struct Lisp_Misc_Any /* Supertype of all Misc types. */ |
diff --git a/src/msdos.c b/src/msdos.c index 1b2deaf7478..527a75c8c2f 100644 --- a/src/msdos.c +++ b/src/msdos.c | |||
| @@ -3957,14 +3957,6 @@ careadlinkat (int fd, char const *filename, | |||
| 3957 | return buffer; | 3957 | return buffer; |
| 3958 | } | 3958 | } |
| 3959 | 3959 | ||
| 3960 | ssize_t | ||
| 3961 | careadlinkatcwd (int fd, char const *filename, char *buffer, | ||
| 3962 | size_t buffer_size) | ||
| 3963 | { | ||
| 3964 | (void) fd; | ||
| 3965 | return readlink (filename, buffer, buffer_size); | ||
| 3966 | } | ||
| 3967 | |||
| 3968 | 3960 | ||
| 3969 | #if __DJGPP__ == 2 && __DJGPP_MINOR__ < 2 | 3961 | #if __DJGPP__ == 2 && __DJGPP_MINOR__ < 2 |
| 3970 | 3962 | ||
diff --git a/src/profiler.c b/src/profiler.c index f6503cf182e..85d9c1ca88a 100644 --- a/src/profiler.c +++ b/src/profiler.c | |||
| @@ -560,7 +560,7 @@ hashfn_profiler (struct hash_table_test *ht, Lisp_Object bt) | |||
| 560 | ? XHASH (XCDR (XCDR (f))) : XHASH (f)); | 560 | ? XHASH (XCDR (XCDR (f))) : XHASH (f)); |
| 561 | hash = sxhash_combine (hash, hash1); | 561 | hash = sxhash_combine (hash, hash1); |
| 562 | } | 562 | } |
| 563 | return (hash & INTMASK); | 563 | return SXHASH_REDUCE (hash); |
| 564 | } | 564 | } |
| 565 | else | 565 | else |
| 566 | return XHASH (bt); | 566 | return XHASH (bt); |
diff --git a/src/xdisp.c b/src/xdisp.c index 8a96a3eadc7..83a58aee32d 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -21630,9 +21630,6 @@ decode_mode_spec (struct window *w, register int c, int field_width, | |||
| 21630 | return "@"; | 21630 | return "@"; |
| 21631 | } | 21631 | } |
| 21632 | 21632 | ||
| 21633 | case 't': /* indicate TEXT or BINARY */ | ||
| 21634 | return "T"; | ||
| 21635 | |||
| 21636 | case 'z': | 21633 | case 'z': |
| 21637 | /* coding-system (not including end-of-line format) */ | 21634 | /* coding-system (not including end-of-line format) */ |
| 21638 | case 'Z': | 21635 | case 'Z': |