Use ATTR_UNUSED instead of void casting

This commit is contained in:
Christian Göttsche 2020-12-20 01:25:09 +01:00
parent a40347e85b
commit df818b9904
4 changed files with 4 additions and 9 deletions

3
CRT.c
View File

@ -652,8 +652,7 @@ int CRT_scrollWheelVAmount = 10;
ColorScheme CRT_colorScheme = COLORSCHEME_DEFAULT; ColorScheme CRT_colorScheme = COLORSCHEME_DEFAULT;
ATTR_NORETURN ATTR_NORETURN
static void CRT_handleSIGTERM(int sgn) { static void CRT_handleSIGTERM(ATTR_UNUSED int sgn) {
(void) sgn;
CRT_done(); CRT_done();
_exit(0); _exit(0);
} }

View File

@ -19,8 +19,7 @@ static const int HostnameMeter_attributes[] = {
HOSTNAME HOSTNAME
}; };
static void HostnameMeter_updateValues(Meter* this, char* buffer, size_t size) { static void HostnameMeter_updateValues(ATTR_UNUSED Meter* this, char* buffer, size_t size) {
(void) this;
gethostname(buffer, size - 1); gethostname(buffer, size - 1);
} }

View File

@ -387,9 +387,7 @@ static void LEDMeterMode_drawDigit(int x, int y, int n) {
mvaddstr(y+i, x, LEDMeterMode_digits[i * 10 + n]); mvaddstr(y+i, x, LEDMeterMode_digits[i * 10 + n]);
} }
static void LEDMeterMode_draw(Meter* this, int x, int y, int w) { static void LEDMeterMode_draw(Meter* this, int x, int y, ATTR_UNUSED int w) {
(void) w;
#ifdef HAVE_LIBNCURSESW #ifdef HAVE_LIBNCURSESW
if (CRT_utf8) if (CRT_utf8)
LEDMeterMode_digits = LEDMeterMode_digitsUtf8; LEDMeterMode_digits = LEDMeterMode_digitsUtf8;

View File

@ -93,8 +93,7 @@ bool TraceScreen_forkTracer(TraceScreen* this) {
// Should never reach here, unless execlp fails ... // Should never reach here, unless execlp fails ...
const char* message = "Could not execute 'strace'. Please make sure it is available in your $PATH."; const char* message = "Could not execute 'strace'. Please make sure it is available in your $PATH.";
ssize_t written = write(STDERR_FILENO, message, strlen(message)); (void)! write(STDERR_FILENO, message, strlen(message));
(void) written;
exit(127); exit(127);
} }