CMakeLists: Treat trailing semicolons as warnings / errors Fix all code that had trailing semicolons. Some downstream projects also consider these as errors, so this change catches the breakages at the source. Bug: b/130343040 Bug: b/130335507 Change-Id: I19ef3b5c682524542cde68f917ca9310a19da286 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/29810 Reviewed-by: Nicolas Capens <nicolascapens@google.com> Tested-by: Ben Clayton <bclayton@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt index e051d32..e2c4ba5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt
@@ -241,6 +241,7 @@ list(APPEND SWIFTSHADER_COMPILE_OPTIONS "-Werror=unused-lambda-capture" "-Werror=string-conversion" + "-Werror=extra-semi" ) endif()
diff --git a/src/Device/Rasterizer.hpp b/src/Device/Rasterizer.hpp index 8a2f0f3..c268e18 100644 --- a/src/Device/Rasterizer.hpp +++ b/src/Device/Rasterizer.hpp
@@ -25,7 +25,7 @@ { public: Rasterizer() : primitive(Arg<0>()), count(Arg<1>()), cluster(Arg<2>()), data(Arg<3>()) {} - virtual ~Rasterizer() {}; + virtual ~Rasterizer() {} protected: Pointer<Byte> primitive;
diff --git a/src/OpenGL/libEGL/Context.hpp b/src/OpenGL/libEGL/Context.hpp index 4768716..438dfff 100644 --- a/src/OpenGL/libEGL/Context.hpp +++ b/src/OpenGL/libEGL/Context.hpp
@@ -44,7 +44,7 @@ protected: Context(egl::Display *display) : display(display) {} - virtual ~Context() {}; + virtual ~Context() {} egl::Display *const display; };
diff --git a/src/OpenGL/libGLES_CM/Renderbuffer.h b/src/OpenGL/libGLES_CM/Renderbuffer.h index 09a7391..c3d751d 100644 --- a/src/OpenGL/libGLES_CM/Renderbuffer.h +++ b/src/OpenGL/libGLES_CM/Renderbuffer.h
@@ -37,7 +37,7 @@ public: RenderbufferInterface(); - virtual ~RenderbufferInterface() {}; + virtual ~RenderbufferInterface() {} virtual void addProxyRef(const Renderbuffer *proxy); virtual void releaseProxy(const Renderbuffer *proxy);
diff --git a/src/OpenGL/libGLESv2/Renderbuffer.h b/src/OpenGL/libGLESv2/Renderbuffer.h index fa7123b..0841a8a 100644 --- a/src/OpenGL/libGLESv2/Renderbuffer.h +++ b/src/OpenGL/libGLESv2/Renderbuffer.h
@@ -41,7 +41,7 @@ public: RenderbufferInterface(); - virtual ~RenderbufferInterface() {}; + virtual ~RenderbufferInterface() {} virtual void addProxyRef(const Renderbuffer *proxy); virtual void releaseProxy(const Renderbuffer *proxy);
diff --git a/src/Pipeline/VertexRoutine.hpp b/src/Pipeline/VertexRoutine.hpp index 757fc51..617dc0c 100644 --- a/src/Pipeline/VertexRoutine.hpp +++ b/src/Pipeline/VertexRoutine.hpp
@@ -31,7 +31,7 @@ { public: VertexRoutinePrototype() : vertex(Arg<0>()), batch(Arg<1>()), task(Arg<2>()), data(Arg<3>()) {} - virtual ~VertexRoutinePrototype() {}; + virtual ~VertexRoutinePrototype() {} protected: Pointer<Byte> vertex;
diff --git a/src/Reactor/SubzeroReactor.cpp b/src/Reactor/SubzeroReactor.cpp index c5fa7c9..d27963d 100644 --- a/src/Reactor/SubzeroReactor.cpp +++ b/src/Reactor/SubzeroReactor.cpp
@@ -430,8 +430,8 @@ template<typename T> struct ExecutableAllocator { - ExecutableAllocator() {}; - template<class U> ExecutableAllocator(const ExecutableAllocator<U> &other) {}; + ExecutableAllocator() {} + template<class U> ExecutableAllocator(const ExecutableAllocator<U> &other) {} using value_type = T; using size_type = std::size_t;
diff --git a/src/Renderer/Surface.cpp b/src/Renderer/Surface.cpp index e06f2bd..3de3cfe 100644 --- a/src/Renderer/Surface.cpp +++ b/src/Renderer/Surface.cpp
@@ -1230,7 +1230,7 @@ : Surface(width, height, depth, format, pixels, pitch, slice) {} SurfaceImplementation(Resource *texture, int width, int height, int depth, int border, int samples, Format format, bool lockable, bool renderTarget, int pitchP = 0) : Surface(texture, width, height, depth, border, samples, format, lockable, renderTarget, pitchP) {} - ~SurfaceImplementation() override {}; + ~SurfaceImplementation() override {} void *lockInternal(int x, int y, int z, Lock lock, Accessor client) override {
diff --git a/tests/VulkanUnitTests/VkInstanceFuncs.hpp b/tests/VulkanUnitTests/VkInstanceFuncs.hpp index 2dc357c..5c4d8c4 100644 --- a/tests/VulkanUnitTests/VkInstanceFuncs.hpp +++ b/tests/VulkanUnitTests/VkInstanceFuncs.hpp
@@ -17,42 +17,42 @@ // TODO: Generate this list. // VK_INSTANCE(<function name>, <return type>, <arguments>...) -VK_INSTANCE(vkAllocateCommandBuffers, VkResult, VkDevice, const VkCommandBufferAllocateInfo*, VkCommandBuffer*); -VK_INSTANCE(vkAllocateDescriptorSets, VkResult, VkDevice, const VkDescriptorSetAllocateInfo*, VkDescriptorSet*); +VK_INSTANCE(vkAllocateCommandBuffers, VkResult, VkDevice, const VkCommandBufferAllocateInfo*, VkCommandBuffer*) +VK_INSTANCE(vkAllocateDescriptorSets, VkResult, VkDevice, const VkDescriptorSetAllocateInfo*, VkDescriptorSet*) VK_INSTANCE(vkAllocateMemory, VkResult, VkDevice, const VkMemoryAllocateInfo*, const VkAllocationCallbacks*, - VkDeviceMemory*); -VK_INSTANCE(vkBeginCommandBuffer, VkResult, VkCommandBuffer, const VkCommandBufferBeginInfo*); -VK_INSTANCE(vkBindBufferMemory, VkResult, VkDevice, VkBuffer, VkDeviceMemory, VkDeviceSize); + VkDeviceMemory*) +VK_INSTANCE(vkBeginCommandBuffer, VkResult, VkCommandBuffer, const VkCommandBufferBeginInfo*) +VK_INSTANCE(vkBindBufferMemory, VkResult, VkDevice, VkBuffer, VkDeviceMemory, VkDeviceSize) VK_INSTANCE(vkCmdBindDescriptorSets, void, VkCommandBuffer, VkPipelineBindPoint, VkPipelineLayout, uint32_t, uint32_t, - const VkDescriptorSet*, uint32_t, const uint32_t*); -VK_INSTANCE(vkCmdBindPipeline, void, VkCommandBuffer, VkPipelineBindPoint, VkPipeline); -VK_INSTANCE(vkCmdDispatch, void, VkCommandBuffer, uint32_t, uint32_t, uint32_t); -VK_INSTANCE(vkCreateBuffer, VkResult, VkDevice, const VkBufferCreateInfo*, const VkAllocationCallbacks*, VkBuffer*); + const VkDescriptorSet*, uint32_t, const uint32_t*) +VK_INSTANCE(vkCmdBindPipeline, void, VkCommandBuffer, VkPipelineBindPoint, VkPipeline) +VK_INSTANCE(vkCmdDispatch, void, VkCommandBuffer, uint32_t, uint32_t, uint32_t) +VK_INSTANCE(vkCreateBuffer, VkResult, VkDevice, const VkBufferCreateInfo*, const VkAllocationCallbacks*, VkBuffer*) VK_INSTANCE(vkCreateCommandPool, VkResult, VkDevice, const VkCommandPoolCreateInfo*, const VkAllocationCallbacks*, - VkCommandPool*); + VkCommandPool*) VK_INSTANCE(vkCreateComputePipelines, VkResult, VkDevice, VkPipelineCache, uint32_t, const VkComputePipelineCreateInfo*, - const VkAllocationCallbacks*, VkPipeline*); + const VkAllocationCallbacks*, VkPipeline*) VK_INSTANCE(vkCreateDescriptorPool, VkResult, VkDevice, const VkDescriptorPoolCreateInfo*, const VkAllocationCallbacks*, - VkDescriptorPool*); + VkDescriptorPool*) VK_INSTANCE(vkCreateDescriptorSetLayout, VkResult, VkDevice, const VkDescriptorSetLayoutCreateInfo*, - const VkAllocationCallbacks*, VkDescriptorSetLayout*); + const VkAllocationCallbacks*, VkDescriptorSetLayout*) VK_INSTANCE(vkCreateDevice, VkResult, VkPhysicalDevice, const VkDeviceCreateInfo*, const VkAllocationCallbacks*, - VkDevice*); + VkDevice*) VK_INSTANCE(vkCreatePipelineLayout, VkResult, VkDevice, const VkPipelineLayoutCreateInfo*, const VkAllocationCallbacks*, - VkPipelineLayout*); + VkPipelineLayout*) VK_INSTANCE(vkCreateShaderModule, VkResult, VkDevice, const VkShaderModuleCreateInfo*, const VkAllocationCallbacks*, - VkShaderModule*); + VkShaderModule*) VK_INSTANCE(vkDestroyDevice, VkResult, VkDevice, const VkAllocationCallbacks*) -VK_INSTANCE(vkEndCommandBuffer, VkResult, VkCommandBuffer); +VK_INSTANCE(vkEndCommandBuffer, VkResult, VkCommandBuffer) VK_INSTANCE(vkEnumeratePhysicalDevices, VkResult, VkInstance, uint32_t*, VkPhysicalDevice*) -VK_INSTANCE(vkGetDeviceQueue, void, VkDevice, uint32_t, uint32_t, VkQueue*); -VK_INSTANCE(vkGetPhysicalDeviceMemoryProperties, void, VkPhysicalDevice, VkPhysicalDeviceMemoryProperties*); +VK_INSTANCE(vkGetDeviceQueue, void, VkDevice, uint32_t, uint32_t, VkQueue*) +VK_INSTANCE(vkGetPhysicalDeviceMemoryProperties, void, VkPhysicalDevice, VkPhysicalDeviceMemoryProperties*) VK_INSTANCE(vkGetPhysicalDeviceProperties, void, VkPhysicalDevice, VkPhysicalDeviceProperties*) -VK_INSTANCE(vkGetPhysicalDeviceQueueFamilyProperties, void, VkPhysicalDevice, uint32_t*, VkQueueFamilyProperties*); -VK_INSTANCE(vkMapMemory, VkResult, VkDevice, VkDeviceMemory, VkDeviceSize, VkDeviceSize, VkMemoryMapFlags, void**); -VK_INSTANCE(vkQueueSubmit, VkResult, VkQueue, uint32_t, const VkSubmitInfo*, VkFence); -VK_INSTANCE(vkQueueWaitIdle, VkResult, VkQueue); -VK_INSTANCE(vkUnmapMemory, void, VkDevice, VkDeviceMemory); +VK_INSTANCE(vkGetPhysicalDeviceQueueFamilyProperties, void, VkPhysicalDevice, uint32_t*, VkQueueFamilyProperties*) +VK_INSTANCE(vkMapMemory, VkResult, VkDevice, VkDeviceMemory, VkDeviceSize, VkDeviceSize, VkMemoryMapFlags, void**) +VK_INSTANCE(vkQueueSubmit, VkResult, VkQueue, uint32_t, const VkSubmitInfo*, VkFence) +VK_INSTANCE(vkQueueWaitIdle, VkResult, VkQueue) +VK_INSTANCE(vkUnmapMemory, void, VkDevice, VkDeviceMemory) VK_INSTANCE(vkUpdateDescriptorSets, void, VkDevice, uint32_t, const VkWriteDescriptorSet*, uint32_t, - const VkCopyDescriptorSet*); -VK_INSTANCE(vkDeviceWaitIdle, VkResult, VkDevice); \ No newline at end of file + const VkCopyDescriptorSet*) +VK_INSTANCE(vkDeviceWaitIdle, VkResult, VkDevice) \ No newline at end of file
diff --git a/third_party/llvm-subzero/include/llvm/Support/thread.h b/third_party/llvm-subzero/include/llvm/Support/thread.h index 9c45418..4e4394c 100644 --- a/third_party/llvm-subzero/include/llvm/Support/thread.h +++ b/third_party/llvm-subzero/include/llvm/Support/thread.h
@@ -57,7 +57,7 @@ thread(const thread &) = delete; void join() {} - static unsigned hardware_concurrency() { return 1; }; + static unsigned hardware_concurrency() { return 1; } }; }
diff --git a/third_party/subzero/src/IceMemory.h b/third_party/subzero/src/IceMemory.h index b651d0a..fc19d7a 100644 --- a/third_party/subzero/src/IceMemory.h +++ b/third_party/subzero/src/IceMemory.h
@@ -139,7 +139,7 @@ using manager_type = Cfg; static constexpr bool cache_allocator = false; - static void init() { ICE_TLS_INIT_FIELD(CfgAllocator); }; + static void init() { ICE_TLS_INIT_FIELD(CfgAllocator); } static allocator_type current(); static void set_current(const manager_type *Manager); @@ -166,7 +166,7 @@ using manager_type = Liveness; static constexpr bool cache_allocator = true; - static void init() { ICE_TLS_INIT_FIELD(LivenessAllocator); }; + static void init() { ICE_TLS_INIT_FIELD(LivenessAllocator); } static allocator_type current(); static void set_current(const manager_type *Manager);
diff --git a/third_party/subzero/src/IceTargetLoweringX86Base.h b/third_party/subzero/src/IceTargetLoweringX86Base.h index fbb7d75..9d60609 100644 --- a/third_party/subzero/src/IceTargetLoweringX86Base.h +++ b/third_party/subzero/src/IceTargetLoweringX86Base.h
@@ -1237,7 +1237,7 @@ private: ENABLE_MAKE_UNIQUE; - explicit TargetDataX86(GlobalContext *Ctx) : TargetDataLowering(Ctx){}; + explicit TargetDataX86(GlobalContext *Ctx) : TargetDataLowering(Ctx){} template <typename T> static void emitConstantPool(GlobalContext *Ctx); };