Skip to content

Commit 0ccc6a7

Browse files
committed
Introduce stdint.h #212
1 parent 28aed60 commit 0ccc6a7

File tree

7 files changed

+25
-26
lines changed

7 files changed

+25
-26
lines changed

library/property/c/include/tetengo/property/propertySet.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
#include <stdbool.h>
1111
#include <stddef.h>
12-
#include <stdint.h> // IWYU pragma: keep
12+
#include <stdint.h>
1313

1414
#include <tetengo/property/storage.h>
1515

library/property/c/include/tetengo/property/storage.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
#include <stdbool.h>
1111
#include <stddef.h>
12-
#include <stdint.h> // IWYU pragma: keep
12+
#include <stdint.h>
1313

1414

1515
#if defined(__cplusplus)

library/trie/c/include/tetengo/trie/storage.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
#include <stdbool.h>
1111
#include <stddef.h>
12+
#include <stdint.h>
1213
#if defined(_WIN32)
1314
#include <wchar.h>
1415
#endif
@@ -44,7 +45,7 @@ typedef char path_character_type;
4445
4546
\return The check value for a vacant element.
4647
*/
47-
unsigned char tetengo_trie_storage_vacantCheckValue();
48+
uint8_t tetengo_trie_storage_vacantCheckValue();
4849

4950
/*!
5051
\brief Creates a storage.
@@ -107,9 +108,9 @@ size_t tetengo_trie_storage_baseCheckSize(const tetengo_trie_storage_t* p_storag
107108
\param p_storage A pointer to a storage.
108109
\param base_check_index A base-check index.
109110
110-
\return The base value. Or INT_MAX on error.
111+
\return The base value. Or INT32_MAX on error.
111112
*/
112-
int tetengo_trie_storage_baseAt(const tetengo_trie_storage_t* p_storage, size_t base_check_index);
113+
int32_t tetengo_trie_storage_baseAt(const tetengo_trie_storage_t* p_storage, size_t base_check_index);
113114

114115
/*!
115116
\brief Sets a base value.
@@ -121,17 +122,17 @@ int tetengo_trie_storage_baseAt(const tetengo_trie_storage_t* p_storage, size_t
121122
\retval true On no error.
122123
\retval false Otherwise.
123124
*/
124-
bool tetengo_trie_storage_setBaseAt(tetengo_trie_storage_t* p_storage, size_t base_check_index, int base);
125+
bool tetengo_trie_storage_setBaseAt(tetengo_trie_storage_t* p_storage, size_t base_check_index, int32_t base);
125126

126127
/*!
127128
\brief Returns the check value.
128129
129130
\param p_storage A pointer to a storage.
130131
\param base_check_index A base-check index.
131132
132-
\return The check value. Or UCHAR_MAX on error.
133+
\return The check value. Or UINT8_MAX on error.
133134
*/
134-
unsigned char tetengo_trie_storage_checkAt(const tetengo_trie_storage_t* p_storage, size_t base_check_index);
135+
uint8_t tetengo_trie_storage_checkAt(const tetengo_trie_storage_t* p_storage, size_t base_check_index);
135136

136137
/*!
137138
\brief Sets a check value.
@@ -143,7 +144,7 @@ unsigned char tetengo_trie_storage_checkAt(const tetengo_trie_storage_t* p_stora
143144
\retval true On no error.
144145
\retval false Otherwise.
145146
*/
146-
bool tetengo_trie_storage_setCheckAt(tetengo_trie_storage_t* p_storage, size_t base_check_index, unsigned char check);
147+
bool tetengo_trie_storage_setCheckAt(tetengo_trie_storage_t* p_storage, size_t base_check_index, uint8_t check);
147148

148149
/*!
149150
\brief Returns the value count.

library/trie/c/src/tetengo_trie_storage.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
*/
66

77
#include <any>
8-
#include <climits>
98
#include <cstddef>
109
#include <filesystem>
1110
#include <fstream>
@@ -16,6 +15,8 @@
1615
#include <utility>
1716
#include <vector>
1817

18+
#include <stdint.h>
19+
1920
#include <boost/interprocess/exceptions.hpp>
2021
#include <boost/interprocess/file_mapping.hpp>
2122

@@ -32,7 +33,7 @@
3233
#include "tetengo_trie_trie.hpp"
3334

3435

35-
unsigned char tetengo_trie_storage_vacantCheckValue()
36+
uint8_t tetengo_trie_storage_vacantCheckValue()
3637
{
3738
return tetengo::trie::double_array::vacant_check_value();
3839
}
@@ -170,7 +171,7 @@ size_t tetengo_trie_storage_baseCheckSize(const tetengo_trie_storage_t* const p_
170171
}
171172
}
172173

