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
+11 -3
View File
@@ -488,8 +488,8 @@ print_debugger_command_usage(const char* commandName)
kprintf_unfiltered("usage: %s ", command->name);
kputs_unfiltered(command->usage);
} else {
char* args[3] = { NULL, "--help", NULL };
invoke_debugger_command(command, 2, args);
const char* args[3] = { NULL, "--help", NULL };
invoke_debugger_command(command, 2, (char**)args);
}
return true;
@@ -498,16 +498,24 @@ print_debugger_command_usage(const char* commandName)
// #pragma mark - public API
int
#if __GNUC__ > 2
add_debugger_command(const char *name, int (*func)(int, char **),
const char *desc)
#else
add_debugger_command(char *name, int (*func)(int, char **), char *desc)
#endif
{
return add_debugger_command_etc(name, func, desc, NULL, 0);
}
int
#if __GNUC__ > 2
remove_debugger_command(const char * name, int (*func)(int, char **))
#else
remove_debugger_command(char * name, int (*func)(int, char **))
#endif
{
struct debugger_command *cmd = sCommands;
struct debugger_command *prev = NULL;