Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


Hello,

Just noticed this with cppcheck:
[gdi/salnativewidgets-gtk.cxx:3452] -> [gdi/salnativewidgets-gtk.cxx:3462]:
(performance) Variable 'eState' is reassigned a value before the old one has
been used.
Here are the lines:
   3452     GtkStateType eState = (nState & CTRL_STATE_ENABLED) ?
GTK_STATE_ACTIVE : GTK_STATE_INSENSITIVE;
   3453     gint slider_width = 10;
   3454     gint slider_length = 10;
   3455     gint trough_border = 0;
   3456     gtk_widget_style_get( pWidget,
   3457                           "slider-width", &slider_width,
   3458                           "slider-length", &slider_length,
   3459                           "trough-border", &trough_border,
   3460                           NULL);
   3461 
   3462     eState = (nState & CTRL_STATE_ENABLED) ? GTK_STATE_NORMAL :
GTK_STATE_INSENSITIVE;
   3463     if( nPart == PART_TRACK_HORZ_AREA )
   3464     {
   3465         gtk_paint_box( pWidget->style,
   3466                        pixDrawable,
   3467                        eState,
   3468                        GTK_SHADOW_IN,
   3469                        NULL,
   3470                        pWidget,
   3471                        "trough",
   3472                        0, (h-slider_width-2*trough_border)/2, w,
slider_width + 2*trough_border);

Is the line 3452 could just be removed or should this part be a little
reworked?

Julien 



--
View this message in context: 
http://nabble.documentfoundation.org/Cppcheck-report-in-vcl-unx-gtk-gdi-salnativewidgets-gtk-cxx-tp4014513.html
Sent from the Dev mailing list archive at Nabble.com.

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.