aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-extended/upm/upm/0001-Use-stdint-types.patch
blob: 40856fcf0dd10628a1d4ebb14812f07e2bd205f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
From 5a1e731d71d577f56a2c013e4a75a8e90188e63b Mon Sep 17 00:00:00 2001
From: Paul Eggleton <paul.eggleton@linux.intel.com>
Date: Tue, 9 Jul 2019 05:21:59 -0700
Subject: [PATCH] Use stdint types

Fixes compilation with musl.

Upstream-Status: Pending

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 src/bma250e/bma250e.cxx   | 16 ++++++++--------
 src/bmg160/bmg160.cxx     | 10 +++++-----
 src/bmi160/bosch_bmi160.h |  2 +-
 src/bmm150/bmm150.cxx     |  8 ++++----
 4 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/src/bma250e/bma250e.cxx b/src/bma250e/bma250e.cxx
index a8792782..1b3ecdd8 100644
--- a/src/bma250e/bma250e.cxx
+++ b/src/bma250e/bma250e.cxx
@@ -195,35 +195,35 @@ BMA250E::BMA250E(std::string initStr) : mraaIo(initStr)
             fifoConfig(mode, axes);
         }
         if(tok.substr(0, 20) == "setInterruptEnable0:") {
-            u_int8_t bits = (u_int8_t)std::stoul(tok.substr(20), nullptr, 0);
+            uint8_t bits = (uint8_t)std::stoul(tok.substr(20), nullptr, 0);
             setInterruptEnable0(bits);
         }
         if(tok.substr(0, 20) == "setInterruptEnable1:") {
-            u_int8_t bits = (u_int8_t)std::stoul(tok.substr(20), nullptr, 0);
+            uint8_t bits = (uint8_t)std::stoul(tok.substr(20), nullptr, 0);
             setInterruptEnable1(bits);
         }
         if(tok.substr(0, 20) == "setInterruptEnable2:") {
-            u_int8_t bits = (u_int8_t)std::stoul(tok.substr(20), nullptr, 0);
+            uint8_t bits = (uint8_t)std::stoul(tok.substr(20), nullptr, 0);
             setInterruptEnable2(bits);
         }
         if(tok.substr(0, 17) == "setInterruptMap0:") {
-            u_int8_t bits = (u_int8_t)std::stoul(tok.substr(17), nullptr, 0);
+            uint8_t bits = (uint8_t)std::stoul(tok.substr(17), nullptr, 0);
             setInterruptMap0(bits);
         }
         if(tok.substr(0, 17) == "setInterruptMap1:") {
-            u_int8_t bits = (u_int8_t)std::stoul(tok.substr(17), nullptr, 0);
+            uint8_t bits = (uint8_t)std::stoul(tok.substr(17), nullptr, 0);
             setInterruptMap1(bits);
         }
         if(tok.substr(0, 17) == "setInterruptMap2:") {
-            u_int8_t bits = (u_int8_t)std::stoul(tok.substr(17), nullptr, 0);
+            uint8_t bits = (uint8_t)std::stoul(tok.substr(17), nullptr, 0);
             setInterruptMap2(bits);
         }
         if(tok.substr(0, 16) == "setInterruptSrc:") {
-            u_int8_t bits = (u_int8_t)std::stoul(tok.substr(16), nullptr, 0);
+            uint8_t bits = (uint8_t)std::stoul(tok.substr(16), nullptr, 0);
             setInterruptSrc(bits);
         }
         if(tok.substr(0, 26) == "setInterruptOutputControl:") {
-            u_int8_t bits = (u_int8_t)std::stoul(tok.substr(26), nullptr, 0);
+            uint8_t bits = (uint8_t)std::stoul(tok.substr(26), nullptr, 0);
             setInterruptOutputControl(bits);
         }
         if(tok.substr(0, 26) == "setInterruptLatchBehavior:") {
diff --git a/src/bmg160/bmg160.cxx b/src/bmg160/bmg160.cxx
index 1a0939f8..2438c399 100644
--- a/src/bmg160/bmg160.cxx
+++ b/src/bmg160/bmg160.cxx
@@ -173,23 +173,23 @@ BMG160::BMG160(std::string initStr) : mraaIo(initStr)
             fifoConfig(mode, axes);
         }
         if(tok.substr(0, 20) == "setInterruptEnable0:") {
-            u_int8_t bits = (u_int8_t)std::stoul(tok.substr(20), nullptr, 0);
+            uint8_t bits = (uint8_t)std::stoul(tok.substr(20), nullptr, 0);
             setInterruptEnable0(bits);
         }
         if(tok.substr(0, 17) == "setInterruptMap0:") {
-            u_int8_t bits = (u_int8_t)std::stoul(tok.substr(17), nullptr, 0);
+            uint8_t bits = (uint8_t)std::stoul(tok.substr(17), nullptr, 0);
             setInterruptMap0(bits);
         }
         if(tok.substr(0, 17) == "setInterruptMap1:") {
-            u_int8_t bits = (u_int8_t)std::stoul(tok.substr(17), nullptr, 0);
+            uint8_t bits = (uint8_t)std::stoul(tok.substr(17), nullptr, 0);
             setInterruptMap1(bits);
         }
         if(tok.substr(0, 16) == "setInterruptSrc:") {
-            u_int8_t bits = (u_int8_t)std::stoul(tok.substr(16), nullptr, 0);
+            uint8_t bits = (uint8_t)std::stoul(tok.substr(16), nullptr, 0);
             setInterruptSrc(bits);
         }
         if(tok.substr(0, 26) == "setInterruptOutputControl:") {
-            u_int8_t bits = (u_int8_t)std::stoul(tok.substr(26), nullptr, 0);
+            uint8_t bits = (uint8_t)std::stoul(tok.substr(26), nullptr, 0);
             setInterruptOutputControl(bits);
         }
         if(tok.substr(0, 26) == "setInterruptLatchBehavior:") {
diff --git a/src/bmi160/bosch_bmi160.h b/src/bmi160/bosch_bmi160.h
index 87ca2249..cd9efe6f 100644
--- a/src/bmi160/bosch_bmi160.h
+++ b/src/bmi160/bosch_bmi160.h
@@ -81,7 +81,7 @@ typedef	int16_t s16;/**< used for signed 16bit */
 typedef	int32_t s32;/**< used for signed 32bit */
 typedef	int64_t s64;/**< used for signed 64bit */
 
-typedef	u_int8_t u8;/**< used for unsigned 8bit */
+typedef	uint8_t u8;/**< used for unsigned 8bit */
 typedef	u_int16_t u16;/**< used for unsigned 16bit */
 typedef	u_int32_t u32;/**< used for unsigned 32bit */
 typedef	u_int64_t u64;/**< used for unsigned 64bit */
diff --git a/src/bmm150/bmm150.cxx b/src/bmm150/bmm150.cxx
index 234ebf92..02436788 100644
--- a/src/bmm150/bmm150.cxx
+++ b/src/bmm150/bmm150.cxx
@@ -170,19 +170,19 @@ BMM150::BMM150(std::string initStr) : mraaIo(initStr)
             setOpmode(opmode);
         }
         if(tok.substr(0, 19) == "setInterruptEnable:") {
-            u_int8_t bits = (u_int8_t)std::stoul(tok.substr(19), nullptr, 0);
+            uint8_t bits = (uint8_t)std::stoul(tok.substr(19), nullptr, 0);
             setInterruptEnable(bits);
         }
         if(tok.substr(0, 19) == "setInterruptConfig:") {
-            u_int8_t bits = (u_int8_t)std::stoul(tok.substr(19), nullptr, 0);
+            uint8_t bits = (uint8_t)std::stoul(tok.substr(19), nullptr, 0);
             setInterruptConfig(bits);
         }
         if(tok.substr(0, 17) == "setRepetitionsXY:") {
-            u_int8_t reps = (u_int8_t)std::stoul(tok.substr(17), nullptr, 0);
+            uint8_t reps = (uint8_t)std::stoul(tok.substr(17), nullptr, 0);
             setRepetitionsXY(reps);
         }
         if(tok.substr(0, 16) == "setRepetitionsZ:") {
-            u_int8_t reps = (u_int8_t)std::stoul(tok.substr(16), nullptr, 0);
+            uint8_t reps = (uint8_t)std::stoul(tok.substr(16), nullptr, 0);
             setRepetitionsZ(reps);
         }
         if(tok.substr(0, 14) == "setPresetMode:") {