[Common-dev] CR: Remove "large integer implicitly truncated tounsigned type" warning
Eric Hyche ehyche at real.comThis looks fine and is now checked into HEAD and 150Cay. > -----Original Message----- > From: common-dev-bounces at helixcommunity.org > [mailto:common-dev-bounces at helixcommunity.org] On Behalf Of > Alberto Meza > Sent: Monday, April 04, 2005 12:59 PM > To: common-dev > Subject: [Common-dev] CR: Remove "large integer implicitly > truncated tounsigned type" warning > > Modified by:ameza at dextratech.com > Reviewed by: > Date:4/4/2005 > Project:Helix Symbian Player > > Synopsis: Fix warning "large integer implicitly truncated > to unsigned type" > > Overview: Casting a define value in order to remove "large integer > implicitly truncated to unsigned type" warning > The defined value is > #define CP_UTF8 65001 > and the two functions uses this value are the showed below, > however the > value is passed but never used. > > int MultiByteToWideChar(UINT8 CodePage, // code page > ULONG32 dwFlags, // > character-type options > const char* lpMultiByteStr, // string to map > int cchMultiByte, // number of > bytes in string > wchar_t* lpWideCharStr, // > wide-character buffer > int cchWideChar) // size of buffer > > > int WideCharToMultiByte(UINT8 CodePage, // code page > ULONG32 dwFlags, // performance > and mapping flags > const wchar_t* lpWideCharStr, // > wide-character string > int cchWideChar, // number of characters > char* lpMultiByteStr, // buffer for new string > int cchMultiByte, // size of buffer > char* lpDefaultChar, // default for unmappable > // characters > HXBOOL* lpUsedDefaultChar) // flag set > when default > // char. used > common/runtime/hlxosstr.cpp > > Image Size and Heap Use impact: None > Platforms and Profiles Affected: symbian-81-winscw-emulator, > helix-client-s60-advanced > Distribution Libraries Affected: None > Distribution library impact and planned action: None > Platforms and Profiles Build Verified: symbian-81-winscw-emulator, > helix-client-s60-advanced > Branch: 150Cay > > > Copyright assignment: > I agree to assign to RealNetworks full copyright ownership of the code > represented by the attached patch. I warrant that I am > legally entitled to > grant the copyright assignment and that my contribution does > not violate any > law or breach any contract. I understand that RealNetworks > may license this > code under RPSL, RCSL, and/or any other license at RealNetworks' sole > discretion. > > Index: runtime/hlxosstr.cpp > =================================================================== > RCS file: /cvsroot/common/runtime/hlxosstr.cpp,v > retrieving revision 1.20 > diff -u -w -r1.20 hlxosstr.cpp > --- runtime/hlxosstr.cpp 23 Mar 2005 23:53:09 -0000 1.20 > +++ runtime/hlxosstr.cpp 4 Apr 2005 16:52:00 -0000 > @@ -453,7 +453,6 @@ > { > int iTmpConvertSize = 0; > int iUTF8Count = 0; > - UINT16 wUtf16 = 0; > UINT32 dwUtf32 = 0; > > /* check parameters */ > @@ -595,12 +594,12 @@ > > if (ascii) > { > - m_outsize = MultiByteToWideChar(CP_UTF8, 0, (const > char*) ascii, length, > NULL, 0); > + m_outsize = MultiByteToWideChar((UINT8)CP_UTF8, 0, > (const char*) ascii, > length, NULL, 0); > if( length!=(size_t)-1 && (size_t)m_outsize<length ) > m_outsize = length; > if ((m_uni = ((wchar_t*) malloc( m_outsize * sizeof(wchar_t))))) > { > - m_outsize = MultiByteToWideChar(CP_UTF8, 0, (const > char*) ascii, > length, m_uni, m_outsize); > + m_outsize = MultiByteToWideChar((UINT8)CP_UTF8, 0, > (const char*) > ascii, length, m_uni, m_outsize); > } > else > { > @@ -618,12 +617,12 @@ > { > if (uni) > { > - m_outsize = WideCharToMultiByte(CP_UTF8, 0, uni, > length, NULL, 0, NULL, > NULL); > + m_outsize = WideCharToMultiByte((UINT8)CP_UTF8, 0, uni, > length, NULL, 0, > NULL, NULL); > if( length!=(size_t)-1 && (size_t)m_outsize<length ) > m_outsize = length; > if ( (m_ascii = ((char*) malloc(m_outsize))) ) > { > - m_outsize = WideCharToMultiByte(CP_UTF8, 0, uni, > length, m_ascii, > m_outsize, NULL, NULL); > + m_outsize = WideCharToMultiByte((UINT8)CP_UTF8, 0, > uni, length, > m_ascii, m_outsize, NULL, NULL); > } > else > { > @@ -638,7 +637,7 @@ > { > if (m_toAscii && m_ascii && m_uni) > { > - WideCharToMultiByte(CP_UTF8, 0, m_uni, -1, m_ascii, > m_size, NULL, > NULL); > + WideCharToMultiByte((UINT8)CP_UTF8, 0, m_uni, -1, > m_ascii, m_size, > NULL, NULL); > } > } > if (m_toAscii) > > > >