mirror of
https://github.com/zeek/zeek.git
synced 2025-10-12 19:48:20 +00:00
Merge remote-tracking branch 'origin/topic/timw/nullptr'
* origin/topic/timw/nullptr: The remaining nulls plugin/probabilistic/zeekygen: Replace nulls with nullptr file_analysis: Replace nulls with nullptr analyzer: Replace nulls with nullptr iosource/threading/input/logging: Replace nulls with nullptr
This commit is contained in:
commit
a3a38f0849
187 changed files with 1119 additions and 1117 deletions
|
@ -22,7 +22,7 @@ BasicThread::BasicThread()
|
|||
buf_len = STD_FMT_BUF_LEN;
|
||||
buf = (char*) safe_malloc(buf_len);
|
||||
|
||||
strerr_buffer = 0;
|
||||
strerr_buffer = nullptr;
|
||||
|
||||
name = copy_string(fmt("thread-%" PRIu64, ++thread_counter));
|
||||
|
||||
|
@ -191,5 +191,5 @@ void* BasicThread::launcher(void *arg)
|
|||
|
||||
thread->Done();
|
||||
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
|
|
@ -172,7 +172,7 @@ bool ReporterMessage::Process()
|
|||
return true;
|
||||
}
|
||||
|
||||
MsgThread::MsgThread() : BasicThread(), queue_in(this, 0), queue_out(0, this)
|
||||
MsgThread::MsgThread() : BasicThread(), queue_in(this, nullptr), queue_out(nullptr, this)
|
||||
{
|
||||
cnt_sent_in = cnt_sent_out = 0;
|
||||
main_finished = false;
|
||||
|
@ -367,7 +367,7 @@ BasicOutputMessage* MsgThread::RetrieveOut()
|
|||
{
|
||||
BasicOutputMessage* msg = queue_out.Get();
|
||||
if ( ! msg )
|
||||
return 0;
|
||||
return nullptr;
|
||||
|
||||
DBG_LOG(DBG_THREADING, "Retrieved '%s' from %s", msg->Name(), Name());
|
||||
|
||||
|
@ -379,7 +379,7 @@ BasicInputMessage* MsgThread::RetrieveIn()
|
|||
BasicInputMessage* msg = queue_in.Get();
|
||||
|
||||
if ( ! msg )
|
||||
return 0;
|
||||
return nullptr;
|
||||
|
||||
#ifdef DEBUG
|
||||
string s = Fmt("Retrieved '%s' in %s", msg->Name(), Name());
|
||||
|
|
|
@ -26,7 +26,7 @@ bool Field::Read(SerializationFormat* fmt)
|
|||
secondary_name = copy_string(tmp_secondary_name.c_str());
|
||||
}
|
||||
else
|
||||
secondary_name = 0;
|
||||
secondary_name = nullptr;
|
||||
|
||||
bool success = (fmt->Read(&tmp_name, "name")
|
||||
&& fmt->Read(&t, "type")
|
||||
|
|
|
@ -31,16 +31,16 @@ struct Field {
|
|||
* Constructor.
|
||||
*/
|
||||
Field(const char* name, const char* secondary_name, TypeTag type, TypeTag subtype, bool optional)
|
||||
: name(name ? copy_string(name) : 0),
|
||||
secondary_name(secondary_name ? copy_string(secondary_name) : 0),
|
||||
: name(name ? copy_string(name) : nullptr),
|
||||
secondary_name(secondary_name ? copy_string(secondary_name) : nullptr),
|
||||
type(type), subtype(subtype), optional(optional) { }
|
||||
|
||||
/**
|
||||
* Copy constructor.
|
||||
*/
|
||||
Field(const Field& other)
|
||||
: name(other.name ? copy_string(other.name) : 0),
|
||||
secondary_name(other.secondary_name ? copy_string(other.secondary_name) : 0),
|
||||
: name(other.name ? copy_string(other.name) : nullptr),
|
||||
secondary_name(other.secondary_name ? copy_string(other.secondary_name) : nullptr),
|
||||
type(other.type), subtype(other.subtype), optional(other.optional) { }
|
||||
|
||||
~Field()
|
||||
|
|
|
@ -214,7 +214,7 @@ threading::Value* Ascii::ParseValue(const string& s, const string& name, TypeTag
|
|||
|
||||
threading::Value* val = new threading::Value(type, subtype, true);
|
||||
const char* start = s.c_str();
|
||||
char* end = 0;
|
||||
char* end = nullptr;
|
||||
errno = 0;
|
||||
size_t pos;
|
||||
|
||||
|
@ -411,7 +411,7 @@ threading::Value* Ascii::ParseValue(const string& s, const string& name, TypeTag
|
|||
}
|
||||
|
||||
threading::Value* newval = ParseValue(element, name, subtype);
|
||||
if ( newval == 0 )
|
||||
if ( newval == nullptr )
|
||||
{
|
||||
GetThread()->Warning("Error while reading set or vector");
|
||||
error = true;
|
||||
|
@ -429,7 +429,7 @@ threading::Value* Ascii::ParseValue(const string& s, const string& name, TypeTag
|
|||
if ( ! error && (s.empty() || *s.rbegin() == separators.set_separator[0]) )
|
||||
{
|
||||
lvals[pos] = ParseValue("", name, subtype);
|
||||
if ( lvals[pos] == 0 )
|
||||
if ( lvals[pos] == nullptr )
|
||||
{
|
||||
GetThread()->Warning("Error while trying to add empty set element");
|
||||
goto parse_error;
|
||||
|
@ -470,7 +470,7 @@ threading::Value* Ascii::ParseValue(const string& s, const string& name, TypeTag
|
|||
|
||||
parse_error:
|
||||
delete val;
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool Ascii::CheckNumberError(const char* start, const char* end) const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue