From e1411707ac5d2a890d853d8a595f103e4e07053f Mon Sep 17 00:00:00 2001
From: Andreas Mohr <and@gmx.li>
Date: Sat, 5 Jan 2019 19:25:29 +0000
Subject: [PATCH] (viewer) Cleanup -Wstring-conversion warning
Found by Clang 6.0.1
In file included from ./internal.h:345:
./inlines.h:110:20: warning: implicit conversion turns string literal into bool: 'const char [24]' to 'bool' [-Wstring-conversion]
g_assert (!"Unknown datasource type");
~^~~~~~~~~~~~~~~~~~~~~~~~~
datasource.c:117:20: warning: implicit conversion turns string literal into bool: 'const char [24]' to '_Bool' [-Wstring-conversion]
g_assert (!"Unknown datasource type");
~^~~~~~~~~~~~~~~~~~~~~~~~~
datasource.c:362:20: warning: implicit conversion turns string literal into bool: 'const char [24]' to '_Bool' [-Wstring-conversion]
g_assert (!"Unknown datasource type");
~^~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Andreas Mohr <and@gmx.li>
---
src/viewer/datasource.c | 4 ++--
src/viewer/inlines.h | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/viewer/datasource.c b/src/viewer/datasource.c
index d5e91dd34..8078b81ea 100644
a
|
b
|
mcview_get_filesize (WView * view) |
114 | 114 | case DS_STRING: |
115 | 115 | return view->ds_string_len; |
116 | 116 | default: |
117 | | g_assert (!"Unknown datasource type"); |
| 117 | g_assert (FALSE && "Unknown datasource type"); |
118 | 118 | return 0; |
119 | 119 | } |
120 | 120 | } |
… |
… |
mcview_close_datasource (WView * view) |
359 | 359 | MC_PTR_FREE (view->ds_string_data); |
360 | 360 | break; |
361 | 361 | default: |
362 | | g_assert (!"Unknown datasource type"); |
| 362 | g_assert (FALSE && "Unknown datasource type"); |
363 | 363 | } |
364 | 364 | view->datasource = DS_NONE; |
365 | 365 | } |
diff --git a/src/viewer/inlines.h b/src/viewer/inlines.h
index efa3eb10a..0f6c6faac 100644
a
|
b
|
mcview_get_byte (WView * view, off_t offset, int *retval) |
107 | 107 | case DS_NONE: |
108 | 108 | return mcview_get_byte_none (view, offset, retval); |
109 | 109 | default: |
110 | | g_assert (!"Unknown datasource type"); |
| 110 | g_assert (FALSE && "Unknown datasource type"); |
111 | 111 | return FALSE; |
112 | 112 | } |
113 | 113 | } |