Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/hash Cast away some compile warnings.



details:   https://anonhg.NetBSD.org/src/rev/e72f5fec8143
branches:  trunk
changeset: 826918:e72f5fec8143
user:      roy <roy%NetBSD.org@localhost>
date:      Thu Oct 05 09:59:04 2017 +0000

description:
Cast away some compile warnings.

diffstat:

 lib/libc/hash/hmac.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (43 lines):

diff -r 1add0ca207ed -r e72f5fec8143 lib/libc/hash/hmac.c
--- a/lib/libc/hash/hmac.c      Thu Oct 05 06:37:45 2017 +0000
+++ b/lib/libc/hash/hmac.c      Thu Oct 05 09:59:04 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: hmac.c,v 1.4 2017/01/10 17:46:26 christos Exp $        */
+/*     $NetBSD: hmac.c,v 1.5 2017/10/05 09:59:04 roy Exp $     */
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: hmac.c,v 1.4 2017/01/10 17:46:26 christos Exp $");
+__RCSID("$NetBSD: hmac.c,v 1.5 2017/10/05 09:59:04 roy Exp $");
 
 #include <string.h>
 #include <stdlib.h>
@@ -113,7 +113,7 @@
 }
 
 ssize_t
-hmac(const char *name, 
+hmac(const char *name,
     const void *key, size_t klen,
     const void *text, size_t tlen,
     void *digest, size_t dlen)
@@ -148,7 +148,7 @@
                memset((char *)p + dlen, 0, h->digsize - dlen);
        }
        (*h->init)(c);
-       (*h->update)(c, ipad, h->blocksize);
+       (*h->update)(c, ipad, (unsigned int)h->blocksize);
        (*h->update)(c, text, (unsigned int)tlen);
        (*h->final)(p, c);
 
@@ -160,5 +160,5 @@
        if (p != digest)
                memcpy(digest, p, dlen);
 
-       return h->digsize;
+       return (ssize_t)h->digsize;
 }



Home | Main Index | Thread Index | Old Index