Base: Clean up explicit uses of namespaces in places where they're not necessary.

This commit covers all of the common and base classes.
This commit is contained in:
Tim Wojtulewicz 2020-08-21 09:29:37 -07:00
parent 9f802b2a4d
commit fe0c22c789
240 changed files with 6823 additions and 6787 deletions

View file

@ -34,12 +34,12 @@ namespace zeek::detail {
int how_many_lines_in(const char* policy_filename)
{
if ( ! policy_filename )
zeek::reporter->InternalError("NULL value passed to how_many_lines_in\n");
reporter->InternalError("NULL value passed to how_many_lines_in\n");
FILE* throwaway = fopen(policy_filename, "r");
if ( ! throwaway )
{
zeek::detail::debug_msg("No such policy file: %s.\n", policy_filename);
debug_msg("No such policy file: %s.\n", policy_filename);
return -1;
}
@ -53,7 +53,7 @@ int how_many_lines_in(const char* policy_filename)
match = policy_files.find(policy_filename);
if ( match == policy_files.end() )
{
zeek::detail::debug_msg("Policy file %s was not loaded.\n", policy_filename);
debug_msg("Policy file %s was not loaded.\n", policy_filename);
return -1;
}
}
@ -71,14 +71,14 @@ bool LoadPolicyFileText(const char* policy_filename)
if ( ! f )
{
zeek::detail::debug_msg("No such policy file: %s.\n", policy_filename);
debug_msg("No such policy file: %s.\n", policy_filename);
return false;
}
PolicyFile* pf = new PolicyFile;
if ( policy_files.find(policy_filename) != policy_files.end() )
zeek::detail::debug_msg("Policy file %s already loaded\n", policy_filename);
debug_msg("Policy file %s already loaded\n", policy_filename);
policy_files.insert(PolicyFileMap::value_type(policy_filename, pf));
@ -86,8 +86,8 @@ bool LoadPolicyFileText(const char* policy_filename)
if ( fstat(fileno(f), &st) != 0 )
{
char buf[256];
zeek::util::zeek_strerror_r(errno, buf, sizeof(buf));
zeek::reporter->Error("fstat failed on %s: %s", policy_filename, buf);
util::zeek_strerror_r(errno, buf, sizeof(buf));
reporter->Error("fstat failed on %s: %s", policy_filename, buf);
fclose(f);
return false;
}
@ -99,7 +99,7 @@ bool LoadPolicyFileText(const char* policy_filename)
// (probably fine with UTF-8)
pf->filedata = new char[size+1];
if ( fread(pf->filedata, size, 1, f) != 1 )
zeek::reporter->InternalError("Failed to fread() file data");
reporter->InternalError("Failed to fread() file data");
pf->filedata[size] = 0;
fclose(f);
@ -131,7 +131,7 @@ bool PrintLines(const char* policy_filename, unsigned int start_line,
FILE* throwaway = fopen(policy_filename, "r");
if ( ! throwaway )
{
zeek::detail::debug_msg("No such policy file: %s.\n", policy_filename);
debug_msg("No such policy file: %s.\n", policy_filename);
return false;
}
@ -145,7 +145,7 @@ bool PrintLines(const char* policy_filename, unsigned int start_line,
match = policy_files.find(policy_filename);
if ( match == policy_files.end() )
{
zeek::detail::debug_msg("Policy file %s was not loaded.\n", policy_filename);
debug_msg("Policy file %s was not loaded.\n", policy_filename);
return false;
}
}
@ -157,7 +157,7 @@ bool PrintLines(const char* policy_filename, unsigned int start_line,
if ( start_line > pf->lines.size() )
{
zeek::detail::debug_msg("Line number %d out of range; %s has %d lines\n",
debug_msg("Line number %d out of range; %s has %d lines\n",
start_line, policy_filename, int(pf->lines.size()));
return false;
}
@ -168,10 +168,10 @@ bool PrintLines(const char* policy_filename, unsigned int start_line,
for ( unsigned int i = 0; i < how_many_lines; ++i )
{
if ( show_numbers )
zeek::detail::debug_msg("%d\t", i + start_line);
debug_msg("%d\t", i + start_line);
const char* line = pf->lines[start_line + i - 1];
zeek::detail::debug_msg("%s\n", line);
debug_msg("%s\n", line);
}
return true;