projects
/
dana
/
urxvt.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
*** empty log message ***
[dana/urxvt.git]
/
src
/
rxvtutil.C
1
#include <cstdlib>
2
#include <cstring>
3
#include <inttypes.h>
4
5
#include "rxvtutil.h"
6
7
class byteorder byteorder;
8
9
unsigned int byteorder::e;
10
11
byteorder::byteorder ()
12
{
13
union {
14
uint32_t u;
15
uint8_t b[4];
16
} w;
17
18
w.b[0] = 0x11;
19
w.b[1] = 0x22;
20
w.b[2] = 0x33;
21
w.b[3] = 0x44;
22
23
e = w.u;
24
}
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
}
40
41
42