[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: on the use of char
From:       Richard Dale <Richard_Dale () tipitina ! demon ! co ! uk>
Date:       2004-07-29 15:03:07
Message-ID: 200407291603.07388.Richard_Dale () tipitina ! demon ! co ! uk
[Download RAW message or body]

On Thursday 29 July 2004 14:58, Frans Englich wrote:
> On Thursday 29 July 2004 02:04, George Staikos wrote:
> > Hi folks,
> >
> >    I'd like to point out that we need to be careful about the use of
> > "char" for storing numbers in KDE.  Some platforms have unsigned char
> > type, others have signed char type.  I happen to have both.  Consequently
> > I have seen, on a regular basis, broken KDE applications on one or both
> > of my machines due to code that assumes signedness or unsignedness of
> > char.  Yes, I have also implemented this bug before.
What's the correct thing to do when sending chars over DCOP?

I send out a char like this:
*stream << (Q_INT8) stack[i].s_char;

And receive a char like this:
Q_INT8 temp;
*stream >> temp;

So should these Q_INT8 types be just 'char' instead, as they can be unsigned 
or signed on different platforms?

-- Richard

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic