Consistently format pointer-to-const

This change replaces occurrences of `T const *p` with `const T *p`.

The latter was already the predominant style. While consistency is a
strong motivation for this change in itself, this arguably also
improves readability.

The common argument for the former order of the const qualifier is that
compilers primarily perform type parsing in right-to-left order. While
there are cases where we need to pay special attention to that, types
like `unsigned int *` read more naturally as a pointer to an unsigned
integer than `int unsigned *`, i.e. we mentally group the modifier with
the basic type and read this part left-to-right.

This also avoids confusion with `int *const` which means something else
than `int const *`. Writing the latter as `const int *` makes them
easier to discern.

`constexpr int *p` actually means `p` is (compile-time) constant, not
its pointee. To make the pointee constant also one would need
`constexpr const int *p`. Since this has the appearance of redundancy
this change formats it as `const int constexpr *p` to bring the
`constexpr` closer to `p` and make it look more similar to
`const int *const p`.

Bug: code style formatting
Change-Id: If6ab49ecbdab8037d46df7581358129de5577902
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/68649
Kokoro-Result: kokoro <noreply+kokoro@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
diff --git a/src/Device/BC_Decoder.cpp b/src/Device/BC_Decoder.cpp
index 8e8b7ad..e77a1c1 100644
--- a/src/Device/BC_Decoder.cpp
+++ b/src/Device/BC_Decoder.cpp
@@ -580,10 +580,10 @@
 	static constexpr uint32_t weights3[] = { 0, 9, 18, 27, 37, 46, 55, 64 };
 	static constexpr uint32_t weights4[] = { 0, 4, 9, 13, 17, 21, 26, 30,
 		                                     34, 38, 43, 47, 51, 55, 60, 64 };
-	static constexpr uint32_t const *weightsN[] = {
+	static const uint32_t constexpr *weightsN[] = {
 		nullptr, nullptr, nullptr, weights3, weights4
 	};
-	auto weights = weightsN[index.numBits];
+	const uint32_t *weights = weightsN[index.numBits];
 	ASSERT_MSG(weights != nullptr, "Unexpected number of index bits: %d", (int)index.numBits);
 	Color color;
 	uint32_t e0Weight = 64 - weights[index.value];
@@ -1437,10 +1437,10 @@
 		static constexpr uint16_t weights3[] = { 0, 9, 18, 27, 37, 46, 55, 64 };
 		static constexpr uint16_t weights4[] = { 0, 4, 9, 13, 17, 21, 26, 30,
 			                                     34, 38, 43, 47, 51, 55, 60, 64 };
-		static constexpr uint16_t const *weightsN[] = {
+		static const uint16_t constexpr *weightsN[] = {
 			nullptr, nullptr, weights2, weights3, weights4
 		};
-		auto weights = weightsN[index.numBits];
+		const uint16_t *weights = weightsN[index.numBits];
 		ASSERT_MSG(weights != nullptr, "Unexpected number of index bits: %d", (int)index.numBits);
 		return (uint8_t)(((64 - weights[index.value]) * uint16_t(e0) + weights[index.value] * uint16_t(e1) + 32) >> 6);
 	}
diff --git a/src/Device/Context.cpp b/src/Device/Context.cpp
index ebb58d5..72bc615 100644
--- a/src/Device/Context.cpp
+++ b/src/Device/Context.cpp
@@ -349,7 +349,7 @@
 		if((attrib.format != VK_FORMAT_UNDEFINED) && instanceStride && (instanceStride < attrib.robustnessSize))
 		{
 			// Under the casts: attrib.buffer += instanceStride
-			attrib.buffer = (void const *)((uintptr_t)attrib.buffer + instanceStride);
+			attrib.buffer = (const void *)((uintptr_t)attrib.buffer + instanceStride);
 			attrib.robustnessSize -= instanceStride;
 		}
 	}
