warnings from MSVC2008

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

warnings from MSVC2008

Gilles Caulier-4
Hi all,

Compiling digiKam 2.0.0 under MSVC 2008 (Win7) i can see this warning
(in French) :

[ 63%] Building CXX object
core/digikam/CMakeFiles/digikamcore.dir/__/libs/widgets/graphicsview/regionframeitem.cpp.obj
regionframeitem.cpp
D:\devel\msvc\digikam-sc\core\libs\widgets\graphicsview\regionframeitem.cpp(621)
: warning C4806: '&' : opération risquée : aucune valeur de type 'boo
l' promue en type 'Digikam::RegionFrameItem::Flag' ne peut être égale
à la constante donnée
[ 63%] Building CXX object
core/digikam/CMakeFiles/digikamcore.dir/__/libs/widgets/graphicsview/graphicsdimgitem.cpp.obj
graphicsdimgitem.cpp

Line is there :

https://projects.kde.org/projects/extragear/graphics/digikam/repository/revisions/master/entry/libs/widgets/graphicsview/regionframeitem.cpp#L621

The problem is NOT operator on front of d->flags, which convert it to
pure boolean and applying AND operator with GeometryEditable is a
problem.

http://msdn.microsoft.com/en-us/library/fx3e68bw%28v=vs.80%29.aspx

What do you think about ?

Gilles Caulier
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

Re: warnings from MSVC2008

Marcel Wiesweg

> Line is there :
>
> https://projects.kde.org/projects/extragear/graphics/digikam/repository/rev
> isions/master/entry/libs/widgets/graphicsview/regionframeitem.cpp#L621
>
> The problem is NOT operator on front of d->flags, which convert it to
> pure boolean and applying AND operator with GeometryEditable is a
> problem.
>
> http://msdn.microsoft.com/en-us/library/fx3e68bw%28v=vs.80%29.aspx
>
> What do you think about ?

Yes, it's a mistake in the code. We want to ignore the event if the flag is
not set. The compiler is right with it's warning...
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

Re: warnings from MSVC2008

Gilles Caulier-4
I fixed this warning by this commit :

http://commits.kde.org/digikam/91a8ec5e16728ceb30883e56cfc5ba0c1c7ba3d7

Let's me hear if all is fine for you ?

Gilles

2011/4/4 Marcel Wiesweg <[hidden email]>:

>
>> Line is there :
>>
>> https://projects.kde.org/projects/extragear/graphics/digikam/repository/rev
>> isions/master/entry/libs/widgets/graphicsview/regionframeitem.cpp#L621
>>
>> The problem is NOT operator on front of d->flags, which convert it to
>> pure boolean and applying AND operator with GeometryEditable is a
>> problem.
>>
>> http://msdn.microsoft.com/en-us/library/fx3e68bw%28v=vs.80%29.aspx
>>
>> What do you think about ?
>
> Yes, it's a mistake in the code. We want to ignore the event if the flag is
> not set. The compiler is right with it's warning...
> _______________________________________________
> Digikam-devel mailing list
> [hidden email]
> https://mail.kde.org/mailman/listinfo/digikam-devel
>
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

Re: warnings from MSVC2008

Richard Mortimer


On 05/04/2011 11:44, Gilles Caulier wrote:
> I fixed this warning by this commit :
>
> http://commits.kde.org/digikam/91a8ec5e16728ceb30883e56cfc5ba0c1c7ba3d7
>
> Let's me hear if all is fine for you ?
>
Hi,

Apologies if I've not understood the code (I only lurk here!) but that
isn't how I expected it to be fixed. I was expecting something more like

if (!(d->flags & GeometryEditable))

or even

if ((d->flags & GeometryEditable) == 0)

The change you made just seems to ignore any other potential flag bits
that could be in that location.

Regards

Richard

P.S. Thanks for all your hard work in making Digikam. It really does
rock and 2.0.0 looks really exciting.

> Gilles
>
> 2011/4/4 Marcel Wiesweg<[hidden email]>:
>>
>>> Line is there :
>>>
>>> https://projects.kde.org/projects/extragear/graphics/digikam/repository/rev
>>> isions/master/entry/libs/widgets/graphicsview/regionframeitem.cpp#L621
>>>
>>> The problem is NOT operator on front of d->flags, which convert it to
>>> pure boolean and applying AND operator with GeometryEditable is a
>>> problem.
>>>
>>> http://msdn.microsoft.com/en-us/library/fx3e68bw%28v=vs.80%29.aspx
>>>
>>> What do you think about ?
>>
>> Yes, it's a mistake in the code. We want to ignore the event if the flag is
>> not set. The compiler is right with it's warning...
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

Re: warnings from MSVC2008

Gilles Caulier-4
2011/4/5 Richard Mortimer <[hidden email]>:

>
>
> On 05/04/2011 11:44, Gilles Caulier wrote:
>> I fixed this warning by this commit :
>>
>> http://commits.kde.org/digikam/91a8ec5e16728ceb30883e56cfc5ba0c1c7ba3d7
>>
>> Let's me hear if all is fine for you ?
>>
> Hi,
>
> Apologies if I've not understood the code (I only lurk here!) but that
> isn't how I expected it to be fixed. I was expecting something more like
>
> if (!(d->flags & GeometryEditable))
>

Right this one is better. Fixed.

Gilles
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel