Skip to content

Commit

Permalink
Fix an issue in aer_state_initialize() of C API (#1885)
Browse files Browse the repository at this point in the history
Correct C API `aer_state_initialize` to take an argument of `handler`.

* update aer_state_initialize API
* add reno
  • Loading branch information
hhorii authored and doichanj committed Aug 9, 2023
1 parent c9c6150 commit e39e458
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
3 changes: 1 addition & 2 deletions contrib/runtime/aer_runtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@ void *aer_state() {
return handler;
};

void *aer_state_initialize(void *handler) {
void aer_state_initialize(void *handler) {
AER::AerState *state = reinterpret_cast<AER::AerState *>(handler);
state->initialize();
return handler;
};

// finalize state
Expand Down
2 changes: 1 addition & 1 deletion contrib/runtime/aer_runtime_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ typedef uint_fast64_t uint_t;
void* aer_state();

// initialize aer state
void* aer_state_initialize();
void aer_state_initialize(void* state);

// finalize state
void aer_state_finalize(void* state);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
fixes:
- |
A function ``aer_state_initialize()`` in C API wrongly takes no argument though
it initializes a state created by ``aer_state()``. Example codes pass ``handler``
and rouboustness of C compiler allows its compilation. This commit corrects for
``aer_state_initialize()`` to take an argument ``handler`` to be initialized.

0 comments on commit e39e458

Please sign in to comment.