Skip to content

Commit ced274c

Browse files
authored
Merge pull request #4093 from nrwahl2/nrwahl2-gint
Replace some GLib type aliases with native C types
2 parents d9ce6a9 + 36898ca commit ced274c

246 files changed

Lines changed: 2344 additions & 1708 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

daemons/attrd/attrd_alerts.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2015-2025 the Pacemaker project contributors
2+
* Copyright 2015-2026 the Pacemaker project contributors
33
*
44
* The version control history for this file may have further details.
55
*
@@ -103,7 +103,7 @@ config_query_callback(xmlNode * msg, int call_id, int rc, xmlNode * output, void
103103
}
104104

105105
gboolean
106-
attrd_read_options(gpointer user_data)
106+
attrd_read_options(void *user_data)
107107
{
108108
int call_id;
109109

daemons/attrd/attrd_attributes.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2013-2025 the Pacemaker project contributors
2+
* Copyright 2013-2026 the Pacemaker project contributors
33
*
44
* The version control history for this file may have further details.
55
*
@@ -172,9 +172,9 @@ attrd_clear_value_seen(void)
172172
attribute_value_t *v = NULL;
173173

174174
g_hash_table_iter_init(&aIter, attributes);
175-
while (g_hash_table_iter_next(&aIter, NULL, (gpointer *) & a)) {
175+
while (g_hash_table_iter_next(&aIter, NULL, (void **) &a)) {
176176
g_hash_table_iter_init(&vIter, a->values);
177-
while (g_hash_table_iter_next(&vIter, NULL, (gpointer *) & v)) {
177+
while (g_hash_table_iter_next(&vIter, NULL, (void **) &v)) {
178178
attrd_clear_value_flags(v, attrd_value_from_peer);
179179
}
180180
}

daemons/attrd/attrd_cib.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ static int last_cib_op_done = 0;
2727
static void write_attribute(attribute_t *a, bool ignore_delay);
2828

2929
static void
30-
attrd_cib_destroy_cb(gpointer user_data)
30+
attrd_cib_destroy_cb(void *user_data)
3131
{
3232
cib_t *cib = user_data;
3333

@@ -235,7 +235,7 @@ attrd_cib_init(void)
235235
}
236236

237237
static gboolean
238-
attribute_timer_cb(gpointer data)
238+
attribute_timer_cb(void *data)
239239
{
240240
attribute_t *a = data;
241241
pcmk__trace("Dampen interval expired for %s", a->id);
@@ -287,7 +287,7 @@ attrd_cib_callback(xmlNode *msg, int call_id, int rc, xmlNode *output, void *use
287287
call_id, a->id, pcmk_strerror(rc), rc);
288288

289289
g_hash_table_iter_init(&iter, a->values);
290-
while (g_hash_table_iter_next(&iter, (gpointer *) & peer, (gpointer *) & v)) {
290+
while (g_hash_table_iter_next(&iter, (void **) &peer, (void **) &v)) {
291291
if (rc == pcmk_ok) {
292292
pcmk__info("* Wrote %s[%s]=%s", a->id, peer,
293293
pcmk__s(v->requested, "(unset)"));
@@ -447,7 +447,7 @@ send_alert_attributes_value(attribute_t *a, GHashTable *t)
447447

448448
g_hash_table_iter_init(&vIter, t);
449449

450-
while (g_hash_table_iter_next(&vIter, NULL, (gpointer *) & at)) {
450+
while (g_hash_table_iter_next(&vIter, NULL, (void **) &at)) {
451451
const char *node_xml_id = attrd_get_node_xml_id(at->nodename);
452452
const char *failed_s = NULL;
453453

@@ -572,7 +572,7 @@ write_attribute(attribute_t *a, bool ignore_delay)
572572

573573
/* Iterate over each peer value of this attribute */
574574
g_hash_table_iter_init(&iter, a->values);
575-
while (g_hash_table_iter_next(&iter, NULL, (gpointer *) &v)) {
575+
while (g_hash_table_iter_next(&iter, NULL, (void **) &v)) {
576576
const char *node_xml_id = NULL;
577577
const char *prev_xml_id = NULL;
578578

@@ -692,7 +692,7 @@ attrd_write_attributes(uint32_t options)
692692
pcmk__debug("Writing out %s attributes",
693693
pcmk__is_set(options, attrd_write_all)? "all" : "changed");
694694
g_hash_table_iter_init(&iter, attributes);
695-
while (g_hash_table_iter_next(&iter, NULL, (gpointer *) & a)) {
695+
while (g_hash_table_iter_next(&iter, NULL, (void **) &a)) {
696696
if (!pcmk__is_set(options, attrd_write_all)
697697
&& pcmk__is_set(a->flags, attrd_attr_node_unknown)) {
698698
// Try writing this attribute again, in case peer ID was learned

daemons/attrd/attrd_corosync.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ attrd_cpg_dispatch(cpg_handle_t handle, const struct cpg_name *group_name,
177177
* \param[in] unused Unused
178178
*/
179179
static void
180-
attrd_cpg_destroy(gpointer unused)
180+
attrd_cpg_destroy(void *unused)
181181
{
182182
if (attrd_shutting_down()) {
183183
pcmk__info("Disconnected from Corosync process group");
@@ -433,7 +433,7 @@ attrd_peer_update_one(const pcmk__node_status_t *peer, xmlNode *xml,
433433
pcmk__xe_remove_attr(xml, PCMK__XA_ATTR_HOST_ID);
434434
g_hash_table_iter_init(&vIter, a->values);
435435

436-
while (g_hash_table_iter_next(&vIter, (gpointer *) & host, NULL)) {
436+
while (g_hash_table_iter_next(&vIter, (void **) &host, NULL)) {
437437
update_attr_on_host(a, peer, xml, attr, value, host, filter);
438438
}
439439

@@ -460,10 +460,10 @@ broadcast_unseen_local_values(void)
460460
xmlNode *sync = NULL;
461461

462462
g_hash_table_iter_init(&aIter, attributes);
463-
while (g_hash_table_iter_next(&aIter, NULL, (gpointer *) & a)) {
463+
while (g_hash_table_iter_next(&aIter, NULL, (void **) &a)) {
464464

465465
g_hash_table_iter_init(&vIter, a->values);
466-
while (g_hash_table_iter_next(&vIter, NULL, (gpointer *) & v)) {
466+
while (g_hash_table_iter_next(&vIter, NULL, (void **) &v)) {
467467

468468
if (!pcmk__is_set(v->flags, attrd_value_from_peer)
469469
&& pcmk__str_eq(v->nodename, attrd_cluster->priv->node_name,
@@ -527,7 +527,7 @@ attrd_peer_clear_failure(pcmk__request_t *request)
527527
const char *host = pcmk__xe_get(xml, PCMK__XA_ATTR_HOST);
528528
const char *op = pcmk__xe_get(xml, PCMK__XA_ATTR_CLEAR_OPERATION);
529529
const char *interval_spec = pcmk__xe_get(xml, PCMK__XA_ATTR_CLEAR_INTERVAL);
530-
guint interval_ms = 0U;
530+
unsigned int interval_ms = 0;
531531
char *attr = NULL;
532532
GHashTableIter iter;
533533
regex_t regex;
@@ -550,7 +550,7 @@ attrd_peer_clear_failure(pcmk__request_t *request)
550550
pcmk__xe_remove_attr(xml, PCMK__XA_ATTR_VALUE);
551551

552552
g_hash_table_iter_init(&iter, attributes);
553-
while (g_hash_table_iter_next(&iter, (gpointer *) &attr, NULL)) {
553+
while (g_hash_table_iter_next(&iter, (void **) &attr, NULL)) {
554554
if (regexec(&regex, attr, 0, NULL, 0) == 0) {
555555
pcmk__trace("Matched %s when clearing %s", attr,
556556
pcmk__s(rsc, "all resources"));
@@ -616,7 +616,7 @@ attrd_erase_removed_peer_attributes(void)
616616
}
617617

618618
g_hash_table_iter_init(&iter, removed_peers);
619-
while (g_hash_table_iter_next(&iter, (gpointer *) &host, NULL)) {
619+
while (g_hash_table_iter_next(&iter, (void **) &host, NULL)) {
620620
attrd_cib_erase_transient_attrs(host);
621621
g_hash_table_iter_remove(&iter);
622622
}
@@ -642,7 +642,7 @@ attrd_peer_remove(const char *host, bool uncache, const char *source)
642642
host, source, (uncache? "and" : "without"));
643643

644644
g_hash_table_iter_init(&aIter, attributes);
645-
while (g_hash_table_iter_next(&aIter, NULL, (gpointer *) & a)) {
645+
while (g_hash_table_iter_next(&aIter, NULL, (void **) &a)) {
646646
if(g_hash_table_remove(a->values, host)) {
647647
pcmk__debug("Removed %s[%s] for peer %s", a->id, host, source);
648648
}
@@ -702,9 +702,9 @@ attrd_peer_sync(pcmk__node_status_t *peer)
702702
pcmk__xe_set(sync, PCMK_XA_TASK, PCMK__ATTRD_CMD_SYNC_RESPONSE);
703703

704704
g_hash_table_iter_init(&aIter, attributes);
705-
while (g_hash_table_iter_next(&aIter, NULL, (gpointer *) & a)) {
705+
while (g_hash_table_iter_next(&aIter, NULL, (void **) &a)) {
706706
g_hash_table_iter_init(&vIter, a->values);
707-
while (g_hash_table_iter_next(&vIter, NULL, (gpointer *) & v)) {
707+
while (g_hash_table_iter_next(&vIter, NULL, (void **) &v)) {
708708
pcmk__debug("Syncing %s[%s]='%s' to %s", a->id, v->nodename,
709709
readable_value(v), readable_peer(peer));
710710
attrd_add_value_xml(sync, a, v, false);

daemons/attrd/attrd_ipc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ static xmlNode *build_query_reply(const char *attr, const char *host)
7373
GHashTableIter iter;
7474

7575
g_hash_table_iter_init(&iter, a->values);
76-
while (g_hash_table_iter_next(&iter, NULL, (gpointer *) &v)) {
76+
while (g_hash_table_iter_next(&iter, NULL, (void **) &v)) {
7777
host_value = pcmk__xe_create(reply, PCMK_XE_NODE);
7878
pcmk__xe_set(host_value, PCMK__XA_ATTR_HOST, v->nodename);
7979
pcmk__xe_set(host_value, PCMK__XA_ATTR_VALUE, v->current);
@@ -114,7 +114,7 @@ attrd_client_clear_failure(pcmk__request_t *request)
114114
pattern = pcmk__assert_asprintf(ATTRD_RE_CLEAR_ONE, rsc);
115115

116116
} else {
117-
guint interval_ms = 0U;
117+
unsigned int interval_ms = 0;
118118

119119
pcmk_parse_interval_spec(interval_spec, &interval_ms);
120120
pattern = pcmk__assert_asprintf(ATTRD_RE_CLEAR_OP, rsc, op,
@@ -257,7 +257,7 @@ expand_regexes(xmlNode *xml, const char *attr, const char *value, const char *re
257257
}
258258

259259
g_hash_table_iter_init(&aIter, attributes);
260-
while (g_hash_table_iter_next(&aIter, (gpointer *) & attr, NULL)) {
260+
while (g_hash_table_iter_next(&aIter, (void **) &attr, NULL)) {
261261
int status = regexec(&r_patt, attr, 0, NULL, 0);
262262

263263
if (status == 0) {

daemons/attrd/attrd_sync.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ next_key(void)
9898
}
9999

100100
static void
101-
free_waitlist_node(gpointer data)
101+
free_waitlist_node(void *data)
102102
{
103103
struct waitlist_node *wl = (struct waitlist_node *) data;
104104

@@ -196,7 +196,7 @@ void
196196
attrd_remove_client_from_waitlist(pcmk__client_t *client)
197197
{
198198
GHashTableIter iter;
199-
gpointer value;
199+
void *value = NULL;
200200

201201
if (waitlist == NULL) {
202202
return;
@@ -231,7 +231,7 @@ void
231231
attrd_ack_waitlist_clients(enum attrd_sync_point sync_point, const xmlNode *xml)
232232
{
233233
int callid;
234-
gpointer value;
234+
void *value = NULL;
235235

236236
if (waitlist == NULL) {
237237
return;
@@ -337,7 +337,7 @@ attrd_request_has_sync_point(xmlNode *xml)
337337
}
338338

339339
static void
340-
free_action(gpointer data)
340+
free_action(void *data)
341341
{
342342
struct confirmation_action *action = (struct confirmation_action *) data;
343343
g_list_free_full(action->respondents, free);
@@ -353,12 +353,12 @@ free_action(gpointer data)
353353
* cleared of things that didn't complete.
354354
*/
355355
static gboolean
356-
confirmation_timeout_cb(gpointer data)
356+
confirmation_timeout_cb(void *data)
357357
{
358358
struct confirmation_action *action = (struct confirmation_action *) data;
359359

360360
GHashTableIter iter;
361-
gpointer value;
361+
void *value = NULL;
362362

363363
if (expected_confirmations == NULL) {
364364
return G_SOURCE_REMOVE;
@@ -431,7 +431,7 @@ void
431431
attrd_do_not_wait_for_client(pcmk__client_t *client)
432432
{
433433
GHashTableIter iter;
434-
gpointer value;
434+
void *value = NULL;
435435

436436
if (expected_confirmations == NULL) {
437437
return;
@@ -476,7 +476,8 @@ attrd_expect_confirmations(pcmk__request_t *request, attrd_confirmation_action_f
476476
{
477477
struct confirmation_action *action = NULL;
478478
GHashTableIter iter;
479-
gpointer host, ver;
479+
void *host = NULL;
480+
void *ver = NULL;
480481
GList *respondents = NULL;
481482
int callid;
482483

daemons/attrd/attrd_utils.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ attrd_expand_value(const char *value, const char *old_value)
168168
*/
169169
int
170170
attrd_failure_regex(regex_t *regex, const char *rsc, const char *op,
171-
guint interval_ms)
171+
unsigned int interval_ms)
172172
{
173173
char *pattern = NULL;
174174
int rc;
@@ -193,7 +193,7 @@ attrd_failure_regex(regex_t *regex, const char *rsc, const char *op,
193193
}
194194

195195
void
196-
attrd_free_attribute_value(gpointer data)
196+
attrd_free_attribute_value(void *data)
197197
{
198198
attribute_value_t *v = data;
199199

@@ -204,7 +204,7 @@ attrd_free_attribute_value(gpointer data)
204204
}
205205

206206
void
207-
attrd_free_attribute(gpointer data)
207+
attrd_free_attribute(void *data)
208208
{
209209
attribute_t *a = data;
210210
if(a) {

daemons/attrd/pacemaker-attrd.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ int attrd_expand_value(const char *value, const char *old_value);
8989
#define ATTRD_RE_CLEAR_OP ATTRD_RE_CLEAR_ALL "%s#%s_%u$"
9090

9191
int attrd_failure_regex(regex_t *regex, const char *rsc, const char *op,
92-
guint interval_ms);
92+
unsigned int interval_ms);
9393

9494
extern cib_t *the_cib;
9595
extern crm_exit_t attrd_exit_status;
@@ -100,7 +100,7 @@ extern lrmd_t *the_lrmd;
100100
extern crm_trigger_t *attrd_config_read;
101101

102102
void attrd_lrmd_disconnect(void);
103-
gboolean attrd_read_options(gpointer user_data);
103+
gboolean attrd_read_options(void *user_data);
104104
int attrd_send_attribute_alert(const char *node, const char *node_xml_id,
105105
const char *attr, const char *value);
106106

@@ -216,8 +216,8 @@ gboolean attrd_send_message(const pcmk__node_status_t *node, xmlNode *data,
216216
xmlNode *attrd_add_value_xml(xmlNode *parent, const attribute_t *a,
217217
const attribute_value_t *v, bool force_write);
218218
void attrd_clear_value_seen(void);
219-
void attrd_free_attribute(gpointer data);
220-
void attrd_free_attribute_value(gpointer data);
219+
void attrd_free_attribute(void *data);
220+
void attrd_free_attribute_value(void *data);
221221
attribute_t *attrd_populate_attribute(xmlNode *xml, const char *attr);
222222
char *attrd_set_id(const attribute_t *attr, const char *node_state_id);
223223
char *attrd_nvpair_id(const attribute_t *attr, const char *node_state_id);

daemons/based/based_callbacks.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include <time.h> // time_t
1919
#include <unistd.h> // close
2020

21-
#include <glib.h> // gboolean, gpointer, g_*, etc.
21+
#include <glib.h> // gboolean, g_*, etc.
2222
#include <libxml/tree.h> // xmlNode
2323
#include <qb/qbipcs.h> // qb_ipcs_connection_t
2424
#include <qb/qblog.h> // LOG_TRACE
@@ -178,7 +178,7 @@ do_local_notify(const xmlNode *xml, const char *client_id, bool sync_reply,
178178
* is received.
179179
*/
180180
static gboolean
181-
digest_timer_cb(gpointer data)
181+
digest_timer_cb(void *data)
182182
{
183183
xmlNode *ping = NULL;
184184

@@ -892,7 +892,7 @@ based_peer_callback(xmlNode *msg, void *private_data)
892892
}
893893

894894
static gboolean
895-
cib_force_exit(gpointer data)
895+
cib_force_exit(void *data)
896896
{
897897
pcmk__notice("Exiting immediately after %s without shutdown acknowledgment",
898898
pcmk__readable_interval(EXIT_ESCALATION_MS));

daemons/based/based_io.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ write_cib_cb(mainloop_child_t *child, int core, int signo, int exit_code)
8787
* \param[in] user_data Ignored
8888
*/
8989
static int
90-
write_cib_async(gpointer user_data)
90+
write_cib_async(void *user_data)
9191
{
9292
int rc = pcmk_rc_ok;
9393
pid_t pid = 0;

0 commit comments

Comments
 (0)