Skip to content

Commit

Permalink
Constify the flags
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com>
  • Loading branch information
KevinJW committed Dec 20, 2024
1 parent 09d0cbe commit b60bffc
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion include/OpenColorIO/OpenColorIO.h
Original file line number Diff line number Diff line change
Expand Up @@ -1536,7 +1536,7 @@ class OCIOEXPORT Config
* \param ostream The output stream to write to.
* \param flags Flags top control archive creation
*/
void archive(std::ostream & ostream, ArchiveFlags flags) const;
void archive(std::ostream & ostream, const ArchiveFlags & flags) const;

//TODO: document
void GetAllFileReferences(std::set<std::string> & files) const;
Expand Down
2 changes: 1 addition & 1 deletion src/OpenColorIO/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5607,7 +5607,7 @@ bool Config::isArchivable(bool minimal) const
return true;
}

void Config::archive(std::ostream & ostream, ArchiveFlags flags) const
void Config::archive(std::ostream & ostream, const ArchiveFlags & flags) const
{
// Using utility functions in OCIOZArchive.cpp.
archiveConfig(ostream, *this, getCurrentContext()->getWorkingDir(), flags);
Expand Down
4 changes: 2 additions & 2 deletions src/OpenColorIO/OCIOZArchive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,15 +267,15 @@ ArchiveFlags EnvironmentOverride(ArchiveFlags oFlags) // TODO: test override
return oFlags;
}

void archiveConfig(std::ostream & ostream, const Config & config, const char * configWorkingDirectory, ArchiveFlags flags)
void archiveConfig(std::ostream & ostream, const Config & config, const char * configWorkingDirectory, const ArchiveFlags & archiveFlags)
{
void * archiver = nullptr;
void *write_mem_stream = NULL;
const uint8_t *buffer_ptr = NULL;
int32_t buffer_size = 0;
mz_zip_file file_info;

flags = EnvironmentOverride(flags);
ArchiveFlags flags = EnvironmentOverride(archiveFlags);
const bool minimal = HasFlag(flags, ARCHIVE_FLAGS_MINIMAL);

if (!config.isArchivable(minimal)) // TODO: pass in flags?
Expand Down
4 changes: 2 additions & 2 deletions src/OpenColorIO/OCIOZArchive.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ namespace OCIO_NAMESPACE
* \param ostream Output stream to write the data into.
* \param config Config object.
* \param configWorkingDirectory Working directory of the current config.
* \param flags Archive flags used to .
* \param archiveFlags Archive flags used to configure archive generation.
*/
void archiveConfig(
std::ostream & ostream,
const Config & config,
const char * configWorkingDirectory,
ArchiveFlags flags);
const ArchiveFlags & archiveFlags);

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

0 comments on commit b60bffc

Please sign in to comment.