In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/1d4ea287e9a924ad1eaef98145b6d6c3b6219e80?hp=7301378635b35757b228e07c14276afaf06a4728>
- Log ----------------------------------------------------------------- commit 1d4ea287e9a924ad1eaef98145b6d6c3b6219e80 Author: Daniel Dragan <bul...@hotmail.com> Date: Sun Aug 14 11:01:00 2016 -0400 silence MSVC warnings for NATIVE_UTF8_TO_I8/I8_TO_NATIVE_UTF8 The result of I8_TO_NATIVE_UTF8 has to be U8 casted for the MSVC specific PERL_SMALL_MACRO_BUFFER option just like it is for newer CCs that dont have a small CPP buffer. Commit 1a3756de64/#127426 did add U8 casts to NATIVE_TO_LATIN1/LATIN1_TO_NATIVE but missed NATIVE_UTF8_TO_I8/I8_TO_NATIVE_UTF8. This commit fixes that. One example of the C4244 warning is VC6 thinks 0xFF & (0xFE << 6) in UTF_START_MARK could be bigger than 0xff (a char), fixes ..\inline.h(247) : warning C4244: '=' : conversion from 'long ' to 'unsigned char ', possible loss of data Also fixes ..\utf8.c(146) : warning C4244: '=' : conversion from 'UV' to 'U8', possible loss of data and alot more warnings in utf8.c ----------------------------------------------------------------------- Summary of changes: utf8.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utf8.h b/utf8.h index bc5b8c9..ee2d97e 100644 --- a/utf8.h +++ b/utf8.h @@ -156,8 +156,8 @@ END_EXTERN_C * rarely do we need to distinguish them. The term "NATIVE_UTF8" applies to * whichever one is applicable on the current platform */ #ifdef PERL_SMALL_MACRO_BUFFER -#define NATIVE_UTF8_TO_I8(ch) (ch) -#define I8_TO_NATIVE_UTF8(ch) (ch) +#define NATIVE_UTF8_TO_I8(ch) ((U8) (ch)) +#define I8_TO_NATIVE_UTF8(ch) ((U8) (ch)) #else #define NATIVE_UTF8_TO_I8(ch) (__ASSERT_(FITS_IN_8_BITS(ch)) ((U8) (ch))) #define I8_TO_NATIVE_UTF8(ch) (__ASSERT_(FITS_IN_8_BITS(ch)) ((U8) (ch))) -- Perl5 Master Repository