Skip to content

Commit ffb6f49

Browse files
committed
clang-format compatible indent
1 parent 8c0bc62 commit ffb6f49

File tree

7 files changed

+72
-74
lines changed

7 files changed

+72
-74
lines changed

jbmc/src/java_bytecode/java_bytecode_language.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -1198,7 +1198,7 @@ bool java_bytecode_languaget::to_expr(
11981198
exprt &expr,
11991199
const namespacet &ns)
12001200
{
1201-
#if 0
1201+
#if 0
12021202
expr.make_nil();
12031203

12041204
// no preprocessing yet...
@@ -1234,13 +1234,13 @@ bool java_bytecode_languaget::to_expr(
12341234
java_bytecode_parser.clear();
12351235

12361236
return result;
1237-
#else
1237+
#else
12381238
// unused parameters
12391239
(void)code;
12401240
(void)module;
12411241
(void)expr;
12421242
(void)ns;
1243-
#endif
1243+
#endif
12441244

12451245
return true; // fail for now
12461246
}

jbmc/src/java_bytecode/java_bytecode_typecheck.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ bool java_bytecode_typecheck(
9090
message_handlert &message_handler,
9191
const namespacet &ns)
9292
{
93-
#if 0
93+
#if 0
9494
symbol_tablet symbol_table;
9595
java_bytecode_parse_treet java_bytecode_parse_tree;
9696

@@ -119,12 +119,12 @@ bool java_bytecode_typecheck(
119119
}
120120

121121
return java_bytecode_typecheck.get_error_found();
122-
#else
122+
#else
123123
// unused parameters
124124
(void)expr;
125125
(void)message_handler;
126126
(void)ns;
127-
#endif
127+
#endif
128128

129129
// fail for now
130130
return true;

src/analyses/local_may_alias.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ void local_may_aliast::build(const goto_functiont &goto_function)
329329
loc_infos.resize(cfg.nodes.size());
330330

331331
(void)goto_function; // unused parameter
332-
#if 0
332+
#if 0
333333
// feed in sufficiently bad defaults
334334
for(code_typet::parameterst::const_iterator
335335
it=goto_function.type.parameters().begin();
@@ -341,9 +341,9 @@ void local_may_aliast::build(const goto_functiont &goto_function)
341341
loc_infos[0].points_to[objects.number(identifier)].objects.insert(
342342
unknown_object);
343343
}
344-
#endif
344+
#endif
345345

346-
#if 0
346+
#if 0
347347
for(localst::locals_mapt::const_iterator
348348
l_it=locals.locals_map.begin();
349349
l_it!=locals.locals_map.end();
@@ -353,7 +353,7 @@ void local_may_aliast::build(const goto_functiont &goto_function)
353353
loc_infos[0].aliases.make_union(
354354
objects.number(l_it->second), unknown_object);
355355
}
356-
#endif
356+
#endif
357357

358358
while(!work_queue.empty())
359359
{

src/goto-analyzer/goto_analyzer_parse_options.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -745,13 +745,13 @@ bool goto_analyzer_parse_optionst::process_goto_program(
745745
remove_vector(goto_model);
746746
remove_complex(goto_model);
747747

748-
#if 0
748+
#if 0
749749
// add generic checks
750750
status() << "Generic Property Instrumentation" << eom;
751751
goto_check(options, goto_model);
752-
#else
752+
#else
753753
(void)options; // unused parameter
754-
#endif
754+
#endif
755755

756756
// recalculate numbers, etc.
757757
goto_model.goto_functions.update();

src/goto-instrument/wmm/shared_buffers.cpp

+2-5
Original file line numberDiff line numberDiff line change
@@ -243,9 +243,8 @@ void shared_bufferst::flush_read(
243243
const source_locationt &source_location,
244244
const irep_idt &write_object)
245245
{
246-
/* option 1 */
247-
248246
#if 0
247+
// option 1
249248
const varst &vars=(*this)(write_object);
250249

251250
const symbol_exprt fresh_var_expr=symbol_exprt(vars.read_new_var, vars.type);
@@ -267,16 +266,14 @@ void shared_bufferst::flush_read(
267266
assignment(goto_program, target, source_location, vars.read_delayed,
268267
false_exprt());
269268
#else
269+
// option 2: do nothing
270270
// unused parameters
271271
(void)goto_program;
272272
(void)target;
273273
(void)target;
274274
(void)source_location;
275275
(void)write_object;
276276
#endif
277-
278-
/* option 2 */
279-
/* do nothing */
280277
}
281278

282279
/// instruments write

src/util/memory_info.cpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Author: Daniel Kroening, [email protected]
3333

3434
void memory_info(std::ostream &out)
3535
{
36-
#if defined(__linux__) && defined(__GLIBC__)
36+
#if defined(__linux__) && defined(__GLIBC__)
3737
// NOLINTNEXTLINE(readability/identifiers)
3838
struct mallinfo m = mallinfo();
3939
out << " non-mmapped space allocated from system: " << m.arena << "\n";
@@ -45,21 +45,21 @@ void memory_info(std::ostream &out)
4545
out << " space available in freed fastbin blocks: " << m.fsmblks << "\n";
4646
out << " total allocated space: " << m.uordblks << "\n";
4747
out << " total free space: " << m.fordblks << "\n";
48-
#endif
48+
#endif
4949

50-
#ifdef _WIN32
50+
#ifdef _WIN32
5151
(void)out; // unused parameter
52-
#if 0
52+
#if 0
5353
PROCESS_MEMORY_COUNTERS pmc;
5454
if(GetProcessMemoryInfo(GetCurrentProcess(), &pmc, sizeof(pmc)))
5555
{
5656
out << " PeakWorkingSetSize: " << pmc.PeakWorkingSetSize << "\n";
5757
out << " WorkingSetSize: " << pmc.WorkingSetSize << "\n";
5858
}
59-
#endif
60-
#endif
59+
#endif
60+
#endif
6161

62-
#ifdef __APPLE__
62+
#ifdef __APPLE__
6363
// NOLINTNEXTLINE(readability/identifiers)
6464
struct task_basic_info t_info;
6565
mach_msg_type_number_t t_info_count = TASK_BASIC_INFO_COUNT;
@@ -74,5 +74,5 @@ void memory_info(std::ostream &out)
7474
<< static_cast<double>(t.max_size_in_use)/1000000 << "m\n";
7575
out << " size_allocated: "
7676
<< static_cast<double>(t.size_allocated)/1000000 << "m\n";
77-
#endif
77+
#endif
7878
}

src/util/tempdir.cpp

+49-48
Original file line numberDiff line numberDiff line change
@@ -39,54 +39,55 @@ std::string get_temporary_directory(const std::string &name_template)
3939
{
4040
std::string result;
4141

42-
#ifdef _WIN32
43-
(void)name_template; // unused parameter
44-
DWORD dwBufSize = MAX_PATH+1;
45-
char lpPathBuffer[MAX_PATH+1];
46-
DWORD dwRetVal = GetTempPathA(dwBufSize, lpPathBuffer);
47-
48-
if(dwRetVal > dwBufSize || (dwRetVal == 0))
49-
{
50-
throw system_exceptiont("Couldn't get temporary path");
51-
}
52-
53-
// GetTempFileNameA produces <path>\<pre><uuuu>.TMP
54-
// where <pre> = "TLO"
55-
// Thus, we must make the buffer 1+3+4+1+3=12 characters longer.
56-
57-
char t[MAX_PATH];
58-
UINT uRetVal=GetTempFileNameA(lpPathBuffer, "TLO", 0, t);
59-
if(uRetVal == 0)
60-
{
61-
throw system_exceptiont(
62-
std::string("Couldn't get new temporary file name in directory") +
63-
lpPathBuffer);
64-
}
65-
66-
unlink(t);
67-
if(_mkdir(t) != 0)
68-
{
69-
throw system_exceptiont(
70-
std::string("Couldn't create temporary directory at ") + t);
71-
}
72-
result=std::string(t);
73-
74-
#else
75-
std::string prefixed_name_template="/tmp/";
76-
const char *TMPDIR_env=getenv("TMPDIR");
77-
if(TMPDIR_env!=nullptr)
78-
prefixed_name_template=TMPDIR_env;
79-
if(*prefixed_name_template.rbegin()!='/')
80-
prefixed_name_template+='/';
81-
prefixed_name_template+=name_template;
82-
83-
std::vector<char> t(prefixed_name_template.begin(), prefixed_name_template.end());
84-
t.push_back('\0'); // add the zero
85-
const char *td = mkdtemp(t.data());
86-
if(!td)
87-
throw system_exceptiont("Failed to create temporary directory");
88-
result=std::string(td);
89-
#endif
42+
#ifdef _WIN32
43+
(void)name_template; // unused parameter
44+
DWORD dwBufSize = MAX_PATH + 1;
45+
char lpPathBuffer[MAX_PATH + 1];
46+
DWORD dwRetVal = GetTempPathA(dwBufSize, lpPathBuffer);
47+
48+
if(dwRetVal > dwBufSize || (dwRetVal == 0))
49+
{
50+
throw system_exceptiont("Couldn't get temporary path");
51+
}
52+
53+
// GetTempFileNameA produces <path>\<pre><uuuu>.TMP
54+
// where <pre> = "TLO"
55+
// Thus, we must make the buffer 1+3+4+1+3=12 characters longer.
56+
57+
char t[MAX_PATH];
58+
UINT uRetVal = GetTempFileNameA(lpPathBuffer, "TLO", 0, t);
59+
if(uRetVal == 0)
60+
{
61+
throw system_exceptiont(
62+
std::string("Couldn't get new temporary file name in directory") +
63+
lpPathBuffer);
64+
}
65+
66+
unlink(t);
67+
if(_mkdir(t) != 0)
68+
{
69+
throw system_exceptiont(
70+
std::string("Couldn't create temporary directory at ") + t);
71+
}
72+
result = std::string(t);
73+
74+
#else
75+
std::string prefixed_name_template = "/tmp/";
76+
const char *TMPDIR_env = getenv("TMPDIR");
77+
if(TMPDIR_env != nullptr)
78+
prefixed_name_template = TMPDIR_env;
79+
if(*prefixed_name_template.rbegin() != '/')
80+
prefixed_name_template += '/';
81+
prefixed_name_template += name_template;
82+
83+
std::vector<char> t(
84+
prefixed_name_template.begin(), prefixed_name_template.end());
85+
t.push_back('\0'); // add the zero
86+
const char *td = mkdtemp(t.data());
87+
if(!td)
88+
throw system_exceptiont("Failed to create temporary directory");
89+
result = std::string(td);
90+
#endif
9091

9192
return result;
9293
}

0 commit comments

Comments
 (0)