Lines 1-48
Link Here
|
1 |
|
|
|
2 |
$FreeBSD: ports/editors/lfhex/files/patch-src::reader.cpp,v 1.5 2005/01/19 12:47:34 krion Exp $ |
3 |
|
4 |
--- src/reader.cpp.orig |
5 |
+++ src/reader.cpp |
6 |
@@ -12,6 +12,7 @@ |
7 |
#include <stdexcept> |
8 |
#include <algorithm> |
9 |
#include <new> |
10 |
+#include <cassert> |
11 |
|
12 |
// for stat: |
13 |
#include <sys/types.h> |
14 |
@@ -117,7 +118,7 @@ |
15 |
return true; |
16 |
} |
17 |
|
18 |
-INLINE bool Reader::is_open() const |
19 |
+bool Reader::is_open() const |
20 |
{ |
21 |
return _is_open; |
22 |
} |
23 |
@@ -195,14 +196,14 @@ |
24 |
return _offset; |
25 |
} |
26 |
|
27 |
-INLINE off_t Reader::tell() const |
28 |
+off_t Reader::tell() const |
29 |
{ |
30 |
if(!is_open()) |
31 |
return -1; |
32 |
return _offset; |
33 |
} |
34 |
|
35 |
-INLINE off_t Reader::size() const |
36 |
+off_t Reader::size() const |
37 |
{ |
38 |
return _size; |
39 |
} |
40 |
@@ -231,7 +232,7 @@ |
41 |
// free the page which is the furthest away from the page we are loading |
42 |
|
43 |
// this could be trouble if off_t is unsigned! |
44 |
- if( abs(_firstPage - pageIdx) > abs(_lastPage - pageIdx) ) |
45 |
+ if( abs((long int)(_firstPage - pageIdx)) > abs((long int)(_lastPage - pageIdx)) ) |
46 |
while(!freePage(_firstPage++)); |
47 |
else |
48 |
while(!freePage(_lastPage--)); |