KRandomSequence and 64-bit
    Nick Shaforostoff 
    shafff at ukr.net
       
    Fri Dec  9 22:39:01 GMT 2011
    
    
  
Hi all.
I see that KRandomSequence uses longs everywhere. long on 64-bit gcc systems is 8 bytes long, while int is always 4.
maybe this is ok overall, but e.g. it uses KRandom::random() return value inside, which is int. so i suppose this can actually make the sequence less random.
i propose to change the code to use ints internally, add getInt(), setSeed(int) methods and deprecate getLong and others (specifying in their documentation that they cast long to int and vice versa), and remove them completely in KDE 5.0
    
    
More information about the kde-core-devel
mailing list