<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
<tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="http://git.reviewboard.kde.org/r/102870/">http://git.reviewboard.kde.org/r/102870/</a>
</td>
</tr>
</table>
<br />
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Your change makes perfect sense, but:
-according to https://projects.kde.org/projects/kde/kdeutils/filelight/repository/entry/src/part/fileTree.h?rev=master FileSize is defined as quint32, so this change will only make a changed FileSize properly work, but for the moment will not change anything
-a "long" is only 32 bits using Windows compilers like Microsoft Visual studio. Using a quint64 seems to be the right thing to make.</pre>
<br />
<p>- Rolf Eike</p>
<br />
<p>On October 15th, 2011, 4:19 p.m., Anssi Hannula wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('http://git.reviewboard.kde.org/media/rb/images/review_request_box_top_bg.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
<tr>
<td>
<div>Review request for KDE Utils.</div>
<div>By Anssi Hannula.</div>
<p style="color: grey;"><i>Updated Oct. 15, 2011, 4:19 p.m.</i></p>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Filelight internally uses a FileSize type in fileTree.h to represent
file sizes. It is defined as unsigned long and contains kilobytes,
therefore it will wrap around at 4 TB when long int is 32-bit, while
64-bit is safe.
However, File::humanReadableSize() takes the size as uint instead of
FileSize, causing it wrap-around even if long int would be big enough.
This causes e.g. directories that take up 6 TB to have a caption
saying 2 TB usage (the graph is generated correctly, though).
Change it to use FileSize to avoid wrap-around on 64-bit systems where
long int is 64-bit, and to make it consistent with other code.
32-bit systems continue to be affected.
This could be trivially fixed on 32-bit systems as well after this patch by making FileSize always a 64-bit integer (and maybe dropping the divide-by-1024 trick), but since 32-bit int seems to be used due to performance reasons and I couldn't test it on a real 32-bit system, I'll leave that to someone else who can test it or knows for sure that the performance impact would be less than the impact of the wrap-around bug.
</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Built filelight in kdeutils-4.6.5 with this change and wrap-around was fixed. Code in git master seems to have no actual code changes since then.</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>src/part/fileTree.h <span style="color: grey">(fe0a9ec)</span></li>
<li>src/part/fileTree.cpp <span style="color: grey">(6da7a8f)</span></li>
</ul>
<p><a href="http://git.reviewboard.kde.org/r/102870/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>