Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 145342
Collapse All | Expand All

(-)par2cmdline-0.4-orig/letype.h (-98 / +3 lines)
Lines 28-71 Link Here
28
28
29
#else
29
#else
30
30
31
class leu16
31
struct leu16
32
{
32
{
33
public:
34
  leu16(void);
35
36
  leu16(const leu16 &other);
37
  leu16& operator=(const leu16 &other);
38
39
  leu16(const u16 &other);
40
  leu16& operator=(const u16 &other);
33
  leu16& operator=(const u16 &other);
41
34
42
  operator u16(void) const;
35
  operator u16(void) const;
43
36
44
protected:
45
  u16 value;
37
  u16 value;
46
};
38
};
47
39
48
inline leu16::leu16(void)
49
{
50
}
51
52
inline leu16::leu16(const leu16 &other)
53
: value(other.value)
54
{
55
}
56
57
inline leu16& leu16::operator =(const leu16 &other)
58
{
59
  value = other.value;
60
  return *this;
61
}
62
63
inline leu16::leu16(const u16 &other)
64
{
65
  ((unsigned char*)&value)[0] = (unsigned char)((other >> 0) & 0xff);
66
  ((unsigned char*)&value)[1] = (unsigned char)((other >> 8) & 0xff);
67
}
68
69
inline leu16& leu16::operator=(const u16 &other)
40
inline leu16& leu16::operator=(const u16 &other)
70
{
41
{
71
  ((unsigned char*)&value)[0] = (unsigned char)((other >> 0) & 0xff);
42
  ((unsigned char*)&value)[0] = (unsigned char)((other >> 0) & 0xff);
Lines 81-126 Link Here
81
}
52
}
82
53
83
54
84
class leu32
55
struct leu32
85
{
56
{
86
public:
87
  leu32(void);
88
89
  leu32(const leu32 &other);
90
  leu32& operator=(const leu32 &other);
91
92
  leu32(const u32 &other);
93
  leu32& operator=(const u32 &other);
57
  leu32& operator=(const u32 &other);
94
58
95
  operator u32(void) const;
59
  operator u32(void) const;
96
60
97
protected:
98
  u32 value;
61
  u32 value;
99
};
62
};
100
63
101
inline leu32::leu32(void)
102
{
103
}
104
105
inline leu32::leu32(const leu32 &other)
106
: value(other.value)
107
{
108
}
109
110
inline leu32& leu32::operator =(const leu32 &other)
111
{
112
  value = other.value;
113
  return *this;
114
}
115
116
inline leu32::leu32(const u32 &other)
117
{
118
  ((unsigned char*)&value)[0] = (unsigned char)((other >> 0) & 0xff);
119
  ((unsigned char*)&value)[1] = (unsigned char)((other >> 8) & 0xff);
120
  ((unsigned char*)&value)[2] = (unsigned char)((other >> 16) & 0xff);
121
  ((unsigned char*)&value)[3] = (unsigned char)((other >> 24) & 0xff);
122
}
123
124
inline leu32& leu32::operator=(const u32 &other)
64
inline leu32& leu32::operator=(const u32 &other)
125
{
65
{
126
  ((unsigned char*)&value)[0] = (unsigned char)((other >> 0) & 0xff);
66
  ((unsigned char*)&value)[0] = (unsigned char)((other >> 0) & 0xff);
Lines 140-189 Link Here
140
}
80
}
141
81
142
82
143
class leu64
83
struct leu64
144
{
84
{
145
public:
146
  leu64(void);
147
148
  leu64(const leu64 &other);
149
  leu64& operator=(const leu64 &other);
150
151
  leu64(const u64 &other);
152
  leu64& operator=(const u64 &other);
85
  leu64& operator=(const u64 &other);
153
86
154
  operator u64(void) const;
87
  operator u64(void) const;
155
88
156
protected:
157
  u64 value;
89
  u64 value;
158
};
90
};
159
91
160
inline leu64::leu64(void)
161
{
162
}
163
164
inline leu64::leu64(const leu64 &other)
165
: value(other.value)
166
{
167
}
168
169
inline leu64& leu64::operator =(const leu64 &other)
170
{
171
  value = other.value;
172
  return *this;
173
}
174
175
inline leu64::leu64(const u64 &other)
176
{
177
  ((unsigned char*)&value)[0] = (unsigned char)((other >> 0) & 0xff);
178
  ((unsigned char*)&value)[1] = (unsigned char)((other >> 8) & 0xff);
179
  ((unsigned char*)&value)[2] = (unsigned char)((other >> 16) & 0xff);
180
  ((unsigned char*)&value)[3] = (unsigned char)((other >> 24) & 0xff);
181
  ((unsigned char*)&value)[4] = (unsigned char)((other >> 32) & 0xff);
182
  ((unsigned char*)&value)[5] = (unsigned char)((other >> 40) & 0xff);
183
  ((unsigned char*)&value)[6] = (unsigned char)((other >> 48) & 0xff);
184
  ((unsigned char*)&value)[7] = (unsigned char)((other >> 56) & 0xff);
185
}
186
187
inline leu64& leu64::operator=(const u64 &other)
92
inline leu64& leu64::operator=(const u64 &other)
188
{
93
{
189
  ((unsigned char*)&value)[0] = (unsigned char)((other >> 0) & 0xff);
94
  ((unsigned char*)&value)[0] = (unsigned char)((other >> 0) & 0xff);
(-)par2cmdline-0.4-orig/md5.h (-22 / +16 lines)
Lines 20-25 Link Here
20
#ifndef __MD5_H__
20
#ifndef __MD5_H__
21
#define __MD5_H__
21
#define __MD5_H__
22
22
23
#ifdef WIN32
24
#pragma pack(push, 1)
25
#define PACKED
26
#else
27
#define PACKED __attribute__ ((packed))
28
#endif
29
23
// This file defines the MD5Hash and MD5Context objects which are used
30
// This file defines the MD5Hash and MD5Context objects which are used
24
// to compute and manipulate the MD5 Hash values for a block of data.
31
// to compute and manipulate the MD5 Hash values for a block of data.
25
32
Lines 35-46 Link Here
35
42
36
// MD5 Hash value
43
// MD5 Hash value
37
44
38
class MD5Hash
45
struct MD5Hash;
39
{
46
ostream& operator<<(ostream &s, const MD5Hash &hash);
40
public:
41
  // Constructor does not initialise the value
42
  MD5Hash(void) {};
43
47
48
struct MD5Hash
49
{
44
  // Comparison operators
50
  // Comparison operators
45
  bool operator==(const MD5Hash &other) const;
51
  bool operator==(const MD5Hash &other) const;
46
  bool operator!=(const MD5Hash &other) const;
52
  bool operator!=(const MD5Hash &other) const;
Lines 54-66 Link Here
54
  friend ostream& operator<<(ostream &s, const MD5Hash &hash);
60
  friend ostream& operator<<(ostream &s, const MD5Hash &hash);
55
  string print(void) const;
61
  string print(void) const;
56
62
57
  // Copy and assignment
58
  MD5Hash(const MD5Hash &other);
59
  MD5Hash& operator=(const MD5Hash &other);
60
61
public:
62
  u8 hash[16]; // 16 byte MD5 Hash value
63
  u8 hash[16]; // 16 byte MD5 Hash value
63
};
64
} PACKED;
64
65
65
// Intermediate computation state
66
// Intermediate computation state
66
67
Lines 144-159 Link Here
144
  return !other.operator<(*this);
145
  return !other.operator<(*this);
145
}
146
}
146
147
147
inline MD5Hash::MD5Hash(const MD5Hash &other)
148
#ifdef WIN32
148
{
149
#pragma pack(pop)
149
  memcpy(&hash, &other.hash, sizeof(hash));
150
#endif
150
}
151
#undef PACKED
151
152
inline MD5Hash& MD5Hash::operator=(const MD5Hash &other)
153
{
154
  memcpy(&hash, &other.hash, sizeof(hash));
155
156
  return *this;
157
}
158
152
159
#endif // __MD5_H__
153
#endif // __MD5_H__

Return to bug 145342