Skip to content

Commit 9b4dd9f

Browse files
unknownalanfalloon
unknown
authored andcommitted
Use autogenerated methods in letype
1 parent 5f2c99e commit 9b4dd9f

File tree

1 file changed

+3
-98
lines changed

1 file changed

+3
-98
lines changed

letype.h

+3-98
Original file line numberDiff line numberDiff line change
@@ -28,44 +28,15 @@ typedef u64 leu64;
2828

2929
#else
3030

31-
class leu16
31+
struct leu16
3232
{
33-
public:
34-
leu16(void);
35-
36-
leu16(const leu16 &other);
37-
leu16& operator=(const leu16 &other);
38-
39-
leu16(const u16 &other);
4033
leu16& operator=(const u16 &other);
4134

4235
operator u16(void) const;
4336

44-
protected:
4537
u16 value;
4638
};
4739

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-
6940
inline leu16& leu16::operator=(const u16 &other)
7041
{
7142
((unsigned char*)&value)[0] = (unsigned char)((other >> 0) & 0xff);
@@ -81,46 +52,15 @@ inline leu16::operator u16(void) const
8152
}
8253

8354

84-
class leu32
55+
struct leu32
8556
{
86-
public:
87-
leu32(void);
88-
89-
leu32(const leu32 &other);
90-
leu32& operator=(const leu32 &other);
91-
92-
leu32(const u32 &other);
9357
leu32& operator=(const u32 &other);
9458

9559
operator u32(void) const;
9660

97-
protected:
9861
u32 value;
9962
};
10063

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-
12464
inline leu32& leu32::operator=(const u32 &other)
12565
{
12666
((unsigned char*)&value)[0] = (unsigned char)((other >> 0) & 0xff);
@@ -140,50 +80,15 @@ inline leu32::operator u32(void) const
14080
}
14181

14282

143-
class leu64
83+
struct leu64
14484
{
145-
public:
146-
leu64(void);
147-
148-
leu64(const leu64 &other);
149-
leu64& operator=(const leu64 &other);
150-
151-
leu64(const u64 &other);
15285
leu64& operator=(const u64 &other);
15386

15487
operator u64(void) const;
15588

156-
protected:
15789
u64 value;
15890
};
15991

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-
18792
inline leu64& leu64::operator=(const u64 &other)
18893
{
18994
((unsigned char*)&value)[0] = (unsigned char)((other >> 0) & 0xff);

0 commit comments

Comments
 (0)