]> git.pld-linux.org Git - packages/openhpi.git/blob - openhpi-types.patch
4a9341e0f579776f40c8157efdc8096a31011d14
[packages/openhpi.git] / openhpi-types.patch
1 --- openhpi-0.7.0/plugins/snmp_client/snmp_client_get_rdrs.c.orig       2004-02-22 02:28:11.000000000 +0000
2 +++ openhpi-0.7.0/plugins/snmp_client/snmp_client_get_rdrs.c    2004-02-22 03:10:15.000000000 +0000
3 @@ -317,9 +317,8 @@
4                          if (vars->type == ASN_OCTET_STR) {
5  
6                                  /* local variables used by case statements */
7 -                                int *data;
8 +                                int data; /* 32-bit */
9                                  char *repeat;
10 -                                int *stream_data;
11                                  char *text_info;
12                                  char *oem_data;
13  
14 @@ -339,18 +338,12 @@
15                                                  ntohl(sahpi_ctr_cap[i].CtrlRec.TypeUnion.Discrete.Default);
16                                          break;
17                                  case SAHPI_CTRL_TYPE_ANALOG:
18 -                                        data = (int *)(void *)vars->val.string;
19 -                                        sahpi_ctr_cap[i].CtrlRec.TypeUnion.Analog.Min = *data;          
20 -                                        sahpi_ctr_cap[i].CtrlRec.TypeUnion.Analog.Min =
21 -                                                ntohl(sahpi_ctr_cap[i].CtrlRec.TypeUnion.Analog.Min);
22 -                                        data++;
23 -                                        sahpi_ctr_cap[i].CtrlRec.TypeUnion.Analog.Max = *data;
24 -                                        sahpi_ctr_cap[i].CtrlRec.TypeUnion.Analog.Max =
25 -                                                ntohl(sahpi_ctr_cap[i].CtrlRec.TypeUnion.Analog.Max);
26 -                                        data++;
27 -                                        sahpi_ctr_cap[i].CtrlRec.TypeUnion.Analog.Default = *data;
28 -                                        sahpi_ctr_cap[i].CtrlRec.TypeUnion.Analog.Default = 
29 -                                                ntohl(sahpi_ctr_cap[i].CtrlRec.TypeUnion.Analog.Default);
30 +                                        memcpy(&data, vars->val.string, sizeof(int));
31 +                                        sahpi_ctr_cap[i].CtrlRec.TypeUnion.Analog.Min = ntohl(data);
32 +                                        memcpy(&data, vars->val.string + sizeof(int), sizeof(int));
33 +                                        sahpi_ctr_cap[i].CtrlRec.TypeUnion.Analog.Max = ntohl(data);
34 +                                        memcpy(&data, vars->val.string + 2*sizeof(int), sizeof(int));
35 +                                        sahpi_ctr_cap[i].CtrlRec.TypeUnion.Analog.Default = ntohl(data);
36                                          break;
37                                  case SAHPI_CTRL_TYPE_STREAM:
38                                          /* set repeat */
39 @@ -359,17 +352,16 @@
40                                                  repeat, 
41                                                  sizeof(sahpi_ctr_cap[i].CtrlRec.TypeUnion.Stream.Default.Repeat));
42                                          repeat++;
43 -                                        stream_data = (int *)(void *)repeat;
44                                          /* set .StreamLength */
45                                          memcpy(&sahpi_ctr_cap[i].CtrlRec.TypeUnion.Stream.Default.StreamLength,
46 -                                               stream_data, 
47 +                                               repeat, 
48                                                 sizeof(sahpi_ctr_cap[i].CtrlRec.TypeUnion.Stream.Default.StreamLength));
49                                          sahpi_ctr_cap[i].CtrlRec.TypeUnion.Stream.Default.StreamLength = 
50                                                  ntohs(sahpi_ctr_cap[i].CtrlRec.TypeUnion.Stream.Default.StreamLength);
51 -                                        stream_data++;
52 +                                        repeat += sizeof(int);
53                                          /* set the .Stream data */
54                                          memcpy(&sahpi_ctr_cap[i].CtrlRec.TypeUnion.Stream.Default.Stream, 
55 -                                               stream_data, 
56 +                                               repeat, 
57                                                 SAHPI_CTRL_MAX_STREAM_LENGTH); 
58                                                break;
59                                  case SAHPI_CTRL_TYPE_TEXT:
60 --- openhpi-0.7.0/plugins/dummy/dummy.c.orig    2004-02-04 03:15:11.000000000 +0000
61 +++ openhpi-0.7.0/plugins/dummy/dummy.c 2004-02-22 03:47:54.000000000 +0000
62 @@ -1355,6 +1355,8 @@
63         return(rval);
64  }
65  
66 +#define align(x) (((x) + sizeof(long) - 1) & (-sizeof(long)))
67 +
68  static int dummy_get_inventory_info(void *hnd, SaHpiResourceIdT id,
69                                     SaHpiEirIdT num,
70                                     SaHpiInventoryDataT *data)
71 @@ -1386,8 +1388,8 @@
72  
73                 for (i=0,pos=0; inventory->DataRecords[i]!=NULL; i++) {
74                         /* FIXME:: very dirty hack to make code compile on IA64 */
75 -                       data->DataRecords[i] = (SaHpiInventDataRecordT *)(void *)&inventory->data[pos];
76 -                       pos+=inventory->DataRecords[i]->DataLength+8;
77 +                       data->DataRecords[i] = (SaHpiInventDataRecordT *)(void *)&inventory->data[pos];
78 +                       pos=align(pos + inventory->DataRecords[i]->DataLength+8);
79                 }
80  
81         }
82 @@ -1427,9 +1429,9 @@
83         
84                 for (i=0, pos=0; data->DataRecords[i] != NULL; i++) {
85                         /* FIXME:: very dirty hack to make code compile on IA64 */
86 -                       inventory->DataRecords[i] = (SaHpiInventDataRecordT *)(void *)&inventory->data[pos];
87 +                       inventory->DataRecords[i] = (SaHpiInventDataRecordT *)(void *)&inventory->data[pos];
88                         memcpy(inventory->DataRecords[i], data->DataRecords[i], data->DataRecords[i]->DataLength+8);
89 -                       pos+=data->DataRecords[i]->DataLength+8;
90 +                       pos=align(pos + data->DataRecords[i]->DataLength+8);
91                 }
92                 inventory->DataRecords[i] = NULL;
93         }
94 --- openhpi-0.7.0/plugins/ipmidirect/ipmi.cpp.orig      2004-02-04 03:15:11.000000000 +0000
95 +++ openhpi-0.7.0/plugins/ipmidirect/ipmi.cpp   2004-02-22 13:36:05.000000000 +0000
96 @@ -908,7 +908,8 @@
97            }
98  
99         memcpy( &lan_addr, ent->h_addr_list[0], ent->h_length );
100 -       unsigned int a = *(unsigned int *)(void *)ent->h_addr_list[0];
101 +       unsigned int a;
102 +       memcpy(&a, ent->h_addr_list[0], sizeof(a));
103  
104         IpmiLog( "Using host at %d.%d.%d.%d.\n",
105                  a & 0xff, (a >> 8 ) & 0xff, 
106 --- openhpi-0.6.0/plugins/ipmidirect/ipmi_log.cpp.orig  2004-01-26 08:29:00.000000000 +0000
107 +++ openhpi-0.6.0/plugins/ipmidirect/ipmi_log.cpp       2004-02-22 16:06:31.000000000 +0000
108 @@ -181,7 +181,7 @@
109  
110             char b[dTimeStringSize+5];
111              IpmiTimeToString( tv.tv_sec, b );
112 -           sprintf( b + dTimeStringSize - 1, ".%03ld ", tv.tv_usec / 1000 );
113 +           sprintf( b + dTimeStringSize - 1, ".%03ld ", (long)(tv.tv_usec / 1000) );
114  
115             Output( b );
116           }
This page took 0.052821 seconds and 2 git commands to generate.