}
static void domain_state_submit_notif(virDomainPtr dom, int state, int reason) {
- if ((state < 0) || (state >= STATIC_ARRAY_SIZE(domain_states))) {
+ if ((state < 0) || ((size_t)state >= STATIC_ARRAY_SIZE(domain_states))) {
ERROR(PLUGIN_NAME ": Array index out of bounds: state=%d", state);
return;
}
char msg[DATA_MAX_NAME_LEN];
const char *state_str = domain_states[state];
#ifdef HAVE_DOM_REASON
- if ((reason < 0) || (reason >= STATIC_ARRAY_SIZE(domain_reasons[0]))) {
+ if ((reason < 0) || ((size_t)reason >= STATIC_ARRAY_SIZE(domain_reasons[0]))) {
ERROR(PLUGIN_NAME ": Array index out of bounds: reason=%d", reason);
return;
}
#define NM_ADD_STR_ITEMS(_items, _size) \
do { \
- for (int _i = 0; _i < _size; ++_i) { \
+ for (size_t _i = 0; _i < _size; ++_i) { \
DEBUG(PLUGIN_NAME \
" plugin: Adding notification metadata name=%s value=%s", \
_items[_i].name, _items[_i].value); \
{.name = "name", .value = fs_info->name},
{.name = "fstype", .value = fs_info->fstype}};
- for (int i = 0; i < fs_info->ndevAlias; ++i) {
+ for (size_t i = 0; i < fs_info->ndevAlias; ++i) {
fs_dev_alias[i].name = "devAlias";
fs_dev_alias[i].value = fs_info->devAlias[i];
}