Fixed two warnings (due to -Wall).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2838 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -432,7 +432,7 @@ Stream<Cache>::ReadAt(off_t pos, uint8 *buffer, size_t *_length)
|
|||||||
run.start += (pos - offset) >> blockShift;
|
run.start += (pos - offset) >> blockShift;
|
||||||
run.length -= (pos - offset) >> blockShift;
|
run.length -= (pos - offset) >> blockShift;
|
||||||
|
|
||||||
if ((run.length << blockShift) > length) {
|
if (uint32(run.length << blockShift) > length) {
|
||||||
if (length < blockSize) {
|
if (length < blockSize) {
|
||||||
Cache cached(fVolume, run);
|
Cache cached(fVolume, run);
|
||||||
if ((block = cached.Block()) == NULL) {
|
if ((block = cached.Block()) == NULL) {
|
||||||
@@ -453,6 +453,10 @@ Stream<Cache>::ReadAt(off_t pos, uint8 *buffer, size_t *_length)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int32 bytes = run.length << blockShift;
|
int32 bytes = run.length << blockShift;
|
||||||
|
#ifdef DEBUG
|
||||||
|
if (bytes > length)
|
||||||
|
DEBUGGER("bytes greater than length");
|
||||||
|
#endif
|
||||||
length -= bytes;
|
length -= bytes;
|
||||||
bytesRead += bytes;
|
bytesRead += bytes;
|
||||||
if (length == 0)
|
if (length == 0)
|
||||||
@@ -577,7 +581,7 @@ Stream<Cache>::WriteAt(Transaction *transaction, off_t pos, const uint8 *buffer,
|
|||||||
run.start += (pos - offset) >> blockShift;
|
run.start += (pos - offset) >> blockShift;
|
||||||
run.length -= (pos - offset) >> blockShift;
|
run.length -= (pos - offset) >> blockShift;
|
||||||
|
|
||||||
if ((run.length << blockShift) > length) {
|
if (uint32(run.length << blockShift) > length) {
|
||||||
if (length < blockSize) {
|
if (length < blockSize) {
|
||||||
Cache cached(fVolume,run);
|
Cache cached(fVolume,run);
|
||||||
if ((block = cached.Block()) == NULL) {
|
if ((block = cached.Block()) == NULL) {
|
||||||
|
|||||||
Reference in New Issue
Block a user