clang-format compatible indent

This commit is contained in:
Michael Tautschnig 2018-11-07 08:19:15 +00:00
parent e139480f8f
commit 359b3b154e
7 changed files with 66 additions and 68 deletions

View File

@ -1198,7 +1198,7 @@ bool java_bytecode_languaget::to_expr(
exprt &expr,
const namespacet &ns)
{
#if 0
#if 0
expr.make_nil();
// no preprocessing yet...
@ -1234,13 +1234,13 @@ bool java_bytecode_languaget::to_expr(
java_bytecode_parser.clear();
return result;
#else
#else
// unused parameters
(void)code;
(void)module;
(void)expr;
(void)ns;
#endif
#endif
return true; // fail for now
}

View File

@ -90,7 +90,7 @@ bool java_bytecode_typecheck(
message_handlert &message_handler,
const namespacet &ns)
{
#if 0
#if 0
symbol_tablet symbol_table;
java_bytecode_parse_treet java_bytecode_parse_tree;
@ -119,12 +119,12 @@ bool java_bytecode_typecheck(
}
return java_bytecode_typecheck.get_error_found();
#else
#else
// unused parameters
(void)expr;
(void)message_handler;
(void)ns;
#endif
#endif
// fail for now
return true;

View File

@ -329,7 +329,7 @@ void local_may_aliast::build(const goto_functiont &goto_function)
loc_infos.resize(cfg.nodes.size());
(void)goto_function; // unused parameter
#if 0
#if 0
// feed in sufficiently bad defaults
for(code_typet::parameterst::const_iterator
it=goto_function.type.parameters().begin();
@ -341,9 +341,9 @@ void local_may_aliast::build(const goto_functiont &goto_function)
loc_infos[0].points_to[objects.number(identifier)].objects.insert(
unknown_object);
}
#endif
#endif
#if 0
#if 0
for(localst::locals_mapt::const_iterator
l_it=locals.locals_map.begin();
l_it!=locals.locals_map.end();
@ -353,7 +353,7 @@ void local_may_aliast::build(const goto_functiont &goto_function)
loc_infos[0].aliases.make_union(
objects.number(l_it->second), unknown_object);
}
#endif
#endif
while(!work_queue.empty())
{

View File

@ -750,13 +750,13 @@ bool goto_analyzer_parse_optionst::process_goto_program(
remove_vector(goto_model);
remove_complex(goto_model);
#if 0
#if 0
// add generic checks
status() << "Generic Property Instrumentation" << eom;
goto_check(options, goto_model);
#else
#else
(void)options; // unused parameter
#endif
#endif
// recalculate numbers, etc.
goto_model.goto_functions.update();

View File

@ -243,9 +243,8 @@ void shared_bufferst::flush_read(
const source_locationt &source_location,
const irep_idt &write_object)
{
/* option 1 */
#if 0
// option 1
const varst &vars=(*this)(write_object);
const symbol_exprt fresh_var_expr=symbol_exprt(vars.read_new_var, vars.type);
@ -267,6 +266,7 @@ void shared_bufferst::flush_read(
assignment(goto_program, target, source_location, vars.read_delayed,
false_exprt());
#else
// option 2: do nothing
// unused parameters
(void)goto_program;
(void)target;
@ -274,9 +274,6 @@ void shared_bufferst::flush_read(
(void)source_location;
(void)write_object;
#endif
/* option 2 */
/* do nothing */
}
/// instruments write

View File

@ -33,7 +33,7 @@ Author: Daniel Kroening, kroening@kroening.com
void memory_info(std::ostream &out)
{
#if defined(__linux__) && defined(__GLIBC__)
#if defined(__linux__) && defined(__GLIBC__)
// NOLINTNEXTLINE(readability/identifiers)
struct mallinfo m = mallinfo();
out << " non-mmapped space allocated from system: " << m.arena << "\n";
@ -45,21 +45,21 @@ void memory_info(std::ostream &out)
out << " space available in freed fastbin blocks: " << m.fsmblks << "\n";
out << " total allocated space: " << m.uordblks << "\n";
out << " total free space: " << m.fordblks << "\n";
#endif
#endif
#ifdef _WIN32
#ifdef _WIN32
(void)out; // unused parameter
#if 0
#if 0
PROCESS_MEMORY_COUNTERS pmc;
if(GetProcessMemoryInfo(GetCurrentProcess(), &pmc, sizeof(pmc)))
{
out << " PeakWorkingSetSize: " << pmc.PeakWorkingSetSize << "\n";
out << " WorkingSetSize: " << pmc.WorkingSetSize << "\n";
}
#endif
#endif
#endif
#endif
#ifdef __APPLE__
#ifdef __APPLE__
// NOLINTNEXTLINE(readability/identifiers)
struct task_basic_info t_info;
mach_msg_type_number_t t_info_count = TASK_BASIC_INFO_COUNT;
@ -74,5 +74,5 @@ void memory_info(std::ostream &out)
<< static_cast<double>(t.max_size_in_use)/1000000 << "m\n";
out << " size_allocated: "
<< static_cast<double>(t.size_allocated)/1000000 << "m\n";
#endif
#endif
}

View File

@ -39,54 +39,55 @@ std::string get_temporary_directory(const std::string &name_template)
{
std::string result;
#ifdef _WIN32
(void)name_template; // unused parameter
DWORD dwBufSize = MAX_PATH+1;
char lpPathBuffer[MAX_PATH+1];
DWORD dwRetVal = GetTempPathA(dwBufSize, lpPathBuffer);
#ifdef _WIN32
(void)name_template; // unused parameter
DWORD dwBufSize = MAX_PATH + 1;
char lpPathBuffer[MAX_PATH + 1];
DWORD dwRetVal = GetTempPathA(dwBufSize, lpPathBuffer);
if(dwRetVal > dwBufSize || (dwRetVal == 0))
{
throw system_exceptiont("Couldn't get temporary path");
}
if(dwRetVal > dwBufSize || (dwRetVal == 0))
{
throw system_exceptiont("Couldn't get temporary path");
}
// GetTempFileNameA produces <path>\<pre><uuuu>.TMP
// where <pre> = "TLO"
// Thus, we must make the buffer 1+3+4+1+3=12 characters longer.
// GetTempFileNameA produces <path>\<pre><uuuu>.TMP
// where <pre> = "TLO"
// Thus, we must make the buffer 1+3+4+1+3=12 characters longer.
char t[MAX_PATH];
UINT uRetVal=GetTempFileNameA(lpPathBuffer, "TLO", 0, t);
if(uRetVal == 0)
{
throw system_exceptiont(
std::string("Couldn't get new temporary file name in directory") +
lpPathBuffer);
}
char t[MAX_PATH];
UINT uRetVal = GetTempFileNameA(lpPathBuffer, "TLO", 0, t);
if(uRetVal == 0)
{
throw system_exceptiont(
std::string("Couldn't get new temporary file name in directory") +
lpPathBuffer);
}
unlink(t);
if(_mkdir(t) != 0)
{
throw system_exceptiont(
std::string("Couldn't create temporary directory at ") + t);
}
result=std::string(t);
unlink(t);
if(_mkdir(t) != 0)
{
throw system_exceptiont(
std::string("Couldn't create temporary directory at ") + t);
}
result = std::string(t);
#else
std::string prefixed_name_template="/tmp/";
const char *TMPDIR_env=getenv("TMPDIR");
if(TMPDIR_env!=nullptr)
prefixed_name_template=TMPDIR_env;
if(*prefixed_name_template.rbegin()!='/')
prefixed_name_template+='/';
prefixed_name_template+=name_template;
#else
std::string prefixed_name_template = "/tmp/";
const char *TMPDIR_env = getenv("TMPDIR");
if(TMPDIR_env != nullptr)
prefixed_name_template = TMPDIR_env;
if(*prefixed_name_template.rbegin() != '/')
prefixed_name_template += '/';
prefixed_name_template += name_template;
std::vector<char> t(prefixed_name_template.begin(), prefixed_name_template.end());
t.push_back('\0'); // add the zero
const char *td = mkdtemp(t.data());
if(!td)
throw system_exceptiont("Failed to create temporary directory");
result=std::string(td);
#endif
std::vector<char> t(
prefixed_name_template.begin(), prefixed_name_template.end());
t.push_back('\0'); // add the zero
const char *td = mkdtemp(t.data());
if(!td)
throw system_exceptiont("Failed to create temporary directory");
result = std::string(td);
#endif
return result;
}