Fixing warnings under GCC4 in preparation to enable -Werror there as well:
* Replaced the use of offsetof() for structs that aren't PODs. Add a offset_of_member() macro to util/khash.h because that's what it's used for in our cases. * Change the signature of add_debugger_command()/remove_debugger_command() on GCC > 2 to avoid the depricated conversion from string constants to char *. * Adding some "suggested" parenthesis. I know that not everyone likes that, but it pointed out at least one bug that is fixed here as well. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29113 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Vendored
+3
-3
@@ -242,7 +242,7 @@ FileMap::_Add(file_io_vec* vecs, size_t vecCount, off_t& lastOffset)
|
||||
if (lastExtent != NULL) {
|
||||
if (lastExtent->disk.offset + lastExtent->disk.length
|
||||
== vecs[i].offset
|
||||
|| lastExtent->disk.offset == -1 && vecs[i].offset == -1) {
|
||||
|| (lastExtent->disk.offset == -1 && vecs[i].offset == -1)) {
|
||||
lastExtent->disk.length += vecs[i].length;
|
||||
offset += vecs[i].length;
|
||||
start--;
|
||||
@@ -368,8 +368,8 @@ FileMap::SetMode(uint32 mode)
|
||||
|
||||
MutexLocker _(fLock);
|
||||
|
||||
if (mode == FILE_MAP_CACHE_ALL && fCacheAll
|
||||
|| mode == FILE_MAP_CACHE_ON_DEMAND && !fCacheAll)
|
||||
if ((mode == FILE_MAP_CACHE_ALL && fCacheAll)
|
||||
|| (mode == FILE_MAP_CACHE_ON_DEMAND && !fCacheAll))
|
||||
return B_OK;
|
||||
|
||||
if (mode == FILE_MAP_CACHE_ALL) {
|
||||
|
||||
Reference in New Issue
Block a user