| Summary: | dcopc C bindings in kdebindings have wrong byteorder on Solaris sparc | ||
|---|---|---|---|
| Product: | [Unmaintained] bindings | Reporter: | Karsten Künne <kuenne> |
| Component: | general | Assignee: | Unassigned bugs <unassigned-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | ||
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Compiled Sources | ||
| OS: | Solaris | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
Subject: kdebindings/dcopc
kdebindings/dcopc marshal.c,1.3,1.4
Author: mueller
Modified Files:
marshal.c
Log Message:
CCMAIL: 32463-done@bugs.kde.org
|
(*** This bug was imported into bugs.kde.org ***) Package: dcop Version: KDE 2.2.0 Severity: normal Installed from: Compiled From Sources Compiler: gcc 2.95.3 OS: Solaris OS/Compiler notes: Not Specified I tried to use the dcop C bindings on Solaris sparc but they didn't work at all. When I started the example program the dcop server only complained about corrupt data and I couldn't get a registration. After I changed the encoding of integers it started working. Following is the patch (it'll probably need some ifdef's around but I wasn't sure which symbol to use): --- kdebindings-2.2/dcopc/marshal.c.orig Sat Sep 8 20:52:30 2001 +++ kdebindings-2.2/dcopc/marshal.c Sat Sep 8 21:22:56 2001 @@ -9010 +9010 @@ g_assert( sizeof( unsigned int ) == 4 ); - buf[3] = *p++; - buf[2] = *p++; + buf[0] = *p++; buf[1] = *p++; - buf[0] = *p; + buf[2] = *p++; + buf[3] = *p; return dcop_marshal_raw( data buf 4 ); } @@ -10710 +10710 @@ if ( !dcop_data_check_size( data 4 ) ) return FALSE; - *p++ = data->cur[3]; - *p++ = data->cur[2]; - *p++ = data->cur[1]; *p++ = data->cur[0]; + *p++ = data->cur[1]; + *p++ = data->cur[2]; + *p++ = data->cur[3]; data->cur += 4; @@ -4185 +4185 @@ } dcop_data *dcop_data_ref( dcop_data *data ) { data->ref++; return data; } -void dcop_data_deref( dcop_data *data ) { if ( !--data->ref ) dcop_data_destroy( data ); } +void dcop_data_deref( dcop_data *data ) { if (data == NULL) return; if ( !--data->ref ) dcop_data_destroy( data ); } void dcop_data_reset( dcop_data *data ) { data->cur = data->ptr; } (Submitted via bugs.kde.org)