[PULL REQUEST] A couple of small mods post the delmulti rework

Dirk Hohndel dirk at hohndel.org
Sat Sep 29 09:28:55 PDT 2012


On Sep 29, 2012, at 9:16 AM, Lubomir I. Ivanov wrote:

> On 29 September 2012 18:36, Dirk Hohndel <dirk at hohndel.org> wrote:
>> "Lubomir I. Ivanov" <neolit123 at gmail.com> writes:
>> 
>>> 1) i was able to find a mysterious bug in the divelist that shows
>>> some of the dives which are _not_ in trips without bold text in the indexes.
>>> this was on windows, but no idea how to reproduce it at this point.
>>> i'm pretty sure this was not imaginary.
>> 
>> Somehow the tripflag of the dive is still set to either IN_TRIP or
>> ASSIGNED_TRIP. I'll do some more staring at the code to see if there's a
>> spot where this could stick around when removing a dive from a trip.
>> 
>> Do you have any idea what you did when you got there? What kind of
>> things were you testing?
> 
> import dives + create/remove trip + import dives again.

Hmm. Maybe fill_dive_table did something silly when you imported more dive.
Or did you import the same dives?

>>> 2) just realized that gtk on both my fairly recent debian and ubuntu don't
>>> show icons at all, which is a bit annoying. i probably have to use apt-get to
>>> download some unknown package, strangely named after someone's pet snake e.g.:
>>> libgtk2-icons-insert-some-inconsistent-package-name-rev-0.11.22 for this stuff
>>> to work.
>> 
>> Linux is odd about this - many of the distros don't seem to have the
>> small icons for in-menu display installed. I haven't quite figured out
>> what is needed for that, either. Maybe something to ask in a larger
>> forum…

I asked on Google+

>>> the two commits in the PR just make some other, small changes.
>>> remote is rebased against master.
>> 
>> Applied (with tiny change - you keep adding empty lines here and there)
>> and pushed.
> 
> i'm ok about your remark, for this particular patch in the commit log.
> but in response i would like to point out that some of the code could
> really need some new lines here and there (e.g. in functions like
> divelist.c: turn_dive_into_trip()).
> its hard to follow the logic(-blocks) without consistently separating
> with either comments or new line…

I'm old school - I almost always prefer to see more code per page over plenty of 
empty space. Within reason :-)

> also are we following a strict coding style rule here that i can refer to?:
> (other than http://users.sosdg.org/~qiyong/lxr/source/Documentation/CodingStyle)

Unsurprisingly much of what we do is inspired by the Linus kernel coding style:
tabs, placement of parenthesis and curly braces, no trailing whitespace, etc
but I don't think we have hard rules for when to add empty lines. To me this is 
mostly a gut feeling thing - as I mentioned, I prefer to see more code in a given
amount of vertical space and especially if we already have blocks (with just a 
closing brace on the line) I usually don't see a point in empty lines. In other cases
this makes sense, for example with dense code of many long lines when a new
logical segment starts.

I guess it's a judgment call and as the person applying the changes, I use my
judgment :-)

/D


More information about the subsurface mailing list