Bug 32463 - dcopc C bindings in kdebindings have wrong byteorder on Solaris sparc
Summary: dcopc C bindings in kdebindings have wrong byteorder on Solaris sparc
Status: RESOLVED FIXED
Alias: None
Product: bindings
Classification: Developer tools
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Solaris
: NOR normal
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-09-13 20:33 UTC by Karsten Künne
Modified: 2007-12-18 11:55 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Karsten Künne 2001-09-13 20:23:42 UTC
(*** 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)
Comment 1 Dirk Mueller 2002-09-26 02:32:18 UTC
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