Skip to content

Commit

Permalink
Fix gcc13 build failures
Browse files Browse the repository at this point in the history
Fixes #580
  • Loading branch information
Strilanc committed Aug 20, 2023
1 parent 836a564 commit 94f17a5
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 8 deletions.
10 changes: 5 additions & 5 deletions src/stim/circuit/circuit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -304,8 +304,8 @@ template <typename SOURCE>
inline void read_result_targets64_into(int &c, SOURCE read_char, Circuit &circuit) {
while (read_until_next_line_arg(c, read_char)) {
uint64_t q = read_uint63_t(c, read_char);
circuit.target_buf.append_tail({(uint32_t)(q & 0xFFFFFFFFULL)});
circuit.target_buf.append_tail({(uint32_t)(q >> 32)});
circuit.target_buf.append_tail(GateTarget{(uint32_t)(q & 0xFFFFFFFFULL)});
circuit.target_buf.append_tail(GateTarget{(uint32_t)(q >> 32)});
}
}

Expand Down Expand Up @@ -382,9 +382,9 @@ void circuit_read_operations(Circuit &circuit, SOURCE read_char, READ_CONDITION

// Rewrite target data to reference the parsed block.
circuit.target_buf.ensure_available(3);
circuit.target_buf.append_tail({block_id});
circuit.target_buf.append_tail({rep_count_low});
circuit.target_buf.append_tail({rep_count_high});
circuit.target_buf.append_tail(GateTarget{block_id});
circuit.target_buf.append_tail(GateTarget{rep_count_low});
circuit.target_buf.append_tail(GateTarget{rep_count_high});
new_op.targets = circuit.target_buf.commit_tail();
}

Expand Down
2 changes: 1 addition & 1 deletion src/stim/circuit/circuit.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
#define _STIM_CIRCUIT_CIRCUIT_H

#include <cmath>
#include <cstdint>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
Expand Down
2 changes: 2 additions & 0 deletions src/stim/circuit/circuit_instruction.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#ifndef _STIM_CIRCUIT_INSTRUCTION_H
#define _STIM_CIRCUIT_INSTRUCTION_H

#include <cstdint>

#include "stim/circuit/gate_target.h"
#include "stim/mem/span_ref.h"

Expand Down
1 change: 1 addition & 0 deletions src/stim/circuit/gate_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <array>
#include <cassert>
#include <complex>
#include <cstdint>
#include <cstring>
#include <functional>
#include <initializer_list>
Expand Down
1 change: 1 addition & 0 deletions src/stim/diagram/ascii_diagram.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#ifndef _STIM_DIAGRAM_TIMELINE_ASCII_DIAGRAM_ASCII_DIAGRAM_H
#define _STIM_DIAGRAM_TIMELINE_ASCII_DIAGRAM_ASCII_DIAGRAM_H

#include <cstdint>
#include <functional>
#include <iostream>
#include <map>
Expand Down
1 change: 1 addition & 0 deletions src/stim/diagram/base64.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#ifndef _STIM_DIAGRAM_BASE64_H
#define _STIM_DIAGRAM_BASE64_H

#include <cstdint>
#include <iostream>

namespace stim_draw_internal {
Expand Down
1 change: 1 addition & 0 deletions src/stim/diagram/gate_data_svg.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#ifndef _STIM_DIAGRAM_GATE_DATA_SVG_H
#define _STIM_DIAGRAM_GATE_DATA_SVG_H

#include <cstdint>
#include <map>
#include <string>

Expand Down
1 change: 1 addition & 0 deletions src/stim/mem/simd_word.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/

#include <cstddef>
#include <cstdint>

#ifndef _STIM_MEM_SIMD_WORD_H
#define _STIM_MEM_SIMD_WORD_H
Expand Down
4 changes: 2 additions & 2 deletions src/stim/search/hyper/algo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
using namespace stim;
using namespace stim::impl_search_hyper;

DetectorErrorModel backtrack_path(const std::map<SearchState, SearchState> &back_map, SearchState final_state) {
DetectorErrorModel backtrack_path(const std::map<SearchState, SearchState> &back_map, SearchState &&final_state) {
DetectorErrorModel out;
SearchState cur_state = std::move(final_state);
while (true) {
Expand Down Expand Up @@ -98,7 +98,7 @@ DetectorErrorModel stim::find_undetectable_logical_error(
}
if (next.dets.empty()) {
assert(next.obs_mask.not_zero()); // Otherwise, it would have already been in back_map.
return backtrack_path(back_map, next);
return backtrack_path(back_map, std::move(next));
}
queue.push(std::move(next));
}
Expand Down
2 changes: 2 additions & 0 deletions src/stim/search/hyper/algo.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#ifndef _STIM_SEARCH_HYPER_ALGO_H
#define _STIM_SEARCH_HYPER_ALGO_H

#include <cstdint>

#include "stim/dem/detector_error_model.h"

namespace stim {
Expand Down

0 comments on commit 94f17a5

Please sign in to comment.