A prophylactic patch: change offsetof -> blkoffsetof

This commit is contained in:
dogcow 2007-08-22 03:42:06 +00:00
parent a82b6826f5
commit fc68757006
4 changed files with 12 additions and 12 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: def.h,v 1.23 2006/12/06 16:26:24 christos Exp $ */
/* $NetBSD: def.h,v 1.24 2007/08/22 03:42:06 dogcow Exp $ */
/*
* Copyright (c) 1980, 1993
* The Regents of the University of California. All rights reserved.
@ -28,7 +28,7 @@
* SUCH DAMAGE.
*
* @(#)def.h 8.4 (Berkeley) 4/20/95
* $NetBSD: def.h,v 1.23 2006/12/06 16:26:24 christos Exp $
* $NetBSD: def.h,v 1.24 2007/08/22 03:42:06 dogcow Exp $
*/
/*
@ -175,7 +175,7 @@ typedef struct mime_info mime_info_t; /* phantom structure only to attach.c */
* Given a file address, determine the block number it represents.
*/
#define blockof(off) ((int) ((off) / 4096))
#define offsetof(off) ((int) ((off) % 4096))
#define blkoffsetof(off) ((int) ((off) % 4096))
#define positionof(block, offset) ((off_t)(block) * 4096 + (offset))
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: edit.c,v 1.21 2006/11/28 18:45:32 christos Exp $ */
/* $NetBSD: edit.c,v 1.22 2007/08/22 03:42:06 dogcow Exp $ */
/*
* Copyright (c) 1980, 1993
@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)edit.c 8.1 (Berkeley) 6/6/93";
#else
__RCSID("$NetBSD: edit.c,v 1.21 2006/11/28 18:45:32 christos Exp $");
__RCSID("$NetBSD: edit.c,v 1.22 2007/08/22 03:42:06 dogcow Exp $");
#endif
#endif /* not lint */
@ -188,7 +188,7 @@ edit1(int *msgvec, int editortype)
(void)fseek(otf, 0L, 2);
size = ftell(otf);
mp->m_block = blockof(size);
mp->m_offset = offsetof(size);
mp->m_offset = blkoffsetof(size);
mp->m_size = fsize(fp);
mp->m_lines = 0;
mp->m_blines = 0;

View File

@ -1,4 +1,4 @@
/* $NetBSD: fio.c,v 1.28 2006/11/28 18:45:32 christos Exp $ */
/* $NetBSD: fio.c,v 1.29 2007/08/22 03:42:06 dogcow Exp $ */
/*
* Copyright (c) 1980, 1993
@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)fio.c 8.2 (Berkeley) 4/20/95";
#else
__RCSID("$NetBSD: fio.c,v 1.28 2006/11/28 18:45:32 christos Exp $");
__RCSID("$NetBSD: fio.c,v 1.29 2007/08/22 03:42:06 dogcow Exp $");
#endif
#endif /* not lint */
@ -110,7 +110,7 @@ message_init(struct message *mp, off_t offset, short flags)
(void)memset(mp, 0, sizeof(*mp));
mp->m_flag = flags;
mp->m_block = blockof(offset);
mp->m_offset = offsetof(offset);
mp->m_offset = blkoffsetof(offset);
}
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: mime_decode.c,v 1.8 2007/01/03 00:24:36 christos Exp $ */
/* $NetBSD: mime_decode.c,v 1.9 2007/08/22 03:42:06 dogcow Exp $ */
/*-
* Copyright (c) 2006 The NetBSD Foundation, Inc.
@ -41,7 +41,7 @@
#include <sys/cdefs.h>
#ifndef __lint__
__RCSID("$NetBSD: mime_decode.c,v 1.8 2007/01/03 00:24:36 christos Exp $");
__RCSID("$NetBSD: mime_decode.c,v 1.9 2007/08/22 03:42:06 dogcow Exp $");
#endif /* not __lint__ */
#include <assert.h>
@ -306,7 +306,7 @@ insert_new_mip(struct mime_info *this_mip, struct mime_info *top_mip,
this_mip->mi_flink = new_mip;
new_mip->mp = salloc_message(this_mip->mp->m_flag,
(long)blockof(end_pos), offsetof(end_pos));
(long)blockof(end_pos), blkoffsetof(end_pos));
new_mip->mi_parent.mip = top_mip;
new_mip->mi_parent.mp = top_mp;