From d72b0a682ecad0a8d5793022733447e855a61798 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Tue, 5 Jan 2021 23:42:55 +0100 Subject: Mark several non-modified pointer variables const --- IncSet.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'IncSet.c') diff --git a/IncSet.c b/IncSet.c index f1031bd0..90974137 100644 --- a/IncSet.c +++ b/IncSet.c @@ -77,8 +77,8 @@ void IncSet_delete(IncSet* this) { free(this); } -static void updateWeakPanel(IncSet* this, Panel* panel, Vector* lines) { - Object* selected = Panel_getSelected(panel); +static void updateWeakPanel(const IncSet* this, Panel* panel, Vector* lines) { + const Object* selected = Panel_getSelected(panel); Panel_prune(panel); if (this->filtering) { int n = 0; @@ -105,7 +105,7 @@ static void updateWeakPanel(IncSet* this, Panel* panel, Vector* lines) { } } -static bool search(IncMode* mode, Panel* panel, IncMode_GetPanelValue getPanelValue) { +static bool search(const IncMode* mode, Panel* panel, IncMode_GetPanelValue getPanelValue) { int size = Panel_size(panel); for (int i = 0; i < size; i++) { if (String_contains_i(getPanelValue(panel, i), mode->buffer)) { @@ -117,7 +117,7 @@ static bool search(IncMode* mode, Panel* panel, IncMode_GetPanelValue getPanelVa return false; } -static bool IncMode_find(IncMode* mode, Panel* panel, IncMode_GetPanelValue getPanelValue, int step) { +static bool IncMode_find(const IncMode* mode, Panel* panel, IncMode_GetPanelValue getPanelValue, int step) { int size = Panel_size(panel); int here = Panel_getSelectedIndex(panel); int i = here; @@ -208,7 +208,7 @@ bool IncSet_handleKey(IncSet* this, int ch, Panel* panel, IncMode_GetPanelValue } const char* IncSet_getListItemValue(Panel* panel, int i) { - ListItem* l = (ListItem*) Panel_get(panel, i); + const ListItem* l = (const ListItem*) Panel_get(panel, i); return l ? l->value : ""; } -- cgit v1.2.3