Mercurial > mm7
comparison MM7.h @ 838:d061180f2b42
Merge
author | Gloval |
---|---|
date | Thu, 28 Mar 2013 00:37:58 +0400 |
parents | 0f56abdcce94 |
children | ae8f83e1b0cf |
comparison
equal
deleted
inserted
replaced
837:bebc19f3d2af | 838:d061180f2b42 |
---|---|
18 #define LOBYTE(a) (*((unsigned char *)&a)) | 18 #define LOBYTE(a) (*((unsigned char *)&a)) |
19 #define HIBYTE(a) (*((unsigned char *)&a + sizeof(a) - 1)) | 19 #define HIBYTE(a) (*((unsigned char *)&a + sizeof(a) - 1)) |
20 #define BYTE1(a) (*((unsigned char *)&a + 1)) | 20 #define BYTE1(a) (*((unsigned char *)&a + 1)) |
21 #define BYTE2(a) (*((unsigned char *)&a + 2)) | 21 #define BYTE2(a) (*((unsigned char *)&a + 2)) |
22 #define BYTE3(a) (*((unsigned char *)&a + 3)) | 22 #define BYTE3(a) (*((unsigned char *)&a + 3)) |
23 | |
24 #define PID(type, id) (unsigned int)((((8 * (id))) | (type)) & 0xFFFF) // packed id | |
25 #define PID_TYPE(pid) (unsigned int)((pid) & 7) // extract type | |
26 #define PID_ID(pid) (unsigned int)(((pid) & 0xFFFF) >> 3) // extract value | |
23 | 27 |
24 | 28 |
25 typedef unsigned __int16 _WORD; | 29 typedef unsigned __int16 _WORD; |
26 typedef unsigned __int64 _QWORD; | 30 typedef unsigned __int64 _QWORD; |
27 | 31 |