diff --git a/reactos/tools/rbuild/backend/mingw/mingw.cpp b/reactos/tools/rbuild/backend/mingw/mingw.cpp index 423c4f6066e..1edd292fa28 100644 --- a/reactos/tools/rbuild/backend/mingw/mingw.cpp +++ b/reactos/tools/rbuild/backend/mingw/mingw.cpp @@ -92,7 +92,7 @@ MingwBackend::ProcessModule ( Module& module ) { MingwModuleHandler* h = MingwModuleHandler::LookupHandler ( module.node.location, - module.stype ); + module.type ); h->Process ( module ); } diff --git a/reactos/tools/rbuild/backend/mingw/modulehandler.cpp b/reactos/tools/rbuild/backend/mingw/modulehandler.cpp index bf89db3a837..e3374174f5c 100644 --- a/reactos/tools/rbuild/backend/mingw/modulehandler.cpp +++ b/reactos/tools/rbuild/backend/mingw/modulehandler.cpp @@ -10,18 +10,16 @@ using std::string; using std::vector; using std::map; -map* +map* MingwModuleHandler::handler_map = NULL; FILE* MingwModuleHandler::fMakefile = NULL; -MingwModuleHandler::MingwModuleHandler ( const char* moduletype_ ) +MingwModuleHandler::MingwModuleHandler ( ModuleType moduletype ) { - string moduletype ( moduletype_ ); - strlwr ( &moduletype[0] ); if ( !handler_map ) - handler_map = new map; + handler_map = new map; (*handler_map)[moduletype] = this; } @@ -33,10 +31,8 @@ MingwModuleHandler::SetMakefile ( FILE* f ) /*static*/ MingwModuleHandler* MingwModuleHandler::LookupHandler ( const string& location, - const string& moduletype_ ) + ModuleType moduletype ) { - string moduletype ( moduletype_ ); - strlwr ( &moduletype[0] ); if ( !handler_map ) throw Exception ( "internal tool error: no registered module handlers" ); MingwModuleHandler* h = (*handler_map)[moduletype]; @@ -386,7 +382,7 @@ MingwModuleHandler::GenerateInvocations ( const Module& module ) const { const Invoke& invoke = *module.invocations[i]; - if ( invoke.invokeModule->etype != BuildTool ) + if ( invoke.invokeModule->type != BuildTool ) throw InvalidBuildFileException ( module.node.location, "Only modules of type buildtool can be invoked." ); @@ -446,7 +442,7 @@ MingwModuleHandler::GeneratePreconditionDependencies ( const Module& module ) co static MingwBuildToolModuleHandler buildtool_handler; MingwBuildToolModuleHandler::MingwBuildToolModuleHandler() - : MingwModuleHandler ( "buildtool" ) + : MingwModuleHandler ( BuildTool ) { } @@ -477,7 +473,7 @@ MingwBuildToolModuleHandler::GenerateBuildToolModuleTarget ( const Module& modul static MingwKernelModuleHandler kernelmodule_handler; MingwKernelModuleHandler::MingwKernelModuleHandler () - : MingwModuleHandler ( "kernelmodedll" ) + : MingwModuleHandler ( KernelModeDLL ) { } @@ -539,7 +535,7 @@ MingwKernelModuleHandler::GenerateKernelModuleTarget ( const Module& module ) static MingwStaticLibraryModuleHandler staticlibrary_handler; MingwStaticLibraryModuleHandler::MingwStaticLibraryModuleHandler () - : MingwModuleHandler ( "staticlibrary" ) + : MingwModuleHandler ( StaticLibrary ) { } diff --git a/reactos/tools/rbuild/backend/mingw/modulehandler.h b/reactos/tools/rbuild/backend/mingw/modulehandler.h index bd4839875cd..36f5a552a72 100644 --- a/reactos/tools/rbuild/backend/mingw/modulehandler.h +++ b/reactos/tools/rbuild/backend/mingw/modulehandler.h @@ -6,14 +6,14 @@ class MingwModuleHandler { public: - static std::map* handler_map; + static std::map* handler_map; - MingwModuleHandler ( const char* moduletype_ ); + MingwModuleHandler ( ModuleType moduletype ); virtual ~MingwModuleHandler() {} static void SetMakefile ( FILE* f ); static MingwModuleHandler* LookupHandler ( const std::string& location, - const std::string& moduletype_ ); + ModuleType moduletype_ ); virtual void Process ( const Module& module ) = 0; protected: diff --git a/reactos/tools/rbuild/exception.cpp b/reactos/tools/rbuild/exception.cpp index b897fdfc1a4..99df90e15da 100644 --- a/reactos/tools/rbuild/exception.cpp +++ b/reactos/tools/rbuild/exception.cpp @@ -130,9 +130,9 @@ UnknownBackendException::UnknownBackendException ( const string& name ) } UnknownModuleTypeException::UnknownModuleTypeException ( const string& location, - const string& moduletype ) + int moduletype ) : InvalidBuildFileException ( location, - "module type requested: '%s'", - moduletype.c_str() ) + "module type requested: %i", + moduletype ) { } diff --git a/reactos/tools/rbuild/exception.h b/reactos/tools/rbuild/exception.h index 8c434a73bf7..465d300b3df 100644 --- a/reactos/tools/rbuild/exception.h +++ b/reactos/tools/rbuild/exception.h @@ -98,7 +98,7 @@ class UnknownModuleTypeException : public InvalidBuildFileException { public: UnknownModuleTypeException ( const std::string& location, - const std::string& moduletype ); + int moduletype ); }; #endif /* __EXCEPTION_H */ diff --git a/reactos/tools/rbuild/module.cpp b/reactos/tools/rbuild/module.cpp index e8ea879fdb7..a569cdc896b 100644 --- a/reactos/tools/rbuild/module.cpp +++ b/reactos/tools/rbuild/module.cpp @@ -38,9 +38,7 @@ Module::Module ( const Project& project, att = moduleNode.GetAttribute ( "type", true ); assert(att); - stype = att->value; - strlwr ( &stype[0] ); - etype = GetModuleType ( node.location, *att ); + type = GetModuleType ( node.location, *att ); att = moduleNode.GetAttribute ( "extension", false ); if (att != NULL) @@ -154,7 +152,7 @@ Module::GetModuleType ( const string& location, const XMLAttribute& attribute ) string Module::GetDefaultModuleExtension () const { - switch (etype) + switch (type) { case BuildTool: return EXEPOSTFIX; diff --git a/reactos/tools/rbuild/rbuild.h b/reactos/tools/rbuild/rbuild.h index 7124552d2c5..1407a84a43f 100644 --- a/reactos/tools/rbuild/rbuild.h +++ b/reactos/tools/rbuild/rbuild.h @@ -71,8 +71,7 @@ public: std::string name; std::string extension; std::string path; - ModuleType etype; - std::string stype; + ModuleType type; std::vector files; std::vector libraries; std::vector includes;