18 #include <sys/types.h> 67 return (
int) score_ll;
95 snprintf(buf, len,
"%d", score);
127 result = pcmk__itoa(score);
142 int result = score1 + score2;
149 crm_trace(
"-INFINITY + -INFINITY = -INFINITY");
151 crm_trace(
"-INFINITY + +INFINITY = -INFINITY");
153 crm_trace(
"-INFINITY + %d = -INFINITY", score2);
161 crm_trace(
"+INFINITY + -INFINITY = -INFINITY");
163 crm_trace(
"%d + -INFINITY = -INFINITY", score1);
171 crm_trace(
"+INFINITY + +INFINITY = +INFINITY");
173 crm_trace(
"+INFINITY + %d = +INFINITY", score2);
179 crm_trace(
"%d + +INFINITY = +INFINITY", score1);
190 crm_trace(
"%d + %d = +INFINITY", score1, score2);
194 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
char * score2char(int score)
Return the string equivalent of an integer score.
bool pcmk_str_is_infinity(const char *s)
pcmk__action_result_t result
bool pcmk_str_is_minus_infinity(const char *s)
#define PCMK__VALUE_YELLOW
char * score2char_stack(int score, char *buf, size_t len)
Convert an integer score to a string, using a provided buffer.