| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
/* |
|
2
|
|
|
|
|
|
|
Copyright (C) 2016-2017 Alexander Borisov |
|
3
|
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or |
|
5
|
|
|
|
|
|
|
modify it under the terms of the GNU Lesser General Public |
|
6
|
|
|
|
|
|
|
License as published by the Free Software Foundation; either |
|
7
|
|
|
|
|
|
|
version 2.1 of the License, or (at your option) any later version. |
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
This library is distributed in the hope that it will be useful, |
|
10
|
|
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11
|
|
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
12
|
|
|
|
|
|
|
Lesser General Public License for more details. |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public |
|
15
|
|
|
|
|
|
|
License along with this library; if not, write to the Free Software |
|
16
|
|
|
|
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
Author: lex.borisov@gmail.com (Alexander Borisov) |
|
19
|
|
|
|
|
|
|
*/ |
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
#include "myfont/myosi.h" |
|
22
|
|
|
|
|
|
|
|
|
23
|
0
|
|
|
|
|
|
uint32_t myfont_read_u32_as_net(uint8_t** data) |
|
24
|
|
|
|
|
|
|
{ |
|
25
|
0
|
|
|
|
|
|
int cp = 0; |
|
26
|
|
|
|
|
|
|
|
|
27
|
0
|
|
|
|
|
|
cp = **data; (*data)++; |
|
28
|
0
|
|
|
|
|
|
cp |= **data << 8; (*data)++; |
|
29
|
0
|
|
|
|
|
|
cp |= **data << 16; (*data)++; |
|
30
|
0
|
|
|
|
|
|
cp |= **data << 24; (*data)++; |
|
31
|
|
|
|
|
|
|
|
|
32
|
0
|
|
|
|
|
|
return (uint32_t)cp; |
|
33
|
|
|
|
|
|
|
} |
|
34
|
|
|
|
|
|
|
|
|
35
|
0
|
|
|
|
|
|
uint32_t myfont_read_u32(uint8_t** data) |
|
36
|
|
|
|
|
|
|
{ |
|
37
|
0
|
|
|
|
|
|
int cp = 0; |
|
38
|
|
|
|
|
|
|
|
|
39
|
0
|
|
|
|
|
|
cp = **data << 24; (*data)++; |
|
40
|
0
|
|
|
|
|
|
cp |= **data << 16; (*data)++; |
|
41
|
0
|
|
|
|
|
|
cp |= **data << 8; (*data)++; |
|
42
|
0
|
|
|
|
|
|
cp |= **data; (*data)++; |
|
43
|
|
|
|
|
|
|
|
|
44
|
0
|
|
|
|
|
|
return (uint32_t)cp; |
|
45
|
|
|
|
|
|
|
} |
|
46
|
|
|
|
|
|
|
|
|
47
|
0
|
|
|
|
|
|
int32_t myfont_read_32(uint8_t** data) |
|
48
|
|
|
|
|
|
|
{ |
|
49
|
0
|
|
|
|
|
|
int cp = 0; |
|
50
|
|
|
|
|
|
|
|
|
51
|
0
|
|
|
|
|
|
cp = **data << 24; (*data)++; |
|
52
|
0
|
|
|
|
|
|
cp |= **data << 16; (*data)++; |
|
53
|
0
|
|
|
|
|
|
cp |= **data << 8; (*data)++; |
|
54
|
0
|
|
|
|
|
|
cp |= **data; (*data)++; |
|
55
|
|
|
|
|
|
|
|
|
56
|
0
|
|
|
|
|
|
return (int32_t)cp; |
|
57
|
|
|
|
|
|
|
} |
|
58
|
|
|
|
|
|
|
|
|
59
|
0
|
|
|
|
|
|
uint32_t myfont_htonl(uint32_t data) |
|
60
|
|
|
|
|
|
|
{ |
|
61
|
0
|
|
|
|
|
|
int cp = 0; |
|
62
|
|
|
|
|
|
|
|
|
63
|
0
|
|
|
|
|
|
cp = data << 24; |
|
64
|
0
|
|
|
|
|
|
cp |= data << 16; |
|
65
|
0
|
|
|
|
|
|
cp |= data << 8; |
|
66
|
0
|
|
|
|
|
|
cp |= data; |
|
67
|
|
|
|
|
|
|
|
|
68
|
0
|
|
|
|
|
|
return (uint32_t)cp; |
|
69
|
|
|
|
|
|
|
} |
|
70
|
|
|
|
|
|
|
|
|
71
|
0
|
|
|
|
|
|
uint16_t myfont_read_u16(uint8_t** data) |
|
72
|
|
|
|
|
|
|
{ |
|
73
|
0
|
|
|
|
|
|
int cp = 0; |
|
74
|
|
|
|
|
|
|
|
|
75
|
0
|
|
|
|
|
|
cp = **data << 8; (*data)++; |
|
76
|
0
|
|
|
|
|
|
cp |= **data; (*data)++; |
|
77
|
|
|
|
|
|
|
|
|
78
|
0
|
|
|
|
|
|
return (uint16_t)cp; |
|
79
|
|
|
|
|
|
|
} |
|
80
|
|
|
|
|
|
|
|
|
81
|
0
|
|
|
|
|
|
int16_t myfont_read_16(uint8_t** data) |
|
82
|
|
|
|
|
|
|
{ |
|
83
|
0
|
|
|
|
|
|
int cp = 0; |
|
84
|
|
|
|
|
|
|
|
|
85
|
0
|
|
|
|
|
|
cp = **data << 8; (*data)++; |
|
86
|
0
|
|
|
|
|
|
cp |= **data; (*data)++; |
|
87
|
|
|
|
|
|
|
|
|
88
|
0
|
|
|
|
|
|
return (int16_t)cp; |
|
89
|
|
|
|
|
|
|
} |
|
90
|
|
|
|
|
|
|
|
|
91
|
0
|
|
|
|
|
|
uint8_t myfont_read_u8(uint8_t** data) |
|
92
|
|
|
|
|
|
|
{ |
|
93
|
0
|
|
|
|
|
|
int cp = **data; |
|
94
|
0
|
|
|
|
|
|
(*data)++; |
|
95
|
|
|
|
|
|
|
|
|
96
|
0
|
|
|
|
|
|
return (uint8_t)cp; |
|
97
|
|
|
|
|
|
|
} |
|
98
|
|
|
|
|
|
|
|
|
99
|
0
|
|
|
|
|
|
int8_t myfont_read_8(uint8_t** data) |
|
100
|
|
|
|
|
|
|
{ |
|
101
|
0
|
|
|
|
|
|
int cp = **data; |
|
102
|
0
|
|
|
|
|
|
(*data)++; |
|
103
|
|
|
|
|
|
|
|
|
104
|
0
|
|
|
|
|
|
return (int8_t)cp; |
|
105
|
|
|
|
|
|
|
} |
|
106
|
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
|