Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid 'getc' symbol #472

Merged
merged 1 commit into from
Jan 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/fileio.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class FileIO
long ftell() {
return ::ftell(file);
}
int getc() {
int get_c() {
return fgetc(file);
}
char * gets(char *buf, int n) {
Expand Down Expand Up @@ -94,7 +94,7 @@ class BlobReader
long ftell() const {
return seek_pos;
}
int getc() {
int get_c() {
if(seek_pos >= data_array_size)
return EOS;
return data[seek_pos++];
Expand Down Expand Up @@ -205,7 +205,7 @@ class BlobIO
int ftell() const {
return seek_pos;
}
int getc() {
int get_c() {
if(seek_pos >= bytes_used)
return EOS;
return data[seek_pos++];
Expand Down
6 changes: 3 additions & 3 deletions src/flif-dec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,7 @@ size_t read_big_endian_varint(IO& io) {
size_t result = 0;
int bytes_read = 0;
while (bytes_read++ < 10) {
int number = io.getc();
int number = io.get_c();
if (number < 0) break;
if (number < 128) return result+number;
number -= 128;
Expand All @@ -938,7 +938,7 @@ size_t read_big_endian_varint(IO& io) {

template <typename IO>
int read_chunk(IO& io, MetaData& metadata) {
metadata.name[0] = io.getc();
metadata.name[0] = io.get_c();
// printf("chunk: %s\n", metadata.name);
if (metadata.name[0] < 32) {
if (metadata.name[0] > 0) {
Expand All @@ -958,7 +958,7 @@ int read_chunk(IO& io, MetaData& metadata) {
// printf("chunk length: %lu\n", metadata.length);
metadata.contents.resize(metadata.length);
for(size_t i = 0; i < metadata.length; i++) {
metadata.contents[i] = io.getc();
metadata.contents[i] = io.get_c();
}
return 0; // read next chunk
}
Expand Down
2 changes: 1 addition & 1 deletion src/io.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ int get_verbosity();
template<class IO>
bool ioget_int_8bit (IO& io, int* result)
{
int c = io.getc();
int c = io.get_c();
if (c == io.EOS) {
e_printf ("Unexpected EOS");
return false;
Expand Down
2 changes: 1 addition & 1 deletion src/maniac/rac.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ template <typename Config, typename IO> class RacInput {
rac_t low;
private:
rac_t read_catch_eof() {
rac_t c = io.getc();
rac_t c = io.get_c();
// no reason to branch here to catch end-of-stream, just return garbage (0xFF I guess) if a premature EOS happens
//if(c == io.EOS) return 0;
return c;
Expand Down