Skip to content

Commit 639c410

Browse files
committed
constness
1 parent ace1e40 commit 639c410

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

simplecpp.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,9 @@ class simplecpp::TokenList::Stream {
254254
if (bom == 0 && static_cast<char>(peek()) == '\n')
255255
(void)get();
256256
else if (isUtf16) {
257-
int c1 = get();
258-
int c2 = get();
259-
int ch16 = (bom == 0xfeff) ? (c1<<8 | c2) : (c2<<8 | c1);
257+
const int c1 = get();
258+
const int c2 = get();
259+
const int ch16 = (bom == 0xfeff) ? (c1<<8 | c2) : (c2<<8 | c1);
260260
if (ch16 != '\n') {
261261
unget();
262262
unget();
@@ -307,7 +307,7 @@ class simplecpp::TokenList::Stream {
307307

308308
// The UTF-16 BOM is 0xfffe or 0xfeff.
309309
if (ch1 >= 0xfe) {
310-
unsigned short bom = (static_cast<unsigned char>(get()) << 8);
310+
const unsigned short bom = (static_cast<unsigned char>(get()) << 8);
311311
if (peek() >= 0xfe)
312312
return bom | static_cast<unsigned char>(get());
313313
unget();

0 commit comments

Comments
 (0)