Skip to content

Commit ad7b28e

Browse files
committed
Updates requsted in the PR: mostly rename 'size -> length'.
1 parent e3fcb9b commit ad7b28e

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/util/file_util.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,11 @@ std::string concat_dir_file(
161161
/// This is not designed to operate on path names and will replace folder
162162
/// seperator characters.
163163
/// \param file_name: The file name to sanitize.
164-
/// \param max_size: The maximum size for the file name. If the name is longer,
165-
/// then its size will be cut to the max_size.
164+
/// \param max_length: The maximum length for the file name. If the name is
165+
/// longer, then its length will be cut to the max_length.
166166
std::string make_valid_filename(
167167
std::string file_name,
168-
const std::size_t max_size)
168+
const std::size_t max_length)
169169
{
170170
std::replace(file_name.begin(), file_name.end(), '#', '_');
171171
std::replace(file_name.begin(), file_name.end(), '$', '_');
@@ -174,7 +174,7 @@ std::string make_valid_filename(
174174
std::replace(file_name.begin(), file_name.end(), '\\', '.');
175175
std::replace(file_name.begin(), file_name.end(), '<', '[');
176176
std::replace(file_name.begin(), file_name.end(), '>', ']');
177-
if(file_name.size() > max_size)
178-
file_name.resize(max_size);
177+
if(file_name.size() > max_length)
178+
file_name.resize(max_length);
179179
return file_name;
180180
}

src/util/file_util.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ Author: Daniel Kroening, [email protected]
1212

1313
#include <string>
1414

15-
/// This constant defines a maximum name length of any file created by
16-
/// any module of the CProver. The value of the constant was inferred
15+
/// This constant defines the maximum name length of any file created by
16+
/// any module of the CProver. The value of the constant was derived
1717
/// from the most restrictive file system we use on our workstations:
1818
/// 'ecryptfs'.
19-
const std::size_t MAX_FILE_NAME_SIZE = 140;
19+
const std::size_t MAX_FILE_NAME_LENGTH = 140;
2020

2121
void delete_directory(const std::string &path);
2222

@@ -27,6 +27,6 @@ std::string concat_dir_file(const std::string &directory,
2727

2828
std::string make_valid_filename(
2929
std::string filename,
30-
const std::size_t max_size = MAX_FILE_NAME_SIZE);
30+
const std::size_t max_length = MAX_FILE_NAME_LENGTH);
3131

3232
#endif // CPROVER_UTIL_FILE_UTIL_H

0 commit comments

Comments
 (0)