Hi 

On Mi, 30 Jan 2013, skeept wrote:

> I have some warnings when compiling with visual studio 2012:
> 
> ex_cmds.c(4768) : warning C4267: '=' : conversion from 'size_t' to 'int', 
> possible loss of data
> 
> 
> if_perl.xs(1051) : warning C4244: '=' : conversion from 'IV' to 'int', 
> possible loss of data
> if_perl.xs(1094) : warning C4244: '=' : conversion from 'IV' to 'int', 
> possible loss of data
> if_perl.xs(1157) : warning C4244: '=' : conversion from 'IV' to 'int', 
> possible loss of data
> if_perl.xs(1158) : warning C4244: '=' : conversion from 'IV' to 'int', 
> possible loss of data
> if_perl.xs(1219) : warning C4244: '=' : conversion from 'IV' to 'long', 
> possible loss of data
> if_perl.xs(1242) : warning C4244: '=' : conversion from 'IV' to 'long', 
> possible loss of data
> if_perl.xs(1277) : warning C4244: '=' : conversion from 'IV' to 'long', 
> possible loss of data
> if_perl.xs(1282) : warning C4244: '=' : conversion from 'IV' to 'long', 
> possible loss of data
> if_perl.xs(1283) : warning C4244: '=' : conversion from 'IV' to 'long', 
> possible loss of data
> if_perl.xs(1334) : warning C4244: '=' : conversion from 'IV' to 'long', 
> possible loss of data
> 
> 
> I think the perl warning have been there for a while, I don't remember the 
> first one being there before this last batch of updates (may be wrong tough).

This patch fixes those warnings.

Mit freundlichen Grüßen
Christian
-- 
Die unzureichende Sinneswahrnehmung wiederlegt die Unendlichkeit
nicht.
                -- Giordano Bruno (eig. Filippo Bruno)

-- 
-- 
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.


diff --git a/src/ex_cmds.c b/src/ex_cmds.c
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -4764,7 +4764,7 @@
 					 * substitute may have inserted or
 					 * deleted characters before the
 					 * cursor. */
-					len_change = STRLEN(new_line)
+					len_change = (int) STRLEN(new_line)
 							  - STRLEN(orig_line);
 					curwin->w_cursor.col += len_change;
 					ml_replace(lnum, new_line, FALSE);
diff --git a/src/if_perl.xs b/src/if_perl.xs
--- a/src/if_perl.xs
+++ b/src/if_perl.xs
@@ -1048,7 +1048,7 @@
 	{
 	    SV *sv = ST(i);
 	    if (SvIOK(sv))
-		b = SvIV(ST(i));
+		b = (int) SvIV(ST(i));
 	    else
 	    {
 		char_u *pat;
@@ -1091,7 +1091,7 @@
     {
 	for (i = 0; i < items; i++)
 	{
-	    w = SvIV(ST(i));
+	    w = (int) SvIV(ST(i));
 	    vimwin = win_find_nr(w);
 	    if (vimwin)
 		XPUSHs(newWINrv(newSV(0), vimwin));
@@ -1154,8 +1154,8 @@
 
       if (!win_valid(win))
 	  win = curwin;
-      lnum = SvIV(ST(1));
-      col = SvIV(ST(2));
+      lnum = (int) SvIV(ST(1));
+      col = (int) SvIV(ST(2));
       win->w_cursor.lnum = lnum;
       win->w_cursor.col = col;
       check_cursor();		    /* put cursor on an existing line */
@@ -1216,7 +1216,7 @@
     {
 	for (i = 1; i < items; i++)
 	{
-	    lnum = SvIV(ST(i));
+	    lnum = (long) SvIV(ST(i));
 	    if (lnum > 0 && lnum <= vimbuf->b_ml.ml_line_count)
 	    {
 		line = ml_get_buf(vimbuf, lnum, FALSE);
@@ -1239,7 +1239,7 @@
 	if (items < 3)
 	    croak("Usage: VIBUF::Set(vimbuf, lnum, @lines)");
 
-	lnum = SvIV(ST(1));
+	lnum = (long) SvIV(ST(1));
 	for(i = 2; i < items; i++, lnum++)
 	{
 	    line = SvPV(ST(i),PL_na);
@@ -1274,13 +1274,13 @@
     {
 	if (items == 2)
 	{
-	    lnum = SvIV(ST(1));
+	    lnum = (long) SvIV(ST(1));
 	    count = 1;
 	}
 	else if (items == 3)
 	{
-	    lnum = SvIV(ST(1));
-	    count = 1 + SvIV(ST(2)) - lnum;
+	    lnum = (long) SvIV(ST(1));
+	    count = (long) 1 + SvIV(ST(2)) - lnum;
 	    if (count == 0)
 		count = 1;
 	    if (count < 0)
@@ -1331,7 +1331,7 @@
 	if (items < 3)
 	    croak("Usage: VIBUF::Append(vimbuf, lnum, @lines)");
 
-	lnum = SvIV(ST(1));
+	lnum = (long) SvIV(ST(1));
 	for (i = 2; i < items; i++, lnum++)
 	{
 	    line = SvPV(ST(i),PL_na);

Raspunde prin e-mail lui