diff --git a/.gitignore b/.gitignore index a15a2d842..fbb342503 100644 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,7 @@ local.properties .cache compile_commands.json /build +/build-* **/.idea **/.clwb /new_offline.db diff --git a/platform/darwin/core/local_glyph_rasterizer.mm b/platform/darwin/core/local_glyph_rasterizer.mm index 340fbb62a..a1e0b56dc 100644 --- a/platform/darwin/core/local_glyph_rasterizer.mm +++ b/platform/darwin/core/local_glyph_rasterizer.mm @@ -266,8 +266,8 @@ PremultipliedImage drawGlyphBitmap(GlyphID glyphID, CTFontRef font, GlyphMetrics CFArrayRef glyphRuns = CTLineGetGlyphRuns(*line); CTRunRef glyphRun = (CTRunRef)CFArrayGetValueAtIndex(glyphRuns, 0); CFRange wholeRunRange = CFRangeMake(0, CTRunGetGlyphCount(glyphRun)); - CGSize advances[wholeRunRange.length]; - CTRunGetAdvances(glyphRun, wholeRunRange, advances); + std::vector advances(wholeRunRange.length); + CTRunGetAdvances(glyphRun, wholeRunRange, advances.data()); metrics.advance = std::round(advances[0].width); // Mimic glyph PBF metrics. diff --git a/src/mbgl/mtl/buffer_resource.cpp b/src/mbgl/mtl/buffer_resource.cpp index 5ac407167..f60528445 100644 --- a/src/mbgl/mtl/buffer_resource.cpp +++ b/src/mbgl/mtl/buffer_resource.cpp @@ -184,7 +184,7 @@ void BufferResource::updateVertexBindOffset(const MTLRenderCommandEncoderPtr& en // The documentation for `setVertexBufferOffset` indicates that it should work for buffers // assigned using `setVertexBytes` but, in practice, it produces a validation failure: // `Set Vertex Buffer Offset Validation index(1) must have an existing buffer.` - if (const auto* mtlBuf = buffer.get()) { + if (buffer.get()) { encoder->setVertexBufferOffset(offset, index); } else { bindVertex(encoder, offset, index, size_); @@ -195,7 +195,7 @@ void BufferResource::updateFragmentBindOffset(const MTLRenderCommandEncoderPtr& std::size_t offset, std::size_t index, std::size_t size_) const noexcept { - if (const auto* mtlBuf = buffer.get()) { + if (buffer.get()) { encoder->setFragmentBufferOffset(offset, index); } else { bindFragment(encoder, offset, index, size_); diff --git a/src/mbgl/mtl/context.cpp b/src/mbgl/mtl/context.cpp index 23624fcb3..b0ccfb116 100644 --- a/src/mbgl/mtl/context.cpp +++ b/src/mbgl/mtl/context.cpp @@ -605,12 +605,12 @@ MTLDepthStencilStatePtr Context::makeDepthStencilState(const gfx::DepthMode& dep // `Draw Errors Validation MTLDepthStencilDescriptor sets depth test but MTLRenderPassDescriptor has a nil // depthAttachment texture` if (auto* depthTarget = rpd->depthAttachment()) { - if (auto* tex = depthTarget->texture()) { + if (depthTarget->texture()) { applyDepthMode(depthMode, depthStencilDescriptor.get()); } } if (auto* stencilTarget = rpd->stencilAttachment()) { - if (auto* tex = stencilTarget->texture()) { + if (stencilTarget->texture()) { auto stencilDescriptor = NS::TransferPtr(MTL::StencilDescriptor::alloc()->init()); if (!stencilDescriptor) { return {};