Skip to content

Commit

Permalink
Prepare for fmt v11. (#1423)
Browse files Browse the repository at this point in the history
* Update `[email protected]`.

* Python 3.12 does `size_t(-1) + 1 == 0`.
  • Loading branch information
1uc authored Sep 10, 2024
1 parent 0bc960c commit e625001
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 12 deletions.
3 changes: 2 additions & 1 deletion .sanitizers/undefined.supp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
implicit-integer-sign-change:double vector[2] Eigen::internal::pabs<double vector[2]>(double vector[2] const&)
unsigned-integer-overflow:std::mersenne_twister_engine
unsigned-integer-overflow:fmt::v10::detail::make_write_int_arg
unsigned-integer-overflow:fmt::*
unsigned-integer-overflow:Py_INCREF
2 changes: 1 addition & 1 deletion ext/fmt
Submodule fmt updated 175 files
3 changes: 2 additions & 1 deletion src/codegen/codegen_info.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
* \brief Various types to store code generation specific information
*/

#include <fmt/format.h>
#include "utils/fmt.h"

#include <optional>
#include <string>
#include <unordered_map>
Expand Down
2 changes: 0 additions & 2 deletions src/codegen/codegen_neuron_cpp_visitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1288,7 +1288,6 @@ void CodegenNeuronCppVisitor::print_neuron_global_variable_declarations() {

void CodegenNeuronCppVisitor::print_mechanism_range_var_structure(bool print_initializers) {
auto const value_initialize = print_initializers ? "{}" : "";
auto int_type = default_int_data_type();
printer->add_newline(2);
printer->add_line("/** all mechanism instance variables and global variables */");
printer->fmt_push_block("struct {} ", instance_struct());
Expand Down Expand Up @@ -1614,7 +1613,6 @@ void CodegenNeuronCppVisitor::print_nrn_alloc() {
}
const auto& var_name = var->get_name();
auto var_pos = position_of_float_var(var_name);
double var_value = var->get_value() == nullptr ? 0.0 : *var->get_value();

printer->fmt_line("_lmc.template fpfield<{}>(_iml) = {}; /* {} */",
var_pos,
Expand Down
2 changes: 1 addition & 1 deletion src/printer/code_printer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* \file
* \brief \copybrief nmodl::printer::CodePrinter
*/
#include <fmt/format.h>
#include "utils/fmt.h"

#include <fstream>
#include <iostream>
Expand Down
2 changes: 1 addition & 1 deletion src/units/units.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include <vector>

#include "units.hpp"
#include <fmt/format.h>
#include "utils/fmt.h"

/**
* \file
Expand Down
2 changes: 1 addition & 1 deletion src/utils/blame.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include "blame.hpp"

#include "string_utils.hpp"
#include "utils/fmt.h"
#include <filesystem>
#include <fmt/format.h>
#include <stdexcept>
#include <string>

Expand Down
4 changes: 4 additions & 0 deletions src/utils/fmt.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#pragma once

#include <fmt/format.h>
#include <fmt/ranges.h>
2 changes: 1 addition & 1 deletion src/utils/string_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include "utils/string_utils.hpp"

#include <fmt/format.h>
#include "utils/fmt.h"

#include <limits>
#include <string>
Expand Down
2 changes: 1 addition & 1 deletion src/visitors/solve_block_visitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

#include "visitors/solve_block_visitor.hpp"

#include "utils/fmt.h"
#include <cassert>
#include <fmt/format.h>

#include "ast/all.hpp"
#include "codegen/codegen_naming.hpp"
Expand Down
2 changes: 1 addition & 1 deletion src/visitors/visitor_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "visitors/lookup_visitor.hpp"
#include "visitors/nmodl_visitor.hpp"

#include <fmt/format.h>
#include "utils/fmt.h"

namespace nmodl {
namespace visitor {
Expand Down
2 changes: 1 addition & 1 deletion test/unit/visitor/units.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* SPDX-License-Identifier: Apache-2.0
*/

#include "utils/fmt.h"
#include <catch2/catch_test_macros.hpp>
#include <fmt/format.h>

#include "ast/double.hpp"
#include "ast/factor_def.hpp"
Expand Down

0 comments on commit e625001

Please sign in to comment.