[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: Re: KDE/kdenetwork/kopete/kopete
From: Lamarque Vieira Souza <lamarque () gmail ! com>
Date: 2011-02-05 16:31:14
Message-ID: 201102051431.14884.lamarque () gmail ! com
[Download RAW message or body]
Em Saturday 05 February 2011, Raphael Kubo da Costa escreveu:
> Lamarque Vieira Souza <lamarque@gmail.com> writes:
> > Em Saturday 05 February 2011, Raphael Kubo da Costa escreveu:
> >> Lamarque Souza <lamarque@gmail.com> writes:
> >> > +bool compareOnlineStatus(const Kopete::Account *a, const
> >> > Kopete::Account *b); +bool invertedCompareOnlineStatus(const
> >> > Kopete::Account *a, const Kopete::Account *b);
> >>
> >> Isn't it better to make them static?
> >>
> > I do not know why. They are not declared in any header, nobody can use
> >
> > them outside kopetewindow.cpp. Making them static would not improve
> > anything as far as I know. Anyway, I can do the change.
>
> I admit I at first had C in my mind when I wrote about this -- if you
> didn't add the static specifier, the functions would be accessible to
> the other compilation units.
>
> In this specific case, I can only think of the possibility of a name
> clash if another compilation unit defines the same functions. Even
> though it is unlikely, you may find it better to err on the safe side.
If someone created a function named exactly like that he/she would
probably implement something very close to what I did, then it is better use
that functions instead of duplicating them. Clashing the names would give the
person a tip that someone had already done that. Anyway I have changed them to
be static.
--
Lamarque V. Souza
http://www.geographicguide.com/brazil.htm
Linux User #57137 - http://counter.li.org/
http://www.kde-mg.org
[Attachment #3 (text/html)]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" \
"http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" \
content="1" /><style type="text/css"> p, li { white-space: pre-wrap; }
</style></head><body style=" font-family:'Tahoma'; font-size:10pt; font-weight:400; \
font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Em Saturday \
05 February 2011, Raphael Kubo da Costa escreveu:</p> <p style=" margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;">> Lamarque Vieira Souza \
<lamarque@gmail.com> writes:</p> <p style=" margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;">> > Em Saturday 05 February 2011, Raphael Kubo da Costa \
escreveu:</p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> \
>> Lamarque Souza <lamarque@gmail.com> writes:</p> <p style=" \
margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> >> > +bool \
compareOnlineStatus(const Kopete::Account *a, const</p> <p style=" margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;">> >> > Kopete::Account *b); +bool \
invertedCompareOnlineStatus(const</p> <p style=" margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;">> >> > Kopete::Account *a, const Kopete::Account \
*b);</p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> \
>> </p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> \
>> Isn't it better to make them static?</p> <p style=" margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;">> >> </p> <p style=" margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;">> > I do not know why. They are not \
declared in any header, nobody can use</p> <p style=" margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;">> > </p> <p style=" margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;">> > them outside kopetewindow.cpp. Making \
them static would not improve</p> <p style=" margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;">> > anything as far as I know. Anyway, I can do the \
change.</p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> </p> \
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> I admit I at first had C \
in my mind when I wrote about this -- if you</p> <p style=" margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;">> didn't add the static specifier, the \
functions would be accessible to</p> <p style=" margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;">> the other compilation units.</p> <p style=" margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;">> </p> <p style=" margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;">> In this specific case, I can only think of \
the possibility of a name</p> <p style=" margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;">> clash if another compilation unit defines the same functions. \
Even</p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> though \
it is unlikely, you may find it better to err on the safe side.</p> <p \
style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br /></p> \
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;"> If someone created a \
function named exactly like that he/she would probably implement something very close \
to what I did, then it is better use that functions instead of duplicating them. \
Clashing the names would give the person a tip that someone had already done that. \
Anyway I have changed them to be static.</p> <p style="-qt-paragraph-type:empty; \
margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br /></p> <p style=" \
margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;">-- </p> <p style=" \
margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Lamarque V. Souza</p> <p \
style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;">http://www.geographicguide.com/brazil.htm</p> <p style=" \
margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Linux User #57137 - \
http://counter.li.org/</p> <p style=" margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;">http://www.kde-mg.org</p></body></html>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic