Skip to content

Commit

Permalink
fix unused parameter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamiras committed Oct 26, 2024
1 parent 0c10f9b commit ef343fa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/rc_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ static void rc_client_natvis_helper(const rc_client_event_t* event, rc_client_t*
} natvis;

memset(&natvis, 0, sizeof(natvis));
(void)event;
(void)client;

/* this code should never be executed. it just ensures these constants get defined for
* the natvis VisualStudio extension as they're not used directly in the code. */
Expand Down
10 changes: 7 additions & 3 deletions src/rcheevos/runtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,28 @@
typedef struct __rc_runtime_trigger_list_t { rc_runtime_t runtime; } __rc_runtime_trigger_list_t;
typedef struct __rc_runtime_lboard_list_t { rc_runtime_t runtime; } __rc_runtime_lboard_list_t;

static void rc_runtime_natvis_helper(void)
static void rc_runtime_natvis_helper(const rc_runtime_event_t* runtime_event)
{
struct natvis_extensions {
__rc_runtime_trigger_list_t trigger_list;
__rc_runtime_lboard_list_t lboard_list;
} natvis;

memset(&natvis, 0, sizeof(natvis));
(void)runtime_event;

natvis.lboard_list.runtime.lboard_count = 0;
}

/* ============================= */

rc_runtime_t* rc_runtime_alloc(void) {
rc_runtime_t* self;

/* create a reference to rc_runtime_natvis_helper so the extensions get compiled in. */
rc_runtime_t* self = (rc_runtime_t*)&rc_runtime_natvis_helper;
/* immediately replace the reference with an actual object. */
rc_runtime_event_handler_t unused = &rc_runtime_natvis_helper;
(void)unused;

self = malloc(sizeof(rc_runtime_t));

if (self) {
Expand Down

0 comments on commit ef343fa

Please sign in to comment.