Source-Changes-HG archive

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

[src/trunk]: src/sys/ufs/ext2fs cast pointers to uintptr_t before comparing t...



details:   https://anonhg.NetBSD.org/src/rev/962d43bdc77e
branches:  trunk
changeset: 817225:962d43bdc77e
user:      macallan <macallan%NetBSD.org@localhost>
date:      Fri Aug 12 20:30:15 2016 +0000

description:
cast pointers to uintptr_t before comparing them, also ()s
now this at least compiles

diffstat:

 sys/ufs/ext2fs/ext2fs_xattr.h |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 2612a2a68f64 -r 962d43bdc77e sys/ufs/ext2fs/ext2fs_xattr.h
--- a/sys/ufs/ext2fs/ext2fs_xattr.h     Fri Aug 12 20:26:15 2016 +0000
+++ b/sys/ufs/ext2fs/ext2fs_xattr.h     Fri Aug 12 20:30:15 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ext2fs_xattr.h,v 1.1 2016/08/12 19:04:03 jdolecek Exp $        */
+/*     $NetBSD: ext2fs_xattr.h,v 1.2 2016/08/12 20:30:15 macallan Exp $        */
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #define _UFS_EXT2FS_EXT2FS_XATTR_H_
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ext2fs_xattr.h,v 1.1 2016/08/12 19:04:03 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ext2fs_xattr.h,v 1.2 2016/08/12 20:30:15 macallan Exp $");
 
 #ifdef _KERNEL
 
@@ -79,7 +79,7 @@
  * doesn't overflow past end.
  */
 #define EXT2FS_XATTR_IS_LAST_ENTRY(entry, end) \
-       *((uint32_t *)(entry)) == 0 || EXT2FS_XATTR_NEXT(entry) > end
+       (*((uint32_t *)(entry)) == 0 || (uintptr_t)EXT2FS_XATTR_NEXT(entry) > (uintptr_t)end)
 
 /*
  * Each ext2fs_xattr_entry starts on next 4-byte boundary, pad if necessary.



Home | Main Index | Thread Index | Old Index