diff options
| author | Paul Eggert | 2016-03-29 08:24:39 -0700 |
|---|---|---|
| committer | Paul Eggert | 2016-03-29 08:25:30 -0700 |
| commit | 46edc38005ce47bdaae656a541858735a8ba5f26 (patch) | |
| tree | 0ec330faac3b77495b00ec1ed7399791e2298aaa | |
| parent | 9e68dfa23e726eb66831d0b54cee998569b2c44d (diff) | |
| download | emacs-46edc38005ce47bdaae656a541858735a8ba5f26.tar.gz emacs-46edc38005ce47bdaae656a541858735a8ba5f26.zip | |
Pacify --enable-gcc-warnings for buffer-hash etc.
* src/fns.c (make_digest_string): Now static.
(secure_hash): Omit unused local.
| -rw-r--r-- | etc/NEWS | 4 | ||||
| -rw-r--r-- | src/fns.c | 8 |
2 files changed, 5 insertions, 7 deletions
| @@ -54,11 +54,11 @@ has been added. They are: 'file-attribute-type', | |||
| 54 | 'file-attribute-device-number' | 54 | 'file-attribute-device-number' |
| 55 | 55 | ||
| 56 | +++ | 56 | +++ |
| 57 | ** The new function `buffer-hash' has been added, and can be used to | 57 | ** The new function 'buffer-hash' has been added, and can be used to |
| 58 | compute a fash, non-consing hash of the contents of a buffer. | 58 | compute a fash, non-consing hash of the contents of a buffer. |
| 59 | 59 | ||
| 60 | --- | 60 | --- |
| 61 | ** `fill-paragraph' no longer marks the buffer as changed unless it | 61 | ** 'fill-paragraph' no longer marks the buffer as changed unless it |
| 62 | actually changed something. | 62 | actually changed something. |
| 63 | 63 | ||
| 64 | --- | 64 | --- |
| @@ -4737,13 +4737,12 @@ returns nil, then (funcall TEST x1 x2) also returns nil. */) | |||
| 4737 | #include "sha256.h" | 4737 | #include "sha256.h" |
| 4738 | #include "sha512.h" | 4738 | #include "sha512.h" |
| 4739 | 4739 | ||
| 4740 | Lisp_Object | 4740 | static Lisp_Object |
| 4741 | make_digest_string (Lisp_Object digest, int digest_size) | 4741 | make_digest_string (Lisp_Object digest, int digest_size) |
| 4742 | { | 4742 | { |
| 4743 | unsigned char *p = SDATA (digest); | 4743 | unsigned char *p = SDATA (digest); |
| 4744 | int i; | ||
| 4745 | 4744 | ||
| 4746 | for (i = digest_size - 1; i >= 0; i--) | 4745 | for (int i = digest_size - 1; i >= 0; i--) |
| 4747 | { | 4746 | { |
| 4748 | static char const hexdigit[16] = "0123456789abcdef"; | 4747 | static char const hexdigit[16] = "0123456789abcdef"; |
| 4749 | int p_i = p[i]; | 4748 | int p_i = p[i]; |
| @@ -4760,7 +4759,6 @@ secure_hash (Lisp_Object algorithm, Lisp_Object object, Lisp_Object start, | |||
| 4760 | Lisp_Object end, Lisp_Object coding_system, Lisp_Object noerror, | 4759 | Lisp_Object end, Lisp_Object coding_system, Lisp_Object noerror, |
| 4761 | Lisp_Object binary) | 4760 | Lisp_Object binary) |
| 4762 | { | 4761 | { |
| 4763 | int i; | ||
| 4764 | ptrdiff_t size, start_char = 0, start_byte, end_char = 0, end_byte; | 4762 | ptrdiff_t size, start_char = 0, start_byte, end_char = 0, end_byte; |
| 4765 | register EMACS_INT b, e; | 4763 | register EMACS_INT b, e; |
| 4766 | register struct buffer *bp; | 4764 | register struct buffer *bp; |
| @@ -5014,7 +5012,6 @@ If nil, use the current buffer." */ ) | |||
| 5014 | Lisp_Object buffer; | 5012 | Lisp_Object buffer; |
| 5015 | struct buffer *b; | 5013 | struct buffer *b; |
| 5016 | struct sha1_ctx ctx; | 5014 | struct sha1_ctx ctx; |
| 5017 | Lisp_Object digest = make_uninit_string (SHA1_DIGEST_SIZE * 2); | ||
| 5018 | 5015 | ||
| 5019 | if (NILP (buffer_or_name)) | 5016 | if (NILP (buffer_or_name)) |
| 5020 | buffer = Fcurrent_buffer (); | 5017 | buffer = Fcurrent_buffer (); |
| @@ -5038,6 +5035,7 @@ If nil, use the current buffer." */ ) | |||
| 5038 | BUF_Z_ADDR (b) - BUF_GAP_END_ADDR (b), | 5035 | BUF_Z_ADDR (b) - BUF_GAP_END_ADDR (b), |
| 5039 | &ctx); | 5036 | &ctx); |
| 5040 | 5037 | ||
| 5038 | Lisp_Object digest = make_uninit_string (SHA1_DIGEST_SIZE * 2); | ||
| 5041 | sha1_finish_ctx (&ctx, SSDATA (digest)); | 5039 | sha1_finish_ctx (&ctx, SSDATA (digest)); |
| 5042 | return make_digest_string (digest, SHA1_DIGEST_SIZE); | 5040 | return make_digest_string (digest, SHA1_DIGEST_SIZE); |
| 5043 | } | 5041 | } |