On Sun, Sep 20, 2009 at 8:09 PM, D. Michael McIntyre
<[email protected]> wrote:
> On Sunday 20 September 2009, Chris Cannam wrote:
>> On Sun, Sep 20, 2009 at 5:29 PM,  <[email protected]> wrote:
>> > Fixed a warning message about getTrack() which the compiler thinks is
>> > unsigned and it really is an integer
>>
>> Hang on a minute -- getTrack surely returns a TrackId, doesn't it?
>> TrackId is a typedef for an unsigned int, not an int.  Is there really
>> a negative failure code?
>
> That's a question I tried to answer myself when I tried to shut up the same
> warning.  I can't really make sense of it.  I would expect getTrack() surely
> does return a TrackId, which is an unsigned int, but the only "::getTrack(" in
> our code is in src/base/CompositionTimeSliceAdapter.cpp
>
> The LilyPond exporter is working with a Composition::iterator i and calling
> (*i)->getTrack() (in my version; I haven't updated yet) so I would expect it's
> Composition::getTrack() not CompositionTimeSliceAdapter::getTrack(), but
> Composition doesn't have a getTrack() method.

i is a Composition::iterator, so *i is a Segment pointer.
Segment::getTrack() returns a TrackId, unsigned, and should never
return an invalid value.

> CompositionTimeSliceAdapter *does* have ::getTrack() that *does* return an int
> though, not a TrackId.

Yes, it does -- bad form, that.  (My fault, I wrote it -- I presumably
wanted the extra error code, but I really should have taken the time
to find a better way.)  But this isn't a CompositionTimeSliceAdapter
iterator.

> Also, my first stab at shutting that warning up was to simply remove the
> (unsigned int) >= 0 on the grounds that it was a completely pointless test,
> and the same thing as TRUE.  When I did that, things broke.

That would be quite strange.


Chris

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Rosegarden-devel mailing list
[email protected] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel

Reply via email to