Tighter declarations of variables.

This commit is contained in:
rocky
2005-02-28 02:05:19 +00:00
parent 306f8bc498
commit 4d393869ba

View File

@@ -1,5 +1,5 @@
/* /*
$Id: util.h,v 1.6 2005/02/03 07:36:51 rocky Exp $ $Id: util.h,v 1.7 2005/02/28 02:05:19 rocky Exp $
Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org> Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
Copyright (C) 2004, 2005 Rocky Bernstein <rocky@panix.com> Copyright (C) 2004, 2005 Rocky Bernstein <rocky@panix.com>
@@ -42,30 +42,30 @@
#undef CLAMP #undef CLAMP
#define CLAMP(x, low, high) (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x))) #define CLAMP(x, low, high) (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x)))
static inline unsigned static inline uint16_t
_cdio_len2blocks (unsigned len, int blocksize) _cdio_len2blocks (unsigned int i_len, uint16_t i_blocksize)
{ {
unsigned blocks; uint16_t i_blocks;
blocks = len / blocksize; i_blocks = i_len / i_blocksize;
if (len % blocksize) if (i_len % i_blocksize)
blocks++; i_blocks++;
return blocks; return i_blocks;
} }
/* round up to next block boundary */ /* round up to next block boundary */
static inline unsigned static inline unsigned
_cdio_ceil2block (unsigned offset, int blocksize) _cdio_ceil2block (unsigned offset, uint16_t i_blocksize)
{ {
return _cdio_len2blocks (offset, blocksize) * blocksize; return _cdio_len2blocks (offset, i_blocksize) * i_blocksize;
} }
static inline unsigned static inline unsigned int
_cdio_ofs_add (unsigned offset, unsigned length, int blocksize) _cdio_ofs_add (unsigned offset, unsigned length, uint16_t i_blocksize)
{ {
if (blocksize - (offset % blocksize) < length) if (i_blocksize - (offset % i_blocksize) < length)
offset = _cdio_ceil2block (offset, blocksize); offset = _cdio_ceil2block (offset, i_blocksize);
offset += length; offset += length;