diff --git a/src/MakeXplat/main.cpp b/src/MakeXplat/main.cpp index c2000101..f0bdddd4 100644 --- a/src/MakeXplat/main.cpp +++ b/src/MakeXplat/main.cpp @@ -187,7 +187,7 @@ int ParseAndRun(std::map& commands, State& state, int argc auto option = command->second.Options.find(argv[index]); while (option != command->second.Options.end()) { - char* parameter = ""; + char const *parameter = ""; if (option->second.TakesParameter) { if (++index == argc) { break; } @@ -208,6 +208,7 @@ int ParseAndRun(std::map& commands, State& state, int argc switch (state.specified) { + case UserSpecified::Help: case UserSpecified::Nothing: return Help(argv[0], commands, state); case UserSpecified::Pack: diff --git a/src/inc/XmlObject.hpp b/src/inc/XmlObject.hpp index ac1e6167..b67a7c04 100644 --- a/src/inc/XmlObject.hpp +++ b/src/inc/XmlObject.hpp @@ -16,16 +16,16 @@ namespace xPlat { { public: // TODO: Implement actual XML validation.... - XmlObject(std::shared_ptr& stream) : m_stream(stream) {} + XmlObject(std::shared_ptr stream) : m_stream(stream) {} // StreamBase interface is largely pass through. // XML de-serialization happens during construction, of this object. // XML serialization happens through - virtual void Write(std::size_t size, const std::uint8_t* bytes) { throw Exception(Error::NotSupported); } - virtual std::size_t Read(std::size_t size, const std::uint8_t* bytes) { return m_stream->Read(size, bytes); } - virtual void Seek(std::uint64_t offset, Reference where) { m_stream->Seek(offset,where); } - virtual int Ferror() { return m_stream->Ferror(); } - virtual bool Feof() { return m_stream->Feof(); } + virtual void Write(std::size_t size, const std::uint8_t* bytes) { throw Exception(Error::NotSupported); } + virtual std::size_t Read(std::size_t size, const std::uint8_t* bytes) { return m_stream->Read(size, bytes); } + virtual void Seek(std::uint64_t offset, Reference where) { m_stream->Seek(offset,where); } + virtual int Ferror() { return m_stream->Ferror(); } + virtual bool Feof() { return m_stream->Feof(); } virtual std::uint64_t Ftell() { return m_stream->Ftell(); } // Returns a shared pointer to the DOMDocument representing the contents of this stream diff --git a/src/xPlatAppx/AppxPackageObject.cpp b/src/xPlatAppx/AppxPackageObject.cpp index a7c5cf7b..60488940 100644 --- a/src/xPlatAppx/AppxPackageObject.cpp +++ b/src/xPlatAppx/AppxPackageObject.cpp @@ -55,24 +55,24 @@ namespace xPlat { // 1. Get the appx signature from the container and parse it // TODO: pass validation flags and other necessary goodness through. m_appxSignature = std::make_unique(m_container->GetFile(APPXSIGNATURE_P7X)); - ThrowErrorIfNot(Error::AppxMissingSignatureP7X, (m_appxSignature != nullptr), "AppxSignature.p7x not in archive!"); + ThrowErrorIf(Error::AppxMissingSignatureP7X, (m_appxSignature == nullptr), "AppxSignature.p7x not in archive!"); // 2. Get content type using signature object for validation // TODO: switch underlying type of m_contentType to something more specific. m_contentType = std::make_unique(m_appxSignature->GetValidationStream( CONTENT_TYPES_XML, m_container->GetFile(CONTENT_TYPES_XML))); - ThrowErrorIfNot(Error::AppxMissingContentTypesXML, (m_contentType != nullptr), "[Content_Types].xml not in archive!"); + ThrowErrorIf(Error::AppxMissingContentTypesXML, (m_contentType == nullptr), "[Content_Types].xml not in archive!"); // 3. Get blockmap object using signature object for validation m_appxBlockMap = std::make_unique(m_appxSignature->GetValidationStream( APPXBLOCKMAP_XML, m_container->GetFile(APPXBLOCKMAP_XML))); - ThrowErrorIfNot(Error::AppxMissingBlockMapXML, (m_appxBlockMap != nullptr), "AppxBlockMap.xml not in archive!"); + ThrowErrorIf(Error::AppxMissingBlockMapXML, (m_appxBlockMap == nullptr), "AppxBlockMap.xml not in archive!"); // 4. Get manifest object using blockmap object for validation // TODO: pass validation flags and other necessary goodness through. m_appxManifest = std::make_unique(m_appxBlockMap->ValidationStream( APPXMANIFEST_XML, m_container->GetFile(APPXMANIFEST_XML))); - ThrowErrorIfNot(Error::AppxMissingAppxManifestXML, (m_appxBlockMap != nullptr), "AppxManifest.xml not in archive!"); + ThrowErrorIf(Error::AppxMissingAppxManifestXML, (m_appxBlockMap == nullptr), "AppxManifest.xml not in archive!"); std::map footPrintFileNames = { { APPXBLOCKMAP_XML, false },