<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.0.4" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>Calitko</title>
	<link>http://www.calitko.org</link>
	<description>Calitko Project Home</description>
	<pubDate>Fri, 09 Nov 2007 08:54:40 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.4</generator>
	<language>en</language>
			<item>
		<title>Calitko v0.6.3</title>
		<link>http://www.calitko.org/source-code/944</link>
		<comments>http://www.calitko.org/source-code/944#comments</comments>
		<pubDate>Fri, 09 Nov 2007 08:54:40 +0000</pubDate>
		<dc:creator>Peter Dimov</dc:creator>
		
	<category>Source Code</category>
		<guid isPermaLink="false">http://www.calitko.org/source-code/944</guid>
		<description><![CDATA[Get the source code:

from SourceForge.net (calitko-0.6.3-src.tar.gz)
using Bazaar (bzr branch http://bzr.calitko.org/releases/calitko-0.6.3)

New in this source code release:

Started writing automated acceptance tests.
Started work on the HTTP implementation.
Finally integrated some of the Generic components for use in the HTTP implementation.
BitTorrent packets are generated using packet-gen.
BitTorrent partial implementation for Tracker requests.
Fixed many compiler warnings. Create a scripts which filters out [...]]]></description>
			<content:encoded><![CDATA[<p>Get the source code:</p>
<ul>
<li>from SourceForge.net (<em><a href="http://prdownloads.sourceforge.net/calitko/calitko-0.6.3-src.tar.gz?download">calitko-0.6.3-src.tar.gz</a></em>)</li>
<li>using Bazaar (<em>bzr branch http://bzr.calitko.org/releases/calitko-0.6.3</em>)</li>
</ul>
<p>New in this source code release:</p>
<ul>
<li>Started writing automated acceptance tests.</li>
<li>Started work on the HTTP implementation.</li>
<li>Finally integrated some of the Generic components for use in the HTTP implementation.</li>
<li>BitTorrent packets are generated using packet-gen.</li>
<li>BitTorrent partial implementation for Tracker requests.</li>
<li>Fixed many compiler warnings. Create a scripts which filters out the warnings we chose to ignore.</li>
</ul>
<p>The following people have contributed to this Calitko release:</p>
<ul>
<li>Peter Dimov</li>
<li>Petr Zemek</li>
<li>Paul Martel</li>
</ul>
]]></content:encoded>
			<wfw:commentRSS>http://www.calitko.org/source-code/944/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>My master thesis is now available for download.</title>
		<link>http://www.calitko.org/source-talk/943</link>
		<comments>http://www.calitko.org/source-talk/943#comments</comments>
		<pubDate>Fri, 28 Sep 2007 22:48:45 +0000</pubDate>
		<dc:creator>Peter Dimov</dc:creator>
		
	<category>Source Talk</category>
		<guid isPermaLink="false">http://www.calitko.org/source-talk/943</guid>
		<description><![CDATA[Dear all,
I&#8217;m happy to announce that I submitted my master thesis on Friday, September 28. The topic is &#8220;Unit-Testing towards a Specification: A Systematic Approach&#8221; and can be downloaded from:
http://bzr.calitko.org/developers/peter/MasterThesis.pdf
In the thesis I do a quick introduction to Test Driven Development (TDD) and Mock Objects. Then I present CalitkoMocks - the Mock Object framework I [...]]]></description>
			<content:encoded><![CDATA[<p>Dear all,</p>
<p>I&#8217;m happy to announce that I submitted my master thesis on Friday, September 28. The topic is &#8220;Unit-Testing towards a Specification: A Systematic Approach&#8221; and can be downloaded from:</p>
<p><a href="http://bzr.calitko.org/developers/peter/MasterThesis.pdf">http://bzr.calitko.org/developers/peter/MasterThesis.pdf</a></p>
<p>In the thesis I do a quick introduction to Test Driven Development (TDD) and Mock Objects. Then I present CalitkoMocks - the Mock Object framework I created for Calitko - which we use for most of out tests. I also introduce some test refactorings and show how specifications in form of sequence diagrams can be extracted from tests. In one of the chapters I present a step-by-step example showing the use of TDD with Mock Objects (CalitkoMocks), test refactorings, and sequence diagram generation. The example is done in the context of Calitko and as such should be extremely useful for any new Calitko member.</p>
<p>Older versions of some of the chapters are already published as separate manuals under <a href="http://trac.calitko.org/wiki/Manuals">http://trac.calitko.org/wiki/Manuals</a>. Hopefully in the near future I&#8217;ll find some time to update these manuals or even convert my master thesis completely to the wiki format.</p>
<p>I hope you&#8217;ll enjoy the reading!</p>
<p>Peter</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.calitko.org/source-talk/943/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Re: Disable the app subproject (temporarily)?</title>
		<link>http://www.calitko.org/source-talk/942</link>
		<comments>http://www.calitko.org/source-talk/942#comments</comments>
		<pubDate>Fri, 07 Sep 2007 15:33:29 +0000</pubDate>
		<dc:creator>Peter Dimov</dc:creator>
		
	<category>Source Talk</category>
		<guid isPermaLink="false">http://www.calitko.org/source-talk/942</guid>
		<description><![CDATA[Dear all,
I&#8217;m planning on further developing the Http component. I will target the functionality of downloading a complete file with a single HTTP request. It will be interesting to see how the Protocol/Generics components would work for a non-packet oriented protocol.
We also have dependencies of BitTorrent and Gnutella on HTTP, so in this regard it [...]]]></description>
			<content:encoded><![CDATA[<p>Dear all,</p>
<p>I&#8217;m planning on further developing the Http component. I will target the functionality of downloading a complete file with a single HTTP request. It will be interesting to see how the Protocol/Generics components would work for a non-packet oriented protocol.</p>
<p>We also have dependencies of BitTorrent and Gnutella on HTTP, so in this regard it also makes sense to focus on our Http implementation. Once we have some HTTP downloads working we could devote some energy on our download services and UI.</p>
<p>My initial idea is to create an HttpClientSession on top of a Generics::Session object (similarly to BitTorrent::Transfers::TransferSessionImpl). The actual Generics::Session object would be a Generics::GenericSession initialized with an Http::DataSerializer. Http::Header and Http::BodyChunk would derive from Generics::Data and HttpClientSession would represent HTTP request and response messages as a sequence of Http::Header HttpBodyChunk *.</p>
<p>I&#8217;d like to give the Http::DataSerializer a try&#8230; anybody interested in the HttpClientSession part?</p>
<p>Regards,</p>
<p>Peter</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.calitko.org/source-talk/942/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Re: Disable the app subproject (temporarily)?</title>
		<link>http://www.calitko.org/source-talk/941</link>
		<comments>http://www.calitko.org/source-talk/941#comments</comments>
		<pubDate>Fri, 07 Sep 2007 15:29:47 +0000</pubDate>
		<dc:creator>Peter Dimov</dc:creator>
		
	<category>Source Talk</category>
		<guid isPermaLink="false">http://www.calitko.org/source-talk/941</guid>
		<description><![CDATA[Dear All,
As a follow-up to Petr&#8217;s post I&#8217;d like to express my vision of Calitko. I&#8217;ll be looking forward to reading your views on our common aim and the way to achieving it. I would appreciate any feedback and ideas how to better communicate the message and aim of Caltiko Project on our own and [...]]]></description>
			<content:encoded><![CDATA[<p>Dear All,</p>
<p>As a follow-up to Petr&#8217;s post I&#8217;d like to express my vision of Calitko. I&#8217;ll be looking forward to reading your views on our common aim and the way to achieving it. I would appreciate any feedback and ideas how to better communicate the message and aim of Caltiko Project on our own and other sites.</p>
<p>The ultimate aim of Calitko Project is to create an extensible software P2P platform. Calitko is both a framework and the application we build while developing the framework. The idea is not to include Calitko as a library to other projects, the idea for other projects to build upon Calitko. A suitable example I think is Eclipse. Calitko would provide core services which 3rdParty plugins could build upon to extend Calitko and provide new services.</p>
<p>Calitko would be of interest to developers fond of software technologies, which care about creating high quality software at all levels (down from source code up to the UI). It would be of interest to P2P researchers, who would be able to easily experiment with existing and new protocols because most of the tasks would already be handled by Calitko (for example, we already have packet-gen which allows us to describe packets in XML and have the C++ code generated).</p>
<p>The architecture of Calitko Project is quite simple - we have three layers of abstraction - Protocols, Services, UIs. We are currently doing work exclusively at the lowest layer (Protocols). If at the Protocols level we have the file-transfer and file-sharing protocols HTTP, FTP, Gnutella, BitTorrent, we could have a single FileDownloader service at the Services layer. Ideally, once we have the FileDownloader service we would be able to extend it to support infinite number of new protocols without many modifications to FileDownloader itself. Similarly, we could create a new service at the Services layer that uses HTTP or Gnutella for something different than file transfers, e.g. for media streaming. At the UIs layer we could have alternative UIs for each of our services.</p>
<p>I see the best way to proceed is bottom-up, i.e. from Protocols through Services to UIs. First we would concentrate on file transfers (both downloads and uploads), next we could move to instant messaging or distributed computations. Once we have a solid base of code and services and more and more new people join us, we would have an infinite set of possibilities - that&#8217;s what I love about software most - aside from CPU and memory, which are increasing steadily, the only limitation we have with software  is our own imagination!</p>
<p>Best regards,</p>
<p>Peter</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.calitko.org/source-talk/941/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Re: Disable the app subproject (temporarily)?</title>
		<link>http://www.calitko.org/source-talk/940</link>
		<comments>http://www.calitko.org/source-talk/940#comments</comments>
		<pubDate>Fri, 07 Sep 2007 15:01:49 +0000</pubDate>
		<dc:creator>Petr Zemek</dc:creator>
		
	<category>Source Talk</category>
		<guid isPermaLink="false">http://www.calitko.org/source-talk/940</guid>
		<description><![CDATA[Hi Peter,
I agree with you that we should disable the calitko.pri subproject since we&#8217;re not working on it. However, I think that we should at first focus on some protocol implementation (BitTorrent seems to me as the best choice now) that will use our generic interface so we have something like a simple and working [...]]]></description>
			<content:encoded><![CDATA[<p>Hi Peter,</p>
<p>I agree with you that we should disable the calitko.pri subproject since we&#8217;re not working on it. However, I think that we should at first focus on some protocol implementation (BitTorrent seems to me as the best choice now) that will use our generic interface so we have something like a simple and working p2p &#8220;framework&#8221;. Then I&#8217;d suggest to re-open the calitko.pri project and try to refactor the application to use our &#8220;framework&#8221; with some basic generic functionality instead of the old Gnutella code. Then I&#8217;d try to add basic BitTorrent functionality (maybe as a some kind of a plugin?), step by step (as you wrote), so the application will be functional and up-to-date. After we have this, we could regularly add some functionality to the tester.pri and right then to the calitko.pri.</p>
<p>I know that it will be actually more difficult because I haven&#8217;t elaborated on this too much and I don&#8217;t know exactly what the application should do, but what I want to say is that I think that having a generic p2p &#8220;framework&#8221; is more important than having a more-or-less functional application.</p>
<p>Could you please describe your (concrete) ideas what the application actually should do (or you&#8217;re planning it should do)? I&#8217;d really appreciate it since I think it will bring more light into my thinking about this topic.</p>
<p>Have a nice day,</p>
<p>Petr
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.calitko.org/source-talk/940/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Disable the app subproject (temporarily)?</title>
		<link>http://www.calitko.org/source-talk/939</link>
		<comments>http://www.calitko.org/source-talk/939#comments</comments>
		<pubDate>Fri, 07 Sep 2007 11:08:36 +0000</pubDate>
		<dc:creator>Peter Dimov</dc:creator>
		
	<category>Source Talk</category>
		<guid isPermaLink="false">http://www.calitko.org/source-talk/939</guid>
		<description><![CDATA[Dear all,
I&#8217;m just back from a vacation and now I&#8217;m looking forward to doing some Calitko work again!
I was thinking recently that in at least in the last 6 months we have done almost no progress in the calitko.pri subproject. The application that it builds mainly runs the code in Gnutella and UIs. The tendency [...]]]></description>
			<content:encoded><![CDATA[<p>Dear all,</p>
<p>I&#8217;m just back from a vacation and now I&#8217;m looking forward to doing some Calitko work again!</p>
<p>I was thinking recently that in at least in the last 6 months we have done almost no progress in the calitko.pri subproject. The application that it builds mainly runs the code in Gnutella and UIs. The tendency is anyway to refactor all of Gnutella to Protocols/Gnutella reusing the components in Protocols/Generics, so I suggest to temporarily disable the calitko.pri subproject. This way people checking the app every few months would not think we are doing no progress at all.</p>
<p>We should try to test &#038; implement a complete set of classes implementing certain functionality which could be integrated in a new app project. For each new release we should target at testing and implementing new functionality in tester.pri and integrating it in the the new calitko.pri. Since each of us only has limited time to work on the project we should work together on a common short term target in order to get more stuff integrated in the app and less code only covered by tests.</p>
<p>What do you guys think?</p>
<p>Regards,</p>
<p>Peter</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.calitko.org/source-talk/939/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Re: ICC compiler warnings - discussion</title>
		<link>http://www.calitko.org/source-talk/938</link>
		<comments>http://www.calitko.org/source-talk/938#comments</comments>
		<pubDate>Sun, 19 Aug 2007 21:26:19 +0000</pubDate>
		<dc:creator>Petr Zemek</dc:creator>
		
	<category>Source Talk</category>
		<guid isPermaLink="false">http://www.calitko.org/source-talk/938</guid>
		<description><![CDATA[Hi Peter,
Yes, we should remove them, but you could filter all such warnings from the Gnutella package.
Ok, I&#8217;ve added them to the ignore list for now.
value_ is non-pointer member. Could you look more into that please?
The official Intel compiler docs says about this warning:
Use delete on pointer members in destructors. The compiler diagnoses any pointer [...]]]></description>
			<content:encoded><![CDATA[<p>Hi Peter,</p>
<blockquote><p>Yes, we should remove them, but you could filter all such warnings from the Gnutella package.</p></blockquote>
<p>Ok, I&#8217;ve added them to the ignore list for now.</p>
<blockquote><p>value_ is non-pointer member. Could you look more into that please?</p></blockquote>
<p>The official Intel compiler docs says about this warning:</p>
<p><code>Use delete on pointer members in destructors. The compiler diagnoses any pointer that does not have a delete.</code></p>
<p>And this is what one would expect, but as I wrote, this warning appears also in classes with no pointer members at all&#8230; I haven&#8217;t found anything about this on the Internet neither.</p>
<blockquote><p>I’d suggest that we tag all classes with one of: REFERENCE_OBJECT, VALUE_OBJECT, STATIC_HELPER. Maybe we could also create a custom Doxygen command (seems to be possible to be defined in Doxyfile) and tag also the docs.</p></blockquote>
<p>I agree!</p>
<blockquote><p><code>./Gnutella/LocalPeer.h(36): warning #64: declaration does not declare anything<br />
    class UIs::Searching::SearchModel;</code></p>
<p>What’s the exact meaning of this warning? That the forward declaration is unnecessary because the the class is fully specified already?</p></blockquote>
<p>No, in this case it means that <code>class UIs::Searching::SearchModel</code> was already declared in the imported <code>UIs/Searching/Namespace.h</code> header. The warning itself (it&#8217;s &#8220;name&#8221;) is a little bit awkward, though.</p>
<blockquote><p><code>Declaration of “some variable” shadows a member of ‘this’</code></p>
<p>We should enforce the memberName_ naming convention</p></blockquote>
<p>Yes, I agree, especially when not using PrivateData class as a private data storage.</p>
<blockquote><p>Please fix as many warnings as you can in your branch and I’ll merge all your revisions at once.</p>
<p>Maybe you could also update your calitko-dev branch and also fix all remaining BitTorrent warnings. I’ll do the same to fix the warnings in Utils::ObjectDispatcher.</p></blockquote>
<p>Ok, I&#8217;ve fixed nearly all warnings (except these in the Gnutella package) - the latest revno is <a href="http://trac.calitko.org/changeset/developers/s3rvac/calitko-dev%2C219">219</a>. I&#8217;ve fixed them in my calitko-dev branch, so I could fix also nearly all warnings in the BitTorrent package. I&#8217;ve also merged my calitko branch, so you don&#8217;t have to merge it - you can merge only my dev branch.</p>
<p>I&#8217;ve also updated our ignored warnings lists - I&#8217;ll soon update the wiki documentation to be up to date.</p>
<p>You can take a look into the attached file for a short list of warnings that still need to be fixed, nevertheless I&#8217;m really glad the we managed to fix nearly all warnings ;). There are still some problems, though (see TODOs in linux-icc.txt file).</p>
<p>Regards,</p>
<p>Petr</p>
<div class="AF_PostFiles">
  <h5>Attached Files:</h5>
	<div class="AF_File">
    <p><span class="AF_Filename"><a href="http://www.calitko.org/?action=download&amp;file_id=205">warnings.log</a></span> <span class="AF_Filesize">2K</span></p>
  </div>
<!-- br style="clear: both;" /--></div>]]></content:encoded>
			<wfw:commentRSS>http://www.calitko.org/source-talk/938/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Re: ICC compiler warnings - discussion</title>
		<link>http://www.calitko.org/source-talk/937</link>
		<comments>http://www.calitko.org/source-talk/937#comments</comments>
		<pubDate>Sun, 19 Aug 2007 17:16:35 +0000</pubDate>
		<dc:creator>Peter Dimov</dc:creator>
		
	<category>Source Talk</category>
		<guid isPermaLink="false">http://www.calitko.org/source-talk/937</guid>
		<description><![CDATA[Hi Petr, 
Great post! I agree with your suggestions, I&#8217;ll only comment some of the warnings.
using-declaration ignored — it refers to the current namespace
Appears only in the Gnutella package (79 total).
./Gnutella/NodeInfo.h(36): warning #780: using-declaration ignored &#8212; it refers to the current namespace
using Gnutella::NodeType;
These using declarations are superfluous, so we should remove them.
Yes, we should remove [...]]]></description>
			<content:encoded><![CDATA[<p>Hi Petr, </p>
<p>Great post! I agree with your suggestions, I&#8217;ll only comment some of the warnings.</p>
<blockquote><p>using-declaration ignored — it refers to the current namespace<br />
Appears only in the Gnutella package (79 total).</p>
<p>./Gnutella/NodeInfo.h(36): warning #780: using-declaration ignored &#8212; it refers to the current namespace<br />
using Gnutella::NodeType;</p>
<p>These using declarations are superfluous, so we should remove them.</p></blockquote>
<p>Yes, we should remove them, but you could filter all such warnings from the Gnutella package.</p>
<blockquote><p>Effective C++ Item 6 missing delete of member pointer member “Some variable” in destructor<br />
Nearly everywhere (777 total).</p>
<p>Protocols/BitTorrent/Bencoding/BString.h(58): warning #2017: Effective C++ Item 6 missing delete of member pointer member &#8220;Protocols::BitTorrent::Bencoding::BString::value_&#8221; in destructor<br />
{}</p>
<p>I don’t really get (understand) this warning - it appears also on places where there is no pointer member variable… I’d understand it if it was only in dtors of classes with some pointer member variable.
</p></blockquote>
<p>value_ is non-pointer member. Could you look more into that please?</p>
<blockquote><p>
Effective C++ Item 11 declare a copy constructor and assignment operator for PrivateData<br />
Gnutella, Http and CalitkoMocks mostly (734 total).</p>
<p>./Http/HeaderReader.h(65): warning #2021: Effective C++ Item 11 declare a copy constructor and assignment operator for Private<br />
} p;</p>
<p>I first thought that this warning was useless, but then I saw that in classes where we don’t use QSharedData (or some other class that have defined copy ctor/assignment operator) for storing private data we don’t have our own copy ctor/assignment operator defined, but there are pointers in the PrivateData classes. This could lead to problems (copy ctor/assignment operator generated by a compiler performs only shalow copy, not deep copy). My suggestion is to either use our REFERENCE_OBJECT macro to disable copy ctor/assignment operator, or use QSharedData instead of a struct or define our own copy ctor/assignment operator.</p></blockquote>
<p>I&#8217;d suggest that we tag all classes with one of: REFERENCE_OBJECT, VALUE_OBJECT, STATIC_HELPER. Maybe we could also create a custom Doxygen command (seems to be possible to be defined in Doxyfile) and tag also the docs.</p>
<blockquote><p>
Effective C++ Item 12 field member “Some class member” not initialized (preferable to assignment in constructors)</p></blockquote>
<p>g++ reports that too - all of them should be fixed now (except for Protocols/BitTorrent and Utils/ObjectDispatcher which are probably fixed in other branches already).</p>
<blockquote><p>
Declaration does not declare anything<br />
./Gnutella/LocalPeer.h:36.</p>
<p>./Gnutella/LocalPeer.h(36): warning #64: declaration does not declare anything<br />
class UIs::Searching::SearchModel;</p></blockquote>
<p>What&#8217;s the exact meaning of this warning? That the forward declaration is unnecessary because the the class is fully specified already?</p>
<blockquote><p>
conversion from “int” to “uchar={unsigned char}” may lose significant bits<br />
Gnutella, UIs, Utils::Uri (115 total).</p>
<p>./Gnutella/Packets/QueryHits.h(160): warning #810: conversion from &#8220;int&#8221; to &#8220;uchar={unsigned char}&#8221; may lose significant bits<br />
uchar numberOfHits() const { return p.resultSet.size(); }</p>
<p>We should check whether there could be no range problems.</p></blockquote>
<p>g++ does not seem to report that. We should probably assert that p.resultSet.size() < = 0xFF. If we use a static_cast the warning should go away.</p>
<blockquote><p>Declaration of “some variable” shadows a member of ‘this’</p>
<p>We should enforce the <code>memberName_</code> naming convention.</p>
<blockquote><p>
function “QDialog::done(int)” is hidden by “UIs::ManagePacketsDialog::done” — virtual function override intended?</p></blockquote>
<p>g++ reported that too - I&#8217;ve fixed it in calitko,141</p>
<p>Please fix as many warnings as you can in your branch and I&#8217;ll merge all your revisions at once.</p>
<p>Maybe you could also update your calitko-dev branch and also fix all remaining BitTorrent warnings. I&#8217;ll do the same to fix the warnings in Utils::ObjectDispatcher. We&#8217;ll very soon have clean builds ;-)</p>
<p>Best regards,</p>
<p>Peter</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.calitko.org/source-talk/937/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>ICC compiler warnings - discussion</title>
		<link>http://www.calitko.org/source-talk/936</link>
		<comments>http://www.calitko.org/source-talk/936#comments</comments>
		<pubDate>Sat, 18 Aug 2007 16:48:43 +0000</pubDate>
		<dc:creator>Petr Zemek</dc:creator>
		
	<category>Source Talk</category>
		<guid isPermaLink="false">http://www.calitko.org/source-talk/936</guid>
		<description><![CDATA[Dear all,
I&#8217;ve recently added extra warnings for ICC (Intel C/C++ compiler) and compiled my latest calitko branch (developers/s3rvac/calitko,142) with this compiler (using our compilation.py script). There are some warnings which I&#8217;d like to discuss (I&#8217;ll follow the following layout: &#8220;name&#8221; of the warning, places of appearance (example[s]), suggestion how to fix it or why we [...]]]></description>
			<content:encoded><![CDATA[<p>Dear all,</p>
<p>I&#8217;ve recently added extra warnings for ICC (Intel C/C++ compiler) and compiled my latest calitko branch (<a href="http://trac.calitko.org/changeset/developers/s3rvac/calitko%2C142">developers/s3rvac/calitko,142</a>) with this compiler (using our compilation.py script). There are some warnings which I&#8217;d like to discuss (I&#8217;ll follow the following layout: &#8220;name&#8221; of the warning, places of appearance (example[s]), suggestion how to fix it or why we should ignore it). The total count of warnings is only orientation.</p>
<p><strong>using-declaration ignored &#8212; it refers to the current namespace</strong><br />
Appears only in the Gnutella package (79 total).<br />
<code><br />
./Gnutella/NodeInfo.h(36): warning #780: using-declaration ignored -- it refers to the current namespace<br />
  using Gnutella::NodeType;<br />
</code></p>
<p>These using declarations are superfluous, so we should remove them.</p>
<p><strong>Effective C++ Item 1 prefer const and inline to #define</strong><br />
Everywhere (18967 total).<br />
<code><br />
Protocols/BitTorrent/Bencoding/BString.h(24): warning #2012: Effective C++ Item 1 prefer const and inline to #define<br />
  #define PROTOCOLS__BIT_TORRENT__BENCODING__B_STRING_H<br />
</code></p>
<p>Since this warning appears with <strong>each</strong> preprocessor directive, it&#8217;s useless. I think we all know that macros are &#8220;evil&#8221;, but there are situation where they&#8217;re handy and can&#8217;t be replaced with const/inline. My suggestion is to ignore this warning.</p>
<p><strong>Effective C++ Item 4 prefer C++ style comments</strong><br />
Gnutella,Http and UIs mostly (360 total).<br />
<code><br />
Http/Testing/HeaderTest.cpp(204): warning #2015: Effective C++ Item 4 prefer C++ style comments<br />
  		CPPUNIT_ASSERT (m_p-&gt;isValid() == false ); /* Does not work */<br />
--<br />
UIs/Searching/SearchModel.h(40): warning #2015: Effective C++ Item 4 prefer C++ style comments<br />
  		 bitrate("8 bps"), /*parent(NULL), */hosts(), showEmphasized (false)<br />
</code></p>
<p>There are no problems, this is just a matter of style, so we could some of them replace with &#8220;C++&#8221; comments, but I&#8217;d suggest to ignore these.</p>
<p><strong>Effective C++ Item 6 missing delete of member pointer member &#8220;Some variable&#8221; in destructor</strong><br />
Nearly everywhere (777 total).<br />
<code><br />
Protocols/BitTorrent/Bencoding/BString.h(58): warning #2017: Effective C++ Item 6 missing delete of member pointer member "Protocols::BitTorrent::Bencoding::BString::value_" in destructor<br />
  {}<br />
</code></p>
<p>I don&#8217;t really get (understand) this warning - it appears also on places where there is no pointer member variable&#8230; I&#8217;d understand it if it was only in dtors of classes with some pointer member variable.</p>
<p><strong>Effective C++ Item 11 declare a copy constructor and assignment operator for PrivateData</strong><br />
Gnutella, Http and CalitkoMocks mostly (734 total).<br />
<code><br />
./Http/HeaderReader.h(65): warning #2021: Effective C++ Item 11 declare a copy constructor and assignment operator for Private<br />
  	} p;<br />
</code></p>
<p>I first thought that this warning was useless, but then I saw that in classes where we don&#8217;t use QSharedData (or some other class that have defined copy ctor/assignment operator) for storing private data we don&#8217;t have our own copy ctor/assignment operator defined, but there are pointers in the PrivateData classes. This could lead to problems (copy ctor/assignment operator generated by a compiler performs only shalow copy, not deep copy). My suggestion is to either use our REFERENCE_OBJECT macro to disable copy ctor/assignment operator, or use QSharedData instead of a struct or define our own copy ctor/assignment operator.</p>
<p><strong>Effective C++ Item 12 field member &#8220;Some class member&#8221; not initialized (preferable to assignment in constructors)</strong><br />
Gnutella, CalitkoMocks and generated files mostly (220 total).<br />
<code><br />
Gnutella/Bootstrapping/NodeCache.cpp(81): warning #2022: Effective C++ Item 12 field member "Gnutella::Bootstrapping::NodeCachePrivate::availabilityList" not initialized (preferable to assignment in constructors)<br />
  	NodeCachePrivate() : nodeTable(), completeList() 	{}<br />
</code></p>
<p>This warning is similar to the g++ &#8220;&#8230;should be initialized in the member initialization list&#8221;, so we should ignore it if it&#8217;s in some PrivateData class and fix it otherwise (most of these warnings are already fixed).</p>
<p><strong>NULL reference is not allowed</strong><br />
CalitkoMocks (6 total).<br />
<code><br />
./Utils/CalitkoMocks/BasicTypes.h(135): warning #327: NULL reference is not allowed<br />
  T &amp; DefaultValue &lt;T &amp;&gt;::value = *reinterpret_cast &lt;T *&gt; (0); // HACK!!!<br />
</code></p>
<p>Peter will fix this (we&#8217;ve already <a href="http://www.calitko.org/source-talk/860">discussed</a> this one).</p>
<p><strong>Declaration does not declare anything</strong><br />
./Gnutella/LocalPeer.h:36.<br />
<code><br />
./Gnutella/LocalPeer.h(36): warning #64: declaration does not declare anything<br />
  class UIs::Searching::SearchModel;<br />
</code></p>
<p>Superfluous, remove it (there is even written: &#8220;// get away with these:&#8221;).</p>
<p><strong>conversion from &#8220;int&#8221; to &#8220;uchar={unsigned char}&#8221; may lose significant bits</strong><br />
Gnutella, UIs, Utils::Uri (115 total).<br />
<code><br />
./Gnutella/Packets/QueryHits.h(160): warning #810: conversion from "int" to "uchar={unsigned char}" may lose significant bits<br />
  	uchar				numberOfHits() const			{ return p.resultSet.size(); }<br />
</code></p>
<p>We should check whether there could be no range problems.</p>
<p><strong>Parameter &#8220;some variable&#8221; was never referenced</strong><br />
Gnutella, UIs and Utils (25 total).<br />
<code><br />
UIs/DownloadProgressBar.cpp(57): warning #869: parameter "start" was never referenced<br />
  void DownloadProgressBar::removeRequestedRange (int start, int end)<br />
</code></p>
<p>This is similar to the g++ &#8220;unused parameter&#8221; warning - we have already <a href="http://www.calitko.org/source-talk/685">discussed</a> this one (we should keep this warning since there is mostly some work needed).</p>
<p><strong>Variable &#8220;variable name&#8221; was declared but never referenced</strong><br />
<strong>Variable &#8220;variable name&#8221; was set but never used</strong><br />
CalitkoMocks mostly (16 total).<br />
<code><br />
Utils/CalitkoMocks/Testing/CallDriverTest.cpp(119): warning #177: variable "expectationDriver" was declared but never referenced<br />
  			expectationDriver = driver.willCall (pair);<br />
</code></p>
<p>This is similar to the g++ &#8220;unused variable&#8221; warning - see the previous warning.</p>
<p><strong>Controlling expression is constant</strong><br />
Protocols/BitTorrent/Packets/BadPacket.cpp (6 total)<br />
Utils/Uri.cpp (1 total)<br />
<code><br />
Protocols/BitTorrent/Packets/BadPacket.cpp(54): warning #279: controlling expression is constant<br />
  	Q_ASSERT (false &amp;&amp; "Modifying header fields of BadPackets not allowed!");<br />
</code></p>
<p>We&#8217;ve <a href="http://www.calitko.org/source-talk/860">agreed</a> to change the form of these assertions to <code>Q_ASSERT (false); // Modifying header fields of BadPackets not allowed!</code>. I think it should be fixed in the Peter&#8217;s dev branch already.</p>
<p><strong>Declaration of &#8220;some variable&#8221; shadows a member of &#8216;this&#8217;</strong><br />
Protocols package, UIs package and CalitkoMocks (15 total)<br />
<code><br />
Protocols/Generics/TcpSocketBuffer.cpp(167): warning #1944: declaration of "readSize" shadows a member of 'this'<br />
            the shadowed declaration is at line 93 of "Protocols/Generics/TcpSocketBuffer.h"<br />
  	int readSize = 0;<br />
</code></p>
<p>We should check all of these and give these variables another name (it could be misleading).</p>
<p><strong>Declaration hides variable &#8220;variable name&#8221;</strong><br />
Gnutella package, Http/Header.cpp and Protocols/Generics/PacketSerializer.cpp (8 total).<br />
<code><br />
Protocols/Generics/PacketSerializer.cpp(61): warning #1599: declaration hides variable "header" (declared at line 57)<br />
  			QByteArray header = transport-&gt;read (headerLength);<br />
</code></p>
<p>This is more or less the same warning as the previous one (we should give these variables another name, too).</p>
<p><strong>function &#8220;QDialog::done(int)&#8221; is hidden by &#8220;UIs::ManagePacketsDialog::done&#8221; &#8212; virtual function override intended?</strong><br />
UIs/PacketDumpTreeView.h:55 (1 total)<br />
<code><br />
UIs/PacketDumpTreeView.h(55): warning #1125: function "QDialog::done(int)" is hidden by "UIs::ManagePacketsDialog::done" -- virtual function override intended?<br />
  	void done();<br />
</code></p>
<p>If virtual function override was intended, we should change the signature of that function. If not, we should change the name of the function.</p>
<p>These are all warnings that were produced by the Intel compiler (uff :-)). Feel free to write down your suggestions! You can also check the compilation log (see attached file).</p>
<p>Regards,</p>
<p>Petr</p>
<div class="AF_PostFiles">
  <h5>Attached Files:</h5>
	<div class="AF_File">
    <p><span class="AF_Filename"><a href="http://www.calitko.org/?action=download&amp;file_id=204">icc-output.zip</a></span> <span class="AF_Filesize">398K</span></p>
  </div>
<!-- br style="clear: both;" /--></div>]]></content:encoded>
			<wfw:commentRSS>http://www.calitko.org/source-talk/936/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Re: error: a template argument may not reference a local type</title>
		<link>http://www.calitko.org/source-talk/935</link>
		<comments>http://www.calitko.org/source-talk/935#comments</comments>
		<pubDate>Sat, 18 Aug 2007 08:15:26 +0000</pubDate>
		<dc:creator>Petr Zemek</dc:creator>
		
	<category>Source Talk</category>
		<guid isPermaLink="false">http://www.calitko.org/source-talk/935</guid>
		<description><![CDATA[Hi Peter,
I think the problem is caused by the two versions of getNodes(). There is a template and non-template one. It seems that the icc compiler prefers the template version and g++ prefers the non-template one. I think a simple cast of the last argument would remedy the situation:
[snip]
Yes, that worked. I&#8217;ve fixed it in [...]]]></description>
			<content:encoded><![CDATA[<p>Hi Peter,</p>
<blockquote><p>I think the problem is caused by the two versions of getNodes(). There is a template and non-template one. It seems that the icc compiler prefers the template version and g++ prefers the non-template one. I think a simple cast of the last argument would remedy the situation:<br />
[snip]</p></blockquote>
<p>Yes, that worked. I&#8217;ve fixed it in my <a href="http://trac.calitko.org/changeset/developers/s3rvac/calitko%2C142">calitko branch, rev142</a>. However, I thought that if a compiler have to decide whether to use a template or a non-template function, it must choose the non-template one&#8230; That is why I was surprised when I found this error on the Intel compiler. But maybe I&#8217;m just missing something.</p>
<p>I have also done some updates in the <a href="http://trac.calitko.org/changeset/developers/s3rvac/calitko%2C141">rev 141</a>, most of them are related to the ICC compiler, so you can merge these changes to the main branch, too (compilation went OK with this version on both compilers - g++ and ICC). I&#8217;ll soon write a post about extra compilation warnings produced by the Intel compiler (with attached logs), so we can discuss them and update the (new) linnux-icc.txt ignore list (and also wiki pages).</p>
<blockquote><p>Btw. I’m on my way to fix all warning (except the ones in BitTorrent which you have probably fixed already) and I’ll write a post once I’ve done that! The filtering script works like a charm for me :-) !</p></blockquote>
<p>Great!</p>
<p>Have a nice day,</p>
<p>Petr</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.calitko.org/source-talk/935/feed/</wfw:commentRSS>
		</item>
	</channel>
</rss>
