Skip to content

Commit

Permalink
Removing unused 'type' for subject notify payloads.
Browse files Browse the repository at this point in the history
  • Loading branch information
Chukobyte committed Dec 9, 2023
1 parent f520565 commit 72bde6d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion seika/utils/observer.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

typedef struct SESubjectNotifyPayload {
void* data; // Primary data, be sure to cast properly
int type; // Secondary data, can be used to filter things, an easier value to access, etc...
} SESubjectNotifyPayload;

typedef void (*SEObserverOnNotify)(SESubjectNotifyPayload*);
Expand Down
4 changes: 2 additions & 2 deletions test/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ void observer_func1(SESubjectNotifyPayload* payload) {

void observer_func2(SESubjectNotifyPayload* payload) {
const int dataValue = *(int*) payload->data;
if (dataValue == 3 && payload->type == 127) {
if (dataValue == 3) {
hasObserved = true;
}
}
Expand All @@ -307,7 +307,7 @@ void seika_observer_test(void) {
se_event_register_observer(event, observer);
int dataValue = 3;
se_event_notify_observers(event, &(SESubjectNotifyPayload) {
.data = &dataValue, .type = 127
.data = &dataValue
});
TEST_ASSERT(hasObserved);

Expand Down
2 changes: 1 addition & 1 deletion vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "seika",
"version": "0.0.3",
"version": "0.0.4",
"dependencies": [
{
"name": "sdl2",
Expand Down

0 comments on commit 72bde6d

Please sign in to comment.