@@ -111,7 +111,7 @@ static void *hplugin_import_symbol(char *name, unsigned int pID)
111111 if (i != VECTOR_LENGTH (HPM -> symbols ))
112112 return VECTOR_INDEX (HPM -> symbols , i )-> ptr ;
113113
114- ShowError ("HPM:get_symbol:%s: '" CL_WHITE "%s" CL_RESET "' not found!\n" ,HPM -> pid2name (pID ),name );
114+ ShowError ("HPM:get_symbol:%s: '" CL_WHITE "%s" CL_RESET "' not found!\n" ,HPM -> pid2name (pID ),name );
115115 return NULL ;
116116}
117117
@@ -243,11 +243,11 @@ static bool hplugin_data_store_validate(enum HPluginDataTypes type, struct hplug
243243 case HPDT_UNIT_PARAMETER :
244244 default :
245245 if (HPM -> data_store_validate_sub == NULL ) {
246- ShowError ("HPM:validateHPData failed, type %u needs sub-handler!\n" , type );
246+ ShowError ("HPM:validateHPData failed, type %u needs sub-handler!\n" , ( unsigned int ) type );
247247 return false;
248248 }
249249 if (!HPM -> data_store_validate_sub (type , storeptr , initialize )) {
250- ShowError ("HPM:HPM:validateHPData failed, unknown type %u!\n" , type );
250+ ShowError ("HPM:HPM:validateHPData failed, unknown type %u!\n" , ( unsigned int ) type );
251251 return false;
252252 }
253253 break ;
@@ -257,7 +257,7 @@ static bool hplugin_data_store_validate(enum HPluginDataTypes type, struct hplug
257257 store = * storeptr ;
258258 }
259259 if (store -> type != type ) {
260- ShowError ("HPM:HPM:validateHPData failed, store type mismatch %u != %u.\n" , store -> type , type );
260+ ShowError ("HPM:HPM:validateHPData failed, store type mismatch %u != %u.\n" , ( unsigned int ) store -> type , ( unsigned int ) type );
261261 return false;
262262 }
263263 return true;
@@ -282,7 +282,7 @@ static void hplugins_addToHPData(enum HPluginDataTypes type, uint32 pluginID, st
282282
283283 if (!HPM -> data_store_validate (type , storeptr , true)) {
284284 /* woo it failed! */
285- ShowError ("HPM:addToHPData:%s: failed, type %u (%u|%u)\n" , HPM -> pid2name (pluginID ), type , pluginID , classid );
285+ ShowError ("HPM:addToHPData:%s: failed, type %u (%u|%u)\n" , HPM -> pid2name (pluginID ), ( unsigned int ) type , pluginID , classid );
286286 return ;
287287 }
288288 store = * storeptr ;
@@ -324,7 +324,7 @@ static void *hplugins_getFromHPData(enum HPluginDataTypes type, uint32 pluginID,
324324
325325 if (!HPM -> data_store_validate (type , & store , false)) {
326326 /* woo it failed! */
327- ShowError ("HPM:getFromHPData:%s: failed, type %u (%u|%u)\n" , HPM -> pid2name (pluginID ), type , pluginID , classid );
327+ ShowError ("HPM:getFromHPData:%s: failed, type %u (%u|%u)\n" , HPM -> pid2name (pluginID ), ( unsigned int ) type , pluginID , classid );
328328 return NULL ;
329329 }
330330 if (!store )
@@ -352,7 +352,7 @@ static void hplugins_removeFromHPData(enum HPluginDataTypes type, uint32 pluginI
352352
353353 if (!HPM -> data_store_validate (type , & store , false)) {
354354 /* woo it failed! */
355- ShowError ("HPM:removeFromHPData:%s: failed, type %u (%u|%u)\n" , HPM -> pid2name (pluginID ), type , pluginID , classid );
355+ ShowError ("HPM:removeFromHPData:%s: failed, type %u (%u|%u)\n" , HPM -> pid2name (pluginID ), ( unsigned int ) type , pluginID , classid );
356356 return ;
357357 }
358358 if (!store )
@@ -451,7 +451,7 @@ static bool hplugins_addconf(unsigned int pluginID, enum HPluginConfType type, c
451451 }
452452
453453 if (type >= HPCT_MAX ) {
454- ShowError ("HPM->addConf:%s: unknown point '%u' specified for config '%s'\n" ,HPM -> pid2name (pluginID ),type ,name );
454+ ShowError ("HPM->addConf:%s: unknown point '%u' specified for config '%s'\n" , HPM -> pid2name (pluginID ), ( unsigned int ) type , name );
455455 return false;
456456 }
457457
@@ -494,20 +494,20 @@ static struct hplugin *hplugin_load(const char *filename)
494494 const char * (* HPMLoadEvent )(int server_type );
495495
496496 if ( HPM -> exists (filename ) ) {
497- ShowWarning ("HPM:plugin_load: attempting to load duplicate '" CL_WHITE "%s" CL_RESET "', skipping...\n" , filename );
497+ ShowWarning ("HPM:plugin_load: attempting to load duplicate '" CL_WHITE "%s" CL_RESET "', skipping...\n" , filename );
498498 return NULL ;
499499 }
500500
501501 plugin = HPM -> create ();
502502
503503 if (!(plugin -> dll = plugin_open (filename ))) {
504504 char buf [1024 ];
505- ShowFatalError ("HPM:plugin_load: failed to load '" CL_WHITE "%s" CL_RESET "' (error: %s)!\n" , filename , plugin_geterror (buf ));
505+ ShowFatalError ("HPM:plugin_load: failed to load '" CL_WHITE "%s" CL_RESET "' (error: %s)!\n" , filename , plugin_geterror (buf ));
506506 exit (EXIT_FAILURE );
507507 }
508508
509509 if ( !( info = plugin_import (plugin -> dll , "pinfo" ,struct hplugin_info * ) ) ) {
510- ShowFatalError ("HPM:plugin_load: failed to retrieve 'plugin_info' for '" CL_WHITE "%s" CL_RESET "'!\n" , filename );
510+ ShowFatalError ("HPM:plugin_load: failed to retrieve 'plugin_info' for '" CL_WHITE "%s" CL_RESET "'!\n" , filename );
511511 exit (EXIT_FAILURE );
512512 }
513513
@@ -517,27 +517,27 @@ static struct hplugin *hplugin_load(const char *filename)
517517 }
518518
519519 if ( !HPM -> iscompatible (info -> req_version ) ) {
520- ShowFatalError ("HPM:plugin_load: '" CL_WHITE "%s" CL_RESET "' incompatible version '%s' -> '%s'!\n" , filename , info -> req_version , HPM_VERSION );
520+ ShowFatalError ("HPM:plugin_load: '" CL_WHITE "%s" CL_RESET "' incompatible version '%s' -> '%s'!\n" , filename , info -> req_version , HPM_VERSION );
521521 exit (EXIT_FAILURE );
522522 }
523523
524524 plugin -> info = info ;
525525 plugin -> filename = aStrdup (filename );
526526
527527 if ((import_symbol_ref = plugin_import (plugin -> dll , "import_symbol" , ImportSymbolFunc * * )) == NULL ) {
528- ShowFatalError ("HPM:plugin_load: failed to retrieve 'import_symbol' for '" CL_WHITE "%s" CL_RESET "'!\n" , filename );
528+ ShowFatalError ("HPM:plugin_load: failed to retrieve 'import_symbol' for '" CL_WHITE "%s" CL_RESET "'!\n" , filename );
529529 exit (EXIT_FAILURE );
530530 }
531531
532532 * import_symbol_ref = HPM -> import_symbol ;
533533
534534 if ( !( HPMi = plugin_import (plugin -> dll , "HPMi" ,struct HPMi_interface * * ) ) ) {
535- ShowFatalError ("HPM:plugin_load: failed to retrieve 'HPMi' for '" CL_WHITE "%s" CL_RESET "'!\n" , filename );
535+ ShowFatalError ("HPM:plugin_load: failed to retrieve 'HPMi' for '" CL_WHITE "%s" CL_RESET "'!\n" , filename );
536536 exit (EXIT_FAILURE );
537537 }
538538
539539 if ( !( * HPMi = plugin_import (plugin -> dll , "HPMi_s" ,struct HPMi_interface * ) ) ) {
540- ShowFatalError ("HPM:plugin_load: failed to retrieve 'HPMi_s' for '" CL_WHITE "%s" CL_RESET "'!\n" , filename );
540+ ShowFatalError ("HPM:plugin_load: failed to retrieve 'HPMi_s' for '" CL_WHITE "%s" CL_RESET "'!\n" , filename );
541541 exit (EXIT_FAILURE );
542542 }
543543 plugin -> hpi = * HPMi ;
@@ -558,40 +558,40 @@ static struct hplugin *hplugin_load(const char *filename)
558558 anyEvent = true;
559559
560560 if ( !anyEvent ) {
561- ShowWarning ("HPM:plugin_load: no events found for '" CL_WHITE "%s" CL_RESET "'!\n" , filename );
561+ ShowWarning ("HPM:plugin_load: no events found for '" CL_WHITE "%s" CL_RESET "'!\n" , filename );
562562 exit (EXIT_FAILURE );
563563 }
564564
565565 if (!(HPMLoadEvent = plugin_import (plugin -> dll , "HPM_shared_symbols" , const char * (* )(int )))) {
566- ShowFatalError ("HPM:plugin_load: failed to retrieve 'HPM_shared_symbols' for '" CL_WHITE "%s" CL_RESET "', most likely not including HPMDataCheck.h!\n" , filename );
566+ ShowFatalError ("HPM:plugin_load: failed to retrieve 'HPM_shared_symbols' for '" CL_WHITE "%s" CL_RESET "', most likely not including HPMDataCheck.h!\n" , filename );
567567 exit (EXIT_FAILURE );
568568 }
569569 {
570570 const char * failure = HPMLoadEvent (SERVER_TYPE );
571571 if (failure ) {
572- ShowFatalError ("HPM:plugin_load: failed to import symbol '%s' into '" CL_WHITE "%s" CL_RESET "'.\n" , failure , filename );
572+ ShowFatalError ("HPM:plugin_load: failed to import symbol '%s' into '" CL_WHITE "%s" CL_RESET "'.\n" , failure , filename );
573573 exit (EXIT_FAILURE );
574574 }
575575 }
576576
577577 if ( !( HPMDataCheckLen = plugin_import (plugin -> dll , "HPMDataCheckLen" , unsigned int * ) ) ) {
578- ShowFatalError ("HPM:plugin_load: failed to retrieve 'HPMDataCheckLen' for '" CL_WHITE "%s" CL_RESET "', most likely not including HPMDataCheck.h!\n" , filename );
578+ ShowFatalError ("HPM:plugin_load: failed to retrieve 'HPMDataCheckLen' for '" CL_WHITE "%s" CL_RESET "', most likely not including HPMDataCheck.h!\n" , filename );
579579 exit (EXIT_FAILURE );
580580 }
581581
582582 if ( !( HPMDataCheckVer = plugin_import (plugin -> dll , "HPMDataCheckVer" , int * ) ) ) {
583- ShowFatalError ("HPM:plugin_load: failed to retrieve 'HPMDataCheckVer' for '" CL_WHITE "%s" CL_RESET "', most likely an outdated plugin!\n" , filename );
583+ ShowFatalError ("HPM:plugin_load: failed to retrieve 'HPMDataCheckVer' for '" CL_WHITE "%s" CL_RESET "', most likely an outdated plugin!\n" , filename );
584584 exit (EXIT_FAILURE );
585585 }
586586
587587 if ( !( HPMDataCheck = plugin_import (plugin -> dll , "HPMDataCheck" , struct s_HPMDataCheck * ) ) ) {
588- ShowFatalError ("HPM:plugin_load: failed to retrieve 'HPMDataCheck' for '" CL_WHITE "%s" CL_RESET "', most likely not including HPMDataCheck.h!\n" , filename );
588+ ShowFatalError ("HPM:plugin_load: failed to retrieve 'HPMDataCheck' for '" CL_WHITE "%s" CL_RESET "', most likely not including HPMDataCheck.h!\n" , filename );
589589 exit (EXIT_FAILURE );
590590 }
591591
592592 // TODO: Remove the HPM->DataCheck != NULL check once login and char support is complete
593593 if (HPM -> DataCheck != NULL && !HPM -> DataCheck (HPMDataCheck ,* HPMDataCheckLen ,* HPMDataCheckVer ,plugin -> info -> name )) {
594- ShowFatalError ("HPM:plugin_load: '" CL_WHITE "%s" CL_RESET "' failed DataCheck, out of sync from the core (recompile plugin)!\n" , filename );
594+ ShowFatalError ("HPM:plugin_load: '" CL_WHITE "%s" CL_RESET "' failed DataCheck, out of sync from the core (recompile plugin)!\n" , filename );
595595 exit (EXIT_FAILURE );
596596 }
597597
@@ -617,7 +617,7 @@ static struct hplugin *hplugin_load(const char *filename)
617617 if ( HPM -> load_sub )
618618 HPM -> load_sub (plugin );
619619
620- ShowStatus ("HPM: Loaded plugin '" CL_WHITE "%s" CL_RESET "' (%s)%s.\n" ,
620+ ShowStatus ("HPM: Loaded plugin '" CL_WHITE "%s" CL_RESET "' (%s)%s.\n" ,
621621 plugin -> info -> name , plugin -> info -> version ,
622622 plugin -> hpi -> hooking != NULL ? " built with HPMHooking support" : "" );
623623
@@ -725,7 +725,7 @@ static void hplugins_config_read(void)
725725 && (addhook_sub = plugin_import (plugin -> dll , "HPM_Plugin_AddHook" ,bool (* )(enum HPluginHookType , const char * , void * , unsigned int ))) != NULL ) {
726726 const char * failed = func (& HPM -> hooking -> force_return );
727727 if (failed ) {
728- ShowError ("HPM: failed to retrieve '%s' for '" CL_WHITE "%s" CL_RESET "'!\n" , failed , plugin_name );
728+ ShowError ("HPM: failed to retrieve '%s' for '" CL_WHITE "%s" CL_RESET "'!\n" , failed , plugin_name );
729729 } else {
730730 HPM -> hooking -> enabled = true;
731731 HPM -> hooking -> addhook_sub = addhook_sub ;
@@ -747,7 +747,7 @@ static void hplugins_config_read(void)
747747 aFree (base_path );
748748
749749 if (VECTOR_LENGTH (HPM -> plugins ))
750- ShowStatus ("HPM: There are '" CL_WHITE "%d" CL_RESET "' plugins loaded, type '" CL_WHITE "plugins" CL_RESET "' to list them\n" , VECTOR_LENGTH (HPM -> plugins ));
750+ ShowStatus ("HPM: There are '" CL_WHITE "%d" CL_RESET "' plugins loaded, type '" CL_WHITE "plugins" CL_RESET "' to list them\n" , VECTOR_LENGTH (HPM -> plugins ));
751751}
752752
753753/**
@@ -766,11 +766,11 @@ static CPCMD(plugins)
766766 return ;
767767 }
768768
769- ShowInfo ("HPC: There are '" CL_WHITE "%d" CL_RESET "' plugins loaded\n" , VECTOR_LENGTH (HPM -> plugins ));
769+ ShowInfo ("HPC: There are '" CL_WHITE "%d" CL_RESET "' plugins loaded\n" , VECTOR_LENGTH (HPM -> plugins ));
770770
771771 for (i = 0 ; i < VECTOR_LENGTH (HPM -> plugins ); i ++ ) {
772772 struct hplugin * plugin = VECTOR_INDEX (HPM -> plugins , i );
773- ShowInfo ("HPC: - '" CL_WHITE "%s" CL_RESET "' (%s)\n" , plugin -> info -> name , plugin -> filename );
773+ ShowInfo ("HPC: - '" CL_WHITE "%s" CL_RESET "' (%s)\n" , plugin -> info -> name , plugin -> filename );
774774 }
775775}
776776
@@ -815,7 +815,7 @@ static unsigned char hplugins_parse_packets(int fd, int packet_id, enum HPluginP
815815 * @retval "core" if the plugin ID belongs to the Hercules core.
816816 * @retval "UnknownPlugin" if the plugin wasn't found.
817817 */
818- static char * hplugins_id2name (unsigned int pid )
818+ static const char * hplugins_id2name (unsigned int pid )
819819{
820820 int i ;
821821
@@ -852,7 +852,7 @@ static const char *HPM_file2ptr(const char *file)
852852 }
853853
854854 /* we handle this memory outside of the server's memory manager because we need it to exist after the memory manager goes down */
855- HPM -> filenames .data = realloc (HPM -> filenames .data , (++ HPM -> filenames .count )* sizeof (struct HPMFileNameCache ));
855+ HPM -> filenames .data = ( struct HPMFileNameCache * ) realloc (HPM -> filenames .data , (++ HPM -> filenames .count )* sizeof (struct HPMFileNameCache ));
856856
857857 HPM -> filenames .data [i ].addr = file ;
858858 HPM -> filenames .data [i ].name = strdup (file );
0 commit comments