aboutsummaryrefslogtreecommitdiff
path: root/grid.h
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-01-20 16:47:05 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-01-20 16:47:05 +0000
commitc5031be4899ea516635ef7c65a6f82b3b45860b9 (patch)
tree10948eb4aface28e80d6a075fecf11fad3075618 /grid.h
parentMerge branch 'decset-1047-and-1048' (diff)
parentdebug: rename assert() to xassert(), to avoid clashing with <assert.h> (diff)
Merge branch 'stacktrace'
Diffstat (limited to 'grid.h')
-rw-r--r--grid.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/grid.h b/grid.h
index 1066e28f..98b34570 100644
--- a/grid.h
+++ b/grid.h
@@ -1,6 +1,7 @@
#pragma once
#include <stddef.h>
+#include "debug.h"
#include "terminal.h"
void grid_swap_row(struct grid *grid, int row_a, int row_b);
@@ -34,7 +35,7 @@ grid_row_absolute_in_view(const struct grid *grid, int row_no)
static inline struct row *
_grid_row_maybe_alloc(struct grid *grid, int row_no, bool alloc_if_null)
{
- assert(grid->offset >= 0);
+ xassert(grid->offset >= 0);
int real_row = grid_row_absolute(grid, row_no);
struct row *row = grid->rows[real_row];
@@ -44,7 +45,7 @@ _grid_row_maybe_alloc(struct grid *grid, int row_no, bool alloc_if_null)
grid->rows[real_row] = row;
}
- assert(row != NULL);
+ xassert(row != NULL);
return row;
}
@@ -63,11 +64,11 @@ grid_row_and_alloc(struct grid *grid, int row_no)
static inline struct row *
grid_row_in_view(struct grid *grid, int row_no)
{
- assert(grid->view >= 0);
+ xassert(grid->view >= 0);
int real_row = grid_row_absolute_in_view(grid, row_no);
struct row *row = grid->rows[real_row];
- assert(row != NULL);
+ xassert(row != NULL);
return row;
}