Merge branch 'cgzones-ci2'

This commit is contained in:
Daniel Lange 2020-08-22 15:35:02 +10:00 committed by Nathan Scott
commit ada780c867
34 changed files with 106 additions and 103 deletions

View File

@ -1,22 +1,22 @@
name: CI name: CI
on: on: [ push, pull_request ]
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs: jobs:
build-ubuntu-latest: build-ubuntu-latest:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Install Dependencies
run: sudo apt-get install libncursesw5-dev
- name: Bootstrap
run: ./autogen.sh
- name: Configure
run: ./configure --enable-werror
- name: Build - name: Build
run: | run: make
sudo apt-get install libncursesw5-dev - name: Distcheck
./autogen.sh run: make distcheck
./configure
make
# build-macos-latest: # build-macos-latest:
# runs-on: macos-latest # runs-on: macos-latest
@ -27,3 +27,12 @@ jobs:
# ./autogen.sh # ./autogen.sh
# ./configure # ./configure
# make # make
whitespace_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: check-whitespaces
run: git diff-tree --check $(git hash-object -t tree /dev/null) HEAD

View File

@ -615,4 +615,3 @@ void Action_setBindings(Htop_Action* keys) {
keys['c'] = actionTagAllChildren; keys['c'] = actionTagAllChildren;
keys['e'] = actionShowEnvScreen; keys['e'] = actionShowEnvScreen;
} }

View File

@ -53,4 +53,3 @@ Donations
If you like htop, feel free to [buy the author a If you like htop, feel free to [buy the author a
beer](http://hisham.hm/htop/index.php?page=donate). :-) beer](http://hisham.hm/htop/index.php?page=donate). :-)

View File

@ -353,4 +353,3 @@ Public License instead of this License.
applicable licenses of the version of PLPA used in your combined work, applicable licenses of the version of PLPA used in your combined work,
provided that you include the source code of such version of PLPA when provided that you include the source code of such version of PLPA when
and as the GNU GPL requires distribution of source code. and as the GNU GPL requires distribution of source code.

View File

@ -164,4 +164,3 @@ void ColumnsPanel_update(Panel* super) {
} }
this->settings->fields[size] = 0; this->settings->fields[size] = 0;
} }

View File

@ -85,4 +85,3 @@ long ListItem_compare(const void* cast1, const void* cast2) {
ListItem* obj2 = (ListItem*) cast2; ListItem* obj2 = (ListItem*) cast2;
return strcmp(obj1->value, obj2->value); return strcmp(obj1->value, obj2->value);
} }

View File

@ -12,7 +12,7 @@ applications_DATA = htop.desktop
pixmapdir = $(datadir)/pixmaps pixmapdir = $(datadir)/pixmaps
pixmap_DATA = htop.png pixmap_DATA = htop.png
AM_CFLAGS = -pedantic -Wall $(wextra_flag) -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"$(sysconfdir)\" -I"$(top_srcdir)/$(my_htop_platform)" AM_CFLAGS += -pedantic -Wall $(wextra_flag) -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"$(sysconfdir)\" -I"$(top_srcdir)/$(my_htop_platform)"
AM_LDFLAGS = AM_LDFLAGS =
AM_CPPFLAGS = -DNDEBUG AM_CPPFLAGS = -DNDEBUG

1
NEWS
View File

@ -2,4 +2,3 @@
See the commit history for news of the past. See the commit history for news of the past.
See the bug tracker for news of the future. See the bug tracker for news of the future.
Run the program for news of the present. Run the program for news of the present.

View File

@ -152,4 +152,3 @@ STrace screen:
LSOF screen: LSOF screen:
TODO TODO

View File

