build: Fix -Wcast-align warning from clang

This commit is contained in:
Gaël Bonithon
2024-01-24 15:04:37 +01:00
parent 9bf1713e82
commit 8f471a735d
4 changed files with 4 additions and 4 deletions

View File

@@ -148,7 +148,7 @@ get_task_details (struct kinfo_proc *kp, Task *task)
task->vsz = kp->ki_size;
task->rss = ((guint64)kp->ki_rssize * (guint64)getpagesize ());
task->uid = kp->ki_uid;
task->prio = (gshort)kp->ki_nice;
task->prio = kp->ki_nice;
g_strlcpy (task->name, kp->ki_comm, sizeof(task->name));
oid[0] = CTL_KERN;

View File

@@ -268,7 +268,7 @@ get_task_details (GPid pid, Task *task)
&idummy, // cutime " waited for children in user mode
&idummy, // cstime " system mode
&idummy, // priority (nice value + fifteen)
(gint*)&task->prio, // nice range from 19 to -19
&task->prio, // nice range from 19 to -19
&idummy, // hardcoded 0
&idummy, // itrealvalue time in jiffies to next SIGALRM send to this process

View File

@@ -197,7 +197,7 @@ get_task_details (GPid pid, Task *task)
snprintf (task->state, sizeof(task->state), "%c", process.pr_lwp.pr_sname);
task->vsz = (guint64)process.pr_size * 1024;
task->rss = (guint64)process.pr_rssize * 1024;
task->prio = (gushort)process.pr_lwp.pr_pri;
task->prio = process.pr_lwp.pr_pri;
task->uid = (guint)process.pr_uid;
get_cpu_percent (task->pid, (process.pr_time.tv_sec * 1000 + process.pr_time.tv_nsec / 100000), &task->cpu_user, 0, &task->cpu_system);

View File

@@ -42,7 +42,7 @@ struct _Task
gfloat cpu_system;
guint64 vsz;
guint64 rss;
gshort prio;
gint prio;
};
/**