Suspicous code in kdelibs-3.5.2

R.F. Pels ruurd at tiscali.nl
Thu Apr 6 07:59:46 BST 2006


On Thursday 6 April 2006 01.21, Aaron J. Seigo wrote:

>> If the Standard does not require multidimensional arrays to be in
>> contiguous memory [1], an optimizing compiler on NUMA platforms can
>> do whatever it wants when allocating multidimensional arrays.
>
> can do, sure. which ones do, though? if it's not an issue people actually
> run into, then i don't think it is worth rewriting that particular bit of
> code.

Three things:

1) Why use a higher level language when writing code that relies on 
   certain aspects of a number of architectures?
2) From the looks of it, the result of the calculation seems the same 
   every time it is executed, so why not precalculate the array and
   use that?
3) On closer inspection of the code, it seems to me that the result of
   the calculation of the Bayer matrix is never used:

	bm is a static but has local scope
	The 'bm' variable is only used in the calculation and not in 
	the rest of the code 

   So unless I'm seriously squinting and overlooking something it seems 
   to me his is dead code. The less utility does not find a reference to 
   'bm' after the calculation is done - at least - not in the kdither_32_to_8
   function.

Comments?

-- 
R.F. Pels,  3e Rompert 118,  5233 AL  's-Hertogenbosch,  The Netherlands
+31736414590        ruurd at tiscali.nl       http://home.tiscali.nl/~ruurd





More information about the kde-core-devel mailing list