From kde-commits Sat Feb 05 16:31:14 2011 From: Lamarque Vieira Souza Date: Sat, 05 Feb 2011 16:31:14 +0000 To: kde-commits Subject: Re: KDE/kdenetwork/kopete/kopete Message-Id: <201102051431.14884.lamarque () gmail ! com> X-MARC-Message: https://marc.info/?l=kde-commits&m=129692352308919 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--Boundary-01=_StXTN+qms7liEtU" --Boundary-01=_StXTN+qms7liEtU Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Em Saturday 05 February 2011, Raphael Kubo da Costa escreveu: > Lamarque Vieira Souza writes: > > Em Saturday 05 February 2011, Raphael Kubo da Costa escreveu: > >> Lamarque Souza 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 --Boundary-01=_StXTN+qms7liEtU Content-Type: text/html; charset="iso-8859-15" Content-Transfer-Encoding: 7bit

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

--Boundary-01=_StXTN+qms7liEtU--