Browse Source

Fixed Archive Gem build on MacOS (#16161)

* Fixed Archive Gem build on MacOS

Signed-off-by: lumberyard-employee-dm <[email protected]>

* Adding the Archive Gem to the .CODEOWNERS file

Signed-off-by: lumberyard-employee-dm <[email protected]>

---------

Signed-off-by: lumberyard-employee-dm <[email protected]>
lumberyard-employee-dm 2 years ago
parent
commit
b39157b51c

+ 1 - 0
.github/CODEOWNERS

@@ -18,6 +18,7 @@
 /Code/Framework/AzGameFramework/ @o3de/sig-core-reviewers @o3de/sig-core-maintainers
 /Code/LauncherUnified/ @o3de/sig-core-reviewers @o3de/sig-core-maintainers
 /engine.json @o3de/sig-core-reviewers @o3de/sig-core-maintainers
+/Gems/Archive/ @o3de/sig-core-reviewers @o3de/sig-core-maintainers
 /Gems/Compression/ @o3de/sig-core-reviewers @o3de/sig-core-maintainers
 /Gems/CrashReporting/ @o3de/sig-core-reviewers @o3de/sig-core-maintainers
 /Gems/ImGui/ @o3de/sig-core-reviewers @o3de/sig-core-maintainers

+ 2 - 2
Gems/Archive/Code/Source/Clients/ArchiveReader.cpp

@@ -198,7 +198,7 @@ namespace Archive
 
         // Build a map of file path view to within the FilePathIndex array of the TOC View
         auto BuildViewOfFilePaths = [this, filePathBlobTable = &tocView.m_filePathBlob, filePathIndex = 0]
-        (AZ::u32 filePathBlobOffset, AZ::u16 filePathSize) mutable
+        (AZ::u64 filePathBlobOffset, AZ::u16 filePathSize) mutable
         {
             AZ::IO::PathView contentPathView(filePathBlobTable->substr(filePathBlobOffset, filePathSize));
             m_pathMap.emplace(contentPathView, filePathIndex++);
@@ -779,7 +779,7 @@ namespace Archive
         ResultOutcome fileResultOutcome;
         // Lambda is marked mutable to allow the filePathIndex variable to be incremented each call
         auto EnumerateAllFiles = [&listFileCallback, &fileResultOutcome, this, filePathIndex = 0]
-        (AZ::u32 filePathBlobOffset, AZ::u16 filePathSize) mutable
+        (AZ::u64 filePathBlobOffset, AZ::u16 filePathSize) mutable
             {
                 // Invoke callback on each file with a non-empty path
                 if (AZ::IO::PathView contentPathView(m_archiveToc.m_tocView.m_filePathBlob.substr(filePathBlobOffset, filePathSize));

+ 1 - 1
Gems/Archive/Code/Source/Clients/ArchiveTOCView.h

@@ -95,7 +95,7 @@ namespace Archive
     //! and the length of that file path
     //! @param filePathBlobOffset Offset into the raw archive TOC file path blob table where the deleted file path starts
     //! @param filePathSize length of the deleted file path. The value is guaranteed to be >0
-    using FilePathIndexEntryVisitor = AZStd::function<void(AZ::u32 filePathBlobOffset, AZ::u16 filePathSize)>;
+    using FilePathIndexEntryVisitor = AZStd::function<void(AZ::u64 filePathBlobOffset, AZ::u16 filePathSize)>;
 
     //! Enumerates each file path index found in the TOC View
     //! @param callback to invoke when a deleted path index entry is found

+ 1 - 2
Gems/Archive/Code/Source/Clients/ArchiveTOCView.inl

@@ -176,7 +176,7 @@ namespace Archive
             // Invoke the visitor callback if the file path size > 0
             if (filePathIndexEntry.m_size > 0)
             {
-                callback(filePathIndexEntry.m_offset, filePathIndexEntry.m_size);
+                callback(filePathIndexEntry.m_offset, static_cast<AZ::u16>(filePathIndexEntry.m_size));
                 ++filePathsVisited;
             }
         }
@@ -346,4 +346,3 @@ namespace Archive
     }
 
 } // namespace Archive
-

+ 3 - 2
Gems/Archive/Code/Source/Tools/ArchiveWriter.cpp

@@ -624,8 +624,9 @@ namespace Archive
             tocWriteSpan = compressResult.m_compressedTocSpan;
 
             // Update the archive header compressed toc metadata
-            m_archiveHeader.m_tocCompressedSize = tocWriteSpan.size();
-            m_archiveHeader.m_tocCompressionAlgoIndex = FindCompressionAlgorithmId(tocCompressionAlgorithmId, m_archiveHeader);
+            m_archiveHeader.m_tocCompressedSize = static_cast<AZ::u32>(tocWriteSpan.size());
+            m_archiveHeader.m_tocCompressionAlgoIndex = static_cast<AZ::u32>(FindCompressionAlgorithmId(
+                tocCompressionAlgorithmId, m_archiveHeader));
         }
         else
         {