diff options
author | Miles Bader <miles@gnu.org> | 1997-06-20 05:15:13 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 1997-06-20 05:15:13 +0000 |
commit | 6812a0a6a4ca5c94777c8377bf04c95307b823ee (patch) | |
tree | 25c54c506814d8b9a7f3e67f08d4f630f929d257 /libstore | |
parent | 9bc6b55d01451025b360cbff70807c060e61a031 (diff) |
(_store_derive):
Assert that block_size & blocks_per_page are powers of two (which should be
enforced elsewhere).
Include <assert.h>
Update FSF address.
Diffstat (limited to 'libstore')
-rw-r--r-- | libstore/derive.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/libstore/derive.c b/libstore/derive.c index 63cf3430..dc0d271b 100644 --- a/libstore/derive.c +++ b/libstore/derive.c @@ -1,9 +1,7 @@ /* Calculation of various derived store fields - Copyright (C) 1995, 1996 Free Software Foundation, Inc. - + Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. Written by Miles Bader <miles@gnu.ai.mit.edu> - This file is part of the GNU Hurd. The GNU Hurd is free software; you can redistribute it and/or @@ -18,7 +16,9 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. */ + +#include <assert.h> #include "store.h" @@ -72,13 +72,11 @@ _store_derive (struct store *store) store->log2_block_size = 0; while ((1 << store->log2_block_size) < bsize) store->log2_block_size++; - if ((1 << store->log2_block_size) != bsize) - store->log2_block_size = 0; + assert ((1 << store->log2_block_size) == bsize); /* LOG2_BLOCKS_PER_PAGE */ store->log2_blocks_per_page = 0; while ((bsize << store->log2_blocks_per_page) < vm_page_size) store->log2_blocks_per_page++; - if ((bsize << store->log2_blocks_per_page) != vm_page_size) - store->log2_blocks_per_page = 0; + assert ((bsize << store->log2_blocks_per_page) == vm_page_size); } |