argv.push_back(&*it);
prev = *it;
}
- argv.push_back(0);
+ argv.push_back(nullptr);
// Debug output.
if (lyxerr.debugging(Debug::FILES)) {
template<>
int convert<int>(string const s)
{
- return strtol(s.c_str(), 0, 10);
+ return strtol(s.c_str(), nullptr, 10);
}
template<>
int convert<int>(docstring const s)
{
- return strtol(to_ascii(s).c_str(), 0, 10);
+ return strtol(to_ascii(s).c_str(), nullptr, 10);
}
template<>
unsigned int convert<unsigned int>(string const s)
{
- return strtoul(s.c_str(), 0, 10);
+ return strtoul(s.c_str(), nullptr, 10);
}
template<>
unsigned long convert<unsigned long>(string const s)
{
- return strtoul(s.c_str(), 0, 10);
+ return strtoul(s.c_str(), nullptr, 10);
}
template<>
double convert<double>(string const s)
{
- return strtod(s.c_str(), 0);
+ return strtod(s.c_str(), nullptr);
}
template<>
int convert<int>(char const * cptr)
{
- return strtol(cptr, 0, 10);
+ return strtol(cptr, nullptr, 10);
}
template<>
double convert<double>(char const * cptr)
{
- return strtod(cptr, 0);
+ return strtod(cptr, nullptr);
}
// As a workaround, we append a nul char in order to force
// a switch to ASCII, and then remove it from output after
// the conversion.
- intern_type * from_new = 0;
+ intern_type * from_new = nullptr;
intern_type const * from_old = from;
size_t extra = 0;
if (*(from_end - 1) >= 0x80 && encoding_ == "ISO-2022-JP") {
magic_t magic_cookie = magic_open(MAGIC_MIME_ENCODING);
if (magic_cookie) {
bool detected = true;
- if (magic_load(magic_cookie, NULL) != 0) {
+ if (magic_load(magic_cookie, nullptr) != 0) {
LYXERR(Debug::FILES, "isBinaryFile: "
"Could not load magic database - "
<< magic_error(magic_cookie));
gzstreambuf* gzstreambuf::open( const char* name, int open_mode) {
if ( is_open())
- return (gzstreambuf*)0;
+ return (gzstreambuf*)(nullptr);
mode = open_mode;
// no append nor read/write mode
if ((mode & ios::ate) || (mode & ios::app)
|| ((mode & ios::in) && (mode & ios::out)))
- return (gzstreambuf*)0;
+ return (gzstreambuf*)(nullptr);
char fmode[10];
char* fmodeptr = fmode;
if ( mode & ios::in)
*fmodeptr++ = 'b';
*fmodeptr = '\0';
file = gzopen( name, fmode);
- if (file == 0)
- return (gzstreambuf*)0;
+ if (file == nullptr)
+ return (gzstreambuf*)(nullptr);
opened = 1;
return this;
}
if ( gzclose( file) == Z_OK)
return this;
}
- return (gzstreambuf*)0;
+ return (gzstreambuf*)(nullptr);
}
int gzstreambuf::underflow() { // used for input buffer only
docstring bt;
for (size_t i = 1; i < size && messages != NULL; i++) {
const std::string orig(messages[i]);
- char* mangled = 0;
+ char* mangled = nullptr;
for (char *p = messages[i]; *p; ++p) {
if (*p == '(') {
*p = 0;
}
}
int status = 0;
- const char* demangled = abi::__cxa_demangle(mangled, 0, 0, &status);
+ const char* demangled =
+ abi::__cxa_demangle(mangled, nullptr, nullptr, &status);
const QByteArray line = QString("(%1) %2: %3\n").arg(i, 3).arg(messages[i])
.arg(demangled ? demangled : orig.c_str()).toLocal8Bit();
free((void*)demangled);
time_t current_time()
{
- return time(0);
+ return time(nullptr);
}