Mark several non-modified pointer variables const

This commit is contained in:
Christian Göttsche
2021-01-05 23:42:55 +01:00
committed by BenBE
parent 1b2d48bc9a
commit d72b0a682e
33 changed files with 97 additions and 100 deletions

View File

@ -80,9 +80,9 @@ inline void RichString_setAttrn(RichString* this, int attrs, int start, int char
}
}
int RichString_findChar(RichString* this, char c, int start) {
wchar_t wc = btowc(c);
cchar_t* ch = this->chptr + start;
int RichString_findChar(const RichString* this, char c, int start) {
const wchar_t wc = btowc(c);
const cchar_t* ch = this->chptr + start;
for (int i = start; i < this->chlen; i++) {
if (ch->chars[0] == wc)
return i;
@ -115,8 +115,8 @@ void RichString_setAttrn(RichString* this, int attrs, int start, int charcount)
}
}
int RichString_findChar(RichString* this, char c, int start) {
chtype* ch = this->chptr + start;
int RichString_findChar(const RichString* this, char c, int start) {
const chtype* ch = this->chptr + start;
for (int i = start; i < this->chlen; i++) {
if ((*ch & 0xff) == (chtype) c)
return i;