<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/100457/">http://git.reviewboard.kde.org/r/100457/</a>
</td>
</tr>
</table>
<br />
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<p style="margin-top: 0;">On February 1st, 2011, 10:46 p.m., <b>Michal Malek</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
<thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
<a href="http://git.reviewboard.kde.org/r/100457/diff/1/?file=7897#file7897line177" style="color: black; font-weight: bold; text-decoration: underline;">libk3bdevice/k3bdevice_mmc.cpp</a>
<span style="font-weight: normal;">
(Diff revision 1)
</span>
</th>
</tr>
</thead>
<tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
<tr>
<td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">bool K3b::Device::Device::getPerformance( UByteArray& data,</pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">177</font></th>
<td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span class="kt">unsigned</span> <span class="kt">char</span> <span class="n">header</span><span class="p">[</span><span class="n">dataLen</span><span class="p">];</span></pre></td>
<th bgcolor="#e9eaa8" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">177</font></th>
<td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span class="kt">unsigned</span> <span class="kt">char</span><span class="o"><span class="hl">*</span></span> <span class="n">header</span><span class="hl"> </span><span class="o"><span class="hl">=</span></span><span class="hl"> </span><span class="k"><span class="hl">new</span></span><span class="hl"> </span><span class="kt"><span class="hl">unsigned</span></span><span class="hl"> </span><span class="kt"><span class="hl">char</span></span><span class="hl"> </span><span class="p">[</span><span class="n">dataLen</span><span class="p">];</span></pre></td>
</tr>
</tbody>
</table>
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Why do you want to allocate this dynamically? You create a memory leak here.</pre>
</blockquote>
<p>On February 2nd, 2011, 1:38 a.m., <b>Patrick Spendrin</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">You can't have static arrays with variable size with the msvc compiler so you need to have dynamic fields instead; (memory leak shouldn't happen though).</pre>
</blockquote>
</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Ah, I've missed that, you're obviously right. Variable-sized static arrays are illegal in C++. I wonder why GCC tolerated it? Anyway, I've changed it a bit: I've used UByteArray to avoid manual allocating & freeing as it's just asking for trouble.</pre>
<br />
<p>- Michal</p>
<br />
<p>On February 2nd, 2011, 1:34 a.m., Andrius da Costa Ribas wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('http://git.reviewboard.kde.orgrb/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 K3b, Michal Malek and Patrick Spendrin.</div>
<div>By Andrius da Costa Ribas.</div>
<p style="color: grey;"><i>Updated Feb. 2, 2011, 1:34 a.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;">Small patch to fix building on Windows</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;">Tested using MSVC 2008 on a Windows 7 machine.
(now I'm testing using MSVC 2010).</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>cmake/modules/FindSamplerate.cmake <span style="color: grey">(9afd66b)</span></li>
<li>libk3b/projects/audiocd/k3baudiocdtrackreader.cpp <span style="color: grey">(83b6a43)</span></li>
<li>libk3b/tools/qprocess/qringbuffer_p.h <span style="color: grey">(4b5ea48)</span></li>
<li>libk3bdevice/k3bdevice_mmc.cpp <span style="color: grey">(4aa8dbf)</span></li>
<li>src/CMakeLists.txt <span style="color: grey">(fd630e4)</span></li>
<li>src/k3bemptydiscwaiter.cpp <span style="color: grey">(738f63c)</span></li>
<li>src/projects/k3bencodingconverter.cpp <span style="color: grey">(93d86f5)</span></li>
</ul>
<p><a href="http://git.reviewboard.kde.org/r/100457/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>