Skip to content

Commit 40a2370

Browse files
authored
Merge pull request #3972 from clumens/enum-refactor
Change how enums are defined.
2 parents caadc9b + d358792 commit 40a2370

38 files changed

+694
-606
lines changed

daemons/attrd/pacemaker-attrd.h

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
# define PACEMAKER_ATTRD__H
1212

1313
#include <regex.h>
14+
#include <stdint.h>
1415
#include <glib.h>
1516
#include <crm/crm.h>
1617
#include <crm/cluster.h>
@@ -114,19 +115,19 @@ void attrd_remove_voter(const pcmk__node_status_t *peer);
114115
void attrd_xml_add_writer(xmlNode *xml);
115116

116117
enum attrd_attr_flags {
117-
attrd_attr_none = 0U,
118+
attrd_attr_none = 0,
118119

119120
// At least one of attribute's values has changed since last write
120-
attrd_attr_changed = (1U << 0),
121+
attrd_attr_changed = (UINT32_C(1) << 0),
121122

122123
// At least one of attribute's values has an unknown node XML ID
123-
attrd_attr_node_unknown = (1U << 1),
124+
attrd_attr_node_unknown = (UINT32_C(1) << 1),
124125

125126
// This attribute should never be written to the CIB
126-
attrd_attr_is_private = (1U << 2),
127+
attrd_attr_is_private = (UINT32_C(1) << 2),
127128

128129
// Ignore any configured delay for next write of this attribute
129-
attrd_attr_force_write = (1U << 3),
130+
attrd_attr_force_write = (UINT32_C(1) << 3),
130131
};
131132

132133
typedef struct attribute_s {
@@ -154,9 +155,13 @@ typedef struct attribute_s {
154155
} while (0)
155156

156157
enum attrd_value_flags {
157-
attrd_value_none = 0U,
158-
attrd_value_remote = (1U << 0), // Value is for Pacemaker Remote node
159-
attrd_value_from_peer = (1U << 1), // Value is from peer sync response
158+
attrd_value_none = 0,
159+
160+
//! Value is for Pacemaker Remote node
161+
attrd_value_remote = (UINT32_C(1) << 0),
162+
163+
//! Value is from peer sync response
164+
attrd_value_from_peer = (UINT32_C(1) << 1),
160165
};
161166

162167
typedef struct attribute_value_s {
@@ -214,8 +219,8 @@ char *attrd_nvpair_id(const attribute_t *attr, const char *node_state_id);
214219

215220
enum attrd_write_options {
216221
attrd_write_changed = 0,
217-
attrd_write_all = (1 << 0),
218-
attrd_write_no_delay = (1 << 1),
222+
attrd_write_all = (UINT32_C(1) << 0),
223+
attrd_write_no_delay = (UINT32_C(1) << 1),
219224
};
220225

221226
void attrd_write_attributes(uint32_t options);

daemons/controld/controld_control.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -479,35 +479,35 @@ do_started(long long action,
479479

480480
} else if (!pcmk__is_set(controld_globals.fsa_input_register,
481481
R_MEMBERSHIP)) {
482-
crm_info("Delaying start, no membership data (%.16llx)", R_MEMBERSHIP);
482+
crm_info("Delaying start, no membership data (%.16" PRIx64 ")", R_MEMBERSHIP);
483483

484484
crmd_fsa_stall(TRUE);
485485
return;
486486

487487
} else if (!pcmk__is_set(controld_globals.fsa_input_register,
488488
R_LRM_CONNECTED)) {
489-
crm_info("Delaying start, not connected to executor (%.16llx)", R_LRM_CONNECTED);
489+
crm_info("Delaying start, not connected to executor (%.16" PRIx64 ")", R_LRM_CONNECTED);
490490

491491
crmd_fsa_stall(TRUE);
492492
return;
493493

494494
} else if (!pcmk__is_set(controld_globals.fsa_input_register,
495495
R_CIB_CONNECTED)) {
496-
crm_info("Delaying start, CIB not connected (%.16llx)", R_CIB_CONNECTED);
496+
crm_info("Delaying start, CIB not connected (%.16" PRIx64 ")", R_CIB_CONNECTED);
497497

498498
crmd_fsa_stall(TRUE);
499499
return;
500500

501501
} else if (!pcmk__is_set(controld_globals.fsa_input_register,
502502
R_READ_CONFIG)) {
503-
crm_info("Delaying start, Config not read (%.16llx)", R_READ_CONFIG);
503+
crm_info("Delaying start, Config not read (%.16" PRIx64 ")", R_READ_CONFIG);
504504

505505
crmd_fsa_stall(TRUE);
506506
return;
507507

508508
} else if (!pcmk__is_set(controld_globals.fsa_input_register,
509509
R_PEER_DATA)) {
510-
crm_info("Delaying start, No peer data (%.16llx)", R_PEER_DATA);
510+
crm_info("Delaying start, No peer data (%.16" PRIx64 ")", R_PEER_DATA);
511511
crmd_fsa_stall(TRUE);
512512
return;
513513
}

daemons/controld/controld_election.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,6 @@ do_dc_takeover(long long action,
213213
controld_execute_fencing_cleanup();
214214

215215
election_reset(controld_globals.cluster);
216-
controld_set_fsa_input_flags(R_JOIN_OK|R_INVOKE_PE);
217216

218217
controld_globals.cib_conn->cmds->set_primary(controld_globals.cib_conn,
219218
cib_none);

0 commit comments

Comments
 (0)