@ -14,7 +14,7 @@
#include <stdlib.h> #include <stdlib.h>
}*/ }*/
static inline void fail() { void fail() {
curs_set(1); curs_set(1);
endwin(); endwin();
err(1, NULL); err(1, NULL);
@ -44,6 +44,10 @@ void* xRealloc(void* ptr, size_t size) {
return data; return data;
} }
#undef xAsprintf
#define xAsprintf(strp, fmt, ...) do { int _r=asprintf(strp, fmt, __VA_ARGS__); if (_r < 0) { fail(); } } while(0)
#define xSnprintf(fmt, len, ...) do { int _l=len; int _n=snprintf(fmt, _l, __VA_ARGS__); if (!(_n > -1 && _n < _l)) { curs_set(1); endwin(); err(1, NULL); } } while(0) #define xSnprintf(fmt, len, ...) do { int _l=len; int _n=snprintf(fmt, _l, __VA_ARGS__); if (!(_n > -1 && _n < _l)) { curs_set(1); endwin(); err(1, NULL); } } while(0)
#undef xStrdup #undef xStrdup

View File

@ -11,12 +11,18 @@
#include <assert.h> #include <assert.h>
#include <stdlib.h> #include <stdlib.h>
extern void fail(void);
extern void* xMalloc(size_t size); extern void* xMalloc(size_t size);
extern void* xCalloc(size_t nmemb, size_t size); extern void* xCalloc(size_t nmemb, size_t size);
extern void* xRealloc(void* ptr, size_t size); extern void* xRealloc(void* ptr, size_t size);
#undef xAsprintf
#define xAsprintf(strp, fmt, ...) do { int _r=asprintf(strp, fmt, __VA_ARGS__); if (_r < 0) { fail(); } } while(0)
#define xSnprintf(fmt, len, ...) do { int _l=len; int _n=snprintf(fmt, _l, __VA_ARGS__); if (!(_n > -1 && _n < _l)) { curs_set(1); endwin(); err(1, NULL); } } while(0) #define xSnprintf(fmt, len, ...) do { int _l=len; int _n=snprintf(fmt, _l, __VA_ARGS__); if (!(_n > -1 && _n < _l)) { curs_set(1); endwin(); err(1, NULL); } } while(0)
#undef xStrdup #undef xStrdup

View File

@ -295,6 +295,9 @@ then
]) ])
fi fi
AC_ARG_ENABLE([werror], [AS_HELP_STRING([--enable-werror], [Treat warnings as errors (default: warnings are not errors)])], [enable_werror="$enableval"], [enable_werror=no])
AS_IF([test "x$enable_werror" = "xyes"], [AM_CFLAGS="$AM_CFLAGS -Werror"])
AC_SUBST([AM_CFLAGS])
# Bail out on errors. # Bail out on errors.
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------

View File

@ -72,4 +72,3 @@ void Battery_getData(double* level, ACPresence* isOnAC) {
CFRelease(power_sources); CFRelease(power_sources);
} }
} }

View File

@ -32,4 +32,3 @@ void CRT_handleSIGSEGV(int sgn) {
#endif #endif
abort(); abort();
} }

View File

@ -32,4 +32,3 @@ void CRT_handleSIGSEGV(int sgn) {
#endif #endif
abort(); abort();
} }

View File

@ -18,4 +18,3 @@ void CRT_handleSIGSEGV(int sgn) {
fprintf(stderr, "\nPlease contact your platform package maintainer!\n\n"); fprintf(stderr, "\nPlease contact your platform package maintainer!\n\n");
abort(); abort();
} }

View File

@ -38,4 +38,3 @@ typedef int IOPriority;
#define IOPriority_Idle IOPriority_tuple(IOPRIO_CLASS_IDLE, 7) #define IOPriority_Idle IOPriority_tuple(IOPRIO_CLASS_IDLE, 7)
}*/ }*/

View File

