Skip to content

Commit e3cef4f

Browse files
committed
Change the boolean ints to bool #212
1 parent 0ecb21b commit e3cef4f

File tree

4 files changed

+25
-20
lines changed

4 files changed

+25
-20
lines changed

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#if !defined(TETENGO_PROPERTY_PROPERTYSET_H)
88
#define TETENGO_PROPERTY_PROPERTYSET_H
99

10+
#include <stdbool.h>
1011
#include <stddef.h>
1112
#include <stdint.h> // IWYU pragma: keep
1213

@@ -50,10 +51,10 @@ void tetengo_property_propertySet_destroy(const tetengo_property_propertySet_t*
5051
\param key A key.
5152
\param p_value The storage for a value.
5253
53-
\retval non-zero When the value is set to p_value.
54-
\retval 0 Otherwise.
54+
\retval true When the value is set to p_value.
55+
\retval false Otherwise.
5556
*/
56-
int tetengo_property_propertySet_getBool(
57+
bool tetengo_property_propertySet_getBool(
5758
const tetengo_property_propertySet_t* p_property_set,
5859
const char* key,
5960
int* p_value);
@@ -74,10 +75,10 @@ void tetengo_property_propertySet_setBool(tetengo_property_propertySet_t* p_prop
7475
\param key A key.
7576
\param p_value The storage for a value.
7677
77-
\retval non-zero When the value is set to p_value.
78-
\retval 0 Otherwise.
78+
\retval true When the value is set to p_value.
79+
\retval false Otherwise.
7980
*/
80-
int tetengo_property_propertySet_getUint32(
81+
bool tetengo_property_propertySet_getUint32(
8182
const tetengo_property_propertySet_t* p_property_set,
8283
const char* key,
8384
uint32_t* p_value);

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

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#define TETENGO_PROPERTY_STORAGE_H
99

1010

11+
#include <stdbool.h>
1112
#include <stddef.h>
1213
#include <stdint.h> // IWYU pragma: keep
1314

@@ -36,10 +37,10 @@ void tetengo_property_storage_destroy(const tetengo_property_storage_t* p_storag
3637
\param key A key.
3738
\param p_value The storage for a value.
3839
39-
\retval non-zero When the value is set to p_value.
40-
\retval 0 Otherwise.
40+
\retval true When the value is set to p_value.
41+
\retval false Otherwise.
4142
*/
42-
int tetengo_property_storage_getBool(const tetengo_property_storage_t* p_storage, const char* key, int* p_value);
43+
bool tetengo_property_storage_getBool(const tetengo_property_storage_t* p_storage, const char* key, int* p_value);
4344

4445
/*!
4546
\brief Sets a value in a boolean.
@@ -57,10 +58,13 @@ void tetengo_property_storage_setBool(tetengo_property_storage_t* p_storage, con
5758
\param key A key.
5859
\param p_value The storage for a value.
5960
60-
\retval non-zero When the value is set to p_value.
61-
\retval 0 Otherwise.
61+
\retval true When the value is set to p_value.
62+
\retval false Otherwise.
6263
*/
63-
int tetengo_property_storage_getUint32(const tetengo_property_storage_t* p_storage, const char* key, uint32_t* p_value);
64+
bool tetengo_property_storage_getUint32(
65+
const tetengo_property_storage_t* p_storage,
66+
const char* key,
67+
uint32_t* p_value);
6468

6569
/*!
6670
\brief Sets a value in an unsigned 32-bit integer.

library/property/c/src/tetengo_property_propertySet.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ void tetengo_property_propertySet_destroy(const tetengo_property_propertySet_t*
7777
{}
7878
}
7979

80-
int tetengo_property_propertySet_getBool(
80+
bool tetengo_property_propertySet_getBool(
8181
const tetengo_property_propertySet_t* const p_property_set,
8282
const char* const key,
8383
int* const p_value)
@@ -106,7 +106,7 @@ int tetengo_property_propertySet_getBool(
106106
}
107107
catch (...)
108108
{
109-
return 0;
109+
return false;
110110
}
111111
}
112112

@@ -132,7 +132,7 @@ void tetengo_property_propertySet_setBool(
132132
{}
133133
}
134134

135-
int tetengo_property_propertySet_getUint32(
135+
bool tetengo_property_propertySet_getUint32(
136136
const tetengo_property_propertySet_t* const p_property_set,
137137
const char* const key,
138138
uint32_t* const p_value)
@@ -161,7 +161,7 @@ int tetengo_property_propertySet_getUint32(
161161
}
162162
catch (...)
163163
{
164-
return 0;
164+
return false;
165165
}
166166
}
167167

library/property/c/src/tetengo_property_storage.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ void tetengo_property_storage_destroy(const tetengo_property_storage_t* const p_
5050
{}
5151
}
5252

53-
int tetengo_property_storage_getBool(
53+
bool tetengo_property_storage_getBool(
5454
const tetengo_property_storage_t* const p_storage,
5555
const char* const key,
5656
int* const p_value)
@@ -79,7 +79,7 @@ int tetengo_property_storage_getBool(
7979
}
8080
catch (...)
8181
{
82-
return 0;
82+
return false;
8383
}
8484
}
8585

@@ -105,7 +105,7 @@ void tetengo_property_storage_setBool(
105105
{}
106106
}
107107

108-
int tetengo_property_storage_getUint32(
108+
bool tetengo_property_storage_getUint32(
109109
const tetengo_property_storage_t* const p_storage,
110110
const char* const key,
111111
uint32_t* const p_value)
@@ -134,7 +134,7 @@ int tetengo_property_storage_getUint32(
134134
}
135135
catch (...)
136136
{
137-
return 0;
137+
return false;
138138
}
139139
}
140140

0 commit comments

Comments
 (0)