<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
On 9/8/2014 8:15 AM, Martin Landa wrote:
<blockquote type="cite">
<pre wrap="">Hi all,
I was trying to change a default value of bForce in
OGRVFKLayer::GetFeatureCount() to FALSE [1], but when I debug eg.
ogrinfo, it still reports bForce as TRUE (1)
Breakpoint 1, OGRVFKLayer::GetFeatureCount (this=0x71a7d0, bForce=1)
at ogrvfklayer.cpp:162
Any idea what could be wrong?
Thanks in advance, Martin
[1] <a class="moz-txt-link-freetext" href="http://trac.osgeo.org/gdal/browser/trunk/gdal/ogr/ogrsf_frmts/vfk/ogr_vfk.h#L83">http://trac.osgeo.org/gdal/browser/trunk/gdal/ogr/ogrsf_frmts/vfk/ogr_vfk.h#L83</a>
</pre>
</blockquote>
What you describe should work. (See <a
href="http://stackoverflow.com/questions/3533589/can-virtual-functions-have-default-parameters">this
stackoverflow post</a>).<br>
I do tend to agree with Even that changing the default seems like a
bad practice, since existing code that relies on the original
default could end up calling your new code and have unexpected
behavior.<br>
<br>
Maybe I'm not understanding what your link to the repository is
supposed to show, but when I look at the linked to the repository
code, I see <br>
<blockquote>
<table class="code">
<tbody>
<tr>
<td><br>
</td>
</tr>
<tr>
<th id="L83"><a
href="http://trac.osgeo.org/gdal/browser/trunk/gdal/ogr/ogrsf_frmts/vfk/ogr_vfk.h#L83">83</a></th>
<td> <span class="kt">int</span>
GetFeatureCount<span class="p">(</span><span class="kt">int</span> <span
class="o">=</span> TRUE<span class="p">);</span></td>
</tr>
</tbody>
</table>
</blockquote>
<br>
ie, you have not changed the default to FALSE as you intended. If
this is the code you're compiling, it would certainly explain your
problem.
</body>
</html>