diff options
Diffstat (limited to 'src/common/HPM.c')
-rw-r--r-- | src/common/HPM.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/common/HPM.c b/src/common/HPM.c index 62ef54499..fa4025fb8 100644 --- a/src/common/HPM.c +++ b/src/common/HPM.c @@ -214,11 +214,11 @@ bool hplugin_data_store_validate(enum HPluginDataTypes type, struct hplugin_data break; default: if (HPM->data_store_validate_sub == NULL) { - ShowError("HPM:validateHPData failed, type %d needs sub-handler!\n",type); + ShowError("HPM:validateHPData failed, type %u needs sub-handler!\n", type); return false; } if (!HPM->data_store_validate_sub(type, storeptr, initialize)) { - ShowError("HPM:HPM:validateHPData failed, unknown type %d!\n",type); + ShowError("HPM:HPM:validateHPData failed, unknown type %u!\n", type); return false; } break; @@ -228,7 +228,7 @@ bool hplugin_data_store_validate(enum HPluginDataTypes type, struct hplugin_data store = *storeptr; } if (store->type != type) { - ShowError("HPM:HPM:validateHPData failed, store type mismatch %d != %d.\n",store->type, type); + ShowError("HPM:HPM:validateHPData failed, store type mismatch %u != %u.\n", store->type, type); return false; } return true; @@ -253,7 +253,7 @@ void hplugins_addToHPData(enum HPluginDataTypes type, uint32 pluginID, struct hp if (!HPM->data_store_validate(type, storeptr, true)) { /* woo it failed! */ - ShowError("HPM:addToHPData:%s: failed, type %d (%u|%u)\n", HPM->pid2name(pluginID), type, pluginID, classid); + ShowError("HPM:addToHPData:%s: failed, type %u (%u|%u)\n", HPM->pid2name(pluginID), type, pluginID, classid); return; } store = *storeptr; @@ -294,7 +294,7 @@ void *hplugins_getFromHPData(enum HPluginDataTypes type, uint32 pluginID, struct if (!HPM->data_store_validate(type, &store, false)) { /* woo it failed! */ - ShowError("HPM:getFromHPData:%s: failed, type %d (%u|%u)\n", HPM->pid2name(pluginID), type, pluginID, classid); + ShowError("HPM:getFromHPData:%s: failed, type %u (%u|%u)\n", HPM->pid2name(pluginID), type, pluginID, classid); return NULL; } if (!store) @@ -322,7 +322,7 @@ void hplugins_removeFromHPData(enum HPluginDataTypes type, uint32 pluginID, stru if (!HPM->data_store_validate(type, &store, false)) { /* woo it failed! */ - ShowError("HPM:removeFromHPData:%s: failed, type %d (%u|%u)\n", HPM->pid2name(pluginID), type, pluginID, classid); + ShowError("HPM:removeFromHPData:%s: failed, type %u (%u|%u)\n", HPM->pid2name(pluginID), type, pluginID, classid); return; } if (!store) @@ -616,8 +616,8 @@ CMDLINEARG(loadplugin) * Reads the plugin configuration and loads the plugins as necessary. */ void hplugins_config_read(void) { - config_t plugins_conf; - config_setting_t *plist = NULL; + struct config_t plugins_conf; + struct config_setting_t *plist = NULL; const char *config_filename = "conf/plugins.conf"; // FIXME hardcoded name FILE *fp; int i; @@ -628,12 +628,12 @@ void hplugins_config_read(void) { fclose(fp); } - if (libconfig->read_file(&plugins_conf, config_filename)) + if (!libconfig->load_file(&plugins_conf, config_filename)) return; plist = libconfig->lookup(&plugins_conf, "plugins_list"); for (i = 0; i < VECTOR_LENGTH(HPM->cmdline_load_plugins); i++) { - config_setting_t *entry = libconfig->setting_add(plist, NULL, CONFIG_TYPE_STRING); + struct config_setting_t *entry = libconfig->setting_add(plist, NULL, CONFIG_TYPE_STRING); config_setting_set_string(entry, VECTOR_INDEX(HPM->cmdline_load_plugins, i)); } @@ -718,13 +718,13 @@ CPCMD(plugins) * @retval 1 OK * @retval 2 incomplete packet */ -unsigned char hplugins_parse_packets(int fd, enum HPluginPacketHookingPoints point) +unsigned char hplugins_parse_packets(int fd, int packet_id, enum HPluginPacketHookingPoints point) { struct HPluginPacket *packet = NULL; int i; int16 length; - ARR_FIND(0, VECTOR_LENGTH(HPM->packets[point]), i, VECTOR_INDEX(HPM->packets[point], i).cmd == RFIFOW(fd,0)); + ARR_FIND(0, VECTOR_LENGTH(HPM->packets[point]), i, VECTOR_INDEX(HPM->packets[point], i).cmd == packet_id); if (i == VECTOR_LENGTH(HPM->packets[point])) return 0; |