Impementation-dependent casts from uchar to char

Marijn Kruisselbrink mkruisselbrink at kde.org
Wed Jan 2 21:52:32 GMT 2013


On Wed, Jan 2, 2013 at 1:26 PM, Jaroslaw Staniek <staniek at kde.org> wrote:

> Hello Marijn,
> There are impementation-dependent casts from uchar to char:
>
Ah yes, that is indeed not good.

Since this is your code, could you point me what are these values?
>
I assume I copied these values from whatever document documents the
encryption ms office uses... Not sure what the nicest way is to hardcode
binary data in c++ source code... "\xfe\xa7\xd2\x76\x3b\x4b\x9e\x79" might
work, but has the downside that there is a trailing 0 byte that should not
be included in the qbytearray. Signed char constants seem ugly, since
QByteArray expects regular char, not signed char (although I guess it would
be safe, since the signed->unsigned underflowing conversion is defined
unlike this unsigned->signed overflow).

Marijn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/calligra-devel/attachments/20130102/199d60f5/attachment.htm>


More information about the calligra-devel mailing list