Source-Changes-HG archive

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

[src/trunk]: src/lib/libkvm Cast off_t to size_t to appease lint:



details:   https://anonhg.NetBSD.org/src/rev/8b946ae82281
branches:  trunk
changeset: 971720:8b946ae82281
user:      christos <christos%NetBSD.org@localhost>
date:      Sat May 02 14:31:13 2020 +0000

description:
Cast off_t to size_t to appease lint:
warning: conversion from 'long long' to 'int' may lose accuracy

diffstat:

 lib/libkvm/kvm.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r b0b5c76cb30e -r 8b946ae82281 lib/libkvm/kvm.c
--- a/lib/libkvm/kvm.c  Sat May 02 12:58:46 2020 +0000
+++ b/lib/libkvm/kvm.c  Sat May 02 14:31:13 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kvm.c,v 1.108 2020/04/28 14:27:41 christos Exp $       */
+/*     $NetBSD: kvm.c,v 1.109 2020/05/02 14:31:13 christos Exp $       */
 
 /*-
  * Copyright (c) 1989, 1992, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)kvm.c      8.2 (Berkeley) 2/13/94";
 #else
-__RCSID("$NetBSD: kvm.c,v 1.108 2020/04/28 14:27:41 christos Exp $");
+__RCSID("$NetBSD: kvm.c,v 1.109 2020/05/02 14:31:13 christos Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -182,7 +182,7 @@
                        errno = EINVAL;
                        return -1;
                }
-               memcpy(buf, (char *)kd->dump_mem + off, size);
+               memcpy(buf, (char *)kd->dump_mem + (size_t)off, size);
                return size;
        }
 
@@ -224,7 +224,7 @@
                errno = EINVAL;
                return -1;
        }
-       memcpy(mem + off, buf, size);
+       memcpy(mem + (size_t)off, buf, size);
        return size;
 }
 



Home | Main Index | Thread Index | Old Index