173-
int tetengo_trie_storage_baseAt(const tetengo_trie_storage_t* const p_storage, const size_t base_check_index)
174+
int32_t tetengo_trie_storage_baseAt(const tetengo_trie_storage_t* const p_storage, const size_t base_check_index)
174175
{
175176
try
176177
{
@@ -183,14 +184,14 @@ int tetengo_trie_storage_baseAt(const tetengo_trie_storage_t* const p_storage, c
183184
}
184185
catch (...)
185186
{
186-
return INT_MAX;
187+
return INT32_MAX;
187188
}
188189
}
189190

190191
bool tetengo_trie_storage_setBaseAt(
191192
tetengo_trie_storage_t* const p_storage,
192193
const size_t base_check_index,
193-
const int base)
194+
const int32_t base)
194195
{
195196
try
196197
{
@@ -209,7 +210,7 @@ bool tetengo_trie_storage_setBaseAt(
209210
}
210211
}
211212

212-
unsigned char tetengo_trie_storage_checkAt(const tetengo_trie_storage_t* const p_storage, const size_t base_check_index)
213+
uint8_t tetengo_trie_storage_checkAt(const tetengo_trie_storage_t* const p_storage, const size_t base_check_index)
213214
{
214215
try
215216
{
@@ -222,14 +223,14 @@ unsigned char tetengo_trie_storage_checkAt(const tetengo_trie_storage_t* const p
222223
}
223224
catch (...)
224225
{
225-
return UCHAR_MAX;
226+
return UINT8_MAX;
226227
}
227228
}
228229

229230
bool tetengo_trie_storage_setCheckAt(
230231
tetengo_trie_storage_t* const p_storage,
231232
const size_t base_check_index,
232-
const unsigned char check)
233+
const uint8_t check)
233234
{
234235
try
235236
{

library/trie/test/src/test_tetengo.trie.memory_storage.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
#include <any>
88
#include <cassert>
9-
#include <climits>
109
#include <cmath>
1110
#include <cstdint>
1211
#include <filesystem>
@@ -372,7 +371,7 @@ BOOST_AUTO_TEST_CASE(base_at)
372371
BOOST_TEST(tetengo_trie_storage_baseAt(p_storage, 16) == 1);
373372
}
374373
{
375-
BOOST_TEST(tetengo_trie_storage_baseAt(nullptr, 0) == INT_MAX);
374+
BOOST_TEST(tetengo_trie_storage_baseAt(nullptr, 0) == INT32_MAX);
376375
}
377376
}
378377

@@ -456,7 +455,7 @@ BOOST_AUTO_TEST_CASE(check_at)
456455
BOOST_TEST(tetengo_trie_storage_checkAt(p_storage, 16) == 0x00);
457456
}
458457
{
459-
BOOST_TEST(tetengo_trie_storage_checkAt(nullptr, 0) == UCHAR_MAX);
458+
BOOST_TEST(tetengo_trie_storage_checkAt(nullptr, 0) == UINT8_MAX);
460459
}
461460
}
462461

library/trie/test/src/test_tetengo.trie.mmap_storage.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
*/
66

77
#include <any>
8-
#include <climits>
98
#include <cmath>
109
#include <cstdint>
1110
#include <filesystem>
@@ -604,7 +603,7 @@ BOOST_AUTO_TEST_CASE(base_at)
604603
BOOST_TEST(tetengo_trie_storage_baseAt(p_storage, 1) == 0xFE);
605604
}
606605
{
607-
BOOST_TEST(tetengo_trie_storage_baseAt(nullptr, 0) == INT_MAX);
606+
BOOST_TEST(tetengo_trie_storage_baseAt(nullptr, 0) == INT32_MAX);
608607
}
609608
}
610609

@@ -784,7 +783,7 @@ BOOST_AUTO_TEST_CASE(check_at)
784783
BOOST_TEST(tetengo_trie_storage_checkAt(p_storage, 16) == 0x00);
785784
}
786785
{
787-
BOOST_TEST(tetengo_trie_storage_checkAt(nullptr, 0) == UCHAR_MAX);
786+
BOOST_TEST(tetengo_trie_storage_checkAt(nullptr, 0) == UINT8_MAX);
788787
}
789788
}
790789

library/trie/test/src/test_tetengo.trie.shared_storage.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
#include <any>
88
#include <cassert>
9-
#include <climits>
109
#include <cmath>
1110
#include <cstdint>
1211
#include <filesystem>
@@ -315,7 +314,7 @@ BOOST_AUTO_TEST_CASE(base_at)
315314
BOOST_TEST(tetengo_trie_storage_baseAt(p_storage, 16) == 1);
316315
}
317316
{
318-
BOOST_TEST(tetengo_trie_storage_baseAt(nullptr, 0) == INT_MAX);
317+
BOOST_TEST(tetengo_trie_storage_baseAt(nullptr, 0) == INT32_MAX);
319318
}
320319
}
321320

@@ -399,7 +398,7 @@ BOOST_AUTO_TEST_CASE(check_at)
399398
BOOST_TEST(tetengo_trie_storage_checkAt(p_storage, 16) == 0x00);
400399
}
401400
{
402-
BOOST_TEST(tetengo_trie_storage_checkAt(nullptr, 0) == UCHAR_MAX);
401+
BOOST_TEST(tetengo_trie_storage_checkAt(nullptr, 0) == UINT8_MAX);
403402
}
404403
}
405404

0 commit comments

Comments
 (0)