On Mon, Sep 8, 2008 at 1:42 AM, D. Michael McIntyre <[EMAIL PROTECTED]> wrote: > On Sunday 07 September 2008, Julie S wrote: > >> These are all coded as traditional c style casts. I don't know much about >> c++ casting. The problem is that Qt4 only wants qintxx and quintxx types. >> So we have to choose one--assuming a traditional cast since the word length >> is directly linked to the type 4 bytes or 8 bytes.
The "source" and "target" types in the cast don't have to have the same size, but of course you do (unless you know something particular about the data involved) have to make sure the target is at least as big as the source. In this case, unsigned long can be either 32 or 64 bits depending on architecture. On a 32-bit architecture, casting from unsigned long to quint32 is a "natural" cast without any change of word size, so it should be preferable (although quint64 is a suitable target as well). On a 64-bit architecture, casting from unsigned long to quint64 is the only sensible choice. So the code is ambiguous. I guess. In this case, the target size clearly matters, and the source size is clearly of some interest because some of the casts are to ints and others to longs. So there's some archaeology to be done here. I'd like to add this particular case (streaming MappedEvent to QDataStream) to my own task list, if that's OK. That's partly because it might be a subtle one, but also because I'm thinking that once DCOP has been eliminated, we might not need these operators at all anyway. Chris ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Rosegarden-devel mailing list [email protected] - use the link below to unsubscribe https://lists.sourceforge.net/lists/listinfo/rosegarden-devel
