]> git.pld-linux.org Git - packages/openhpi.git/blob - openhpi-align.patch
- added headers patch (install missing headers)
[packages/openhpi.git] / openhpi-align.patch
1 --- openhpi-0.9.0/marshal/marshal.c~    Wed Jun 16 19:50:24 2004
2 +++ openhpi-0.9.0/marshal/marshal.c     Wed Jun 16 19:54:27 2004
3 @@ -19,6 +19,7 @@
4  #include <assert.h>
5  #include <endian.h>
6  #include <byteswap.h>
7 +#include <string.h>
8  #include "marshal.h"
9  
10  
11 @@ -270,8 +271,7 @@
12         case eMtInt16:
13         case eMtUint16:
14              {
15 -              tUint16 v = *(const tUint16 *)data;
16 -              *(tUint16 *)buffer = v;
17 +              memcpy(buffer, data, sizeof(tUint16));
18              }
19  
20              return sizeof( tUint16 );
21 @@ -279,8 +279,7 @@
22         case eMtUint32:
23         case eMtInt32:
24              {
25 -              tUint32 v = *(const tUint32 *)data;
26 -              *(tUint32 *)buffer = v;
27 +              memcpy(buffer, data, sizeof(tUint32));
28              }
29  
30              return sizeof( tUint32 );
31 @@ -288,24 +287,21 @@
32         case eMtUint64:
33         case eMtInt64:
34              {
35 -              tUint64 v = *(const tUint64 *)data;
36 -              *(tUint64 *)buffer = v;
37 +              memcpy(buffer, data, sizeof(tUint64));
38              }
39  
40              return sizeof( tUint64 );
41  
42         case eMtFloat32:
43              {
44 -              tFloat32 v = *(const tFloat32 *)data;
45 -              *(tFloat32 *)buffer = v;
46 +              memcpy(buffer, data, sizeof(tFloat32));
47              }
48  
49              return sizeof( tFloat32 );
50  
51         case eMtFloat64:
52              {
53 -              tFloat64 v = *(const tFloat64 *)data;
54 -              *(tFloat64 *)buffer = v;
55 +              memcpy(buffer, data, sizeof(tFloat64));
56              }
57  
58              return sizeof( tFloat64 );
59 @@ -339,12 +335,16 @@
60  
61         case eMtUint16:
62         case eMtInt16:
63 -           m = (tUint32)*(const tUint16 *)so;
64 +           {
65 +           tUint16 buf;
66 +           memcpy(&buf, so, sizeof(tUint16));
67 +           m = (tUint32)buf;
68 +           }
69             break;
70  
71         case eMtUint32:
72         case eMtInt32:
73 -           m = *(const tUint32 *)so;
74 +           memcpy(&m, so, sizeof(tUint32));
75             break;
76  
77         default:
78 @@ -383,12 +383,16 @@
79  
80         case eMtUint16:
81         case eMtInt16:
82 -           size = (tUint32)*(const tUint16 *)so;
83 +           {
84 +           tUint16 buf;
85 +           memcpy(&buf, so, sizeof(tUint16));
86 +           size = (tUint32)buf;
87 +           }
88             break;
89  
90         case eMtUint32:
91         case eMtInt32:
92 -           size = *(const tUint32 *)so;
93 +           memcpy(&size, so, sizeof(tUint32));
94             break;
95  
96         default:
97 @@ -583,12 +587,13 @@
98         case eMtInt16:
99         case eMtUint16:
100              {
101 -              tUint16 v = *(const tUint16 *)buffer;
102 +              tUint16 v;
103 +              memcpy(&v, buffer, sizeof(tUint16));
104  
105                if ( MarshalByteOrder() != byte_order )
106                     v = bswap_16( v );
107                
108 -              *(tUint16 *)data = v;
109 +              memcpy(data, &v, sizeof(tUint16));
110              }            
111  
112              return sizeof( tUint16 );
113 @@ -596,12 +601,13 @@
114         case eMtUint32:
115         case eMtInt32:
116              {
117 -              tUint32 v = *(const tUint32 *)buffer;
118 +              tUint32 v;
119 +              memcpy(&v, buffer, sizeof(tUint32));
120  
121                if ( MarshalByteOrder() != byte_order )
122                     v = bswap_32( v );
123  
124 -              *(tUint32 *)data = v;
125 +              memcpy(data, &v, sizeof(tUint32));
126              }
127  
128              return sizeof( tUint32 );
129 @@ -609,12 +615,13 @@
130         case eMtUint64:
131         case eMtInt64:
132              {
133 -              tUint64 v = *(const tUint64 *)buffer;
134 +              tUint64 v;
135 +              memcpy(&v, buffer, sizeof(tUint64));
136  
137                if ( MarshalByteOrder() != byte_order )
138                     v = bswap_64( v );
139  
140 -              *(tUint64 *)data = v;
141 +              memcpy(data, &v, sizeof(tUint64));
142              }
143  
144              return sizeof( tUint64 );
145 @@ -622,13 +629,16 @@
146         case eMtFloat32:
147              {
148                // this has been tested for i386 and PPC
149 +              tFloat32 v2;
150                tFloat32Uint32 v;
151 -              v.m_f32 = *(const tFloat32 *)buffer;
152 +              memcpy(&v2, buffer, sizeof(tFloat32));
153 +              v.m_f32 = v2;
154  
155                if ( MarshalByteOrder() != byte_order )
156                     v.m_u32 = bswap_32( v.m_u32 );
157  
158 -              *(tFloat32 *)data = v.m_f32;
159 +              v2 = v.m_f32;
160 +              memcpy(data, &v2, sizeof(tFloat32));
161              }
162  
163              return sizeof( tFloat32 );
164 @@ -636,13 +646,16 @@
165         case eMtFloat64:
166              {
167                // this has been tested for i386 and PPC
168 +              tFloat64 v2;
169                tFloat64Uint64 v;
170 -              v.m_f64 = *(const tFloat64 *)buffer;
171 +              memcpy(&v2, buffer, sizeof(tFloat64));
172 +              v.m_f64 = v2;
173  
174                if ( MarshalByteOrder() != byte_order )
175                     v.m_u64 = bswap_64( v.m_u64 );
176  
177 -              *(tFloat64 *)data = v.m_f64;
178 +              v2 = v.m_f64;
179 +              memcpy(data, &v2, sizeof(tFloat64));
180              }
181  
182              return sizeof( tFloat64 );
183 --- openhpi-1.0.0/plugins/ipmi/ipmi_controls.c.orig     2004-06-14 06:38:42.000000000 +0000
184 +++ openhpi-1.0.0/plugins/ipmi/ipmi_controls.c  2004-07-03 15:13:28.000000000 +0000
185 @@ -111,7 +111,7 @@
186          }
187                          
188          ipmi_control_set_val(control, 
189 -                             (int *)&info->state->StateUnion.Oem.Body[0],
190 +                             (int *)(void*)&info->state->StateUnion.Oem.Body[0],
191                               __set_control_state, info);
192  }
193  
This page took 0.076451 seconds and 3 git commands to generate.