| Revision: | 1.2 |
| Committed: | Sat Aug 21 05:32:00 2004 UTC (22 years, 2 months ago) by root |
| Content type: | text/plain |
| Branch: | MAIN |
| CVS Tags: | rel-7_2, rel-7_1, rel-7_0, rel-5_5, rel-5_4, rel-5_7, rel-5_1, rel-5_0, rel-5_3, rel-5_2, rel-4_4, rel-4_6, rel-4_7, rel-5_9, rel-5_8, rel-4_2, rel-4_3, rel-3_8, rel-6_2, rel-6_3, rel-6_0, rel-4_1, rel-4_0, rel-6_1, rel-4_8, rel-4_9 |
| Changes since 1.1: | +17 -0 lines |
| Log Message: | *** empty log message *** |
| # | User | Rev | Content |
|---|---|---|---|
| 1 | root | 1.1 | #include <cstdlib> |
| 2 | #include <cstring> | ||
| 3 | #include <inttypes.h> | ||
| 4 | |||
| 5 | #include "rxvtutil.h" | ||
| 6 | |||
| 7 | class byteorder byteorder; | ||
| 8 | |||
| 9 | root | 1.2 | unsigned int byteorder::e; |
| 10 | |||
| 11 | root | 1.1 | 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 | root | 1.2 | 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 | root | 1.1 | |
| 42 |