From: Sam Hartman Date: Fri, 14 Oct 2011 14:40:32 +0000 (+0000) Subject: Fixed some warnings in libwin X-Git-Tag: krb5-1.10-alpha1~38 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6b39aeb15325008af22d4efd64a417b41884e326;p=krb5.git Fixed some warnings in libwin Signed-off-by: Alexey Melnikov git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25337 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/windows/lib/gic.c b/src/windows/lib/gic.c index 51e752dc0..fe586c6fc 100644 --- a/src/windows/lib/gic.c +++ b/src/windows/lib/gic.c @@ -103,7 +103,7 @@ gic_dialog_command(HWND hwnd, int cid, HWND hwndCtl, UINT codeNotify) for (n = 0 ; n < gd->num_prompts ; n++) { Edit_GetText(GetDlgItem(hwnd, id), gd->prompts[n].reply->data, gd->prompts[n].reply->length); - gd->prompts[n].reply->length = strlen(gd->prompts[n].reply->data); + gd->prompts[n].reply->length = (unsigned)strlen(gd->prompts[n].reply->data); id += 2; } @@ -113,7 +113,7 @@ gic_dialog_command(HWND hwnd, int cid, HWND hwndCtl, UINT codeNotify) /* * The dialog callback. */ -static BOOL CALLBACK +static INT_PTR CALLBACK gic_dialog(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { switch (message) { diff --git a/src/windows/lib/registry.c b/src/windows/lib/registry.c index 5b0e7a1ab..be4ef894d 100644 --- a/src/windows/lib/registry.c +++ b/src/windows/lib/registry.c @@ -116,7 +116,7 @@ registry_string_set(HKEY hkey, char *sub, char *x) { DWORD err; - err = RegSetValueEx(hkey, sub, 0, REG_SZ, (BYTE *)x, strlen(x) + 1); + err = RegSetValueEx(hkey, sub, 0, REG_SZ, (BYTE *)x, (DWORD)strlen(x) + 1); if (err != ERROR_SUCCESS) return -1; diff --git a/src/windows/lib/vardlg.c b/src/windows/lib/vardlg.c index 742947ee1..91a6bf4b5 100644 --- a/src/windows/lib/vardlg.c +++ b/src/windows/lib/vardlg.c @@ -45,12 +45,12 @@ ADD_DWORD(unsigned char *p, DWORD dw) return 4; } -static int +static size_t ADD_UNICODE_STRING(unsigned char *p, const char *s) { WORD *w; - int i; - int len; + size_t i; + size_t len; w = (WORD *)p; @@ -64,7 +64,7 @@ ADD_UNICODE_STRING(unsigned char *p, const char *s) #define DWORD_ALIGN(p) { while ((DWORD)p % 4) *p++ = 0x00; } -static int +static size_t ADD_DLGTEMPLATE(unsigned char *dlg, short x, short y, short cx, short cy, const char *caption, const char *fontname, WORD fontsize, WORD n) @@ -107,7 +107,7 @@ ADD_DLGTEMPLATE(unsigned char *dlg, short x, short y, short cx, short cy, return (p - dlg); } -static int +static size_t ADD_DLGITEM(unsigned char *dlg, short x, short y, short cx, short cy, const char *label, WORD id, WORD type, DWORD style) { @@ -276,7 +276,7 @@ vardlg_config(HWND hwnd, WORD width, const char *banner, WORD num_prompts, hdc = GetDC(GetDlgItem(hwnd, cid)); /* assume one label is the same as all the others */ for (n = 0 ; n < num_prompts ; n++) { - GetTextExtentPoint32(hdc, prompts[n].prompt, strlen(prompts[n].prompt), &csize); + GetTextExtentPoint32(hdc, prompts[n].prompt, (int)strlen(prompts[n].prompt), &csize); if (csize.cx > maxsize.cx) maxsize.cx = csize.cx; if (csize.cy > maxsize.cy) @@ -352,7 +352,7 @@ vardlg_config(HWND hwnd, WORD width, const char *banner, WORD num_prompts, hdc = GetDC(GetDlgItem(hwnd, id)); - GetTextExtentExPoint(hdc, p, strlen(p), cx, &nFit, + GetTextExtentExPoint(hdc, p, (int)strlen(p), cx, &nFit, pDx, &csize); banner_y += csize.cy;