summaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/astar.c2
-rw-r--r--examples/mapmap.c2
-rw-r--r--examples/stack.c5
3 files changed, 4 insertions, 5 deletions
diff --git a/examples/astar.c b/examples/astar.c
index 04c18113..7410de96 100644
--- a/examples/astar.c
+++ b/examples/astar.c
@@ -107,7 +107,7 @@ astar(cstr* maze, int width)
int new_cost = *csmap_pcost_at(&costs, current);
if (maze->str[point_index(&next)] != '#')
{
- csmap_pcost_value *cost = csmap_pcost_get(&costs, next);
+ const csmap_pcost_value *cost = csmap_pcost_get(&costs, next);
if (cost == NULL || new_cost < cost->second)
{
csmap_pcost_insert(&costs, next, new_cost);
diff --git a/examples/mapmap.c b/examples/mapmap.c
index 047132d1..73a00861 100644
--- a/examples/mapmap.c
+++ b/examples/mapmap.c
@@ -19,7 +19,7 @@ void add(csmap_conf* map, const char* section, const char* entry, const char* va
bool contains(csmap_conf* map, const char* section, const char* entry)
{
- csmap_conf_value *val = csmap_conf_get(map, section);
+ const csmap_conf_value *val = csmap_conf_get(map, section);
return val && csmap_sect_get(&val->second, entry);
}
diff --git a/examples/stack.c b/examples/stack.c
index 54d5aeed..dac0112e 100644
--- a/examples/stack.c
+++ b/examples/stack.c
@@ -11,9 +11,8 @@
#include <stc/cstack.h>
int main() {
- cstack_i stack = cstack_i_init();
- cstack_c chars = cstack_c_init();
- c_autodefer (cstack_i_del(&stack), cstack_c_del(&chars))
+ c_auto (cstack_i, stack)
+ c_auto (cstack_c, chars)
{
c_forrange (i, int, 101)
cstack_i_push(&stack, i*i);