[mythtv] Eit fixup for comhem

Torbjörn Jansson torbjorn.jansson at mbox200.swipnet.se
Thu May 25 13:42:31 UTC 2006


mythtv-dev-bounces at mythtv.org <> wrote:
> On Thu, 2006-05-25 at 15:13 +0200, Torbjörn Jansson wrote:
> 
>> What happends is that the fix variable never picks up all the data
>> from the fixup map resulting in my fixup function never being called.
>> The problem seems to come from the line:
>> uint fix = fixup[eit->OriginalNetworkID() << 16];
>> This makes the map always return zero even when it shouldn't, if i
>> cast the eit->OriginalNetworkID() to an int it works.
>> I don't understand why the QMap does this, maybe i've overlooked
>> something, it should have returned kFixComHem even without the cast.
> Hmm, this is strange. eit->OriginalNetworkID() should return a value
> cast to uint, which gets converted to a uint64_t after the shift.
> Casting the uint to int should have no effect on a 32 bit system,
> and casting it to a int64_t before the shift shouldn't effect it
> either because the original network id is a 16 bit value.
> 
> -- Daniel

I know.
I had to do a smal test program to see what was happening.
The problem have to do with what type the key is in init_fixup.

This "fix[40999 << 16] = kFixComHem;" makes the cast-to-int case work and
"fix[(uint64_t)40999 << 16] = kFixComHem;" makes the uint and uint64_t case
work.

Maybe the index operator in QMap is doing something wierd?



More information about the mythtv-dev mailing list