Hi Pavel,

I committed some changes to solve the found warnings...Please help to
verify again..And I will have a check to the whole sw module to see whether
any missed warning is still existing.thanks.

On Fri, Nov 30, 2012 at 3:54 AM, Pavel Janík <pa...@janik.cz> wrote:

> Hi,
>
> current trunk issues few warnings in sw/source/filter/ww8:
>
> cc1plus: warnings being treated as errors
> /Users/pavel/BUILD/BuildDir/ooo_trunk_src/sw/source/filter/ww8/ww8par3.cxx:
> In member function ‘SwNumRule* WW8ListManager::GetNumRule(int)’:
> /Users/pavel/BUILD/BuildDir/ooo_trunk_src/sw/source/filter/ww8/ww8par3.cxx:1125:
> warning: comparison between signed and unsigned integer expressions
> make: *** [/Users/pavel/BUILD/BuildDir/ooo_trunk_src/solver/350/
> unxmacxi.pro/workdir/CxxObject/sw/source/filter/ww8/ww8par3.o] Error 1
>
> cc1plus: warnings being treated as errors
> /Users/pavel/BUILD/BuildDir/ooo_trunk_src/sw/source/filter/ww8/wrtww8.cxx:
> In member function ‘void WW8_WrtBookmarks::MoveFieldMarks(sal_uLong,
> sal_uLong)’:
> /Users/pavel/BUILD/BuildDir/ooo_trunk_src/sw/source/filter/ww8/wrtww8.cxx:317:
> warning: comparison between signed and unsigned integer expressions
> /Users/pavel/BUILD/BuildDir/ooo_trunk_src/sw/source/filter/ww8/wrtww8.cxx:
> In member function ‘int WW8Export::CollectGrfsOfBullets() const’:
> /Users/pavel/BUILD/BuildDir/ooo_trunk_src/sw/source/filter/ww8/wrtww8.cxx:1452:
> warning: comparison between signed and unsigned integer expressions
> /Users/pavel/BUILD/BuildDir/ooo_trunk_src/sw/source/filter/ww8/wrtww8.cxx:
> In member function ‘int WW8Export::GetGrfIndex(const SvxBrushItem&)’:
> /Users/pavel/BUILD/BuildDir/ooo_trunk_src/sw/source/filter/ww8/wrtww8.cxx:1535:
> warning: comparison between signed and unsigned integer expressions
> make: *** [/Users/pavel/BUILD/BuildDir/ooo_trunk_src/solver/350/
> unxmacxi.pro/workdir/CxxObject/sw/source/filter/ww8/wrtww8.o] Error 1
>
> The following patch "fixes" these issues, but I'd like to see author
> committing the change:
>
> ===================================================================
> --- wrtww8.cxx  (revision 1415339)
> +++ wrtww8.cxx  (working copy)
> @@ -314,7 +314,7 @@
>      {
>          if (aItr->second)
>          {
> -            if (aItr->second->first == nFrom)
> +            if (aItr->second->first == static_cast<long>(nFrom))
>              {
>                  aItr->second->second.first = true;
>                  aItr->second->first = nTo;
> @@ -1449,7 +1449,7 @@
>                                 if ( pGrf )
>                                 {
>                                         bool bHas = false;
> -                                       for (int i = 0; i <
> m_vecBulletPic.size(); ++i)
> +                                       for (unsigned int i = 0; i <
> m_vecBulletPic.size(); ++i)
>                                         {
>                                                 if
> (m_vecBulletPic[i]->GetChecksum() == pGrf->GetChecksum())
>                                                 {
> @@ -1532,7 +1532,7 @@
>         int nIndex = -1;
>         if ( rBrush.GetGraphic() )
>         {
> -               for (int i = 0; i < m_vecBulletPic.size(); ++i)
> +               for (unsigned int i = 0; i < m_vecBulletPic.size(); ++i)
>                 {
>                         if (m_vecBulletPic[i]->GetChecksum() ==
> rBrush.GetGraphic()->GetChecksum())
>                         {
> Index: ww8par3.cxx
> ===================================================================
> --- ww8par3.cxx (revision 1415339)
> +++ ww8par3.cxx (working copy)
> @@ -1122,7 +1122,7 @@
>
>  SwNumRule* WW8ListManager::GetNumRule(int i)
>  {
> -       if ( i >= 0 && i < maLSTInfos.size() )
> +       if ( i >= 0 && static_cast<sal_Size>(i) < maLSTInfos.size() )
>                 return maLSTInfos[i]->pNumRule;
>         else
>                 return 0;
>
>
> --
> Pavel Janík
>
>
>
>


-- 

Best Regards,Jianhong Cheng

Reply via email to