diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-05-28 01:40:13 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-05-28 01:40:13 +0000 |
commit | 487c2da08884ccbb70af65a4c70accd5b152542f (patch) | |
tree | 7af4bf04b97523aaa0b9fdd355862630764422ef | |
parent | edae0ea3d86ba779ae019306751484aefd6fde48 (diff) |
hopefully the last try at making this happy across
various versions of newt (bug #4388)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/v1-0@5781 f38db490-d61c-443f-a65b-d21fe96a405b
-rwxr-xr-x | astman/astman.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/astman/astman.c b/astman/astman.c index 01087003d..c26c24be6 100755 --- a/astman/astman.c +++ b/astman/astman.c @@ -28,6 +28,14 @@ #define MAX_HEADERS 80 #define MAX_LEN 256 +/* + * 2005.05.27 - different versions of newt define the type of the buffer + * for the 5th argument to newtEntry() as char ** or const char ** . To + * let the code compile cleanly with -Werror, we cast it to void * through + * _NEWT_CAST. + */ +#define _NEWT_CAST (void *) + static struct ast_mansession { struct sockaddr_in sin; int fd; @@ -430,13 +438,13 @@ static int get_user_input(char *msg, char *buf, int buflen) newtComponent ok; newtComponent cancel; newtComponent inpfield; - char *input; + const char *input; int res = -1; struct newtExitStruct es; newtCenteredWindow(60,7, msg); - inpfield = newtEntry(5, 2, "", 50, (const char **)&input, 0); + inpfield = newtEntry(5, 2, "", 50, _NEWT_CAST &input, 0); ok = newtButton(22, 3, "OK"); cancel = newtButton(32, 3, "Cancel"); form = newtForm(NULL, NULL, 0); @@ -553,8 +561,8 @@ static int login(char *hostname) newtComponent label; newtComponent ulabel; newtComponent plabel; - char *user; - char *pass; + const char *user; + const char *pass; struct message *m; struct newtExitStruct es; char tmp[55]; @@ -603,8 +611,8 @@ static int login(char *hostname) ulabel = newtLabel(4,2,"Username:"); plabel = newtLabel(4,3,"Password:"); - username = newtEntry(14, 2, "", 20, (const char **)&user, 0); - password = newtEntry(14, 3, "", 20, (const char **)&pass, NEWT_FLAG_HIDDEN); + username = newtEntry(14, 2, "", 20, _NEWT_CAST &user, 0); + password = newtEntry(14, 3, "", 20, _NEWT_CAST &pass, NEWT_FLAG_HIDDEN); form = newtForm(NULL, NULL, 0); newtFormAddComponents(form, username, password, login, cancel, label, ulabel, plabel,NULL); |