Skip to content

Use nullptr instead of zero #141

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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 csv.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class OwningStdIOByteSourceBase : public ByteSourceBase {
public:
explicit OwningStdIOByteSourceBase(FILE *file) : file(file) {
// Tell the std library that we want to do the buffering ourself.
std::setvbuf(file, 0, _IONBF, 0);
std::setvbuf(file, nullptr, _IONBF, 0);
}

int read(char *buffer, int size) { return std::fread(buffer, 1, size, file); }
Expand Down Expand Up @@ -306,7 +306,7 @@ class LineReader {
// We open the file in binary mode as it makes no difference under *nix
// and under Windows we handle \r\n newlines ourself.
FILE *file = std::fopen(file_name, "rb");
if (file == 0) {
if (file == nullptr) {
int x = errno; // store errno as soon as possible, doing it after
// constructor call can fail.
error::can_not_open_file err;
Expand Down Expand Up @@ -845,7 +845,7 @@ void parse_header_line(char *line, std::vector<int> &col_order,
}
found[i] = true;
col_order.push_back(i);
col_begin = 0;
col_begin = nullptr;
break;
}
if (col_begin) {
Expand Down