a static jni method takes the jclass for that method as its second argument; simplify pad() and divide(), and rename divide() to ceiling(); sketch FileInputStream.cpp and FileOutputStream.cpp

This commit is contained in:
Joel Dice
2007-07-25 18:48:28 -06:00
parent 38a982c7dd
commit 9ab88ef619
14 changed files with 233 additions and 49 deletions

View File

@ -60,15 +60,14 @@ avg(unsigned a, unsigned b)
inline unsigned
pad(unsigned n)
{
unsigned extra = n % BytesPerWord;
return (extra ? n + BytesPerWord - extra : n);
n += BytesPerWord - 1;
return n - (n % BytesPerWord);
}
inline unsigned
divide(unsigned n, unsigned d)
ceiling(unsigned n, unsigned d)
{
if (n and d > n) return 1;
return (n / d) + (n % d ? 1 : 0);
return (n + d - 1) / d;
}
inline bool