Settings: mark non-modified pointer parameters const

This commit is contained in:
Christian Göttsche 2021-03-12 16:48:41 +01:00
parent d37d66bb3a
commit c38819a675
2 changed files with 4 additions and 4 deletions

View File

@ -262,7 +262,7 @@ static void writeFields(FILE* fd, const ProcessField* fields, const char* name)
fprintf(fd, "\n");
}
static void writeMeters(Settings* this, FILE* fd, int column) {
static void writeMeters(const Settings* this, FILE* fd, int column) {
const char* sep = "";
for (int i = 0; i < this->columns[column].len; i++) {
fprintf(fd, "%s%s", sep, this->columns[column].names[i]);
@ -271,7 +271,7 @@ static void writeMeters(Settings* this, FILE* fd, int column) {
fprintf(fd, "\n");
}
static void writeMeterModes(Settings* this, FILE* fd, int column) {
static void writeMeterModes(const Settings* this, FILE* fd, int column) {
const char* sep = "";
for (int i = 0; i < this->columns[column].len; i++) {
fprintf(fd, "%s%d", sep, this->columns[column].modes[i]);
@ -280,7 +280,7 @@ static void writeMeterModes(Settings* this, FILE* fd, int column) {
fprintf(fd, "\n");
}
bool Settings_write(Settings* this) {
bool Settings_write(const Settings* this) {
FILE* fd = fopen(this->filename, "w");
if (fd == NULL)
return false;

View File

@ -87,7 +87,7 @@ static inline int Settings_getActiveDirection(const Settings* this) {
void Settings_delete(Settings* this);
bool Settings_write(Settings* this);
bool Settings_write(const Settings* this);
Settings* Settings_new(int initialCpuCount);