71 int linenum() const { return _linenum; } |
71 int linenum() const { return _linenum; } |
72 void set_linenum(int line) { _linenum = line; } |
72 void set_linenum(int line) { _linenum = line; } |
73 |
73 |
74 // This converts a pointer into the buffer to a file offset. It only works |
74 // This converts a pointer into the buffer to a file offset. It only works |
75 // when the pointer is valid (i.e. just obtained from getline()). |
75 // when the pointer is valid (i.e. just obtained from getline()). |
76 long getoff(const char* s) { return _bufoff + (s - _buf); } |
76 long getoff(const char* s) { return _bufoff + (long)(s - _buf); } |
77 }; |
77 }; |
78 |
78 |
79 //------------------------------FileBuffRegion--------------------------------- |
79 //------------------------------FileBuffRegion--------------------------------- |
80 // A buffer region is really a region of some file, specified as a linked list |
80 // A buffer region is really a region of some file, specified as a linked list |
81 // of offsets and lengths. These regions can be merged; overlapping regions |
81 // of offsets and lengths. These regions can be merged; overlapping regions |