[Libreoffice] signed/unsigned comparison
Eike Rathke
ooo at erack.de
Tue Aug 9 06:12:49 PDT 2011
Hi Stephan,
On Tuesday, 2011-08-09 09:05:49 +0200, Stephan Bergmann wrote:
> On Aug 6, 2011, at 3:32 PM, Maciej Rumianowski wrote:
> >> @@ -1325,7 +1288,7 @@ String SvxNumberFormatShell::GetComment4Entry(short nEntry)
> >> if(nEntry < 0)
> >> return String();
> >>
> >> - if(nEntry<aCurEntryList.Count())
> >> + if(nEntry < (short)aCurEntryList.size())
> >> {
> >
> > 5. Should short type be replaced with sal_Int16 or more appropriate type?
>
> Some C++ compilers warn about comparisons like (x < y) where x is an rvalue of a signed integral type and y is an rvalue of an unsigned integral type.
The actual code committed has
if( static_cast<size_t>(nEntry) < aCurEntryList.size())
Eike
--
PGP/OpenPGP/GnuPG encrypted mail preferred in all private communication.
Key ID: 0x293C05FD - 997A 4C60 CE41 0149 0DB3 9E96 2F1A D073 293C 05FD
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20110809/e2aca926/attachment.pgp>
More information about the LibreOffice
mailing list