};
Z::Z(int argc, char **argv):
- input_file(0)
+ input_file(nullptr)
{
string input_fn;
GetOpt getopt;
extern "C" void ANativeActivity_onCreate(ANativeActivity *activity, void * /*saved_state*/, size_t /*state_size*/)
{
- static Msp::Android::MainThread *thread = 0;
+ static Msp::Android::MainThread *thread = nullptr;
if(thread)
thread->attach_to_activity(activity);
else
JavaVM *MainThread::get_java_vm() const
{
if(!activity)
- return 0;
+ return nullptr;
return activity->vm;
}
/* I have no idea how dependable this is, but it seems to be the only way
to get the package name aside from making a Java call through JNI */
char *appname = strdup(int_data_path[-2].c_str());
- char *argv[] = { appname, 0 };
+ char *argv[] = { appname, nullptr };
Msp::Android::ErrorLogger err_logger;
FS::chdir(FS::dirname(int_data_path));
Msp::Application::run(1, argv, this, &app_created);
sigc::signal<void, AInputQueue *> signal_input_queue_destroyed;
private:
- ANativeActivity *activity = 0;
- AAssetManager *asset_manager = 0;
+ ANativeActivity *activity = nullptr;
+ AAssetManager *asset_manager = nullptr;
FS::Path int_data_path;
bool starting_up = true;
Mutex startup_mutex;
namespace Msp {
-Application *Application::_app = 0;
-Application::Starter *Application::_starter = 0;
-const char *Application::_argv0 = 0;
+Application *Application::_app = nullptr;
+Application::Starter *Application::_starter = nullptr;
+const char *Application::_argv0 = nullptr;
string Application::_name;
-void *Application::_data = 0;
+void *Application::_data = nullptr;
Application::Application(const string &n)
{
int result = _app->main();
Application *a = _app;
- _app = 0;
+ _app = nullptr;
delete a;
return result;
}
}
delete _app;
- _app = 0;
+ _app = nullptr;
return 124;
}
This function can only be called once. The global main() function provided
by the library normally does it automatically at program startup. */
- static int run(int, char **, void * = 0, void (*)(void *) = 0);
+ static int run(int, char **, void * = nullptr, void (*)(void *) = nullptr);
/** Sets application startup info, including argv[0] value and platform-
specific data.
std::string lng;
ArgType arg_type = NO_ARG;
unsigned seen_count = 0;
- unsigned *ext_seen_count = 0;
+ unsigned *ext_seen_count = nullptr;
std::string help;
std::string metavar = "ARG";
- Store *store = 0;
+ Store *store = nullptr;
public:
OptionImpl(char, const std::string &, const Store &, ArgType);
std::string name;
ArgType type = REQUIRED_ARG;
std::string help;
- Store *store = 0;
+ Store *store = nullptr;
public:
ArgumentImpl(const std::string &, const Store &, ArgType);
private:
struct Private;
- Private *priv = 0;
+ Private *priv = nullptr;
public:
Module(const std::string &);
private:
struct Private;
- Private *priv = 0;
+ Private *priv = nullptr;
public:
Mutex();
T &operator*() const { return *data; }
T *operator->() const { return data; }
- void clear() { mutex = 0; data = 0; }
+ void clear() { mutex = nullptr; data = nullptr; }
};
}
int main(int argc, char **argv)
{
- void *data = 0;
+ void *data = nullptr;
/* Applications launched from Finder get a special argument, which would
interfere with GetOpt. Remove it from argv but pass it as data so it can
argv[j++] = argv[i];
}
argc = j;
- argv[j] = 0;
+ argv[j] = nullptr;
return Msp::Application::run(argc, argv, data);
}
namespace Msp {
-Process *Process::_self = 0;
+Process *Process::_self = nullptr;
Process::Process(const Private &p):
priv(new Private(p))
private:
struct Private;
- Private *priv = 0;
+ Private *priv = nullptr;
FS::Path work_dir;
bool redirect = false;
- IO::Base *cin = 0;
- IO::Base *cout = 0;
- IO::Base *cerr = 0;
+ IO::Base *cin = nullptr;
+ IO::Base *cout = nullptr;
+ IO::Base *cerr = nullptr;
bool running = false;
bool finished = false;
unsigned exit_code = 0;
template<typename U> friend class WeakPtr;
private:
- T *data = 0;
- RefCounts *counts = 0;
+ T *data = nullptr;
+ RefCounts *counts = nullptr;
public:
RefPtr() = default;
- RefPtr(T *d): data(d), counts(data ? new RefCounts : 0) { incref(); }
+ RefPtr(T *d): data(d), counts(data ? new RefCounts : nullptr) { incref(); }
private:
- RefPtr(T *d, RefCounts *c): data(d), counts(d ? c : 0) { incref(); }
+ RefPtr(T *d, RefCounts *c): data(d), counts(d ? c : nullptr) { incref(); }
public:
/* Must have this or the compiler will generate a default copy-c'tor despite
RefPtr(const RefPtr<U> &p): data(p.data), counts(p.counts) { incref(); }
template<typename U>
- RefPtr(const WeakPtr<U> &p): data(p.get()), counts(data ? p.counts : 0) { incref(); }
+ RefPtr(const WeakPtr<U> &p): data(p.get()), counts(data ? p.counts : nullptr) { incref(); }
~RefPtr() { decref(); }
T *get() const { return data; }
T &operator*() const { return *data; }
T *operator->() const { return data; }
- explicit operator bool() const { return data!=0; }
+ explicit operator bool() const { return data; }
unsigned refcount() const { return (data ? counts->count : 0); }
template<typename U> friend class WeakPtr;
private:
- T *data = 0;
- RefCounts *counts = 0;
+ T *data = nullptr;
+ RefCounts *counts = nullptr;
public:
WeakPtr() = default;
private:
- WeakPtr(T *d, RefCounts *c): data(d), counts(d ? c : 0) { incref(); }
+ WeakPtr(T *d, RefCounts *c): data(d), counts(d ? c : nullptr) { incref(); }
public:
- WeakPtr(const WeakPtr &p): data(p.get()), counts(data ? p.counts : 0) { incref(); }
+ WeakPtr(const WeakPtr &p): data(p.get()), counts(data ? p.counts : nullptr) { incref(); }
template<typename U>
- WeakPtr(const WeakPtr<U> &p): data(p.get()), counts(data ? p.counts : 0) { incref(); }
+ WeakPtr(const WeakPtr<U> &p): data(p.get()), counts(data ? p.counts : nullptr) { incref(); }
template<typename U>
WeakPtr(const RefPtr<U> &p): data(p.data), counts(p.counts) { incref(); }
template<typename U>
WeakPtr &assign(const WeakPtr<U> &);
- T *get() const { return (counts && counts->count ? data : 0); }
+ T *get() const { return (counts && counts->count ? data : nullptr); }
void incref() { if(counts) ++counts->weak_count; }
void decref();
};
{
decref();
data = d;
- counts = (d ? new RefCounts : 0);
+ counts = (d ? new RefCounts : nullptr);
incref();
return *this;
}
T *RefPtr<T>::release()
{
T *d = data;
- data = 0;
+ data = nullptr;
decref();
- counts = 0;
+ counts = nullptr;
return d;
}
if(!counts->count)
{
delete data;
- data = 0;
+ data = nullptr;
}
else if(counts->count==RefCounts::KEEP)
- data = 0;
+ data = nullptr;
else
return;
if(!counts->weak_count)
{
delete counts;
- counts = 0;
+ counts = nullptr;
}
}
{
decref();
data = p.get();
- counts = (data ? p.counts : 0);
+ counts = (data ? p.counts : nullptr);
incref();
return *this;
}
if(!counts->weak_count && (!counts->count || counts->count==RefCounts::KEEP))
{
delete counts;
- data = 0;
- counts = 0;
+ data = nullptr;
+ counts = nullptr;
}
}
private:
struct Private;
- Private *priv = 0;
+ Private *priv = nullptr;
public:
Semaphore(unsigned);
thread->platform_setname();
thread->main();
thread->_state = FINISHED;
- return 0;
+ return nullptr;
}
} // namespace Msp
JOINED
};
- Private *_priv = 0;
+ Private *_priv = nullptr;
std::string _name;
State _state = PENDING;
int main(int argc, char **argv)
{
- return Msp::Application::run(argc, argv, 0);
+ return Msp::Application::run(argc, argv, nullptr);
}
Mutex::Mutex():
priv(new Private)
{
- pthread_mutex_init(&priv->mutex, 0);
+ pthread_mutex_init(&priv->mutex, nullptr);
}
Mutex::~Mutex()
argv[0] = command.c_str();
for(unsigned i=0; i<args.size(); ++i)
argv[i+1] = args[i].c_str();
- argv[args.size()+1] = 0;
+ argv[args.size()+1] = nullptr;
if(redirect)
{
Semaphore::Semaphore(unsigned limit):
priv(new Private)
{
- pthread_cond_init(&priv->cond, 0);
+ pthread_cond_init(&priv->cond, nullptr);
priv->limit = limit;
}
void Thread::platform_join()
{
- pthread_join(_priv->handle, 0);
+ pthread_join(_priv->handle, nullptr);
}
void Thread::platform_kill()
void Thread::platform_launch()
{
- pthread_create(&_priv->handle, 0, &Private::main_wrapper, this);
+ pthread_create(&_priv->handle, nullptr, &Private::main_wrapper, this);
}
void Thread::platform_setname()
{ return false; }
};
- StoreBase *store = 0;
+ StoreBase *store = nullptr;
public:
Variant() = default;
template<typename T>
Variant(const T &v): store(new Store<typename std::remove_cv<T>::type>(v)) { }
- Variant(const Variant &v): store(v.store ? v.store->clone() : 0) { }
+ Variant(const Variant &v): store(v.store ? v.store->clone() : nullptr) { }
~Variant() { delete store; }
template<typename T>
Variant &operator=(const Variant &v)
{
delete store;
- store = (v.store ? v.store->clone() : 0);
+ store = (v.store ? v.store->clone() : nullptr);
return *this;
}
template<typename T>
bool check_type() const
{
- return dynamic_cast<Store<typename std::remove_cv<T>::type> *>(store)!=0;
+ return dynamic_cast<Store<typename std::remove_cv<T>::type> *>(store);
}
bool check_same_type(const Variant &v) const
void Process::platform_get_self_info(Private &priv)
{
priv.info.hProcess = GetCurrentProcess();
- priv.info.hThread = 0;
+ priv.info.hThread = nullptr;
priv.info.dwProcessId = GetCurrentProcessId();
priv.info.dwThreadId = 0;
}
STARTUPINFO startup;
startup.cb = sizeof(STARTUPINFO);
- startup.lpReserved = 0;
- startup.lpDesktop = 0;
- startup.lpTitle = 0;
+ startup.lpReserved = nullptr;
+ startup.lpDesktop = nullptr;
+ startup.lpTitle = nullptr;
startup.dwFlags = 0;
startup.cbReserved2 = 0;
- startup.lpReserved2 = 0;
+ startup.lpReserved2 = nullptr;
if(redirect)
{
startup.dwFlags |= STARTF_USESTDHANDLES;
HANDLE cerr_handle = (cerr ? *cerr->get_handle(IO::M_WRITE) : GetStdHandle(STD_ERROR_HANDLE));
DuplicateHandle(self_handle, cerr_handle, self_handle, &startup.hStdError, 0, true, DUPLICATE_SAME_ACCESS);
}
- const char *cmdptr = (path_search ? 0 : command.c_str());
- const char *wd = (work_dir.empty() ? 0 : work_dir.c_str());
- if(!CreateProcess(cmdptr, const_cast<char *>(cmdline.c_str()), 0, 0, true, 0, 0, wd, &startup, &priv->info))
+ const char *cmdptr = (path_search ? nullptr : command.c_str());
+ const char *wd = (work_dir.empty() ? nullptr : work_dir.c_str());
+ if(!CreateProcess(cmdptr, const_cast<char *>(cmdline.c_str()), nullptr, nullptr, true, 0, nullptr, wd, &startup, &priv->info))
throw system_error("CreateProcess");
if(redirect)
Process::Private::Private()
{
- info.hProcess = 0;
- info.hThread = 0;
+ info.hProcess = nullptr;
+ info.hThread = nullptr;
info.dwProcessId = 0;
info.dwThreadId = 0;
}
c = GetLastError();
char msg[1024];
- if(FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, 0, c, 0, msg, sizeof(msg), 0))
+ if(FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, nullptr, c, 0, msg, sizeof(msg), nullptr))
return msg;
else
return lexical_cast<string>(c, Fmt().hex());
void Thread::platform_launch()
{
DWORD dummy; // Win9x needs the lpTthreadId parameter
- _priv->handle = CreateThread(0, 0, &Private::main_wrapper, this, 0, &dummy);
+ _priv->handle = CreateThread(nullptr, 0, &Private::main_wrapper, this, 0, &dummy);
}
void Thread::platform_setname()
public:
struct StackFrame
{
- void *address = 0;
+ void *address = nullptr;
std::string file;
std::string symbol;
};
{
#ifdef __GNUC__
int status;
- char *dm = abi::__cxa_demangle(sym.c_str(), 0, 0, &status);
+ char *dm = abi::__cxa_demangle(sym.c_str(), nullptr, nullptr, &status);
string result;
if(status==0)
namespace Msp {
namespace Debug {
-ErrorReporter *ErrorReporter::_current = 0;
+ErrorReporter *ErrorReporter::_current = nullptr;
ErrorReporter::ErrorReporter():
_prev(_current)
class ErrorReporter: private NonCopyable
{
private:
- ErrorReporter *_prev = 0;
+ ErrorReporter *_prev = nullptr;
static ErrorReporter *_current;
HookThrow::HookThrow()
{
- void *handle = dlopen(0, RTLD_LAZY);
+ void *handle = dlopen(nullptr, RTLD_LAZY);
orig_cxa_throw = reinterpret_cast<CxaThrowType *>(dlvsym(handle, "__cxa_throw", "CXXABI_1.3"));
dlclose(handle);
}
private:
unsigned period = 0;
std::map<std::string, ScopeInfo> scopes;
- ProfilingScope *inner = 0;
+ ProfilingScope *inner = nullptr;
public:
/** Sets the averaging period for timing data, measured in calls. Previous
private:
Profiler &profiler;
std::string name;
- ProfilingScope *parent = 0;
+ ProfilingScope *parent = nullptr;
Time::TimeStamp entry_time;
Time::TimeDelta time_spent;
Time::TimeDelta child_time;
void FileMonitor::use_event_dispatcher(IO::EventDispatcher &ed)
{
if(event_disp)
- throw logic_error("event_disp!=0");
+ throw logic_error("event_disp!=nullptr");
event_disp = &ed;
platform_use_event_dispatcher();
sigc::signal<void, const FS::Path &> signal_file_modified;
private:
- Private *priv = 0;
- IO::EventDispatcher *event_disp = 0;
+ Private *priv = nullptr;
+ IO::EventDispatcher *event_disp = nullptr;
std::vector<MonitoredFile> files;
public:
alloc_size(other.alloc_size),
mtime(other.mtime),
owner_info(other.owner_info),
- priv(other.priv ? new Private(*other.priv) : 0)
+ priv(other.priv ? new Private(*other.priv) : nullptr)
{ }
Stat &Stat::operator=(const Stat &other)
mtime = other.mtime;
owner_info = other.owner_info;
delete priv;
- priv = (other.priv ? new Private(*other.priv) : 0);
+ priv = (other.priv ? new Private(*other.priv) : nullptr);
return *this;
}
FileSize alloc_size = 0;
Time::TimeStamp mtime;
mutable OwnerInfo owner_info;
- Private *priv = 0;
+ Private *priv = nullptr;
public:
Stat() = default;
vector<string> result;
WIN32_FIND_DATA entry;
string pattern = path.str()+"\\*";
- HANDLE search_handle = FindFirstFileEx(pattern.c_str(), FindExInfoBasic, &entry, FindExSearchNameMatch, 0, 0);
+ HANDLE search_handle = FindFirstFileEx(pattern.c_str(), FindExInfoBasic, &entry, FindExSearchNameMatch, nullptr, 0);
if(search_handle==INVALID_HANDLE_VALUE)
{
DWORD err = GetLastError();
Path get_home_dir()
{
char home[MAX_PATH];
- if(SHGetFolderPath(0, CSIDL_PERSONAL, 0, 0, home)==S_OK)
+ if(SHGetFolderPath(nullptr, CSIDL_PERSONAL, nullptr, 0, home)==S_OK)
return home;
return ".";
}
throw logic_error("no application name");
char datadir[MAX_PATH];
- if(SHGetFolderPath(0, CSIDL_LOCAL_APPDATA, 0, 0, datadir)==S_OK)
+ if(SHGetFolderPath(nullptr, CSIDL_LOCAL_APPDATA, nullptr, 0, datadir)==S_OK)
return Path(datadir)/appname;
return ".";
}
PSID copy_sid(PSID sid)
{
if(!sid || !IsValidSid(sid))
- return 0;
+ return nullptr;
DWORD len = GetLengthSid(sid);
PSID copy = reinterpret_cast<PSID>(HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len));
if(!CopySid(len, copy, sid))
char domain[1024];
DWORD dlen = sizeof(domain);
SID_NAME_USE use;
- if(!LookupAccountSid(0, sid, name, &nlen, domain, &dlen, &use))
+ if(!LookupAccountSid(nullptr, sid, name, &nlen, domain, &dlen, &use))
throw Msp::system_error("LookupAccountSid");
return Msp::format("%s/%s", name, domain);
}
Stat Stat::stat(const Path &path)
{
HANDLE handle;
- handle = CreateFile(path.str().c_str(), READ_CONTROL, FILE_SHARE_READ, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL|FILE_FLAG_BACKUP_SEMANTICS, 0);
+ handle = CreateFile(path.str().c_str(), READ_CONTROL, FILE_SHARE_READ, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL|FILE_FLAG_BACKUP_SEMANTICS, nullptr);
if(handle==INVALID_HANDLE_VALUE)
{
DWORD err = GetLastError();
result.mtime = Time::TimeStamp(Time::filetime_to_rawtime(info.ftLastWriteTime));
PSECURITY_DESCRIPTOR sec_desc;
- PSID owner = 0;
- PSID group = 0;
+ PSID owner = nullptr;
+ PSID group = nullptr;
const SECURITY_INFORMATION sec_info = OWNER_SECURITY_INFORMATION|GROUP_SECURITY_INFORMATION;
- DWORD err = GetSecurityInfo(handle, SE_FILE_OBJECT, sec_info, &owner, &group, 0, 0, &sec_desc);
+ DWORD err = GetSecurityInfo(handle, SE_FILE_OBJECT, sec_info, &owner, &group, nullptr, nullptr, &sec_desc);
if(err)
{
CloseHandle(handle);
typedef PSID UserID;
typedef PSID GroupID;
-const UserID INVALID_UID = 0;
-const GroupID INVALID_GID = 0;
+const UserID INVALID_UID = nullptr;
+const GroupID INVALID_GID = nullptr;
} // namespace FS
} // namespace Msp
private:
struct Private;
- Private *priv = 0;
+ Private *priv = nullptr;
public:
Asset(const std::string &);
protected:
Mode mode = M_READ;
bool eof_flag = false;
- Mutex *mutex = 0;
+ Mutex *mutex = nullptr;
Base();
public:
private:
Base &below;
std::size_t buf_size = 0;
- char *buf = 0;
- char *begin = 0;
- char *end = 0;
+ char *buf = nullptr;
+ char *begin = nullptr;
+ char *end = nullptr;
Mode cur_op = M_NONE;
public:
struct Private;
Handle &handle;
- Private *priv = 0;
+ Private *priv = nullptr;
public:
EventReader(Handle &, unsigned);
struct Private;
private:
- Private *priv = 0;
+ Private *priv = nullptr;
public:
Handle();
class Memory: public Seekable
{
private:
- char *begin = 0;
- char *end = 0;
- char *pos = 0;
+ char *begin = nullptr;
+ char *end = nullptr;
+ char *pos = nullptr;
public:
Memory(char *d, std::size_t s, Mode m = M_RDWR): Memory(d, d+s, m) { }
public:
struct PolledObject
{
- EventObject *object = 0;
+ EventObject *object = nullptr;
PollEvent events = P_NONE;
PolledObject(EventObject *o, PollEvent e): object(o), events(e) { }
struct Private;
std::vector<PolledObject> objects;
- Private *priv = 0;
+ Private *priv = nullptr;
bool events_changed = false;
bool objs_changed = false;
std::vector<PolledObject> poll_result;
OVERLAPPED overlapped;
Handle event;
size_t buf_size = 0;
- char *buffer = 0;
+ char *buffer = nullptr;
size_t buf_avail = 0;
- char *buf_next = 0;
+ char *buf_next = nullptr;
bool pending = false;
bool eof = false;
};
priv(new Private)
{
memset(&priv->overlapped, 0, sizeof(OVERLAPPED));
- *priv->event = CreateEvent(0, true, false, 0);
+ *priv->event = CreateEvent(nullptr, true, false, nullptr);
priv->overlapped.hEvent = *priv->event;
priv->buf_size = size;
priv->buffer = new char[priv->buf_size];
SECURITY_ATTRIBUTES sec_attr;
sec_attr.nLength = sizeof(SECURITY_ATTRIBUTES);
- sec_attr.lpSecurityDescriptor = 0;
+ sec_attr.lpSecurityDescriptor = nullptr;
sec_attr.bInheritHandle = !!(mode&M_INHERIT);
- *handle = CreateFile(fn.c_str(), flags, share_flags, 0, create_flags, FILE_ATTRIBUTE_NORMAL, &sec_attr);
+ *handle = CreateFile(fn.c_str(), flags, share_flags, nullptr, create_flags, FILE_ATTRIBUTE_NORMAL, &sec_attr);
if(!handle)
{
int err = GetLastError();
throw invalid_argument("read");
DWORD ret;
- if(ReadFile(*handle, buf, size, &ret, 0)==0)
+ if(ReadFile(*handle, buf, size, &ret, nullptr)==0)
throw system_error("ReadFile");
return ret;
throw invalid_argument("write");
DWORD ret;
- if(WriteFile(*handle, buf, size, &ret, 0)==0)
+ if(WriteFile(*handle, buf, size, &ret, nullptr)==0)
throw system_error("WriteFile");
return ret;
void Pipe::platform_init()
{
string name = format("\\\\.\\pipe\\%u.%p", GetCurrentProcessId(), this);
- *read_handle = CreateNamedPipe(name.c_str(), PIPE_ACCESS_INBOUND|FILE_FLAG_OVERLAPPED, PIPE_TYPE_BYTE, 1, 1024, 1024, 0, 0);
+ *read_handle = CreateNamedPipe(name.c_str(), PIPE_ACCESS_INBOUND|FILE_FLAG_OVERLAPPED, PIPE_TYPE_BYTE, 1, 1024, 1024, 0, nullptr);
if(!read_handle)
throw system_error("CreateNamedPipe");
- *write_handle = CreateFile(name.c_str(), GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0);
+ *write_handle = CreateFile(name.c_str(), GENERIC_WRITE, 0, nullptr, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, nullptr);
if(!write_handle)
{
unsigned err = GetLastError();
{
string name = "\\\\.\\"+port;
- *handle = CreateFile(name.c_str(), GENERIC_READ|GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL|FILE_FLAG_OVERLAPPED, 0);
+ *handle = CreateFile(name.c_str(), GENERIC_READ|GENERIC_WRITE, 0, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL|FILE_FLAG_OVERLAPPED, nullptr);
if(!handle)
throw system_error(format("CreateFile(%s)", port));
mode = M_READ|M_WRITE;
ZlibCompressed::Private::Private()
{
#ifdef WITH_ZLIB
- stream.zalloc = 0;
- stream.zfree = 0;
- stream.opaque = 0;
+ stream.zalloc = nullptr;
+ stream.zfree = nullptr;
+ stream.opaque = nullptr;
#endif
}
Base &below;
std::size_t buffer_size = 1024;
- unsigned char *in_buffer = 0;
- unsigned char *out_buffer = 0;
+ unsigned char *in_buffer = nullptr;
+ unsigned char *out_buffer = nullptr;
bool stream_end = false;
- Private *priv = 0;
+ Private *priv = nullptr;
public:
/** Creates a zlib de/compression object. The underlying object must be
{
private:
Mode mode = ASCII;
- Codec::Decoder *dec = 0;
+ Codec::Decoder *dec = nullptr;
public:
Decoder(ErrorMode = DEFAULT);
if(timeout>=zero)
deadline = now()+timeout;
- Slot *next = 0;
+ Slot *next = nullptr;
{
MutexLock l(mutex);
while(1)
private:
struct SlotProxy
{
- Slot *slot = 0;
+ Slot *slot = nullptr;
SlotProxy(Slot *);
bool operator<(const SlotProxy &) const;
TimeStamp now()
{
timeval tv;
- gettimeofday(&tv, 0);
+ gettimeofday(&tv, nullptr);
return TimeStamp(timeval_to_rawtime(tv));
}
void sleep(const TimeDelta &d)
{
timespec ts = rawtime_to_timespec(d.raw());
- while(nanosleep(&ts, 0)==-1)
+ while(nanosleep(&ts, nullptr)==-1)
if(errno!=EINTR)
throw system_error("nanosleep");
}