Skip to content

Commit b812a85

Browse files
dmcppcheckclaude
andcommitted
Remove Stream::good(), it is no longer used
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 333a821 commit b812a85

1 file changed

Lines changed: 3 additions & 15 deletions

File tree

‎simplecpp.cpp‎

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,6 @@ class simplecpp::TokenList::Stream {
298298
virtual int get() = 0;
299299
virtual int peek() = 0;
300300
virtual void unget() = 0;
301-
virtual bool good() = 0;
302301

303302
/**
304303
* Read the next character. CR and CR LF are returned as LF.
@@ -454,9 +453,6 @@ namespace {
454453
void unget() override {
455454
istr.unget();
456455
}
457-
bool good() override {
458-
return istr.good();
459-
}
460456

461457
private:
462458
std::istream &istr;
@@ -474,26 +470,22 @@ namespace {
474470

475471
int get() override {
476472
if (pos >= size)
477-
return lastStatus = EOF;
473+
return EOF;
478474
return str[pos++];
479475
}
480476
int peek() override {
481477
if (pos >= size)
482-
return lastStatus = EOF;
478+
return EOF;
483479
return str[pos];
484480
}
485481
void unget() override {
486482
--pos;
487483
}
488-
bool good() override {
489-
return lastStatus != EOF;
490-
}
491484

492485
private:
493486
const unsigned char *str;
494487
const std::size_t size;
495488
std::size_t pos{};
496-
int lastStatus{};
497489
};
498490

499491
class FileStream : public simplecpp::TokenList::Stream {
@@ -521,7 +513,7 @@ namespace {
521513
}
522514

523515
int get() override {
524-
lastStatus = lastCh = fgetc(file);
516+
lastCh = fgetc(file);
525517
return lastCh;
526518
}
527519
int peek() override {
@@ -533,9 +525,6 @@ namespace {
533525
void unget() override {
534526
unget_internal(lastCh);
535527
}
536-
bool good() override {
537-
return lastStatus != EOF;
538-
}
539528

540529
private:
541530
void unget_internal(int ch) {
@@ -550,7 +539,6 @@ namespace {
550539

551540
FILE *file;
552541
int lastCh{};
553-
int lastStatus{};
554542
};
555543
}
556544

0 commit comments

Comments
 (0)