@ -41,4 +41,3 @@ Panel* IOPriorityPanel_new(IOPriority currPrio) {
IOPriority IOPriorityPanel_getIOPriority(Panel* this) { IOPriority IOPriorityPanel_getIOPriority(Panel* this) {
return (IOPriority) ( ((ListItem*) Panel_getSelected(this))->key ); return (IOPriority) ( ((ListItem*) Panel_getSelected(this))->key );
} }

View File

@ -514,4 +514,3 @@ long LinuxProcess_compare(const void* v1, const void* v2) {
bool Process_isThread(Process* this) { bool Process_isThread(Process* this) {
return (Process_isUserlandThread(this) || Process_isKernelThread(this)); return (Process_isUserlandThread(this) || Process_isKernelThread(this));
} }

View File

@ -822,11 +822,11 @@ static char* LinuxProcessList_updateTtyDevice(TtyDriver* ttyDrivers, unsigned in
struct stat sstat; struct stat sstat;
char* fullPath; char* fullPath;
for(;;) { for(;;) {
asprintf(&fullPath, "%s/%d", ttyDrivers[i].path, idx); xAsprintf(&fullPath, "%s/%d", ttyDrivers[i].path, idx);
int err = stat(fullPath, &sstat); int err = stat(fullPath, &sstat);
if (err == 0 && major(sstat.st_rdev) == maj && minor(sstat.st_rdev) == min) return fullPath; if (err == 0 && major(sstat.st_rdev) == maj && minor(sstat.st_rdev) == min) return fullPath;
free(fullPath); free(fullPath);
asprintf(&fullPath, "%s%d", ttyDrivers[i].path, idx); xAsprintf(&fullPath, "%s%d", ttyDrivers[i].path, idx);
err = stat(fullPath, &sstat); err = stat(fullPath, &sstat);
if (err == 0 && major(sstat.st_rdev) == maj && minor(sstat.st_rdev) == min) return fullPath; if (err == 0 && major(sstat.st_rdev) == maj && minor(sstat.st_rdev) == min) return fullPath;
free(fullPath); free(fullPath);
@ -837,7 +837,7 @@ static char* LinuxProcessList_updateTtyDevice(TtyDriver* ttyDrivers, unsigned in
if (err == 0 && tty_nr == sstat.st_rdev) return strdup(ttyDrivers[i].path); if (err == 0 && tty_nr == sstat.st_rdev) return strdup(ttyDrivers[i].path);
} }
char* out; char* out;
asprintf(&out, "/dev/%u:%u", maj, min); xAsprintf(&out, "/dev/%u:%u", maj, min);
return out; return out;
} }

View File

@ -19,4 +19,3 @@ void CRT_handleSIGSEGV(int sgn) {
fprintf(stderr, "\nPlease contact your platform package maintainer!\n\n"); fprintf(stderr, "\nPlease contact your platform package maintainer!\n\n");
abort(); abort();
} }

View File

@ -400,4 +400,3 @@ void ProcessList_goThroughEntries(ProcessList* this) {
OpenBSDProcessList_scanProcs(opl); OpenBSDProcessList_scanProcs(opl);
OpenBSDProcessList_scanCPUTime(opl); OpenBSDProcessList_scanCPUTime(opl);
} }

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python #!/usr/bin/env python3
import os, sys, string, io import os, sys, io
try: try:
from StringIO import StringIO from StringIO import StringIO
except ImportError: except ImportError:

View File

@ -5,4 +5,3 @@ void Battery_getData(double* level, ACPresence* isOnAC) {
*level = -1; *level = -1;
*isOnAC = AC_ERROR; *isOnAC = AC_ERROR;
} }

View File

@ -419,4 +419,3 @@ void ProcessList_goThroughEntries(ProcessList* this) {
this->kernelThreads = 1; this->kernelThreads = 1;
proc_walk(&SolarisProcessList_walkproc, this, PR_WALK_LWP); proc_walk(&SolarisProcessList_walkproc, this, PR_WALK_LWP);
} }

View File

@ -685,4 +685,3 @@ describe("htop test suite", function()
os.execute("make lcov && xdg-open lcov/index.html") os.execute("make lcov && xdg-open lcov/index.html")
end) end)
end) end)

View File

@ -5,4 +5,3 @@ void Battery_getData(double* level, ACPresence* isOnAC) {
*level = -1; *level = -1;
*isOnAC = AC_ERROR; *isOnAC = AC_ERROR;
} }

View File

@ -18,4 +18,3 @@ void CRT_handleSIGSEGV(int sgn) {
fprintf(stderr, "\nPlease contact your platform package maintainer!\n\n"); fprintf(stderr, "\nPlease contact your platform package maintainer!\n\n");
abort(); abort();
} }

View File

@ -30,4 +30,3 @@ void UnsupportedProcess_delete(Object* cast) {
// free platform-specific fields here // free platform-specific fields here
free(this); free(this);
} }

View File

@ -20,3 +20,5 @@ typedef struct ZfsArcStats_ {
unsigned long long int uncompressed; unsigned long long int uncompressed;
} ZfsArcStats; } ZfsArcStats;
}*/ }*/
static int make_iso_compilers_happy __attribute__((unused));

View File

@ -23,4 +23,5 @@ typedef struct ZfsArcStats_ {
unsigned long long int uncompressed; unsigned long long int uncompressed;
} ZfsArcStats; } ZfsArcStats;
#endif #endif