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:
Michael Lotz
2009-02-01 20:48:02 +00:00
parent 47bc666311
commit c33667d400
24 changed files with 112 additions and 79 deletions
+4 -4
View File
@@ -364,7 +364,7 @@ Inode::WriteDataToBuffer(const void *_data, size_t *_length, bool nonBlocking)
while (dataSize > 0) {
// Wait until enough space in the buffer is available.
while (!fActive
|| fBuffer.Writable() < minToWrite && fReaderCount > 0) {
|| (fBuffer.Writable() < minToWrite && fReaderCount > 0)) {
if (nonBlocking)
return B_WOULD_BLOCK;
@@ -639,9 +639,9 @@ Inode::Select(uint8 event, selectsync *sync, int openMode)
// signal right away, if the condition holds already
if (writer) {
if (event == B_SELECT_WRITE
&& (fBuffer.Writable() > 0 || fReaderCount == 0)
|| event == B_SELECT_ERROR && fReaderCount == 0) {
if ((event == B_SELECT_WRITE
&& (fBuffer.Writable() > 0 || fReaderCount == 0))
|| (event == B_SELECT_ERROR && fReaderCount == 0)) {
return notify_select_event(sync, event);
}
} else {