Skip to content

Commit

Permalink
Misc cleanup
Browse files Browse the repository at this point in the history
* declare read-only pointer parameter const
* drop duplicate include of <errno.h>
* use String_startsWith
  • Loading branch information
cgzones committed Feb 18, 2023
1 parent 37eddcf commit 7c68f01
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ScreenManager.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ static void checkRecalculation(ScreenManager* this, double* oldTime, int* sortTi
*rescan = false;
}

static inline bool drawTab(int* y, int* x, int l, const char* name, bool cur) {
static inline bool drawTab(const int* y, int* x, int l, const char* name, bool cur) {
attrset(CRT_colors[cur ? SCREENS_CUR_BORDER : SCREENS_OTH_BORDER]);
mvaddch(*y, *x, '[');
(*x)++;
Expand Down
3 changes: 1 addition & 2 deletions linux/Platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ in the source distribution for its full text.
#include "zfs/ZfsCompressedArcMeter.h"

#ifdef HAVE_LIBCAP
#include <errno.h>
#include <sys/capability.h>
#endif

Expand Down Expand Up @@ -476,7 +475,7 @@ FileLocks_ProcessData* Platform_getProcessLocks(pid_t pid) {
if (!strchr(buffer, '\n'))
continue;

if (strncmp(buffer, "lock:\t", strlen("lock:\t")))
if (!String_startsWith(buffer, "lock:\t"))
continue;

FileLocks_Data data = {.fd = file};
Expand Down

0 comments on commit 7c68f01

Please sign in to comment.