… | |
… | |
3 | #include <inttypes.h> |
3 | #include <inttypes.h> |
4 | |
4 | |
5 | #include "rxvtutil.h" |
5 | #include "rxvtutil.h" |
6 | |
6 | |
7 | class byteorder byteorder; |
7 | class byteorder byteorder; |
|
|
8 | |
|
|
9 | unsigned int byteorder::e; |
8 | |
10 | |
9 | byteorder::byteorder () |
11 | byteorder::byteorder () |
10 | { |
12 | { |
11 | union { |
13 | union { |
12 | uint32_t u; |
14 | uint32_t u; |
… | |
… | |
19 | w.b[3] = 0x44; |
21 | w.b[3] = 0x44; |
20 | |
22 | |
21 | e = w.u; |
23 | e = w.u; |
22 | } |
24 | } |
23 | |
25 | |
|
|
26 | void * |
|
|
27 | zero_initialized::operator new (size_t s) |
|
|
28 | { |
|
|
29 | void *p = malloc (s); |
|
|
30 | |
|
|
31 | memset (p, 0, s); |
|
|
32 | return p; |
|
|
33 | } |
|
|
34 | |
|
|
35 | void |
|
|
36 | zero_initialized::operator delete (void *p, size_t s) |
|
|
37 | { |
|
|
38 | free (p); |
|
|
39 | } |
24 | |
40 | |
25 | |
41 | |
|
|
42 | |