mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-12 12:14:36 +03:00
Mark signal tables 'const'
Specifically, Platform_signals[] and Platform_numberOfSignals. Both are not supposed to be mutable. Marking them 'const' puts them into rodata sections in binary. And for Platform_numberOfSignals, this aids optimization (aids only Link Time Optimization for now). :) Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
This commit is contained in:
@ -47,7 +47,7 @@ ProcessField Platform_defaultFields[] = { PID, USER, PRIORITY, NICE, M_SIZE, M_R
|
||||
|
||||
int Platform_numberOfFields = LAST_PROCESSFIELD;
|
||||
|
||||
SignalItem Platform_signals[] = {
|
||||
const SignalItem Platform_signals[] = {
|
||||
{ .name = " 0 Cancel", .number = 0 },
|
||||
{ .name = " 1 SIGHUP", .number = 1 },
|
||||
{ .name = " 2 SIGINT", .number = 2 },
|
||||
@ -84,7 +84,7 @@ SignalItem Platform_signals[] = {
|
||||
{ .name = "31 SIGSYS", .number = 31 },
|
||||
};
|
||||
|
||||
unsigned int Platform_numberOfSignals = sizeof(Platform_signals)/sizeof(SignalItem);
|
||||
const unsigned int Platform_numberOfSignals = sizeof(Platform_signals)/sizeof(SignalItem);
|
||||
|
||||
static Htop_Reaction Platform_actionSetIOPriority(State* st) {
|
||||
Panel* panel = st->panel;
|
||||
|
Reference in New Issue
Block a user