1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
|
--- ./classes/src/ArtsAttribute.cc.orig Mon Oct 2 13:05:22 2000
+++ ./classes/src/ArtsAttribute.cc Wed Sep 25 16:38:10 2002
@@ -41,6 +41,7 @@
//===========================================================================
extern "C" {
+#include "artslocal.h"
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
@@ -51,7 +52,12 @@
}
#include <string>
-#include <iomanip.h>
+#if HAVE_IOMANIP
+# include <iomanip>
+ using namespace std;
+#else
+# include <iomanip.h>
+#endif
#include "ArtsAttribute.hh"
#include "ArtsPrimitive.hh"
@@ -487,10 +493,10 @@
idAndFormat = (this->_identifier << 8) | this->_format;
uIntDatum = htonl(idAndFormat);
- os.write(&uIntDatum,sizeof(uIntDatum));
+ os.write((char *)&uIntDatum,sizeof(uIntDatum));
uIntDatum = htonl(this->_length);
- os.write(&uIntDatum,sizeof(uIntDatum));
+ os.write((char *)&uIntDatum,sizeof(uIntDatum));
switch (this->_identifier) {
case artsC_ATTR_COMMENT:
@@ -499,16 +505,16 @@
break;
case artsC_ATTR_CREATION:
uIntDatum = htonl(this->_value.creation);
- os.write(&uIntDatum,sizeof(uIntDatum));
+ os.write((char *)&uIntDatum,sizeof(uIntDatum));
break;
case artsC_ATTR_PERIOD:
uIntDatum = htonl(this->_value.period[0]);
- os.write(&uIntDatum,sizeof(uIntDatum));
+ os.write((char *)&uIntDatum,sizeof(uIntDatum));
uIntDatum = htonl(this->_value.period[1]);
- os.write(&uIntDatum,sizeof(uIntDatum));
+ os.write((char *)&uIntDatum,sizeof(uIntDatum));
break;
case artsC_ATTR_HOST:
- os.write(&this->_value.host,sizeof(this->_value.host));
+ os.write((char *)&this->_value.host,sizeof(this->_value.host));
break;
case artsC_ATTR_IFDESCR:
ptr = this->_value.ifDescr->c_str();
@@ -516,14 +522,14 @@
break;
case artsC_ATTR_IFINDEX:
uShortDatum = htons(this->_value.ifIndex);
- os.write(&uShortDatum,sizeof(uShortDatum));
+ os.write((char *)&uShortDatum,sizeof(uShortDatum));
break;
case artsC_ATTR_IFIPADDR:
- os.write(&this->_value.ifIpAddr,sizeof(this->_value.ifIpAddr));
+ os.write((char *)&this->_value.ifIpAddr,sizeof(this->_value.ifIpAddr));
break;
case artsC_ATTR_HOSTPAIR:
- os.write(&(this->_value.hostPair[0]),sizeof(ipv4addr_t));
- os.write(&(this->_value.hostPair[1]),sizeof(ipv4addr_t));
+ os.write((char *)&(this->_value.hostPair[0]),sizeof(ipv4addr_t));
+ os.write((char *)&(this->_value.hostPair[1]),sizeof(ipv4addr_t));
break;
default:
break;
@@ -675,12 +681,12 @@
break;
}
- is.read(&uIntDatum,sizeof(uIntDatum));
+ is.read((char *)&uIntDatum,sizeof(uIntDatum));
idAndFormat = ntohl(uIntDatum);
this->_identifier = idAndFormat >> 8;
this->_format = idAndFormat & 0xff;
- is.read(&uIntDatum,sizeof(uIntDatum));
+ is.read((char *)&uIntDatum,sizeof(uIntDatum));
this->_length = ntohl(uIntDatum);
switch (this->_identifier) {
@@ -693,17 +699,17 @@
free(ptr);
break;
case artsC_ATTR_CREATION:
- is.read(&uIntDatum,sizeof(uIntDatum));
+ is.read((char *)&uIntDatum,sizeof(uIntDatum));
this->_value.creation = ntohl(uIntDatum);
break;
case artsC_ATTR_PERIOD:
- is.read(&uIntDatum,sizeof(uIntDatum));
+ is.read((char *)&uIntDatum,sizeof(uIntDatum));
this->_value.period[0] = htonl(uIntDatum);
- is.read(&uIntDatum,sizeof(uIntDatum));
+ is.read((char *)&uIntDatum,sizeof(uIntDatum));
this->_value.period[1] = htonl(uIntDatum);
break;
case artsC_ATTR_HOST:
- is.read(&this->_value.host,sizeof(this->_value.host));
+ is.read((char *)&this->_value.host,sizeof(this->_value.host));
break;
case artsC_ATTR_IFDESCR:
ptr = (char *)malloc(this->_length - (sizeof(uint32_t) * 2));
@@ -714,15 +720,15 @@
free(ptr);
break;
case artsC_ATTR_IFINDEX:
- is.read(&this->_value.ifIndex,sizeof(this->_value.ifIndex));
+ is.read((char *)&this->_value.ifIndex,sizeof(this->_value.ifIndex));
this->_value.ifIndex = ntohs(this->_value.ifIndex);
break;
case artsC_ATTR_IFIPADDR:
- is.read(&this->_value.ifIpAddr,sizeof(this->_value.ifIpAddr));
+ is.read((char *)&this->_value.ifIpAddr,sizeof(this->_value.ifIpAddr));
break;
case artsC_ATTR_HOSTPAIR:
- is.read(&(this->_value.hostPair[0]),sizeof(ipv4addr_t));
- is.read(&(this->_value.hostPair[1]),sizeof(ipv4addr_t));
+ is.read((char *)&(this->_value.hostPair[0]),sizeof(ipv4addr_t));
+ is.read((char *)&(this->_value.hostPair[1]),sizeof(ipv4addr_t));
break;
default:
break;
|