[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[screen-devel] [PATCH 8/8] WinMsgBuf: Fix const qualifier in wmbc_mergew
From: |
Kieran Bingham |
Subject: |
[screen-devel] [PATCH 8/8] WinMsgBuf: Fix const qualifier in wmbc_mergewmb |
Date: |
Sun, 4 Oct 2015 16:52:33 +0100 |
Assignment to 'p' discards the const qualifier.
To repair, we need to adapt the local pointer, and the
function declaration to match the others.
Signed-off-by: Kieran Bingham <address@hidden>
---
src/winmsgbuf.c | 4 ++--
src/winmsgbuf.h | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/winmsgbuf.c b/src/winmsgbuf.c
index 793e8de..40c817e 100644
--- a/src/winmsgbuf.c
+++ b/src/winmsgbuf.c
@@ -276,9 +276,9 @@ size_t wmbc_bytesleft(WinMsgBufContext *wmbc)
/* Merges the contents of another null-terminated buffer and its renditions.
The
* return value is a pointer to the first character of WMB's buffer. */
-char *wmbc_mergewmb(WinMsgBufContext *wmbc, WinMsgBuf *wmb)
+const char *wmbc_mergewmb(WinMsgBufContext *wmbc, WinMsgBuf *wmb)
{
- char *p;
+ const char *p;
size_t offset = wmbc_offset(wmbc);
int ri;
diff --git a/src/winmsgbuf.h b/src/winmsgbuf.h
index 81a9fcf..f090d80 100644
--- a/src/winmsgbuf.h
+++ b/src/winmsgbuf.h
@@ -80,7 +80,7 @@ int wmbc_printf(WinMsgBufContext *, const char *, ...)
__attribute__((format(printf,2,3)));
size_t wmbc_offset(WinMsgBufContext *);
size_t wmbc_bytesleft(WinMsgBufContext *);
-char *wmbc_mergewmb(WinMsgBufContext *, WinMsgBuf *);
+const char *wmbc_mergewmb(WinMsgBufContext *, WinMsgBuf *);
const char *wmbc_finish(WinMsgBufContext *);
void wmbc_free(WinMsgBufContext *);
--
2.1.4
- [screen-devel] [Trivial] Bugfixes and compiler warnings, Kieran Bingham, 2015/10/08
- [screen-devel] [PATCH 1/8] Makefile.in: Fix out of tree build, Kieran Bingham, 2015/10/08
- [screen-devel] [PATCH 2/8] Process: Fix sign-compare errors, Kieran Bingham, 2015/10/08
- [screen-devel] [PATCH 3/8] Process: Fix const qualifer loss in ShowWindows, Kieran Bingham, 2015/10/08
- [screen-devel] [PATCH 5/8] Process: Fix printf modifier warning, Kieran Bingham, 2015/10/08
- [screen-devel] [PATCH 6/8] Display: Unsigned comparison causes unreachable code, Kieran Bingham, 2015/10/08
- [screen-devel] [PATCH 4/8] Process: Pointer arithmetic comparison with unsigned size_t, Kieran Bingham, 2015/10/08
- [screen-devel] [PATCH 7/8] Display: Convert strlen_onscreen to be unsigned like strlen, Kieran Bingham, 2015/10/08
- [screen-devel] [PATCH 8/8] WinMsgBuf: Fix const qualifier in wmbc_mergewmb,
Kieran Bingham <=