From fd72586c1bbffc15054ace900e5caff7f8aca1ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Deuc=D0=B5?= <shurd@sasktel.net> Date: Thu, 10 Feb 2022 19:49:58 -0500 Subject: [PATCH] More constifying of showbuf() Oddly enough the hbuf wasn't actually modified. --- src/uifc/uifc.h | 2 +- src/uifc/uifc32.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/uifc/uifc.h b/src/uifc/uifc.h index ae68c8e869..6eeffa3553 100644 --- a/src/uifc/uifc.h +++ b/src/uifc/uifc.h @@ -481,7 +481,7 @@ typedef struct { /* Shows a scrollable text buffer - optionally parsing "help markup codes" */ /****************************************************************************/ void (*showbuf)(int mode, int left, int top, int width, int height - ,const char *title, char *hbuf, int *curp, int *barp); + ,const char *title, const char *hbuf, int *curp, int *barp); /****************************************************************************/ /* Updates time in upper left corner of screen with current time in ASCII/ */ diff --git a/src/uifc/uifc32.c b/src/uifc/uifc32.c index ec0a426fed..185bf3be94 100644 --- a/src/uifc/uifc32.c +++ b/src/uifc/uifc32.c @@ -88,7 +88,7 @@ static BOOL deny(char *fmt, ...); static void upop(const char *str); static void sethelp(int line, char* file); static void showbuf(int mode, int left, int top, int width, int height, const char *title - , char *hbuf, int *curp, int *barp); + , const char *hbuf, int *curp, int *barp); /* Dynamic menu support */ static int *last_menu_cur=NULL; @@ -2690,12 +2690,12 @@ void sethelp(int line, char* file) /****************************************************************************/ /* Shows a scrollable text buffer - optionally parsing "help markup codes" */ /****************************************************************************/ -void showbuf(int mode, int left, int top, int width, int height, const char *title, char *hbuf, int *curp, int *barp) +void showbuf(int mode, int left, int top, int width, int height, const char *title, const char *hbuf, int *curp, int *barp) { char inverse=0,high=0; struct vmem_cell *textbuf; struct vmem_cell *p; - char *pc; + const char *cpc; struct vmem_cell *oldp=NULL; int i,j,k,len; int lines; @@ -2768,8 +2768,8 @@ void showbuf(int mode, int left, int top, int width, int height, const char *tit } tmp_buffer2[i].ch = api->chars->help_titlebreak_left; i+=2; - for(pc=title;*pc && pc < &title[j];pc++) { - tmp_buffer2[i].ch=*pc; + for(cpc=title;*cpc && cpc < &title[j];cpc++) { + tmp_buffer2[i].ch=*cpc; i++; } i++; -- GitLab