diff options
author | Daniel Pfeifer <daniel@pfeifer-mail.de> | 2017-08-23 07:41:23 (GMT) |
---|---|---|
committer | Daniel Pfeifer <daniel@pfeifer-mail.de> | 2017-08-27 07:58:46 (GMT) |
commit | 190e3825d44d4f846d37e1ec7372f5829a5b6b3e (patch) | |
tree | 85605643bc6fcdcb455d5fe58469a08874ef8673 /Source/cmLoadCommandCommand.cxx | |
parent | 2ade9a0264b7c8d4e97d9d820e8c1531f3d1a43c (diff) | |
download | CMake-190e3825d44d4f846d37e1ec7372f5829a5b6b3e.zip CMake-190e3825d44d4f846d37e1ec7372f5829a5b6b3e.tar.gz CMake-190e3825d44d4f846d37e1ec7372f5829a5b6b3e.tar.bz2 |
Replace C-style casts
Diffstat (limited to 'Source/cmLoadCommandCommand.cxx')
-rw-r--r-- | Source/cmLoadCommandCommand.cxx | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/Source/cmLoadCommandCommand.cxx b/Source/cmLoadCommandCommand.cxx index f533c97..5ce48e3 100644 --- a/Source/cmLoadCommandCommand.cxx +++ b/Source/cmLoadCommandCommand.cxx @@ -120,15 +120,14 @@ bool cmLoadedCommand::InitialPass(std::vector<std::string> const& args, int argc = static_cast<int>(args.size()); char** argv = nullptr; if (argc) { - argv = (char**)malloc(argc * sizeof(char*)); + argv = reinterpret_cast<char**>(malloc(argc * sizeof(char*))); } int i; for (i = 0; i < argc; ++i) { argv[i] = strdup(args[i].c_str()); } cmLoadedCommand::InstallSignalHandlers(info.Name); - int result = - info.InitialPass((void*)&info, (void*)this->Makefile, argc, argv); + int result = info.InitialPass(&info, this->Makefile, argc, argv); cmLoadedCommand::InstallSignalHandlers(info.Name, 1); cmFreeArguments(argc, argv); @@ -147,7 +146,7 @@ void cmLoadedCommand::FinalPass() { if (this->info.FinalPass) { cmLoadedCommand::InstallSignalHandlers(info.Name); - this->info.FinalPass((void*)&this->info, (void*)this->Makefile); + this->info.FinalPass(&this->info, this->Makefile); cmLoadedCommand::InstallSignalHandlers(info.Name, 1); } } @@ -156,7 +155,7 @@ cmLoadedCommand::~cmLoadedCommand() { if (this->info.Destructor) { cmLoadedCommand::InstallSignalHandlers(info.Name); - this->info.Destructor((void*)&this->info); + this->info.Destructor(&this->info); cmLoadedCommand::InstallSignalHandlers(info.Name, 1); } if (this->info.Error) { @@ -225,14 +224,13 @@ bool cmLoadCommandCommand::InitialPass(std::vector<std::string> const& args, // find the init function std::string initFuncName = args[0] + "Init"; - CM_INIT_FUNCTION initFunction = - (CM_INIT_FUNCTION)cmsys::DynamicLoader::GetSymbolAddress(lib, - initFuncName); + CM_INIT_FUNCTION initFunction = reinterpret_cast<CM_INIT_FUNCTION>( + cmsys::DynamicLoader::GetSymbolAddress(lib, initFuncName)); if (!initFunction) { initFuncName = "_"; initFuncName += args[0]; initFuncName += "Init"; - initFunction = (CM_INIT_FUNCTION)( + initFunction = reinterpret_cast<CM_INIT_FUNCTION>( cmsys::DynamicLoader::GetSymbolAddress(lib, initFuncName)); } // if the symbol is found call it to set the name on the |