mirror of https://github.com/xzeldon/htop.git
Resolve -Wimplicit-int-conversion warnings
Panel.c:414:49: error: implicit conversion loses integer precision: 'int' to 'short' [-Werror,-Wimplicit-int-conversion] this->scrollH = MAXIMUM(this->selectedLen - this->w, 0); ~ ~~~~~~~~~~~~~~~~~~^~~~~~~~~ ./Macros.h:11:54: note: expanded from macro 'MAXIMUM' #define MAXIMUM(a, b) ((a) > (b) ? (a) : (b)) ^ IncSet.c:159:38: error: implicit conversion loses integer precision: 'int' to 'char' [-Werror,-Wimplicit-int-conversion] mode->buffer[mode->index] = ch; ~ ^~ Panel.c:456:24: error: implicit conversion loses integer precision: 'int' to 'char' [-Werror,-Wimplicit-int-conversion] buffer[len] = ch; ~ ^~ Panel.c:473:22: error: implicit conversion loses integer precision: 'int' to 'char' [-Werror,-Wimplicit-int-conversion] buffer[0] = ch; ~ ^~
This commit is contained in:
parent
8932efece9
commit
53732ab0bb
2
IncSet.c
2
IncSet.c
|
@ -156,7 +156,7 @@ bool IncSet_handleKey(IncSet* this, int ch, Panel* panel, IncMode_GetPanelValue
|
||||||
doSearch = false;
|
doSearch = false;
|
||||||
} else if (0 < ch && ch < 255 && isprint((unsigned char)ch)) {
|
} else if (0 < ch && ch < 255 && isprint((unsigned char)ch)) {
|
||||||
if (mode->index < INCMODE_MAX) {
|
if (mode->index < INCMODE_MAX) {
|
||||||
mode->buffer[mode->index] = ch;
|
mode->buffer[mode->index] = (char) ch;
|
||||||
mode->index++;
|
mode->index++;
|
||||||
mode->buffer[mode->index] = 0;
|
mode->buffer[mode->index] = 0;
|
||||||
if (mode->isFilter) {
|
if (mode->isFilter) {
|
||||||
|
|
4
Panel.c
4
Panel.c
|
@ -453,7 +453,7 @@ HandlerResult Panel_selectByTyping(Panel* this, int ch) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (len < 99) {
|
if (len < 99) {
|
||||||
buffer[len] = ch;
|
buffer[len] = (char) ch;
|
||||||
buffer[len + 1] = '\0';
|
buffer[len + 1] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -470,7 +470,7 @@ HandlerResult Panel_selectByTyping(Panel* this, int ch) {
|
||||||
|
|
||||||
// if current word did not match,
|
// if current word did not match,
|
||||||
// retry considering the character the start of a new word.
|
// retry considering the character the start of a new word.
|
||||||
buffer[0] = ch;
|
buffer[0] = (char) ch;
|
||||||
buffer[1] = '\0';
|
buffer[1] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
2
Panel.h
2
Panel.h
|
@ -67,7 +67,7 @@ struct Panel_ {
|
||||||
int selectedLen;
|
int selectedLen;
|
||||||
void* eventHandlerState;
|
void* eventHandlerState;
|
||||||
int scrollV;
|
int scrollV;
|
||||||
short scrollH;
|
int scrollH;
|
||||||
bool needsRedraw;
|
bool needsRedraw;
|
||||||
bool wasFocus;
|
bool wasFocus;
|
||||||
FunctionBar* currentBar;
|
FunctionBar* currentBar;
|
||||||
|
|
|
@ -668,7 +668,8 @@ AS_VAR_IF(CACHEVAR,yes,
|
||||||
AS_VAR_POPDEF([CACHEVAR])dnl
|
AS_VAR_POPDEF([CACHEVAR])dnl
|
||||||
])dnl AX_CHECK_COMPILE_FLAGS
|
])dnl AX_CHECK_COMPILE_FLAGS
|
||||||
|
|
||||||
AX_CHECK_COMPILE_FLAG([-Wnull-dereference], [AM_CFLAGS="$AM_CFLAGS -Wnull-dereference"], , [-Werror])
|
AX_CHECK_COMPILE_FLAG([-Wimplicit-int-conversion], [AM_CFLAGS="$AM_CFLAGS -Wimplicit-int-conversion"], , [-Werror])
|
||||||
|
AX_CHECK_COMPILE_FLAG([-Wnull-dereference], [AM_CFLAGS="$AM_CFLAGS -Wnull-dereference"], , [-Werror])
|
||||||
|
|
||||||
AC_ARG_ENABLE([werror],
|
AC_ARG_ENABLE([werror],
|
||||||
[AS_HELP_STRING([--enable-werror],
|
[AS_HELP_STRING([--enable-werror],
|
||||||
|
|
Loading…
Reference in New Issue