Skip to content

Commit b42159f

Browse files
committed
Constify the flags
Signed-off-by: Kevin Wheatley <[email protected]>
1 parent 9a471c0 commit b42159f

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

include/OpenColorIO/OpenColorIO.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1536,7 +1536,7 @@ class OCIOEXPORT Config
15361536
* \param ostream The output stream to write to.
15371537
* \param flags Flags top control archive creation
15381538
*/
1539-
void archive(std::ostream & ostream, ArchiveFlags flags) const;
1539+
void archive(std::ostream & ostream, const ArchiveFlags & flags) const;
15401540

15411541
//TODO: document
15421542
void GetAllFileReferences(std::set<std::string> & files) const;

src/OpenColorIO/Config.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5607,7 +5607,7 @@ bool Config::isArchivable(bool minimal) const
56075607
return true;
56085608
}
56095609

5610-
void Config::archive(std::ostream & ostream, ArchiveFlags flags) const
5610+
void Config::archive(std::ostream & ostream, const ArchiveFlags & flags) const
56115611
{
56125612
// Using utility functions in OCIOZArchive.cpp.
56135613
archiveConfig(ostream, *this, getCurrentContext()->getWorkingDir(), flags);

src/OpenColorIO/OCIOZArchive.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,15 +267,15 @@ ArchiveFlags EnvironmentOverride(ArchiveFlags oFlags) // TODO: test override
267267
return oFlags;
268268
}
269269

270-
void archiveConfig(std::ostream & ostream, const Config & config, const char * configWorkingDirectory, ArchiveFlags flags)
270+
void archiveConfig(std::ostream & ostream, const Config & config, const char * configWorkingDirectory, const ArchiveFlags & archiveFlags)
271271
{
272272
void * archiver = nullptr;
273273
void *write_mem_stream = NULL;
274274
const uint8_t *buffer_ptr = NULL;
275275
int32_t buffer_size = 0;
276276
mz_zip_file file_info;
277277

278-
flags = EnvironmentOverride(flags);
278+
ArchiveFlags flags = EnvironmentOverride(archiveFlags);
279279
const bool minimal = HasFlag(flags, ARCHIVE_FLAGS_MINIMAL);
280280

281281
if (!config.isArchivable(minimal)) // TODO: pass in flags?

src/OpenColorIO/OCIOZArchive.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ namespace OCIO_NAMESPACE
2323
* \param ostream Output stream to write the data into.
2424
* \param config Config object.
2525
* \param configWorkingDirectory Working directory of the current config.
26-
* \param flags Archive flags used to .
26+
* \param archiveFlags Archive flags used to configure archive generation.
2727
*/
2828
void archiveConfig(
2929
std::ostream & ostream,
3030
const Config & config,
3131
const char * configWorkingDirectory,
32-
ArchiveFlags flags);
32+
const ArchiveFlags & archiveFlags);
3333

3434
/**
3535
* \brief Get the content of a file inside an OCIOZ archive as a buffer.

0 commit comments

Comments
 (0)