Hi,

I found some compiler warnings in winclip.c.
Attached patch fixes them.

Thanks,
Ken Takata

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


# HG changeset patch
# Parent 71d7d1f1b9a05ecb00db962b468b1ef71142b730
diff --git a/src/winclip.c b/src/winclip.c
--- a/src/winclip.c
+++ b/src/winclip.c
@@ -180,7 +180,7 @@
 {
     *outlen = WideCharToMultiByte(cp, flags, in, inlen, NULL, 0, def, useddef);
     /* Add one one byte to avoid a zero-length alloc(). */
-    *out = alloc((unsigned)*outlen + 1);
+    *out = (LPSTR)alloc((unsigned)*outlen + 1);
     if (*out != NULL)
     {
 	WideCharToMultiByte(cp, flags, in, inlen, *out, *outlen, def, useddef);
@@ -557,7 +557,7 @@
 		return;		/* out of memory */
 	    }
 	    WideCharToMultiByte(GetACP(), 0, out, len,
-						  str, metadata.txtlen, 0, 0);
+					   (LPSTR)str, metadata.txtlen, 0, 0);
 
 	    /* Allocate memory for the UTF-16 text, add one NUL word to
 	     * terminate the string. */
@@ -584,7 +584,7 @@
 
 	if (lpszMem)
 	{
-	    vim_strncpy(lpszMem, str, metadata.txtlen);
+	    vim_strncpy((char_u *)lpszMem, str, metadata.txtlen);
 	    GlobalUnlock(hMem);
 	}
     }
@@ -677,7 +677,8 @@
     {
 	/* We can do any CP### -> UTF-16 in one pass, and we can do it
 	 * without iconv() (convert_* may need iconv). */
-	MultiByteToWideChar_alloc(enc_codepage, 0, str, *lenp, &ret, &length);
+	MultiByteToWideChar_alloc(enc_codepage, 0, (LPCSTR)str, *lenp,
+							       &ret, &length);
     }
     else
     {
@@ -787,7 +788,8 @@
 {
     LPWSTR	widestr;
 
-    MultiByteToWideChar_alloc(GetACP(), 0, str, str_size, &widestr, outlen);
+    MultiByteToWideChar_alloc(GetACP(), 0, (LPCSTR)str, str_size,
+							    &widestr, outlen);
     if (widestr != NULL)
     {
 	++*outlen;	/* Include the 0 after the string */

Raspunde prin e-mail lui