From 1a0dd342cc21a307e568efdc2b7ae40fda310edb Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Thu, 27 Jan 2011 23:09:00 -0500 Subject: [PATCH] Windows: remove warnings afskfw.c Sometimes warnings are errors and sometimes they are just warnings. In this case, the krb5 error message functions were being passed a krb5_context with the wrong level of indirection which resulted in an actual error. Other warnings were due to improper typing and unnecessary casts. Fix them all. Change-Id: Ib2cefe94acca858dda9af92baaae3168c074bb2e Reviewed-on: http://gerrit.openafs.org/5344 Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- src/WINNT/afsd/afskfw.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/WINNT/afsd/afskfw.c b/src/WINNT/afsd/afskfw.c index 57918bb..2671e1b 100644 --- a/src/WINNT/afsd/afskfw.c +++ b/src/WINNT/afsd/afskfw.c @@ -677,7 +677,7 @@ KRB5_error(krb5_error_code rc, LPCSTR FailedFunctionName, */ if (pkrb5_get_error_message) - errText = pkrb5_get_error_message(ctx, rc); + errText = pkrb5_get_error_message(*ctx, rc); else errText = perror_message(rc); StringCbPrintf(message, sizeof(message), @@ -686,7 +686,7 @@ KRB5_error(krb5_error_code rc, LPCSTR FailedFunctionName, krb5Error, FailedFunctionName); if (pkrb5_free_error_message) - pkrb5_free_error_message(ctx, (char *)errText); + pkrb5_free_error_message(*ctx, (char *)errText); if ( IsDebuggerPresent() ) OutputDebugString(message); @@ -2554,7 +2554,7 @@ MultiInputDialog( HINSTANCE hinst, HWND hwndOwner, GlobalUnlock(hgbl); ret = DialogBoxIndirect(hinst, (LPDLGTEMPLATE) hgbl, - hwndOwner, (DLGPROC) MultiInputDialogProc); + hwndOwner, (DLGPROC) MultiInputDialogProc); GlobalFree(hgbl); switch ( ret ) { @@ -2580,9 +2580,9 @@ static int multi_field_dialog(HWND hParent, char * preface, int n, struct textField tb[]) { HINSTANCE hInst = 0; - int maxwidth = 0; + size_t maxwidth = 0; int numlines = 0; - int len; + size_t len; char * plines[16], *p = preface ? preface : ""; int i; @@ -2599,7 +2599,7 @@ multi_field_dialog(HWND hParent, char * preface, int n, struct textField tb[]) *p++ = '\0'; } if ( strlen(plines[numlines-1]) > maxwidth ) - maxwidth = (int)strlen(plines[numlines-1]); + maxwidth = strlen(plines[numlines-1]); } for ( i=0;i