man: clarify that we decode D-Bus bools as "int", not as C99 "bool"
Fixes: #14643
This commit is contained in:
parent
e5667705fa
commit
10c238b2cc
|
@ -174,6 +174,14 @@ int64_t x;
|
||||||
|
|
||||||
sd_bus_message_read(m, "x", &x);</programlisting>
|
sd_bus_message_read(m, "x", &x);</programlisting>
|
||||||
|
|
||||||
|
<para>Read a boolean value:</para>
|
||||||
|
|
||||||
|
<programlisting>sd_bus_message *m;
|
||||||
|
int x; /* Do not use C99 'bool' type here, it's typically smaller
|
||||||
|
in memory and would cause memory corruption */
|
||||||
|
|
||||||
|
sd_bus_message_read(m, "b", &x);</programlisting>
|
||||||
|
|
||||||
<para>Read all types of integers:</para>
|
<para>Read all types of integers:</para>
|
||||||
|
|
||||||
<programlisting>uint8_t y;
|
<programlisting>uint8_t y;
|
||||||
|
|
|
@ -93,7 +93,7 @@
|
||||||
<entry><literal>b</literal></entry>
|
<entry><literal>b</literal></entry>
|
||||||
<entry><constant>SD_BUS_TYPE_BOOLEAN</constant></entry>
|
<entry><constant>SD_BUS_TYPE_BOOLEAN</constant></entry>
|
||||||
<entry>boolean</entry>
|
<entry>boolean</entry>
|
||||||
<entry><type>int *</type></entry>
|
<entry><type>int *</type> (NB: not <type>bool *</type>)</entry>
|
||||||
</row>
|
</row>
|
||||||
|
|
||||||
<row>
|
<row>
|
||||||
|
|
Loading…
Reference in New Issue