From f6c49b88178780e0b351dd79ebc8a720506ef3df Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Wed, 9 Jul 2025 13:19:11 -0400 Subject: [PATCH] MT#62181 update FactoryCreate prototype Makes a type cast unnecessary Change-Id: I8df7d5e4657a094a4d0933c8add6d39a0d4e882a --- core/AmApi.h | 2 +- core/AmPlugIn.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/AmApi.h b/core/AmApi.h index 91991eda..6e205201 100644 --- a/core/AmApi.h +++ b/core/AmApi.h @@ -238,7 +238,7 @@ class AmLoggingFacility : public AmPluginFactory } #endif -typedef void* (*FactoryCreate)(); +typedef AmPluginFactory* (*FactoryCreate)(); #define STR(x) #x #define XSTR(x) STR(x) diff --git a/core/AmPlugIn.cpp b/core/AmPlugIn.cpp index 83de306c..50e7ac64 100644 --- a/core/AmPlugIn.cpp +++ b/core/AmPlugIn.cpp @@ -314,28 +314,28 @@ int AmPlugIn::loadPlugIn(const string& file, const string& plugin_name, } if ((fc = (FactoryCreate) dlsym(*h_dl, FACTORY_SESSION_EXPORT_STR)) != NULL) { - plugin = (AmPluginFactory*)fc(); + plugin = fc(); if(loadAppPlugIn(plugin)) goto error; has_sym=true; if (NULL != plugin) plugins.push_back(plugin); } if ((fc = (FactoryCreate) dlsym(*h_dl, FACTORY_SESSION_EVENT_HANDLER_EXPORT_STR)) != NULL) { - plugin = (AmPluginFactory*)fc(); + plugin = fc(); if(loadSehPlugIn(plugin)) goto error; has_sym=true; if (NULL != plugin) plugins.push_back(plugin); } if ((fc = (FactoryCreate) dlsym(*h_dl, FACTORY_PLUGIN_EXPORT_STR)) != NULL) { - plugin = (AmPluginFactory*)fc(); + plugin = fc(); if(loadBasePlugIn(plugin)) goto error; has_sym=true; if (NULL != plugin) plugins.push_back(plugin); } if ((fc = (FactoryCreate) dlsym(*h_dl, FACTORY_PLUGIN_CLASS_EXPORT_STR)) != NULL) { - plugin = (AmPluginFactory*)fc(); + plugin = fc(); if(loadDiPlugIn(plugin)) goto error; has_sym=true; @@ -343,7 +343,7 @@ int AmPlugIn::loadPlugIn(const string& file, const string& plugin_name, } if ((fc = (FactoryCreate) dlsym(*h_dl, FACTORY_LOG_FACILITY_EXPORT_STR)) != NULL) { - plugin = (AmPluginFactory*)fc(); + plugin = fc(); if(loadLogFacPlugIn(plugin)) goto error; has_sym=true;