diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2018-02-18 10:38:49 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2018-02-18 10:38:49 -0300 |
commit | 8c653212c0e6d15997e4217a514301f5682a41c4 (patch) | |
tree | 53c72812eebbb69c212183cb77db8051731f63c2 /Action.c | |
parent | b064d501ae68a20f519064662205905dbe9f9b85 (diff) |
Replace size_t with int/void* union
I was occasionally passing negative values to size_t.
Plus, this better reflects the intent of the variant argument.
Reported by Coverity:
https://scan8.coverity.com/reports.htm#v13253/p10402/fileInstanceId=22093891&defectInstanceId=7543346&mergedDefectId=174179&fileStart=251&fileEnd=500
Diffstat (limited to 'Action.c')
-rw-r--r-- | Action.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -115,7 +115,7 @@ static void Action_runSetup(Settings* settings, const Header* header, ProcessLis static bool changePriority(MainPanel* panel, int delta) { bool anyTagged; - bool ok = MainPanel_foreachProcess(panel, (MainPanel_ForeachProcessFn) Process_changePriorityBy, delta, &anyTagged); + bool ok = MainPanel_foreachProcess(panel, (MainPanel_ForeachProcessFn) Process_changePriorityBy, (Arg){ .i = delta }, &anyTagged); if (!ok) beep(); return anyTagged; @@ -285,7 +285,7 @@ static Htop_Reaction actionSetAffinity(State* st) { void* set = Action_pickFromVector(st, affinityPanel, 15); if (set) { Affinity* affinity = AffinityPanel_getAffinity(affinityPanel, st->pl); - bool ok = MainPanel_foreachProcess((MainPanel*)panel, (MainPanel_ForeachProcessFn) Affinity_set, (size_t) affinity, NULL); + bool ok = MainPanel_foreachProcess((MainPanel*)panel, (MainPanel_ForeachProcessFn) Affinity_set, (Arg){ .v = affinity }, NULL); if (!ok) beep(); Affinity_delete(affinity); } @@ -302,7 +302,7 @@ static Htop_Reaction actionKill(State* st) { Panel_setHeader(st->panel, "Sending..."); Panel_draw(st->panel, true); refresh(); - MainPanel_foreachProcess((MainPanel*)st->panel, (MainPanel_ForeachProcessFn) Process_sendSignal, (size_t) sgn->key, NULL); + MainPanel_foreachProcess((MainPanel*)st->panel, (MainPanel_ForeachProcessFn) Process_sendSignal, (Arg){ .i = sgn->key }, NULL); napms(500); } } |