Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format src/ and test/ #610

Merged
merged 2 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ NamespaceIndentation: All
PointerAlignment: Left
QualifierAlignment: Left
ReferenceAlignment: Left
RemoveParentheses: MultipleParentheses
#RemoveParentheses: MultipleParentheses
SeparateDefinitionBlocks: Always
SpaceAfterTemplateKeyword: true
SpaceBeforeParens: ControlStatements
20 changes: 10 additions & 10 deletions src/adiar/adiar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

#include <exception>

#include <tpie/tpie.h>
#include <tpie/memory.h>
#include <tpie/tempname.h>
#include <tpie/tpie.h>

#include <adiar/internal/assert.h>
#include <adiar/internal/block_size.h>
Expand All @@ -15,7 +15,8 @@
bool _adiar_initialized = false;
bool _tpie_initialized = false;

void adiar_init(size_t memory_limit_bytes, std::string temp_dir)
void
adiar_init(size_t memory_limit_bytes, std::string temp_dir)
{
if (_adiar_initialized) {
#ifndef NDEBUG
Expand All @@ -28,8 +29,7 @@
}
if (memory_limit_bytes < minimum_memory) {
throw invalid_argument("Adiar requires at least "
+ std::to_string(minimum_memory / 1024 / 1024)
+ " MiB of memory");
+ std::to_string(minimum_memory / 1024 / 1024) + " MiB of memory");
}

try {
Expand All @@ -41,9 +41,7 @@
tpie::tempname::set_default_extension("adiar");

// - tmp directory
if (temp_dir != "") {
tpie::tempname::set_default_path(temp_dir);
}
if (temp_dir != "") { tpie::tempname::set_default_path(temp_dir); }

// - memory limit and block size
tpie::get_memory_manager().set_limit(memory_limit_bytes);
Expand All @@ -57,7 +55,7 @@

// - all done, mark initialized
_adiar_initialized = true;
} catch (const std::exception &e) {
} catch (const std::exception& e) {

Check warning on line 58 in src/adiar/adiar.cpp

View check run for this annotation

Codecov / codecov/patch

src/adiar/adiar.cpp#L58

Added line #L58 was not covered by tests
// LCOV_EXCL_START
// Mark as not initialized.
_adiar_initialized = false;
Expand All @@ -72,12 +70,14 @@
}
}

bool adiar_initialized() noexcept
bool
adiar_initialized() noexcept
{
return _adiar_initialized;
}

void adiar_deinit()
void
adiar_deinit()
{
if (!_adiar_initialized) return;

Expand Down
11 changes: 7 additions & 4 deletions src/adiar/adiar.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
////////////////////////////////////////////////////////////////////////////////
/// Decision Diagrams
#include <adiar/bdd.h>
#include <adiar/zdd.h>
#include <adiar/builder.h>
#include <adiar/zdd.h>

////////////////////////////////////////////////////////////////////////////////
/// Statistics
Expand Down Expand Up @@ -75,12 +75,14 @@ namespace adiar
/// \throws runtime_error If `adiar_init()` and then `adiar_deinit()` have
/// been called previously.
//////////////////////////////////////////////////////////////////////////////
void adiar_init(size_t memory_limit_bytes, std::string temp_dir = "");
void
adiar_init(size_t memory_limit_bytes, std::string temp_dir = "");

//////////////////////////////////////////////////////////////////////////////
/// \brief Whether Adiar is initialized.
//////////////////////////////////////////////////////////////////////////////
bool adiar_initialized() noexcept;
bool
adiar_initialized() noexcept;

//////////////////////////////////////////////////////////////////////////////
/// \brief Closes and cleans up everything by Adiar
Expand All @@ -93,7 +95,8 @@ namespace adiar
/// \throws runtime_error If compiled with *debug* and one of Adiar's objects
/// have *not* been destructed.
//////////////////////////////////////////////////////////////////////////////
void adiar_deinit();
void
adiar_deinit();

/// \}
//////////////////////////////////////////////////////////////////////////////
Expand Down
Loading
Loading