PDA

View Full Version : Variables without using, the most interesting.



daltomi
12-13-2013, 12:26 PM
Hello.
I would like to note some variables that are not being used.
There are many but these are what I found so far.
The problem is that I have no answers to correct them.

datetime.cpp#L676 (https://github.com/sphair/ClanLib/blob/master/Sources/Core/System/datetime.cpp#L676)
The line 652 maybe indicating how to use.

png_loader.cpp#L391 (https://github.com/sphair/ClanLib/blob/master/Sources/Display/ImageProviders/PNGLoader/png_loader.cpp#L391)

x11_window.cpp#L1180 (https://github.com/sphair/ClanLib/blob/master/Sources/Display/X11/x11_window.cpp#L1180)

dom_named_node_map.cpp#L252 (https://github.com/sphair/ClanLib/blob/master/Sources/Core/XML/dom_named_node_map.cpp#L252)
Later only: last_index = cur_index; but not more.

big_int_impl.cpp#L676 (https://github.com/sphair/ClanLib/blob/master/Sources/Core/Math/big_int_impl.cpp#L676)
Line 711 too.

I will be looking so grows the list :)

rombust
12-13-2013, 08:33 PM
It should be safe to remove all of them.


To be pedantic


void BigInt_Impl::set(ubyte64 d)
{
zero();
ubyte32 d_low = d;
ubyte32 d_high = d>>32;

if (d_high)
{
internal_pad(2);
digits[1] = d_high;
}

digits[0] = d;
}

"digits[0] = d;" could be changed to "digits[0] = d_low;"

daltomi
12-14-2013, 01:34 AM
Ok, thanks.

One more:
css_border_renderer.cpp#L102 (https://github.com/sphair/ClanLib/blob/master/Sources/CSSLayout/Layout/LayoutTree/css_border_renderer.cpp#L102)
From 102 to 109 unused.