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:
@@ -83,7 +83,7 @@ KernelDaemon::Register(daemon_hook function, void* arg, int frequency)
|
||||
if (function == NULL || frequency < 1)
|
||||
return B_BAD_VALUE;
|
||||
|
||||
struct daemon* daemon = new(std::nothrow) struct ::daemon;
|
||||
struct ::daemon* daemon = new(std::nothrow) (struct ::daemon);
|
||||
if (daemon == NULL)
|
||||
return B_NO_MEMORY;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user