Skip to content

Commit

Permalink
Mark several non-modified pointer variables const
Browse files Browse the repository at this point in the history
  • Loading branch information
cgzones committed Jan 11, 2021
1 parent 960f52b commit 2b62126
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion AvailableMetersPanel.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ static void AvailableMetersPanel_delete(Object* object) {
}

static inline void AvailableMetersPanel_addMeter(Header* header, Panel* panel, const MeterClass* type, int param, int column) {
Meter* meter = Header_addMeterByClass(header, type, param, column);
const Meter* meter = Header_addMeterByClass(header, type, param, column);
Panel_add(panel, (Object*) Meter_toListItem(meter, false));
Panel_setSelected(panel, Panel_size(panel) - 1);
MetersPanel_setMoving((MetersPanel*)panel, true);
Expand Down
2 changes: 1 addition & 1 deletion MetersPanel.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ MetersPanel* MetersPanel_new(Settings* settings, const char* header, Vector* met
this->leftNeighbor = NULL;
Panel_setHeader(super, header);
for (int i = 0; i < Vector_size(meters); i++) {
Meter* meter = (Meter*) Vector_get(meters, i);
const Meter* meter = (const Meter*) Vector_get(meters, i);
Panel_add(super, (Object*) Meter_toListItem(meter, false));
}
return this;
Expand Down
2 changes: 1 addition & 1 deletion htop.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ static CommandLineSettings parseArguments(int argc, char** argv) {
assert(optarg); /* please clang analyzer, cause optarg can be NULL in the 'u' case */
char* argCopy = xStrdup(optarg);
char* saveptr;
char* pid = strtok_r(argCopy, ",", &saveptr);
const char* pid = strtok_r(argCopy, ",", &saveptr);

if(!flags.pidMatchList) {
flags.pidMatchList = Hashtable_new(8, false);
Expand Down
2 changes: 1 addition & 1 deletion linux/Platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ static void Platform_Battery_getSysData(double* percent, ACPresence* isOnAC) {
}

char* buf = buffer;
char* line = NULL;
const char* line;
bool full = false;
bool now = false;
int fullSize = 0;
Expand Down

0 comments on commit 2b62126

Please sign in to comment.