From 280776dab087fac2ffd8d3a044cd79af0b42efc6 Mon Sep 17 00:00:00 2001 From: Sam Hartman Date: Wed, 28 Sep 2011 20:55:10 +0000 Subject: [PATCH] Eliminated lots of warnings about not typecasting char * to wchar_t * Fixed various warnings in leashdll Unused variables, dropping of const from "const char *", etc. Signed-off-by: Alexey Melnikov git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25255 dc483132-0cff-0310-8789-dd5450dbe970 --- src/windows/leashdll/Makefile.in | 2 +- src/windows/leashdll/krb5routines.c | 5 +++-- src/windows/leashdll/lshfunc.c | 10 ++++------ 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/windows/leashdll/Makefile.in b/src/windows/leashdll/Makefile.in index d423d3995..12f281bd2 100644 --- a/src/windows/leashdll/Makefile.in +++ b/src/windows/leashdll/Makefile.in @@ -56,7 +56,7 @@ WINLIBS = kernel32.lib advapi32.lib user32.lib gdi32.lib Version.lib \ WINDLLFLAGS = /nologo /dll /incremental:no /release $(LOPTS) -DEFINES = -DUNICODE -D_UNICODE -DWINSOCK -DWIN32 -DWINDOWS -DNO_KRB4 +DEFINES = -DWINSOCK -DWIN32 -DWINDOWS -DNO_KRB4 !ifdef NODEBUG DEFINES = $(DEFINES) !else diff --git a/src/windows/leashdll/krb5routines.c b/src/windows/leashdll/krb5routines.c index 09d564c0a..521602c6f 100644 --- a/src/windows/leashdll/krb5routines.c +++ b/src/windows/leashdll/krb5routines.c @@ -1272,7 +1272,8 @@ MultiInputDialog( HINSTANCE hinst, HWND hwndOwner, LPWORD lpw; LPWSTR lpwsz; LRESULT ret; - int nchar, i, pwid; + int nchar, i; + size_t pwid; hgbl = GlobalAlloc(GMEM_ZEROINIT, 4096); if (!hgbl) @@ -1460,7 +1461,7 @@ static int multi_field_dialog(HWND hParent, char * preface, int n, struct textField tb[]) { extern HINSTANCE hLeashInst; - int maxwidth = 0; + size_t maxwidth = 0; int numlines = 0; int len; char * plines[16], *p = preface ? preface : ""; diff --git a/src/windows/leashdll/lshfunc.c b/src/windows/leashdll/lshfunc.c index b0c1867d4..0618fafec 100644 --- a/src/windows/leashdll/lshfunc.c +++ b/src/windows/leashdll/lshfunc.c @@ -492,7 +492,6 @@ Leash_int_kinit_ex( int displayErrors ) { - LPCSTR functionName; char aname[ANAME_SZ]; char inst[INST_SZ]; char realm[REALM_SZ]; @@ -600,7 +599,6 @@ Leash_int_kinit_ex( } #endif /* NO_AFS */ - cleanup: return leash_error_message("Ticket initialization failed.", rcL, rc5, rcA, 0, @@ -2698,7 +2696,7 @@ static int acquire_tkt_send_msg(krb5_context ctx, const char * title, const char * ccachename, krb5_principal desiredKrb5Principal, - const char * out_ccname, int out_cclen) + char * out_ccname, int out_cclen) { krb5_error_code err; HWND hNetIdMgr; @@ -2865,7 +2863,7 @@ acquire_tkt_no_princ(krb5_context context, char * ccname, int cclen) GetEnvironmentVariable("KRB5CCNAME", ccachename, sizeof(ccachename)); gle = GetLastError(); if ( ((gle == ERROR_ENVVAR_NOT_FOUND) || !ccachename[0]) && context ) { - char * ccdef = pkrb5_cc_default_name(ctx); + const char * ccdef = pkrb5_cc_default_name(ctx); SetEnvironmentVariable("KRB5CCNAME", ccdef ? ccdef : NULL); GetEnvironmentVariable("KRB5CCNAME", ccachename, sizeof(ccachename)); } @@ -2897,7 +2895,7 @@ acquire_tkt_no_princ(krb5_context context, char * ccname, int cclen) krb5_principal princ = NULL; char *mslsa_principal = NULL; char ms_realm[128] = "", *def_realm = NULL, *r; - int i; + size_t i; if (code = pkrb5_cc_resolve(ctx, "MSLSA:", &mslsa_ccache)) goto cleanup; @@ -2984,7 +2982,7 @@ acquire_tkt_for_princ(krb5_context context, krb5_principal desiredPrincipal, GetEnvironmentVariable("KRB5CCNAME", ccachename, sizeof(ccachename)); gle = GetLastError(); if ( ((gle == ERROR_ENVVAR_NOT_FOUND) || !ccachename[0]) && context ) { - char * ccdef = pkrb5_cc_default_name(ctx); + const char * ccdef = pkrb5_cc_default_name(ctx); SetEnvironmentVariable("KRB5CCNAME", ccdef ? ccdef : NULL); GetEnvironmentVariable("KRB5CCNAME", ccachename, sizeof(ccachename)); } -- 2.26.2