Module Name:    src
Committed By:   christos
Date:           Sun Jun 26 22:20:31 UTC 2011

Modified Files:
        src/lib/libc/db/btree: bt_overflow.c bt_put.c

Log Message:
- use sizeof(var) instead of sizeof(type)
- remove useless cast


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/lib/libc/db/btree/bt_overflow.c
cvs rdiff -u -r1.19 -r1.20 src/lib/libc/db/btree/bt_put.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/db/btree/bt_overflow.c
diff -u src/lib/libc/db/btree/bt_overflow.c:1.16 src/lib/libc/db/btree/bt_overflow.c:1.17
--- src/lib/libc/db/btree/bt_overflow.c:1.16	Thu Sep 11 08:58:00 2008
+++ src/lib/libc/db/btree/bt_overflow.c	Sun Jun 26 18:20:31 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: bt_overflow.c,v 1.16 2008/09/11 12:58:00 joerg Exp $	*/
+/*	$NetBSD: bt_overflow.c,v 1.17 2011/06/26 22:20:31 christos Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993, 1994
@@ -37,7 +37,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: bt_overflow.c,v 1.16 2008/09/11 12:58:00 joerg Exp $");
+__RCSID("$NetBSD: bt_overflow.c,v 1.17 2011/06/26 22:20:31 christos Exp $");
 
 #include "namespace.h"
 #include <sys/param.h>
@@ -87,7 +87,7 @@
 	uint32_t sz, nb, plen;
 	size_t temp;
 
-	memmove(&pg, p, sizeof(pgno_t));
+	memmove(&pg, p, sizeof(pg));
 	memmove(&sz, (char *)p + sizeof(pgno_t), sizeof(uint32_t));
 	*ssz = sz;
 
@@ -97,7 +97,7 @@
 #endif
 	/* Make the buffer bigger as necessary. */
 	if (*bufsz < sz) {
-		*buf = (char *)(*buf == NULL ? malloc(sz) : realloc(*buf, sz));
+		*buf = (*buf == NULL ? malloc(sz) : realloc(*buf, sz));
 		if (*buf == NULL)
 			return (RET_ERROR);
 		*bufsz = sz;
@@ -200,7 +200,7 @@
 	uint32_t sz, plen;
 	size_t temp;
 
-	(void)memmove(&pg, p, sizeof(pgno_t));
+	(void)memmove(&pg, p, sizeof(pg));
 	(void)memmove(&sz, (char *)p + sizeof(pgno_t), sizeof(uint32_t));
 
 #ifdef DEBUG

Index: src/lib/libc/db/btree/bt_put.c
diff -u src/lib/libc/db/btree/bt_put.c:1.19 src/lib/libc/db/btree/bt_put.c:1.20
--- src/lib/libc/db/btree/bt_put.c:1.19	Thu Feb 12 01:40:14 2009
+++ src/lib/libc/db/btree/bt_put.c	Sun Jun 26 18:20:31 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: bt_put.c,v 1.19 2009/02/12 06:40:14 lukem Exp $	*/
+/*	$NetBSD: bt_put.c,v 1.20 2011/06/26 22:20:31 christos Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993, 1994
@@ -37,7 +37,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: bt_put.c,v 1.19 2009/02/12 06:40:14 lukem Exp $");
+__RCSID("$NetBSD: bt_put.c,v 1.20 2011/06/26 22:20:31 christos Exp $");
 
 #include "namespace.h"
 #include <sys/types.h>
@@ -127,7 +127,7 @@
 				return (RET_ERROR);
 			tkey.data = kb;
 			tkey.size = NOVFLSIZE;
-			memmove(kb, &pg, sizeof(pgno_t));
+			memmove(kb, &pg, sizeof(pg));
 			memmove(kb + sizeof(pgno_t),
 			    &key->size, sizeof(uint32_t));
 			dflags |= P_BIGKEY;
@@ -138,7 +138,7 @@
 				return (RET_ERROR);
 			tdata.data = db;
 			tdata.size = NOVFLSIZE;
-			memmove(db, &pg, sizeof(pgno_t));
+			memmove(db, &pg, sizeof(pg));
 			_DBFIT(data->size, uint32_t);
 			temp = (uint32_t)data->size;
 			(void)memmove(db + sizeof(pgno_t),

Reply via email to