Skip to content

Commit

Permalink
Please Clang 15
Browse files Browse the repository at this point in the history
    CRT.c:1015:14: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    void CRT_done() {
                 ^
                  void
  • Loading branch information
cgzones committed Aug 9, 2022
1 parent 3e1908b commit 9a4879b
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions CRT.c
Original file line number Diff line number Diff line change
Expand Up @@ -1012,7 +1012,7 @@ IGNORE_WCASTQUAL_END
CRT_degreeSign = initDegreeSign();
}

void CRT_done() {
void CRT_done(void) {
int resetColor = CRT_colors ? CRT_colors[RESET_COLOR] : CRT_colorSchemes[COLORSCHEME_DEFAULT][RESET_COLOR];

attron(resetColor);
Expand All @@ -1033,7 +1033,7 @@ void CRT_fatalError(const char* note) {
exit(2);
}

int CRT_readKey() {
int CRT_readKey(void) {
nocbreak();
cbreak();
nodelay(stdscr, FALSE);
Expand All @@ -1042,13 +1042,13 @@ int CRT_readKey() {
return ret;
}

void CRT_disableDelay() {
void CRT_disableDelay(void) {
nocbreak();
cbreak();
nodelay(stdscr, TRUE);
}

void CRT_enableDelay() {
void CRT_enableDelay(void) {
halfdelay(*CRT_delay);
}

Expand Down
2 changes: 1 addition & 1 deletion MainPanel.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ const PanelClass MainPanel_class = {
.printHeader = MainPanel_printHeader
};

MainPanel* MainPanel_new() {
MainPanel* MainPanel_new(void) {
MainPanel* this = AllocThis(MainPanel);
Panel_init((Panel*) this, 1, 1, 1, 1, Class(Process), false, FunctionBar_new(Settings_isReadonly() ? MainFunctions_ro : MainFunctions, NULL, NULL));
this->keys = xCalloc(KEY_MAX, sizeof(Htop_Action));
Expand Down
2 changes: 1 addition & 1 deletion MetersPanel.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ static const char* const MetersMovingKeys[] = {"Space", "Enter", "Up", "Dn", "<-
static const int MetersMovingEvents[] = {' ', 13, KEY_UP, KEY_DOWN, KEY_LEFT, KEY_RIGHT, ERR, KEY_DC, KEY_F(10)};
static FunctionBar* Meters_movingBar = NULL;

void MetersPanel_cleanup() {
void MetersPanel_cleanup(void) {
if (Meters_movingBar) {
FunctionBar_delete(Meters_movingBar);
Meters_movingBar = NULL;
Expand Down
4 changes: 2 additions & 2 deletions Process.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ static uid_t Process_getuid = (uid_t)-1;
int Process_pidDigits = PROCESS_MIN_PID_DIGITS;
int Process_uidDigits = PROCESS_MIN_UID_DIGITS;

void Process_setupColumnWidths() {
void Process_setupColumnWidths(void) {
int maxPid = Platform_getMaxPid();
if (maxPid == -1)
return;
Expand Down Expand Up @@ -1240,7 +1240,7 @@ void Process_updateExe(Process* this, const char* exe) {

uint8_t Process_fieldWidths[LAST_PROCESSFIELD] = { 0 };

void Process_resetFieldWidths() {
void Process_resetFieldWidths(void) {
for (size_t i = 0; i < LAST_PROCESSFIELD; i++) {
if (!Process_fields[i].autoWidth)
continue;
Expand Down
2 changes: 1 addition & 1 deletion UsersTable.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ in the source distribution for its full text.
#include "XUtils.h"


UsersTable* UsersTable_new() {
UsersTable* UsersTable_new(void) {
UsersTable* this;
this = xMalloc(sizeof(UsersTable));
this->users = Hashtable_new(10, true);
Expand Down
2 changes: 1 addition & 1 deletion XUtils.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ in the source distribution for its full text.
#include "CRT.h"


void fail() {
void fail(void) {
CRT_done();
abort();

Expand Down
4 changes: 2 additions & 2 deletions linux/Platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ const MeterClass* const Platform_meterTypes[] = {
NULL
};

int Platform_getUptime() {
int Platform_getUptime(void) {
double uptime = 0;
FILE* fd = fopen(PROCDIR "/uptime", "r");
if (fd) {
Expand Down Expand Up @@ -285,7 +285,7 @@ void Platform_getLoadAverage(double* one, double* five, double* fifteen) {
*fifteen = NAN;
}

int Platform_getMaxPid() {
int Platform_getMaxPid(void) {
FILE* file = fopen(PROCDIR "/sys/kernel/pid_max", "r");
if (!file)
return -1;
Expand Down

0 comments on commit 9a4879b

Please sign in to comment.