From 0f83c8dffaf8c6c5ff0a398276187b78333524bb Mon Sep 17 00:00:00 2001
From: Lioncash <mathew1800@gmail.com>
Date: Tue, 14 May 2019 13:38:01 -0400
Subject: [PATCH 1/4] video_core/engines/engine_upload: Remove unnecessary
 includes

---
 src/video_core/engines/engine_upload.cpp | 2 ++
 src/video_core/engines/engine_upload.h   | 2 --
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/video_core/engines/engine_upload.cpp b/src/video_core/engines/engine_upload.cpp
index f8aa4ff55d..42faf0a400 100644
--- a/src/video_core/engines/engine_upload.cpp
+++ b/src/video_core/engines/engine_upload.cpp
@@ -2,6 +2,8 @@
 // Licensed under GPLv2 or any later version
 // Refer to the license.txt file included.
 
+#include <cstring>
+
 #include "common/assert.h"
 #include "video_core/engines/engine_upload.h"
 #include "video_core/memory_manager.h"
diff --git a/src/video_core/engines/engine_upload.h b/src/video_core/engines/engine_upload.h
index 9c6e0d21ca..d3ffd6952b 100644
--- a/src/video_core/engines/engine_upload.h
+++ b/src/video_core/engines/engine_upload.h
@@ -4,10 +4,8 @@
 
 #pragma once
 
-#include <cstddef>
 #include <vector>
 #include "common/bit_field.h"
-#include "common/common_funcs.h"
 #include "common/common_types.h"
 
 namespace Tegra {

From ec1c69258a548b6d5d5e0bcaf8f6302d2eb0cc40 Mon Sep 17 00:00:00 2001
From: Lioncash <mathew1800@gmail.com>
Date: Tue, 14 May 2019 13:40:05 -0400
Subject: [PATCH 2/4] video_core/engines/engine_upload: Remove unnecessary
 const on parameters in function declarations

These only apply in the definition of the function. They can be omitted
from the declaration.
---
 src/video_core/engines/engine_upload.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/video_core/engines/engine_upload.h b/src/video_core/engines/engine_upload.h
index d3ffd6952b..56809ec58b 100644
--- a/src/video_core/engines/engine_upload.h
+++ b/src/video_core/engines/engine_upload.h
@@ -57,8 +57,8 @@ public:
     State(MemoryManager& memory_manager, Registers& regs);
     ~State() = default;
 
-    void ProcessExec(const bool is_linear);
-    void ProcessData(const u32 data, const bool is_last_call);
+    void ProcessExec(bool is_linear);
+    void ProcessData(u32 data, bool is_last_call);
 
 private:
     u32 write_offset = 0;

From 9b6d993e520db29697263ef86b0498f98d15a8f2 Mon Sep 17 00:00:00 2001
From: Lioncash <mathew1800@gmail.com>
Date: Tue, 14 May 2019 13:41:34 -0400
Subject: [PATCH 3/4] video_core/engines/engine_upload: Default destructor in
 the cpp file

Avoids inlining destruction logic where applicable, and also makes
forward declarations not cause unexpected compilation errors depending
on where the State class is used.
---
 src/video_core/engines/engine_upload.cpp | 2 ++
 src/video_core/engines/engine_upload.h   | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/video_core/engines/engine_upload.cpp b/src/video_core/engines/engine_upload.cpp
index 42faf0a400..1aaec1964d 100644
--- a/src/video_core/engines/engine_upload.cpp
+++ b/src/video_core/engines/engine_upload.cpp
@@ -14,6 +14,8 @@ namespace Tegra::Engines::Upload {
 State::State(MemoryManager& memory_manager, Registers& regs)
     : memory_manager(memory_manager), regs(regs) {}
 
+State::~State() = default;
+
 void State::ProcessExec(const bool is_linear) {
     write_offset = 0;
     copy_size = regs.line_length_in * regs.line_count;
diff --git a/src/video_core/engines/engine_upload.h b/src/video_core/engines/engine_upload.h
index 56809ec58b..ef4f5839a0 100644
--- a/src/video_core/engines/engine_upload.h
+++ b/src/video_core/engines/engine_upload.h
@@ -55,7 +55,7 @@ struct Registers {
 class State {
 public:
     State(MemoryManager& memory_manager, Registers& regs);
-    ~State() = default;
+    ~State();
 
     void ProcessExec(bool is_linear);
     void ProcessData(u32 data, bool is_last_call);

From b01cce716e406bf8eb4d322344366e68a7250d6a Mon Sep 17 00:00:00 2001
From: Lioncash <mathew1800@gmail.com>
Date: Tue, 14 May 2019 13:43:23 -0400
Subject: [PATCH 4/4] video_core/engines/engine_upload: Amend constructor
 initializer list order

Silences a -Wreorder warning.
---
 src/video_core/engines/engine_upload.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/video_core/engines/engine_upload.cpp b/src/video_core/engines/engine_upload.cpp
index 1aaec1964d..082a40cd9e 100644
--- a/src/video_core/engines/engine_upload.cpp
+++ b/src/video_core/engines/engine_upload.cpp
@@ -12,7 +12,7 @@
 namespace Tegra::Engines::Upload {
 
 State::State(MemoryManager& memory_manager, Registers& regs)
-    : memory_manager(memory_manager), regs(regs) {}
+    : regs{regs}, memory_manager{memory_manager} {}
 
 State::~State() = default;