Remove bzero use and replace with memset (patch from Kirk Beitz).
llvm-svn: 124897
This commit is contained in:
parent
d2e2f56c36
commit
72b77ebc8a
|
@ -571,7 +571,7 @@ ConnectionFileDescriptor::SocketConnect (const char *host_and_port, Error *error
|
||||||
SetSocketOption (m_fd, SOL_SOCKET, SO_REUSEADDR, 1);
|
SetSocketOption (m_fd, SOL_SOCKET, SO_REUSEADDR, 1);
|
||||||
|
|
||||||
struct sockaddr_in sa;
|
struct sockaddr_in sa;
|
||||||
::bzero (&sa, sizeof (sa));
|
::memset (&sa, 0, sizeof (sa));
|
||||||
sa.sin_family = AF_INET;
|
sa.sin_family = AF_INET;
|
||||||
sa.sin_port = htons (port);
|
sa.sin_port = htons (port);
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,7 @@ EmulateInstruction::EmulateInstruction
|
||||||
m_write_reg_callback (write_reg_callback),
|
m_write_reg_callback (write_reg_callback),
|
||||||
m_inst_pc (LLDB_INVALID_ADDRESS)
|
m_inst_pc (LLDB_INVALID_ADDRESS)
|
||||||
{
|
{
|
||||||
::bzero (&m_inst, sizeof (m_inst));
|
::memset (&m_inst, 0, sizeof (m_inst));
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t
|
uint64_t
|
||||||
|
|
|
@ -356,7 +356,7 @@ Log::GetLogChannelCallbacks (const char *channel, Log::Callbacks &log_callbacks)
|
||||||
log_callbacks = pos->second;
|
log_callbacks = pos->second;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
::bzero (&log_callbacks, sizeof(log_callbacks));
|
::memset (&log_callbacks, 0, sizeof(log_callbacks));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ namespace lldb_private {
|
||||||
|
|
||||||
UUID::UUID()
|
UUID::UUID()
|
||||||
{
|
{
|
||||||
::bzero (m_uuid, sizeof(m_uuid));
|
::memset (m_uuid, 0, sizeof(m_uuid));
|
||||||
}
|
}
|
||||||
|
|
||||||
UUID::UUID(const UUID& rhs)
|
UUID::UUID(const UUID& rhs)
|
||||||
|
@ -35,7 +35,7 @@ UUID::UUID (const void *uuid_bytes, uint32_t num_uuid_bytes)
|
||||||
if (uuid_bytes && num_uuid_bytes >= 16)
|
if (uuid_bytes && num_uuid_bytes >= 16)
|
||||||
::memcpy (m_uuid, uuid_bytes, sizeof (m_uuid));
|
::memcpy (m_uuid, uuid_bytes, sizeof (m_uuid));
|
||||||
else
|
else
|
||||||
::bzero (m_uuid, sizeof(m_uuid));
|
::memset (m_uuid, 0, sizeof(m_uuid));
|
||||||
}
|
}
|
||||||
|
|
||||||
const UUID&
|
const UUID&
|
||||||
|
@ -53,7 +53,7 @@ UUID::~UUID()
|
||||||
void
|
void
|
||||||
UUID::Clear()
|
UUID::Clear()
|
||||||
{
|
{
|
||||||
::bzero (m_uuid, sizeof(m_uuid));
|
::memset (m_uuid, 0, sizeof(m_uuid));
|
||||||
}
|
}
|
||||||
|
|
||||||
const void *
|
const void *
|
||||||
|
@ -85,7 +85,7 @@ UUID::SetBytes (const void *uuid_bytes)
|
||||||
if (uuid_bytes)
|
if (uuid_bytes)
|
||||||
::memcpy (m_uuid, uuid_bytes, sizeof (m_uuid));
|
::memcpy (m_uuid, uuid_bytes, sizeof (m_uuid));
|
||||||
else
|
else
|
||||||
::bzero (m_uuid, sizeof(m_uuid));
|
::memset (m_uuid, 0, sizeof(m_uuid));
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t
|
size_t
|
||||||
|
|
|
@ -137,7 +137,7 @@ Host::LaunchApplication (const FileSpec &app_file_spec)
|
||||||
app_file_spec.GetPath(app_path, sizeof(app_path));
|
app_file_spec.GetPath(app_path, sizeof(app_path));
|
||||||
|
|
||||||
LSApplicationParameters app_params;
|
LSApplicationParameters app_params;
|
||||||
::bzero (&app_params, sizeof (app_params));
|
::memset (&app_params, 0, sizeof (app_params));
|
||||||
app_params.flags = kLSLaunchDefaults |
|
app_params.flags = kLSLaunchDefaults |
|
||||||
kLSLaunchDontAddToRecents |
|
kLSLaunchDontAddToRecents |
|
||||||
kLSLaunchNewInstance;
|
kLSLaunchNewInstance;
|
||||||
|
@ -176,7 +176,7 @@ AcceptPIDFromInferior (void *arg)
|
||||||
if (file_conn.Connect (connect_url, &error) == eConnectionStatusSuccess)
|
if (file_conn.Connect (connect_url, &error) == eConnectionStatusSuccess)
|
||||||
{
|
{
|
||||||
char pid_str[256];
|
char pid_str[256];
|
||||||
::bzero (pid_str, sizeof(pid_str));
|
::memset (pid_str, 0, sizeof(pid_str));
|
||||||
ConnectionStatus status;
|
ConnectionStatus status;
|
||||||
const size_t pid_str_len = file_conn.Read (pid_str, sizeof(pid_str), status, NULL);
|
const size_t pid_str_len = file_conn.Read (pid_str, sizeof(pid_str), status, NULL);
|
||||||
if (pid_str_len > 0)
|
if (pid_str_len > 0)
|
||||||
|
@ -316,7 +316,7 @@ LaunchInNewTerminalWithCommandFile
|
||||||
}
|
}
|
||||||
|
|
||||||
LSApplicationParameters app_params;
|
LSApplicationParameters app_params;
|
||||||
::bzero (&app_params, sizeof (app_params));
|
::memset (&app_params, 0, sizeof (app_params));
|
||||||
app_params.flags = kLSLaunchDontAddToRecents | kLSLaunchAsync;
|
app_params.flags = kLSLaunchDontAddToRecents | kLSLaunchAsync;
|
||||||
app_params.argv = NULL;
|
app_params.argv = NULL;
|
||||||
app_params.environment = (CFDictionaryRef)cf_env_dict.get();
|
app_params.environment = (CFDictionaryRef)cf_env_dict.get();
|
||||||
|
@ -638,7 +638,7 @@ Host::OpenFileInExternalEditor (const FileSpec &file_spec, uint32_t line_no)
|
||||||
static FSRef g_app_fsref;
|
static FSRef g_app_fsref;
|
||||||
|
|
||||||
LSApplicationParameters app_params;
|
LSApplicationParameters app_params;
|
||||||
::bzero (&app_params, sizeof (app_params));
|
::memset (&app_params, 0, sizeof (app_params));
|
||||||
app_params.flags = kLSLaunchDefaults |
|
app_params.flags = kLSLaunchDefaults |
|
||||||
kLSLaunchDontAddToRecents |
|
kLSLaunchDontAddToRecents |
|
||||||
kLSLaunchDontSwitch;
|
kLSLaunchDontSwitch;
|
||||||
|
@ -691,7 +691,7 @@ Host::OpenFileInExternalEditor (const FileSpec &file_spec, uint32_t line_no)
|
||||||
}
|
}
|
||||||
|
|
||||||
ProcessInfoRec which_process;
|
ProcessInfoRec which_process;
|
||||||
bzero(&which_process, sizeof(which_process));
|
::memset(&which_process, 0, sizeof(which_process));
|
||||||
unsigned char ap_name[PATH_MAX];
|
unsigned char ap_name[PATH_MAX];
|
||||||
which_process.processName = ap_name;
|
which_process.processName = ap_name;
|
||||||
error = ::GetProcessInformation (&psn, &which_process);
|
error = ::GetProcessInformation (&psn, &which_process);
|
||||||
|
|
|
@ -230,7 +230,7 @@ protected:
|
||||||
slide = 0;
|
slide = 0;
|
||||||
mod_date = 0;
|
mod_date = 0;
|
||||||
file_spec.Clear();
|
file_spec.Clear();
|
||||||
::bzero (&header, sizeof(header));
|
::memset (&header, 0, sizeof(header));
|
||||||
}
|
}
|
||||||
uuid.Clear();
|
uuid.Clear();
|
||||||
segments.clear();
|
segments.clear();
|
||||||
|
|
|
@ -107,8 +107,8 @@ ObjectFileMachO::ObjectFileMachO(Module* module, DataBufferSP& dataSP, const Fil
|
||||||
m_sections_ap(),
|
m_sections_ap(),
|
||||||
m_symtab_ap()
|
m_symtab_ap()
|
||||||
{
|
{
|
||||||
::bzero (&m_header, sizeof(m_header));
|
::memset (&m_header, 0, sizeof(m_header));
|
||||||
::bzero (&m_dysymtab, sizeof(m_dysymtab));
|
::memset (&m_dysymtab, 0, sizeof(m_dysymtab));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -280,7 +280,7 @@ ObjectFileMachO::ParseSections ()
|
||||||
}
|
}
|
||||||
|
|
||||||
struct section_64 sect64;
|
struct section_64 sect64;
|
||||||
::bzero (§64, sizeof(sect64));
|
::memset (§64, 0, sizeof(sect64));
|
||||||
// Push a section into our mach sections for the section at
|
// Push a section into our mach sections for the section at
|
||||||
// index zero (NListSectionNoSection) if we don't have any
|
// index zero (NListSectionNoSection) if we don't have any
|
||||||
// mach sections yet...
|
// mach sections yet...
|
||||||
|
|
|
@ -455,10 +455,10 @@ MachException::Data::PutToLog(Log *log) const
|
||||||
MachException::PortInfo::PortInfo() :
|
MachException::PortInfo::PortInfo() :
|
||||||
count(0)
|
count(0)
|
||||||
{
|
{
|
||||||
::bzero (masks, sizeof(masks));
|
::memset (masks, 0, sizeof(masks));
|
||||||
::bzero (ports, sizeof(ports));
|
::memset (ports, 0, sizeof(ports));
|
||||||
::bzero (behaviors, sizeof(behaviors));
|
::memset (behaviors, 0, sizeof(behaviors));
|
||||||
::bzero (flavors, sizeof(flavors));
|
::memset (flavors, 0, sizeof(flavors));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -45,9 +45,9 @@ ThreadMacOSX::ThreadMacOSX (ProcessMacOSX &process, lldb::tid_t tid) :
|
||||||
m_context.reset(create_arch_callback(process.GetArchSpec(), *this));
|
m_context.reset(create_arch_callback(process.GetArchSpec(), *this));
|
||||||
assert(m_context.get() != NULL);
|
assert(m_context.get() != NULL);
|
||||||
m_context->InitializeInstance();
|
m_context->InitializeInstance();
|
||||||
::bzero (&m_basic_info, sizeof (m_basic_info));
|
::memset (&m_basic_info, 0, sizeof (m_basic_info));
|
||||||
::bzero (&m_ident_info, sizeof (m_ident_info));
|
::memset (&m_ident_info, 0, sizeof (m_ident_info));
|
||||||
::bzero (&m_proc_threadinfo, sizeof (m_proc_threadinfo));
|
::memset (&m_proc_threadinfo, 0, sizeof (m_proc_threadinfo));
|
||||||
ProcessMacOSXLog::LogIf(PD_LOG_THREAD | PD_LOG_VERBOSE, "ThreadMacOSX::ThreadMacOSX ( pid = %i, tid = 0x%4.4x, )", m_process.GetID(), GetID());
|
ProcessMacOSXLog::LogIf(PD_LOG_THREAD | PD_LOG_VERBOSE, "ThreadMacOSX::ThreadMacOSX ( pid = %i, tid = 0x%4.4x, )", m_process.GetID(), GetID());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -192,7 +192,7 @@ ThreadPlanAssemblyTracer::Log ()
|
||||||
|
|
||||||
if (m_disassembler)
|
if (m_disassembler)
|
||||||
{
|
{
|
||||||
bzero(m_buffer_sp->GetBytes(), m_buffer_sp->GetByteSize());
|
::memset(m_buffer_sp->GetBytes(), 0, m_buffer_sp->GetByteSize());
|
||||||
|
|
||||||
Error err;
|
Error err;
|
||||||
m_process.ReadMemory(pc, m_buffer_sp->GetBytes(), m_buffer_sp->GetByteSize(), err);
|
m_process.ReadMemory(pc, m_buffer_sp->GetBytes(), m_buffer_sp->GetByteSize(), err);
|
||||||
|
|
Loading…
Reference in New Issue