+2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
+
+ * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
+ (crypto_hash_function): Now static.
+ Fix pointer signedness problems. Avoid unnecessary initializations.
+
2011-05-27 Chong Yidong <cyd@stupidchicken.com>
* termhooks.h (Vselection_alist): Make it terminal-local.
/* TYPE: 0 for md5, 1 for sha1. */
-Lisp_Object
+static Lisp_Object
crypto_hash_function (int type, Lisp_Object object, Lisp_Object start, Lisp_Object end, Lisp_Object coding_system, Lisp_Object noerror, Lisp_Object binary)
{
int i;
{
case 0: /* MD5 */
{
- unsigned char digest[16];
+ char digest[16];
md5_buffer (SSDATA (object) + start_byte,
SBYTES (object) - (size_byte - end_byte),
digest);
- if (NILP(binary))
+ if (NILP (binary))
{
- unsigned char value[33];
+ char value[33];
for (i = 0; i < 16; i++)
sprintf (&value[2 * i], "%02x", digest[i]);
- value[32] = '\0';
res = make_string (value, 32);
}
else
case 1: /* SHA1 */
{
- unsigned char digest[20];
- sha1_buffer (SDATA (object) + start_byte,
+ char digest[20];
+ sha1_buffer (SSDATA (object) + start_byte,
SBYTES (object) - (size_byte - end_byte),
digest);
- if (NILP(binary))
+ if (NILP (binary))
{
- unsigned char value[41];
+ char value[41];
for (i = 0; i < 20; i++)
sprintf (&value[2 * i], "%02x", digest[i]);
- value[40] = '\0';
res = make_string (value, 40);
}
else