From 518685818c52fcd5504405aed9d624eb5aafbd0e Mon Sep 17 00:00:00 2001 From: Explorer09 Date: Sat, 29 Jul 2023 16:20:14 +0800 Subject: Minor data type fixes in Process.c and PCPProcess.c In PCPProcess_writeField(), the "n" variable should be size_t type. The "n" parameters of Process_printPercentage() and PCPProcess_printDelay() should be size_t type as well. Signed-off-by: Kang-Che Sung --- pcp/PCPProcess.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pcp') diff --git a/pcp/PCPProcess.c b/pcp/PCPProcess.c index cefd0ac3..5e025a1c 100644 --- a/pcp/PCPProcess.c +++ b/pcp/PCPProcess.c @@ -103,7 +103,7 @@ void Process_delete(Object* cast) { free(this); } -static void PCPProcess_printDelay(float delay_percent, char* buffer, int n) { +static void PCPProcess_printDelay(float delay_percent, char* buffer, size_t n) { if (isnan(delay_percent)) { xSnprintf(buffer, n, " N/A "); } else { @@ -116,7 +116,7 @@ static void PCPProcess_writeField(const Process* this, RichString* str, ProcessF bool coloring = this->host->settings->highlightMegabytes; char buffer[256]; buffer[255] = '\0'; int attr = CRT_colors[DEFAULT_COLOR]; - int n = sizeof(buffer) - 1; + size_t n = sizeof(buffer) - 1; switch ((int)field) { case CMINFLT: Process_printCount(str, pp->cminflt, coloring); return; case CMAJFLT: Process_printCount(str, pp->cmajflt, coloring); return; -- cgit v1.2.3