18 #include <sys/types.h> 67 return (
int) score_ll;
99 snprintf(score_s,
sizeof(score_s),
"%d", score);
115 int result = score1 + score2;
122 crm_trace(
"-INFINITY + -INFINITY = -INFINITY");
124 crm_trace(
"-INFINITY + +INFINITY = -INFINITY");
126 crm_trace(
"-INFINITY + %d = -INFINITY", score2);
134 crm_trace(
"+INFINITY + -INFINITY = -INFINITY");
136 crm_trace(
"%d + -INFINITY = -INFINITY", score1);
144 crm_trace(
"+INFINITY + +INFINITY = +INFINITY");
146 crm_trace(
"+INFINITY + %d = +INFINITY", score2);
152 crm_trace(
"%d + +INFINITY = +INFINITY", score1);
163 crm_trace(
"%d + %d = +INFINITY", score1, score2);
167 crm_trace(
"%d + %d = -INFINITY", score1, score2);
#define CRM_CHECK(expr, failure_action)
#define PCMK__VALUE_GREEN
int pcmk__add_scores(int score1, int score2)
int char2score(const char *score)
Get the integer value of a score string.
#define CRM_SCORE_INFINITY
int pcmk__scan_ll(const char *text, long long *result, long long default_value)
#define crm_trace(fmt, args...)
#define CRM_MINUS_INFINITY_S
const char * pcmk_readable_score(int score)
Return a displayable static string for a score value.
char * score2char(int score)
bool pcmk_str_is_infinity(const char *s)
pcmk__action_result_t result
bool pcmk_str_is_minus_infinity(const char *s)
Deprecated Pacemaker utilities.
#define PCMK__VALUE_YELLOW
char * score2char_stack(int score, char *buf, size_t len)