@@ -1288,7 +1288,7 @@
 			if((librarySubset & VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT) != 0)
 			{
 				preRasterizationState = libraryState.preRasterizationState;
-				if (layout)
+				if(layout)
 				{
 					preRasterizationState.overridePipelineLayout(layout);
 				}
@@ -1296,7 +1296,7 @@
 			if((librarySubset & VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT) != 0)
 			{
 				fragmentState = libraryState.fragmentState;
-				if (layout)
+				if(layout)
 				{
 					fragmentState.overridePipelineLayout(layout);
 				}
diff --git a/src/Device/QuadRasterizer.cpp b/src/Device/QuadRasterizer.cpp
index 3201dde..f9f3c8f 100644
--- a/src/Device/QuadRasterizer.cpp
+++ b/src/Device/QuadRasterizer.cpp
@@ -23,7 +23,7 @@
 
 namespace sw {
 
-QuadRasterizer::QuadRasterizer(const PixelProcessor::State &state, SpirvShader const *spirvShader)
+QuadRasterizer::QuadRasterizer(const PixelProcessor::State &state, const SpirvShader *spirvShader)
     : state(state)
     , spirvShader{ spirvShader }
 {
diff --git a/src/Device/QuadRasterizer.hpp b/src/Device/QuadRasterizer.hpp
index 8d9e24b..16399e0 100644
--- a/src/Device/QuadRasterizer.hpp
+++ b/src/Device/QuadRasterizer.hpp
@@ -25,7 +25,7 @@
 class QuadRasterizer : public Rasterizer
 {
 public:
-	QuadRasterizer(const PixelProcessor::State &state, SpirvShader const *spirvShader);
+	QuadRasterizer(const PixelProcessor::State &state, const SpirvShader *spirvShader);
 	virtual ~QuadRasterizer();
 
 	void generate();
diff --git a/src/Device/VertexProcessor.cpp b/src/Device/VertexProcessor.cpp
index e5562cb..5122780 100644
--- a/src/Device/VertexProcessor.cpp
+++ b/src/Device/VertexProcessor.cpp
@@ -93,8 +93,8 @@
 }
 
 VertexProcessor::RoutineType VertexProcessor::routine(const State &state,
-                                                      vk::PipelineLayout const *pipelineLayout,
-                                                      SpirvShader const *vertexShader,
+                                                      const vk::PipelineLayout *pipelineLayout,
+                                                      const SpirvShader *vertexShader,
                                                       const vk::DescriptorSet::Bindings &descriptorSets)
 {
 	auto routine = routineCache->lookup(state);
diff --git a/src/Device/VertexProcessor.hpp b/src/Device/VertexProcessor.hpp
index f4f7e3a..2b9ed7d 100644
--- a/src/Device/VertexProcessor.hpp
+++ b/src/Device/VertexProcessor.hpp
@@ -97,8 +97,8 @@
 	VertexProcessor();
 
 	const State update(const vk::GraphicsState &pipelineState, const sw::SpirvShader *vertexShader, const vk::Inputs &inputs);
-	RoutineType routine(const State &state, vk::PipelineLayout const *pipelineLayout,
-	                    SpirvShader const *vertexShader, const vk::DescriptorSet::Bindings &descriptorSets);
+	RoutineType routine(const State &state, const vk::PipelineLayout *pipelineLayout,
+	                    const SpirvShader *vertexShader, const vk::DescriptorSet::Bindings &descriptorSets);
 
 	void setRoutineCacheSize(int cacheSize);
 
diff --git a/src/Pipeline/ComputeProgram.cpp b/src/Pipeline/ComputeProgram.cpp
index 4c433e4..b2f9c5e 100644
--- a/src/Pipeline/ComputeProgram.cpp
+++ b/src/Pipeline/ComputeProgram.cpp
@@ -27,7 +27,7 @@
 
 namespace sw {
 
-ComputeProgram::ComputeProgram(vk::Device *device, std::shared_ptr<SpirvShader> shader, vk::PipelineLayout const *pipelineLayout, const vk::DescriptorSet::Bindings &descriptorSets)
+ComputeProgram::ComputeProgram(vk::Device *device, std::shared_ptr<SpirvShader> shader, const vk::PipelineLayout *pipelineLayout, const vk::DescriptorSet::Bindings &descriptorSets)
     : device(device)
     , shader(shader)
     , pipelineLayout(pipelineLayout)
diff --git a/src/Pipeline/ComputeProgram.hpp b/src/Pipeline/ComputeProgram.hpp
index 4260f80..25e57c7 100644
--- a/src/Pipeline/ComputeProgram.hpp
+++ b/src/Pipeline/ComputeProgram.hpp
@@ -47,7 +47,7 @@
                            int32_t subgroupCount)>
 {
 public:
-	ComputeProgram(vk::Device *device, std::shared_ptr<SpirvShader> spirvShader, vk::PipelineLayout const *pipelineLayout, const vk::DescriptorSet::Bindings &descriptorSets);
+	ComputeProgram(vk::Device *device, std::shared_ptr<SpirvShader> spirvShader, const vk::PipelineLayout *pipelineLayout, const vk::DescriptorSet::Bindings &descriptorSets);
 
 	virtual ~ComputeProgram();
 
diff --git a/src/Pipeline/PixelRoutine.cpp b/src/Pipeline/PixelRoutine.cpp
index d58a34c..68e13f3 100644
--- a/src/Pipeline/PixelRoutine.cpp
+++ b/src/Pipeline/PixelRoutine.cpp
@@ -28,8 +28,8 @@
 
 PixelRoutine::PixelRoutine(
     const PixelProcessor::State &state,
-    vk::PipelineLayout const *pipelineLayout,
-    SpirvShader const *spirvShader,
+    const vk::PipelineLayout *pipelineLayout,
+    const SpirvShader *spirvShader,
     const vk::DescriptorSet::Bindings &descriptorSets)
     : QuadRasterizer(state, spirvShader)
     , routine(pipelineLayout)
diff --git a/src/Pipeline/PixelRoutine.hpp b/src/Pipeline/PixelRoutine.hpp
index c4effab..3b5224a 100644
--- a/src/Pipeline/PixelRoutine.hpp
+++ b/src/Pipeline/PixelRoutine.hpp
@@ -28,8 +28,8 @@
 {
 public:
 	PixelRoutine(const PixelProcessor::State &state,
-	             vk::PipelineLayout const *pipelineLayout,
-	             SpirvShader const *spirvShader,
+	             const vk::PipelineLayout *pipelineLayout,
+	             const SpirvShader *spirvShader,
 	             const vk::DescriptorSet::Bindings &descriptorSets);
 
 	virtual ~PixelRoutine();
diff --git a/src/Pipeline/SpirvShader.cpp b/src/Pipeline/SpirvShader.cpp
index 3e3e9c6..c5fb86a 100644
--- a/src/Pipeline/SpirvShader.cpp
+++ b/src/Pipeline/SpirvShader.cpp
@@ -1384,7 +1384,7 @@
 	return ptr;
 }
 
-SIMD::Pointer SpirvShader::WalkAccessChain(Object::ID baseId, Object::ID elementId, const Span &indexIds, bool nonUniform, EmitState const *state) const
+SIMD::Pointer SpirvShader::WalkAccessChain(Object::ID baseId, Object::ID elementId, const Span &indexIds, bool nonUniform, const EmitState *state) const
 {
 	// TODO: avoid doing per-lane work in some cases if we can?
 	auto routine = state->routine;
@@ -1730,7 +1730,7 @@
 	dbgDeclareResult(insn, resultId);
 }
 
-OutOfBoundsBehavior SpirvShader::getOutOfBoundsBehavior(Object::ID pointerId, EmitState const *state) const
+OutOfBoundsBehavior SpirvShader::getOutOfBoundsBehavior(Object::ID pointerId, const EmitState *state) const
 {
 	auto it = descriptorDecorations.find(pointerId);
 	if(it != descriptorDecorations.end())
@@ -2841,12 +2841,12 @@
 	return true;
 }
 
-SpirvRoutine::SpirvRoutine(vk::PipelineLayout const *pipelineLayout)
+SpirvRoutine::SpirvRoutine(const vk::PipelineLayout *pipelineLayout)
     : pipelineLayout(pipelineLayout)
 {
 }
 
-void SpirvRoutine::setImmutableInputBuiltins(SpirvShader const *shader)
+void SpirvRoutine::setImmutableInputBuiltins(const SpirvShader *shader)
 {
 	setInputBuiltin(shader, spv::BuiltInSubgroupLocalInvocationId, [&](const SpirvShader::BuiltinMapping &builtin, Array<SIMD::Float> &value) {
 		ASSERT(builtin.SizeInComponents == 1);
diff --git a/src/Pipeline/SpirvShader.hpp b/src/Pipeline/SpirvShader.hpp
index aa82774..2e57c5d 100644
--- a/src/Pipeline/SpirvShader.hpp
+++ b/src/Pipeline/SpirvShader.hpp
@@ -1362,10 +1362,10 @@
 	//  - Pointer
 	//  - InterfaceVariable
 	// Calling GetPointerToData with objects of any other kind will assert.
-	SIMD::Pointer GetPointerToData(Object::ID id, SIMD::Int arrayIndex, bool nonUniform, EmitState const *state) const;
-	void OffsetToElement(SIMD::Pointer &ptr, Object::ID elementId, int32_t arrayStride, EmitState const *state) const;
+	SIMD::Pointer GetPointerToData(Object::ID id, SIMD::Int arrayIndex, bool nonUniform, const EmitState *state) const;
+	void OffsetToElement(SIMD::Pointer &ptr, Object::ID elementId, int32_t arrayStride, const EmitState *state) const;
 
-	OutOfBoundsBehavior getOutOfBoundsBehavior(Object::ID pointerId, EmitState const *state) const;
+	OutOfBoundsBehavior getOutOfBoundsBehavior(Object::ID pointerId, const EmitState *state) const;
 
 	SIMD::Pointer WalkExplicitLayoutAccessChain(Object::ID id, Object::ID elementId, const Span &indexIds, bool nonUniform, const EmitState *state) const;
 	SIMD::Pointer WalkAccessChain(Object::ID id, Object::ID elementId, const Span &indexIds, bool nonUniform, const EmitState *state) const;
@@ -1456,7 +1456,7 @@
 	Pointer<Byte> lookupSamplerFunction(Pointer<Byte> imageDescriptor, Pointer<Byte> samplerDescriptor, const ImageInstruction &instruction, EmitState *state) const;
 	void callSamplerFunction(Pointer<Byte> samplerFunction, Array<SIMD::Float> &out, Pointer<Byte> imageDescriptor, const ImageInstruction &instruction, EmitState *state) const;
 
-	void GetImageDimensions(EmitState const *state, const Type &resultTy, Object::ID imageId, Object::ID lodId, Intermediate &dst) const;
+	void GetImageDimensions(const EmitState *state, const Type &resultTy, Object::ID imageId, Object::ID lodId, Intermediate &dst) const;
 	struct TexelAddressData
 	{
 		bool isArrayed;
@@ -1523,9 +1523,9 @@
 
 	// Helper as we often need to take dot products as part of doing other things.
 	static SIMD::Float FDot(unsigned numComponents, const Operand &x, const Operand &y);
-	static SIMD::Int SDot(unsigned numComponents, const Operand &x, const Operand &y, Operand const *accum);
-	static SIMD::UInt UDot(unsigned numComponents, const Operand &x, const Operand &y, Operand const *accum);
-	static SIMD::Int SUDot(unsigned numComponents, const Operand &x, const Operand &y, Operand const *accum);
+	static SIMD::Int SDot(unsigned numComponents, const Operand &x, const Operand &y, const Operand *accum);
+	static SIMD::UInt UDot(unsigned numComponents, const Operand &x, const Operand &y, const Operand *accum);
+	static SIMD::Int SUDot(unsigned numComponents, const Operand &x, const Operand &y, const Operand *accum);
 	static SIMD::Int AddSat(RValue<SIMD::Int> a, RValue<SIMD::Int> b);
 	static SIMD::UInt AddSat(RValue<SIMD::UInt> a, RValue<SIMD::UInt> b);
 
@@ -1598,7 +1598,7 @@
 class SpirvRoutine
 {
 public:
-	SpirvRoutine(vk::PipelineLayout const *pipelineLayout);
+	SpirvRoutine(const vk::PipelineLayout *pipelineLayout);
 
 	using Variable = Array<SIMD::Float>;
 
@@ -1629,7 +1629,7 @@
 		SIMD::Float rhwCentroid;
 	};
 
-	vk::PipelineLayout const *const pipelineLayout;
+	const vk::PipelineLayout *const pipelineLayout;
 
 	std::unordered_map<SpirvShader::Object::ID, Variable> variables;
 	std::unordered_map<uint32_t, SamplerCache> samplerCache;  // Indexed by the instruction position, in words.
@@ -1685,7 +1685,7 @@
 
 	// setImmutableInputBuiltins() sets all the immutable input builtins,
 	// common for all shader types.
-	void setImmutableInputBuiltins(SpirvShader const *shader);
+	void setImmutableInputBuiltins(const SpirvShader *shader);
 
 	static SIMD::Float interpolateAtXY(const SIMD::Float &x, const SIMD::Float &y, const SIMD::Float &rhw, Pointer<Byte> planeEquation, Interpolation interpolation);
 
@@ -1694,7 +1694,7 @@
 	// F is a function with the signature:
 	// void(const SpirvShader::BuiltinMapping& builtin, Array<SIMD::Float>& value)
 	template<typename F>
-	inline void setInputBuiltin(SpirvShader const *shader, spv::BuiltIn id, F &&f)
+	inline void setInputBuiltin(const SpirvShader *shader, spv::BuiltIn id, F &&f)
 	{
 		auto it = shader->inputBuiltins.find(id);
 		if(it != shader->inputBuiltins.end())
diff --git a/src/Pipeline/SpirvShaderArithmetic.cpp b/src/Pipeline/SpirvShaderArithmetic.cpp
index 57a075e..e26a955 100644
--- a/src/Pipeline/SpirvShaderArithmetic.cpp
+++ b/src/Pipeline/SpirvShaderArithmetic.cpp
@@ -640,7 +640,7 @@
 	return d;
 }
 
-SIMD::Int SpirvShader::SDot(unsigned numComponents, const Operand &x, const Operand &y, Operand const *accum)
+SIMD::Int SpirvShader::SDot(unsigned numComponents, const Operand &x, const Operand &y, const Operand *accum)
 {
 	SIMD::Int d(0);
 
@@ -676,7 +676,7 @@
 	return d;
 }
 
-SIMD::UInt SpirvShader::UDot(unsigned numComponents, const Operand &x, const Operand &y, Operand const *accum)
+SIMD::UInt SpirvShader::UDot(unsigned numComponents, const Operand &x, const Operand &y, const Operand *accum)
 {
 	SIMD::UInt d(0);
 
@@ -712,7 +712,7 @@
 	return d;
 }
 
-SIMD::Int SpirvShader::SUDot(unsigned numComponents, const Operand &x, const Operand &y, Operand const *accum)
+SIMD::Int SpirvShader::SUDot(unsigned numComponents, const Operand &x, const Operand &y, const Operand *accum)
 {
 	SIMD::Int d(0);
 
diff --git a/src/Pipeline/SpirvShaderDebugger.cpp b/src/Pipeline/SpirvShaderDebugger.cpp
index e35aaf3..bcfb02b 100644
--- a/src/Pipeline/SpirvShaderDebugger.cpp
+++ b/src/Pipeline/SpirvShaderDebugger.cpp
@@ -1169,7 +1169,7 @@
 	// Data shared across all nodes in the LocalVariableValue.
 	struct Shared
 	{
-		Shared(debug::LocalVariable const *const variable, State const *const state, int const lane)
+		Shared(const debug::LocalVariable *const variable, const State *const state, int const lane)
 		    : variable(variable)
 		    , state(state)
 		    , lane(lane)
@@ -1177,17 +1177,17 @@
 			ASSERT(variable->definition == debug::LocalVariable::Definition::Values);
 		}
 
-		debug::LocalVariable const *const variable;
-		State const *const state;
+		const debug::LocalVariable *const variable;
+		const State *const state;
 		int const lane;
 	};
 
-	LocalVariableValue(debug::LocalVariable *variable, State const *const state, int lane);
+	LocalVariableValue(debug::LocalVariable *variable, const State *const state, int lane);
 
 	LocalVariableValue(
 	    const std::shared_ptr<const Shared> &shared,
-	    debug::Type const *ty,
-	    debug::LocalVariable::ValueNode const *node);
+	    const debug::Type *ty,
+	    const debug::LocalVariable::ValueNode *node);
 
 private:
 	// vk::dbg::Value
@@ -1197,8 +1197,8 @@
 
 	void updateValue();
 	std::shared_ptr<const Shared> const shared;
-	debug::Type const *const ty;
-	debug::LocalVariable::ValueNode const *const node;
+	const debug::Type *const ty;
+	const debug::LocalVariable::ValueNode *const node;
 	debug::Value *activeValue = nullptr;
 	std::shared_ptr<vk::dbg::Value> value;
 };
@@ -1348,7 +1348,7 @@
 
 		// getOrCreateLocals() creates and returns the per-lane local variables
 		// from those in the lexical block.
-		PerLaneVariables getOrCreateLocals(State *state, debug::LexicalBlock const *block);
+		PerLaneVariables getOrCreateLocals(State *state, const debug::LexicalBlock *block);
 
 		// buildGlobal() creates and adds to globals global variable with the
 		// given name and value. The value is copied instead of holding a
@@ -1373,7 +1373,7 @@
 		GlobalVariables globals;
 		std::shared_ptr<vk::dbg::Thread> thread;
 		std::vector<StackEntry> stack;
-		std::unordered_map<debug::LexicalBlock const *, PerLaneVariables> locals;
+		std::unordered_map<const debug::LexicalBlock *, PerLaneVariables> locals;
 	};
 
 	State(const Debugger *debugger);
@@ -2014,15 +2014,15 @@
 ////////////////////////////////////////////////////////////////////////////////
 sw::SpirvShader::Impl::Debugger::LocalVariableValue::LocalVariableValue(
     debug::LocalVariable *variable,
-    State const *const state,
+    const State *state,
     int lane)
     : LocalVariableValue(std::make_shared<Shared>(variable, state, lane), variable->type, &variable->values)
 {}
 
 sw::SpirvShader::Impl::Debugger::LocalVariableValue::LocalVariableValue(
     const std::shared_ptr<const Shared> &shared,
-    debug::Type const *ty,
-    debug::LocalVariable::ValueNode const *node)
+    const debug::Type *ty,
+    const debug::LocalVariable::ValueNode *node)
     : shared(shared)
     , ty(ty)
     , node(node)
@@ -2338,7 +2338,7 @@
 }
 
 SpirvShader::Impl::Debugger::State::Data::PerLaneVariables
-SpirvShader::Impl::Debugger::State::Data::getOrCreateLocals(State *state, debug::LexicalBlock const *block)
+SpirvShader::Impl::Debugger::State::Data::getOrCreateLocals(State *state, const debug::LexicalBlock *block)
 {
 	return getOrCreate(locals, block, [&] {
 		PerLaneVariables locals;
diff --git a/src/Pipeline/SpirvShaderImage.cpp b/src/Pipeline/SpirvShaderImage.cpp
index addcd1f..ea79184 100644
--- a/src/Pipeline/SpirvShaderImage.cpp
+++ b/src/Pipeline/SpirvShaderImage.cpp
@@ -526,7 +526,7 @@
 	return EmitResult::Continue;
 }
 
-void SpirvShader::GetImageDimensions(EmitState const *state, const Type &resultTy, Object::ID imageId, Object::ID lodId, Intermediate &dst) const
+void SpirvShader::GetImageDimensions(const EmitState *state, const Type &resultTy, Object::ID imageId, Object::ID lodId, Intermediate &dst) const
 {
 	auto routine = state->routine;
 	auto &image = getObject(imageId);
diff --git a/src/Pipeline/SpirvShaderMemory.cpp b/src/Pipeline/SpirvShaderMemory.cpp
index d8a7873..90818a4 100644
--- a/src/Pipeline/SpirvShaderMemory.cpp
+++ b/src/Pipeline/SpirvShaderMemory.cpp
@@ -406,7 +406,7 @@
 	}
 }
 
-SIMD::Pointer SpirvShader::GetPointerToData(Object::ID id, SIMD::Int arrayIndices, bool nonUniform, EmitState const *state) const
+SIMD::Pointer SpirvShader::GetPointerToData(Object::ID id, SIMD::Int arrayIndices, bool nonUniform, const EmitState *state) const
 {
 	auto routine = state->routine;
 	auto &object = getObject(id);
@@ -493,7 +493,7 @@
 	}
 }
 
-void SpirvShader::OffsetToElement(SIMD::Pointer &ptr, Object::ID elementId, int32_t arrayStride, EmitState const *state) const
+void SpirvShader::OffsetToElement(SIMD::Pointer &ptr, Object::ID elementId, int32_t arrayStride, const EmitState *state) const
 {
 	if(elementId != 0 && arrayStride != 0)
 	{
diff --git a/src/Pipeline/VertexProgram.cpp b/src/Pipeline/VertexProgram.cpp
index 5a3dc2a..9a553cf 100644
--- a/src/Pipeline/VertexProgram.cpp
+++ b/src/Pipeline/VertexProgram.cpp
@@ -26,8 +26,8 @@
 
 VertexProgram::VertexProgram(
     const VertexProcessor::State &state,
-    vk::PipelineLayout const *pipelineLayout,
-    SpirvShader const *spirvShader,
+    const vk::PipelineLayout *pipelineLayout,
+    const SpirvShader *spirvShader,
     const vk::DescriptorSet::Bindings &descriptorSets)
     : VertexRoutine(state, pipelineLayout, spirvShader)
     , descriptorSets(descriptorSets)
diff --git a/src/Pipeline/VertexProgram.hpp b/src/Pipeline/VertexProgram.hpp
index 6abb727..1edfecc 100644
--- a/src/Pipeline/VertexProgram.hpp
+++ b/src/Pipeline/VertexProgram.hpp
@@ -27,8 +27,8 @@
 public:
 	VertexProgram(
 	    const VertexProcessor::State &state,
-	    vk::PipelineLayout const *pipelineLayout,
-	    SpirvShader const *spirvShader,
+	    const vk::PipelineLayout *pipelineLayout,
+	    const SpirvShader *spirvShader,
 	    const vk::DescriptorSet::Bindings &descriptorSets);
 
 	virtual ~VertexProgram();
diff --git a/src/Pipeline/VertexRoutine.cpp b/src/Pipeline/VertexRoutine.cpp
index 44e1b15..6f30f0f 100644
--- a/src/Pipeline/VertexRoutine.cpp
+++ b/src/Pipeline/VertexRoutine.cpp
@@ -27,8 +27,8 @@
 
 VertexRoutine::VertexRoutine(
     const VertexProcessor::State &state,
-    vk::PipelineLayout const *pipelineLayout,
-    SpirvShader const *spirvShader)
+    const vk::PipelineLayout *pipelineLayout,
+    const SpirvShader *spirvShader)
     : routine(pipelineLayout)
     , state(state)
     , spirvShader(spirvShader)
diff --git a/src/Pipeline/VertexRoutine.hpp b/src/Pipeline/VertexRoutine.hpp
index 3e41f10..5e2aa0a 100644
--- a/src/Pipeline/VertexRoutine.hpp
+++ b/src/Pipeline/VertexRoutine.hpp
@@ -50,8 +50,8 @@
 public:
 	VertexRoutine(
 	    const VertexProcessor::State &state,
-	    vk::PipelineLayout const *pipelineLayout,
-	    SpirvShader const *spirvShader);
+	    const vk::PipelineLayout *pipelineLayout,
+	    const SpirvShader *spirvShader);
 	virtual ~VertexRoutine();
 
 	void generate();
@@ -65,7 +65,7 @@
 	SpirvRoutine routine;
 
 	const VertexProcessor::State &state;
-	SpirvShader const *const spirvShader;
+	const SpirvShader *const spirvShader;
 
 private:
 	virtual void program(Pointer<UInt> &batch, UInt &vertexCount) = 0;
diff --git a/src/Reactor/LLVMReactor.cpp b/src/Reactor/LLVMReactor.cpp
index 54bbebc..9a2cb0b 100644
--- a/src/Reactor/LLVMReactor.cpp
+++ b/src/Reactor/LLVMReactor.cpp
@@ -3354,7 +3354,7 @@
 	return RValue<Long>(V(jit->builder->CreateCall(rdtsc)));
 }
 
-RValue<Pointer<Byte>> ConstantPointer(void const *ptr)
+RValue<Pointer<Byte>> ConstantPointer(const void *ptr)
 {
 	RR_DEBUG_INFO_UPDATE_LOC();
 	// Note: this should work for 32-bit pointers as well because 'inttoptr'
@@ -3363,7 +3363,7 @@
 	return RValue<Pointer<Byte>>(V(jit->builder->CreateIntToPtr(ptrAsInt, T(Pointer<Byte>::type()))));
 }
 
-RValue<Pointer<Byte>> ConstantData(void const *data, size_t size)
+RValue<Pointer<Byte>> ConstantData(const void *data, size_t size)
 {
 	RR_DEBUG_INFO_UPDATE_LOC();
 	auto str = ::std::string(reinterpret_cast<const char *>(data), size);
diff --git a/src/Reactor/LLVMReactorDebugInfo.cpp b/src/Reactor/LLVMReactorDebugInfo.cpp
index 79ea930..b4c0688 100644
--- a/src/Reactor/LLVMReactorDebugInfo.cpp
+++ b/src/Reactor/LLVMReactorDebugInfo.cpp
@@ -486,7 +486,7 @@
 	return file;
 }
 
-DebugInfo::LineTokens const *DebugInfo::getOrParseFileTokens(const char *path)
+const DebugInfo::LineTokens *DebugInfo::getOrParseFileTokens(const char *path)
 {
 	static std::regex reLocalDecl(
 	    "^"                                              // line start
diff --git a/src/Reactor/LLVMReactorDebugInfo.hpp b/src/Reactor/LLVMReactorDebugInfo.hpp
index 5538c8b..2754bac 100644
--- a/src/Reactor/LLVMReactorDebugInfo.hpp
+++ b/src/Reactor/LLVMReactorDebugInfo.hpp
@@ -148,7 +148,7 @@
 
 	llvm::DIType *getOrCreateType(llvm::Type *type);
 	llvm::DIFile *getOrCreateFile(const char *path);
-	LineTokens const *getOrParseFileTokens(const char *path);
+	const LineTokens *getOrParseFileTokens(const char *path);
 
 	// Synchronizes diScope with the current backtrace.
 	void syncScope(const Backtrace &backtrace);
@@ -166,7 +166,7 @@
 	std::unordered_map<std::string, llvm::DIFile *> diFiles;
 	std::unordered_map<llvm::Type *, llvm::DIType *> diTypes;
 	std::unordered_map<std::string, std::unique_ptr<LineTokens>> fileTokens;
-	std::vector<void const *> pushed;
+	std::vector<const void *> pushed;
 };
 
 }  // namespace rr
diff --git a/src/Reactor/Reactor.hpp b/src/Reactor/Reactor.hpp
index 0792218..f5f189e 100644
--- a/src/Reactor/Reactor.hpp
+++ b/src/Reactor/Reactor.hpp
@@ -2754,10 +2754,10 @@
 }
 
 // Returns a reactor pointer to the fixed-address ptr.
-RValue<Pointer<Byte>> ConstantPointer(void const *ptr);
+RValue<Pointer<Byte>> ConstantPointer(const void *ptr);
 
 // Returns a reactor pointer to an immutable copy of the data of size bytes.
-RValue<Pointer<Byte>> ConstantData(void const *data, size_t size);
+RValue<Pointer<Byte>> ConstantData(const void *data, size_t size);
 
 template<class T>
 Pointer<T>::Pointer(Argument<Pointer<T>> argument)
diff --git a/src/Reactor/SubzeroReactor.cpp b/src/Reactor/SubzeroReactor.cpp
index 8f8bd70..0a4e9d2 100644
--- a/src/Reactor/SubzeroReactor.cpp
+++ b/src/Reactor/SubzeroReactor.cpp
@@ -110,7 +110,7 @@
 	return address;
 }
 
-Ice::Constant *getConstantPointer(Ice::GlobalContext *context, void const *ptr)
+Ice::Constant *getConstantPointer(Ice::GlobalContext *context, const void *ptr)
 {
 	if(sizeof(void *) == 8)
 	{
@@ -160,7 +160,7 @@
 	return ret;
 }
 
-Ice::Variable *Call(Ice::Cfg *function, Ice::CfgNode *basicBlock, Ice::Type retTy, void const *fptr, const std::vector<Ice::Operand *> &iceArgs, bool isVariadic)
+Ice::Variable *Call(Ice::Cfg *function, Ice::CfgNode *basicBlock, Ice::Type retTy, const void *fptr, const std::vector<Ice::Operand *> &iceArgs, bool isVariadic)
 {
 	Ice::Operand *callTarget = getConstantPointer(function->getContext(), fptr);
 	return Call(function, basicBlock, retTy, callTarget, iceArgs, isVariadic);
@@ -174,7 +174,7 @@
 
 	Ice::Type retTy = T(rr::CToReactorT<Return>::type());
 	std::vector<Ice::Operand *> iceArgs{ std::forward<RArgs>(args)... };
-	return Call(function, basicBlock, retTy, reinterpret_cast<void const *>(fptr), iceArgs, false);
+	return Call(function, basicBlock, retTy, reinterpret_cast<const void *>(fptr), iceArgs, false);
 }
 
 Ice::Variable *createTruncate(Ice::Cfg *function, Ice::CfgNode *basicBlock, Ice::Operand *from, Ice::Type toType)
@@ -2073,7 +2073,7 @@
 	return createNullValue(T(sizeof(void *) == 8 ? Ice::IceType_i64 : Ice::IceType_i32));
 }
 
-static Ice::Constant *IceConstantData(void const *data, size_t size, size_t alignment = 1)
+static Ice::Constant *IceConstantData(const void *data, size_t size, size_t alignment = 1)
 {
 	return sz::getConstantPointer(::context, ::routine->addConstantData(data, size, alignment));
 }
@@ -4044,13 +4044,13 @@
 	return Long(Int(0));
 }
 
-RValue<Pointer<Byte>> ConstantPointer(void const *ptr)
+RValue<Pointer<Byte>> ConstantPointer(const void *ptr)
 {
 	RR_DEBUG_INFO_UPDATE_LOC();
 	return RValue<Pointer<Byte>>{ V(sz::getConstantPointer(::context, ptr)) };
 }
 
-RValue<Pointer<Byte>> ConstantData(void const *data, size_t size)
+RValue<Pointer<Byte>> ConstantData(const void *data, size_t size)
 {
 	RR_DEBUG_INFO_UPDATE_LOC();
 	return RValue<Pointer<Byte>>{ V(IceConstantData(data, size)) };
diff --git a/src/Vulkan/VkCommandBuffer.cpp b/src/Vulkan/VkCommandBuffer.cpp
index 58ad34d..fca78f8 100644
--- a/src/Vulkan/VkCommandBuffer.cpp
+++ b/src/Vulkan/VkCommandBuffer.cpp
@@ -339,7 +339,7 @@
 
 	void execute(vk::CommandBuffer::ExecutionState &executionState) override
 	{
-		const auto *cmd = reinterpret_cast<VkDispatchIndirectCommand const *>(buffer->getOffsetPointer(offset));
+		const auto *cmd = reinterpret_cast<const VkDispatchIndirectCommand *>(buffer->getOffsetPointer(offset));
 
 		const auto &pipelineState = executionState.pipelineState[VK_PIPELINE_BIND_POINT_COMPUTE];
 
@@ -1029,7 +1029,7 @@
 	{
 		for(auto drawId = 0u; drawId < drawCount; drawId++)
 		{
-			const auto *cmd = reinterpret_cast<VkDrawIndirectCommand const *>(buffer->getOffsetPointer(offset + drawId * stride));
+			const auto *cmd = reinterpret_cast<const VkDrawIndirectCommand *>(buffer->getOffsetPointer(offset + drawId * stride));
 			draw(executionState, false, cmd->vertexCount, cmd->instanceCount, 0, cmd->firstVertex, cmd->firstInstance);
 		}
 	}
@@ -1058,7 +1058,7 @@
 	{
 		for(auto drawId = 0u; drawId < drawCount; drawId++)
 		{
-			const auto *cmd = reinterpret_cast<VkDrawIndexedIndirectCommand const *>(buffer->getOffsetPointer(offset + drawId * stride));
+			const auto *cmd = reinterpret_cast<const VkDrawIndexedIndirectCommand *>(buffer->getOffsetPointer(offset + drawId * stride));
 			draw(executionState, true, cmd->indexCount, cmd->instanceCount, cmd->firstIndex, cmd->vertexOffset, cmd->firstInstance);
 		}
 	}
@@ -1519,7 +1519,7 @@
 class CmdSetPushConstants : public vk::CommandBuffer::Command
 {
 public:
-	CmdSetPushConstants(uint32_t offset, uint32_t size, void const *pValues)
+	CmdSetPushConstants(uint32_t offset, uint32_t size, const void *pValues)
 	    : offset(offset)
 	    , size(size)
 	{
@@ -1827,7 +1827,7 @@
 }
 
 template<typename T, typename... Args>
-void CommandBuffer::addCommand(Args &&... args)
+void CommandBuffer::addCommand(Args &&...args)
 {
 	// FIXME (b/119409619): use an allocator here so we can control all memory allocations
 	commands.push_back(std::make_unique<T>(std::forward<Args>(args)...));
diff --git a/src/Vulkan/VkDescriptorSetLayout.hpp b/src/Vulkan/VkDescriptorSetLayout.hpp
index a0c0227..bf3a1c0 100644
--- a/src/Vulkan/VkDescriptorSetLayout.hpp
+++ b/src/Vulkan/VkDescriptorSetLayout.hpp
@@ -104,7 +104,7 @@
 	static void WriteDescriptorSet(Device *device, const VkWriteDescriptorSet &descriptorWrites);
 	static void CopyDescriptorSet(const VkCopyDescriptorSet &descriptorCopies);
 
-	static void WriteDescriptorSet(Device *device, DescriptorSet *dstSet, const VkDescriptorUpdateTemplateEntry &entry, char const *src);
+	static void WriteDescriptorSet(Device *device, DescriptorSet *dstSet, const VkDescriptorUpdateTemplateEntry &entry, const char *src);
 
 	void initialize(DescriptorSet *descriptorSet, uint32_t variableDescriptorCount);
 
diff --git a/src/Vulkan/VkDescriptorUpdateTemplate.cpp b/src/Vulkan/VkDescriptorUpdateTemplate.cpp
index 9394384..d3e88bb 100644
--- a/src/Vulkan/VkDescriptorUpdateTemplate.cpp
+++ b/src/Vulkan/VkDescriptorUpdateTemplate.cpp
@@ -43,7 +43,7 @@
 	for(uint32_t i = 0; i < descriptorUpdateEntryCount; i++)
 	{
 		DescriptorSetLayout::WriteDescriptorSet(device, descriptorSet, descriptorUpdateEntries[i],
-		                                        reinterpret_cast<char const *>(pData));
+		                                        reinterpret_cast<const char *>(pData));
 	}
 }
 
diff --git a/src/Vulkan/VkImage.cpp b/src/Vulkan/VkImage.cpp
index c960de9..4aba37c 100644
--- a/src/Vulkan/VkImage.cpp
+++ b/src/Vulkan/VkImage.cpp
@@ -127,7 +127,7 @@
 
 VkFormat GetImageFormat(const VkImageCreateInfo *pCreateInfo)
 {
-	const auto *nextInfo = reinterpret_cast<VkBaseInStructure const *>(pCreateInfo->pNext);
+	const auto *nextInfo = reinterpret_cast<const VkBaseInStructure *>(pCreateInfo->pNext);
 	while(nextInfo)
 	{
 		// Casting to an int since some structures, such as VK_STRUCTURE_TYPE_NATIVE_BUFFER_ANDROID and
diff --git a/src/Vulkan/VkRenderPass.cpp b/src/Vulkan/VkRenderPass.cpp
index 077efb0..135fbde 100644
--- a/src/Vulkan/VkRenderPass.cpp
+++ b/src/Vulkan/VkRenderPass.cpp
@@ -247,7 +247,7 @@
 			{
 				// Renderpass uses multiview if this structure is present AND some subpass specifies
 				// a nonzero view mask
-				const auto *multiviewCreateInfo = reinterpret_cast<VkRenderPassMultiviewCreateInfo const *>(extensionCreateInfo);
+				const auto *multiviewCreateInfo = reinterpret_cast<const VkRenderPassMultiviewCreateInfo *>(extensionCreateInfo);
 				for(auto i = 0u; i < pCreateInfo->subpassCount; i++)
 				{
 					masks[i] = multiviewCreateInfo->pViewMasks[i];
diff --git a/src/Vulkan/libVulkan.cpp b/src/Vulkan/libVulkan.cpp
index cc9e550..4d33623 100644
--- a/src/Vulkan/libVulkan.cpp
+++ b/src/Vulkan/libVulkan.cpp
@@ -1122,7 +1122,7 @@
 			UNSUPPORTED("pCreateInfo->pQueueCreateInfos[%d]->flags 0x%08X", i, queueCreateInfo.flags);
 		}
 
-		const auto *extInfo = reinterpret_cast<VkBaseInStructure const *>(queueCreateInfo.pNext);
+		const auto *extInfo = reinterpret_cast<const VkBaseInStructure *>(queueCreateInfo.pNext);
 		while(extInfo)
 		{
 			UNSUPPORTED("pCreateInfo->pQueueCreateInfos[%d].pNext sType = %s", i, vk::Stringify(extInfo->sType).c_str());
@@ -1724,7 +1724,7 @@
 		UNSUPPORTED("pCreateInfo->flags 0x%08X", int(pCreateInfo->flags));
 	}
 
-	const auto *extInfo = reinterpret_cast<VkBaseInStructure const *>(pCreateInfo->pNext);
+	const auto *extInfo = reinterpret_cast<const VkBaseInStructure *>(pCreateInfo->pNext);
 	while(extInfo)
 	{
 		// Vulkan 1.2: "pNext must be NULL"
@@ -1779,7 +1779,7 @@
 		UNSUPPORTED("pCreateInfo->flags 0x%08X", int(pCreateInfo->flags));
 	}
 
-	const auto *extInfo = reinterpret_cast<VkBaseInStructure const *>(pCreateInfo->pNext);
+	const auto *extInfo = reinterpret_cast<const VkBaseInStructure *>(pCreateInfo->pNext);
 	while(extInfo)
 	{
 		UNSUPPORTED("pCreateInfo->pNext sType = %s", vk::Stringify(extInfo->sType).c_str());
@@ -1877,7 +1877,7 @@
 		UNSUPPORTED("pCreateInfo->flags 0x%08X", int(pCreateInfo->flags));
 	}
 
-	const auto *extInfo = reinterpret_cast<VkBaseInStructure const *>(pCreateInfo->pNext);
+	const auto *extInfo = reinterpret_cast<const VkBaseInStructure *>(pCreateInfo->pNext);
 	while(extInfo)
 	{
 		UNSUPPORTED("pCreateInfo->pNext sType = %s", vk::Stringify(extInfo->sType).c_str());
@@ -2145,7 +2145,7 @@
 		UNSUPPORTED("pCreateInfo->flags 0x%08X", int(pCreateInfo->flags));
 	}
 
-	const auto *extInfo = reinterpret_cast<VkBaseInStructure const *>(pCreateInfo->pNext);
+	const auto *extInfo = reinterpret_cast<const VkBaseInStructure *>(pCreateInfo->pNext);
 	while(extInfo)
 	{
 		UNSUPPORTED("pCreateInfo->pNext sType = %s", vk::Stringify(extInfo->sType).c_str());
@@ -2433,7 +2433,7 @@
 	TRACE("(VkDevice device = %p, const VkDescriptorPoolCreateInfo* pCreateInfo = %p, const VkAllocationCallbacks* pAllocator = %p, VkDescriptorPool* pDescriptorPool = %p)",
 	      device, pCreateInfo, pAllocator, pDescriptorPool);
 
-	const auto *extInfo = reinterpret_cast<VkBaseInStructure const *>(pCreateInfo->pNext);
+	const auto *extInfo = reinterpret_cast<const VkBaseInStructure *>(pCreateInfo->pNext);
 	while(extInfo)
 	{
 		switch(extInfo->sType)
@@ -2479,13 +2479,13 @@
 
 	const VkDescriptorSetVariableDescriptorCountAllocateInfo *variableDescriptorCountAllocateInfo = nullptr;
 
-	const auto *extInfo = reinterpret_cast<VkBaseInStructure const *>(pAllocateInfo->pNext);
+	const auto *extInfo = reinterpret_cast<const VkBaseInStructure *>(pAllocateInfo->pNext);
 	while(extInfo)
 	{
 		switch(extInfo->sType)
 		{
 		case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO:
-			variableDescriptorCountAllocateInfo = reinterpret_cast<VkDescriptorSetVariableDescriptorCountAllocateInfo const *>(extInfo);
+			variableDescriptorCountAllocateInfo = reinterpret_cast<const VkDescriptorSetVariableDescriptorCountAllocateInfo *>(extInfo);
 			break;
 		default:
 			UNSUPPORTED("pAllocateInfo->pNext sType = %s", vk::Stringify(extInfo->sType).c_str());
@@ -3336,7 +3336,7 @@
 
 	for(uint32_t i = 0; i < bindInfoCount; i++)
 	{
-		const auto *extInfo = reinterpret_cast<VkBaseInStructure const *>(pBindInfos[i].pNext);
+		const auto *extInfo = reinterpret_cast<const VkBaseInStructure *>(pBindInfos[i].pNext);
 		while(extInfo)
 		{
 			UNSUPPORTED("pBindInfos[%d].pNext sType = %s", i, vk::Stringify(extInfo->sType).c_str());
@@ -3377,7 +3377,7 @@
 		vk::DeviceMemory *memory = vk::Cast(pBindInfos[i].memory);
 		VkDeviceSize offset = pBindInfos[i].memoryOffset;
 
-		const auto *extInfo = reinterpret_cast<VkBaseInStructure const *>(pBindInfos[i].pNext);
+		const auto *extInfo = reinterpret_cast<const VkBaseInStructure *>(pBindInfos[i].pNext);
 		while(extInfo)
 		{
 			switch(extInfo->sType)
@@ -3389,7 +3389,7 @@
 #ifndef __ANDROID__
 			case VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR:
 				{
-					const auto *swapchainInfo = reinterpret_cast<VkBindImageMemorySwapchainInfoKHR const *>(extInfo);
+					const auto *swapchainInfo = reinterpret_cast<const VkBindImageMemorySwapchainInfoKHR *>(extInfo);
 					memory = vk::Cast(swapchainInfo->swapchain)->getImage(swapchainInfo->imageIndex).getImageMemory();
 					offset = 0;
 				}
@@ -3453,7 +3453,7 @@
 	TRACE("(VkDevice device = %p, const VkImageMemoryRequirementsInfo2* pInfo = %p, VkMemoryRequirements2* pMemoryRequirements = %p)",
 	      device, pInfo, pMemoryRequirements);
 
-	const auto *extInfo = reinterpret_cast<VkBaseInStructure const *>(pInfo->pNext);
+	const auto *extInfo = reinterpret_cast<const VkBaseInStructure *>(pInfo->pNext);
 	while(extInfo)
 	{
 		UNSUPPORTED("pInfo->pNext sType = %s", vk::Stringify(extInfo->sType).c_str());
@@ -3468,7 +3468,7 @@
 	TRACE("(VkDevice device = %p, const VkBufferMemoryRequirementsInfo2* pInfo = %p, VkMemoryRequirements2* pMemoryRequirements = %p)",
 	      device, pInfo, pMemoryRequirements);
 
-	const auto *extInfo = reinterpret_cast<VkBaseInStructure const *>(pInfo->pNext);
+	const auto *extInfo = reinterpret_cast<const VkBaseInStructure *>(pInfo->pNext);
 	while(extInfo)
 	{
 		UNSUPPORTED("pInfo->pNext sType = %s", vk::Stringify(extInfo->sType).c_str());
@@ -3502,14 +3502,14 @@
 	TRACE("(VkDevice device = %p, const VkImageSparseMemoryRequirementsInfo2* pInfo = %p, uint32_t* pSparseMemoryRequirementCount = %p, VkSparseImageMemoryRequirements2* pSparseMemoryRequirements = %p)",
 	      device, pInfo, pSparseMemoryRequirementCount, pSparseMemoryRequirements);
 
-	const auto *extInfo = reinterpret_cast<VkBaseInStructure const *>(pInfo->pNext);
+	const auto *extInfo = reinterpret_cast<const VkBaseInStructure *>(pInfo->pNext);
 	while(extInfo)
 	{
 		UNSUPPORTED("pInfo->pNext sType = %s", vk::Stringify(extInfo->sType).c_str());
 		extInfo = extInfo->pNext;
 	}
 
-	const auto *extensionRequirements = reinterpret_cast<VkBaseInStructure const *>(pSparseMemoryRequirements->pNext);
+	const auto *extensionRequirements = reinterpret_cast<const VkBaseInStructure *>(pSparseMemoryRequirements->pNext);
 	while(extensionRequirements)
 	{
 		UNSUPPORTED("pSparseMemoryRequirements->pNext sType = %s", vk::Stringify(extensionRequirements->sType).c_str());
@@ -4019,7 +4019,7 @@
 
 	if(pQueueFamilyProperties)
 	{
-		const auto *extInfo = reinterpret_cast<VkBaseInStructure const *>(pQueueFamilyProperties->pNext);
+		const auto *extInfo = reinterpret_cast<const VkBaseInStructure *>(pQueueFamilyProperties->pNext);
 		while(extInfo)
 		{
 			UNSUPPORTED("pQueueFamilyProperties->pNext sType = %s", vk::Stringify(extInfo->sType).c_str());
@@ -4041,7 +4041,7 @@
 {
 	TRACE("(VkPhysicalDevice physicalDevice = %p, VkPhysicalDeviceMemoryProperties2* pMemoryProperties = %p)", physicalDevice, pMemoryProperties);
 
-	const auto *extInfo = reinterpret_cast<VkBaseInStructure const *>(pMemoryProperties->pNext);
+	const auto *extInfo = reinterpret_cast<const VkBaseInStructure *>(pMemoryProperties->pNext);
 	while(extInfo)
 	{
 		UNSUPPORTED("pMemoryProperties->pNext sType = %s", vk::Stringify(extInfo->sType).c_str());
@@ -4058,7 +4058,7 @@
 
 	if(pProperties)
 	{
-		const auto *extInfo = reinterpret_cast<VkBaseInStructure const *>(pProperties->pNext);
+		const auto *extInfo = reinterpret_cast<const VkBaseInStructure *>(pProperties->pNext);
 		while(extInfo)
 		{
 			UNSUPPORTED("pProperties->pNext sType = %s", vk::Stringify(extInfo->sType).c_str());
@@ -4103,7 +4103,7 @@
 	TRACE("(VkDevice device = %p, const VkDeviceQueueInfo2* pQueueInfo = %p, VkQueue* pQueue = %p)",
 	      device, pQueueInfo, pQueue);
 
-	const auto *extInfo = reinterpret_cast<VkBaseInStructure const *>(pQueueInfo->pNext);
+	const auto *extInfo = reinterpret_cast<const VkBaseInStructure *>(pQueueInfo->pNext);
 	while(extInfo)
 	{
 		UNSUPPORTED("pQueueInfo->pNext sType = %s", vk::Stringify(extInfo->sType).c_str());
@@ -4128,7 +4128,7 @@
 	TRACE("(VkDevice device = %p, const VkSamplerYcbcrConversionCreateInfo* pCreateInfo = %p, const VkAllocationCallbacks* pAllocator = %p, VkSamplerYcbcrConversion* pYcbcrConversion = %p)",
 	      device, pCreateInfo, pAllocator, pYcbcrConversion);
 
-	const auto *extInfo = reinterpret_cast<VkBaseInStructure const *>(pCreateInfo->pNext);
+	const auto *extInfo = reinterpret_cast<const VkBaseInStructure *>(pCreateInfo->pNext);
 	while(extInfo)
 	{
 		switch(extInfo->sType)
@@ -4171,7 +4171,7 @@
 		UNSUPPORTED("pCreateInfo->templateType %d", int(pCreateInfo->templateType));
 	}
 
-	const auto *extInfo = reinterpret_cast<VkBaseInStructure const *>(pCreateInfo->pNext);
+	const auto *extInfo = reinterpret_cast<const VkBaseInStructure *>(pCreateInfo->pNext);
 	while(extInfo)
 	{
 		UNSUPPORTED("pCreateInfo->pNext sType = %s", vk::Stringify(extInfo->sType).c_str());
@@ -4291,7 +4291,7 @@
 	TRACE("(VkDevice device = %p, const VkDeviceImageMemoryRequirements* pInfo = %p, VkMemoryRequirements2* pMemoryRequirements = %p)",
 	      device, pInfo, pMemoryRequirements);
 
-	const auto *extInfo = reinterpret_cast<VkBaseInStructure const *>(pInfo->pNext);
+	const auto *extInfo = reinterpret_cast<const VkBaseInStructure *>(pInfo->pNext);
 	while(extInfo)
 	{
 		UNSUPPORTED("pInfo->pNext sType = %s", vk::Stringify(extInfo->sType).c_str());
diff --git a/tests/VulkanUnitTests/Device.cpp b/tests/VulkanUnitTests/Device.cpp
index 7cffc43..6785267 100644
--- a/tests/VulkanUnitTests/Device.cpp
+++ b/tests/VulkanUnitTests/Device.cpp
@@ -23,7 +23,7 @@
 {}
 
 Device::Device(
-    Driver const *driver, VkDevice device, VkPhysicalDevice physicalDevice,
+    const Driver *driver, VkDevice device, VkPhysicalDevice physicalDevice,
     uint32_t queueFamilyIndex)
     : driver(driver)
     , device(device)
@@ -46,7 +46,7 @@
 }
 
 VkResult Device::CreateComputeDevice(
-    Driver const *driver, VkInstance instance, std::unique_ptr<Device> &out)
+    const Driver *driver, VkInstance instance, std::unique_ptr<Device> &out)
 {
 	VkResult result;
 
@@ -105,7 +105,7 @@
 }
 
 int Device::GetComputeQueueFamilyIndex(
-    Driver const *driver, VkPhysicalDevice device)
+    const Driver *driver, VkPhysicalDevice device)
 {
 	auto properties = GetPhysicalDeviceQueueFamilyProperties(driver, device);
 	for(uint32_t i = 0; i < properties.size(); i++)
@@ -120,7 +120,7 @@
 
 std::vector<VkQueueFamilyProperties>
 Device::GetPhysicalDeviceQueueFamilyProperties(
-    Driver const *driver, VkPhysicalDevice device)
+    const Driver *driver, VkPhysicalDevice device)
 {
 	std::vector<VkQueueFamilyProperties> out;
 	uint32_t count = 0;
diff --git a/tests/VulkanUnitTests/Device.hpp b/tests/VulkanUnitTests/Device.hpp
index 5a67da4..5a141c2 100644
--- a/tests/VulkanUnitTests/Device.hpp
+++ b/tests/VulkanUnitTests/Device.hpp
@@ -35,7 +35,7 @@
 	// returned (as there was no Vulkan error), but calling Device::IsValid()
 	// on this device will return false.
 	static VkResult CreateComputeDevice(
-	    Driver const *driver, VkInstance instance, std::unique_ptr<Device> &out);
+	    const Driver *driver, VkInstance instance, std::unique_ptr<Device> &out);
 
 	// IsValid returns true if the Device is initialized and can be used.
 	bool IsValid() const;
@@ -137,20 +137,20 @@
 	VkResult QueueSubmitAndWait(VkCommandBuffer commandBuffer) const;
 
 	static VkResult GetPhysicalDevices(
-	    Driver const *driver, VkInstance instance,
+	    const Driver *driver, VkInstance instance,
 	    std::vector<VkPhysicalDevice> &out);
 
 	static int GetComputeQueueFamilyIndex(
-	    Driver const *driver, VkPhysicalDevice device);
+	    const Driver *driver, VkPhysicalDevice device);
 
 private:
-	Device(Driver const *driver, VkDevice device, VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex);
+	Device(const Driver *driver, VkDevice device, VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex);
 
 	static std::vector<VkQueueFamilyProperties>
 	GetPhysicalDeviceQueueFamilyProperties(
-	    Driver const *driver, VkPhysicalDevice device);
+	    const Driver *driver, VkPhysicalDevice device);
 
-	Driver const *driver;
+	const Driver *driver;
 	VkDevice device;
 	VkPhysicalDevice physicalDevice;
 	uint32_t queueFamilyIndex;