Update examples to remove warnings with assertion disabled.

This commit is contained in:
Patrick Pelissier committed 2022-08-09 00:19:26 +02:00
1 parent c13533cf21
commit 4ca166b0b9
4 files changed
+5 -5

No files matched your search

+1 -1
View File
@@ -23,7 +23,7 @@ ARRAY_DEF(vector_int, int)
int main(void)
{
int s;
int s = 0;
// Init keys as a vector_int_t, initialize it (and prepare its destruction)
M_LET(keys, vector_int_t)
// Initialize m as a dictionnary and initialize it with the given database
+1 -1
View File
@@ -19,7 +19,7 @@ int main(void)
M_LET(s, string_t)
// Let v be a vector of integer and initialize it.
M_LET( (v, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10), vector_int_t) {
int sum, product;
int sum = 0, product = 0;
// Compute the sum of theses integers.
ALGO_REDUCE(sum, v, vector_int_t, add);
+2 -2
View File
@@ -231,7 +231,7 @@ test_cstring(int n)
r_cstring_init(array);
for(int i = 0; i < n; i++) {
char buffer[10];
char buffer[16];
// Create a string from the integer
sprintf(buffer, "%d", i);
// We need to make an explicit copy of the string
@@ -612,7 +612,7 @@ int main (int argc, const char *argv[])
s = test_rockme3(n);
printf ("S[rockme3] = %d\n", s);
s = test_rockme3(n);
s = test_rockme4(n);
printf ("S[rockme4] = %d\n", s);
exit(0);
+1 -1
View File
@@ -14,7 +14,7 @@ int main(void) {
dict_m32_set_at (h, 5, 10); // h[5] = 10
char *k = dict_m32_get(h, 10); // No 10 in h, so k == NULL
int is_missing = (k != NULL); // true
assert (is_missing);
assert (is_missing); (void) is_missing;
dict_m32_erase(h, 5); // h is now empty
dict_m32_it_t it; // iterate over all dictionnary
for (dict_m32_it (it, h) ; !dict_m32_end_p (it); dict_m32_next(it)) {