summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2020-10-15 22:35:44 +0200
committercgzones <cgzones@googlemail.com>2020-10-16 19:16:53 +0200
commitaf4f58d0136fedca4894194daf89ab242167185d (patch)
tree7225680471663f7a8e282ec45fd240481c591fe9
parent1d00893110bd7cc68b49c751d4fd734610eac959 (diff)
Misc conversion fixes
-rw-r--r--Action.c2
-rw-r--r--TraceScreen.c6
-rw-r--r--htop.c2
3 files changed, 5 insertions, 5 deletions
diff --git a/Action.c b/Action.c
index c4d71479..6d7782ca 100644
--- a/Action.c
+++ b/Action.c
@@ -107,7 +107,7 @@ bool Action_setUserOnly(const char* userName, uid_t* userId) {
*userId = user->pw_uid;
return true;
}
- *userId = -1;
+ *userId = (uid_t)-1;
return false;
}
diff --git a/TraceScreen.c b/TraceScreen.c
index 8e5f61e7..2956b569 100644
--- a/TraceScreen.c
+++ b/TraceScreen.c
@@ -109,13 +109,13 @@ void TraceScreen_updateTrace(InfoScreen* super) {
struct timeval tv;
tv.tv_sec = 0; tv.tv_usec = 500;
int ready = select(this->fd_strace+1, &fds, NULL, NULL, &tv);
- int nread = 0;
+ size_t nread = 0;
if (ready > 0 && FD_ISSET(this->fd_strace, &fds))
nread = fread(buffer, 1, sizeof(buffer) - 1, this->strace);
if (nread && this->tracing) {
- char* line = buffer;
+ const char* line = buffer;
buffer[nread] = '\0';
- for (int i = 0; i < nread; i++) {
+ for (size_t i = 0; i < nread; i++) {
if (buffer[i] == '\n') {
buffer[i] = '\0';
if (this->contLine) {
diff --git a/htop.c b/htop.c
index 44182ae1..8c813564 100644
--- a/htop.c
+++ b/htop.c
@@ -74,7 +74,7 @@ static CommandLineSettings parseArguments(int argc, char** argv) {
CommandLineSettings flags = {
.pidMatchList = NULL,
.commFilter = NULL,
- .userId = -1, // -1 is guaranteed to be an invalid uid_t (see setreuid(2))
+ .userId = (uid_t)-1, // -1 is guaranteed to be an invalid uid_t (see setreuid(2))
.sortKey = 0,
.delay = -1,
.useColors = true,

© 2014-2024 Faster IT GmbH | imprint | privacy policy