| 649 | } |
| 650 | |
| 651 | static void |
| 652 | calculate_system_health(gpointer gKey, gpointer gValue, gpointer user_data) |
| 653 | { |
| 654 | const char *key = (const char *)gKey; |
| 655 | const char *value = (const char *)gValue; |
| 656 | int *system_health = (int *)user_data; |
| 657 | |
| 658 | if (!gKey || !gValue || !user_data) { |
| 659 | return; |
| 660 | } |
| 661 | |
| 662 | /* Does it start with #health? */ |
| 663 | if (0 == strncmp(key, "#health", 7)) { |
| 664 | int score; |
| 665 | |
| 666 | /* Convert the value into an integer */ |
| 667 | score = char2score(value); |
| 668 | |
| 669 | /* Add it to the running total */ |
| 670 | *system_health = merge_weights(score, *system_health); |
| 671 | } |
| 672 | } |
| 673 | |
| 674 | static gboolean |
| 675 | apply_system_health(pe_working_set_t * data_set) |
nothing calls this directly
no test coverage detected