[prev in list] [next in list] [prev in thread] [next in thread]
List: kfm-devel
Subject: Re: Bug#22179: File Size display overflow
From: Marc Mutz <Marc () Mutz ! com>
Date: 2001-03-13 12:08:50
[Download RAW message or body]
On Monday 12 March 2001 20:07, Thomas Leitner wrote:
<snip>
> > While digging in KDE's code base, I wondered why you don't use size_t
> > (or is this a linuxism?) for sizes?
>
> Many KDE apps. do you size_t, in fact they're using ksize_t because
> size_t is not defined everywhere.
>
But not even the kdelibs do everywhere: The function I stumbled over was
unsigned long KDirSize::totalSize().
In fact,
$ cd kdelibs
$ find . -name '*.h' -o -name '*.cpp' | xargs grep ksize_t
prints nothing! But
$ cd kio
$ find . -name '*.h' | xargs grep -i size | grep 'unsigned long'|wc -l
54
and worse,
$ find . -name '*.h' | xargs grep -i size|grep uint
./gzip/kgzipfilter.h: virtual void setInBuffer( char * data, uint size );
./bzip2/kbzip2filter.h: virtual void setInBuffer( char * data, uint size );
./kfilterbase.h: virtual void setInBuffer( char * data, uint size ) = 0;
./kfilterdev.h: virtual uint size() const;
Ugh. With this variety in types used to represent sizes, bugs like the
"<insert-10-digit-number-here> files total"-Bug are bound to happen.
Marc
--
Marc Mutz <Marc@Mutz.com>
o http://marc.mutz.com (homepage)
o http://www.mathematik.uni-bielefeld.de/~mmutz/ (maths)
o http://EncryptionHOWTO.sourceforge.net
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic