From 3c4a4408d703446ab0c7fd2a9dbf9efb38d056ef Mon Sep 17 00:00:00 2001 From: ainyan03 Date: Mon, 9 Feb 2026 08:39:54 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20WASM=E3=83=93=E3=83=AB=E3=83=89=E6=99=82?= =?UTF-8?q?=E3=81=AE=E3=82=B3=E3=83=B3=E3=83=91=E3=82=A4=E3=83=AB=E8=AD=A6?= =?UTF-8?q?=E5=91=8A=E3=82=92=E8=A7=A3=E6=B6=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ##__VA_ARGS__ (GNU拡張) を標準の , __VA_ARGS__ に変更 - sign-conversion警告: int系→size_tの暗黙変換にstatic_castを追加 - 対象: common.h, image_buffer.h, pixel_format.h, rgba8_straight.h, viewport.h, distributor_node.h, matte_node.h, sink_node.h --- src/fleximg/core/common.h | 20 +++++++++---------- src/fleximg/image/image_buffer.h | 8 ++++---- src/fleximg/image/pixel_format.h | 2 +- .../image/pixel_format/rgba8_straight.h | 6 +++--- src/fleximg/image/viewport.h | 2 +- src/fleximg/nodes/distributor_node.h | 2 +- src/fleximg/nodes/matte_node.h | 2 +- src/fleximg/nodes/sink_node.h | 2 +- 8 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/fleximg/core/common.h b/src/fleximg/core/common.h index ef26f79..e8ee602 100644 --- a/src/fleximg/core/common.h +++ b/src/fleximg/core/common.h @@ -31,22 +31,22 @@ // #ifdef ARDUINO -#define FLEXIMG_DEBUG_LOG(fmt, ...) \ - do { \ - printf(fmt "\n", ##__VA_ARGS__); \ - fflush(stdout); \ - vTaskDelay(1); \ +#define FLEXIMG_DEBUG_LOG(fmt, ...) \ + do { \ + printf(fmt "\n", __VA_ARGS__); \ + fflush(stdout); \ + vTaskDelay(1); \ } while (0) #else -#define FLEXIMG_DEBUG_LOG(fmt, ...) \ - do { \ - printf(fmt "\n", ##__VA_ARGS__); \ - fflush(stdout); \ +#define FLEXIMG_DEBUG_LOG(fmt, ...) \ + do { \ + printf(fmt "\n", __VA_ARGS__); \ + fflush(stdout); \ } while (0) #endif #ifdef FLEXIMG_DEBUG -#define FLEXIMG_DEBUG_WARN(fmt, ...) FLEXIMG_DEBUG_LOG(fmt, ##__VA_ARGS__) +#define FLEXIMG_DEBUG_WARN(fmt, ...) FLEXIMG_DEBUG_LOG(fmt, __VA_ARGS__) #else #define FLEXIMG_DEBUG_WARN(fmt, ...) ((void)0) #endif diff --git a/src/fleximg/image/image_buffer.h b/src/fleximg/image/image_buffer.h index 97154a3..ea907f3 100644 --- a/src/fleximg/image/image_buffer.h +++ b/src/fleximg/image/image_buffer.h @@ -370,7 +370,7 @@ class ImageBuffer { const uint8_t *srcRow = static_cast(view_.data) + (view_.y + y) * view_.stride + view_.x * view_.bytesPerPixel(); uint8_t *dstRow = static_cast(converted.view_.data) + y * converted.view_.stride; - resolved(dstRow, srcRow, view_.width); + resolved(dstRow, srcRow, static_cast(view_.width)); } } } @@ -582,7 +582,7 @@ inline bool ImageBuffer::blendFrom(const ImageBuffer &src) auto blendFunc = srcFmt->blendUnderStraight; if (blendFunc) { // 直接ブレンド(RGBA8_Straight等、blendUnderStraight実装済みフォーマット) - blendFunc(dstPtr, srcPtr, remaining, srcAux); + blendFunc(dstPtr, srcPtr, static_cast(remaining), srcAux); } else { // フォールバック: チャンク単位でRGBA8_Straightに変換してからブレンド auto converter = resolveConverter(srcFmt, PixelFormatIDs::RGBA8_Straight, srcAux); @@ -600,9 +600,9 @@ inline bool ImageBuffer::blendFrom(const ImageBuffer &src) do { int_fast16_t chunk = std::min(remaining, CHUNK_SIZE); - converter(tempBuf, srcChunkPtr, chunk); + converter(tempBuf, srcChunkPtr, static_cast(chunk)); void *dstChunkPtr = dstRow + static_cast(cursor - dstStartX) * dstPixelBytes; - straightBlend(dstChunkPtr, tempBuf, chunk, nullptr); + straightBlend(dstChunkPtr, tempBuf, static_cast(chunk), nullptr); srcChunkPtr += srcBytesPerChunk; cursor += chunk; remaining -= chunk; diff --git a/src/fleximg/image/pixel_format.h b/src/fleximg/image/pixel_format.h index 7f70735..fa87f72 100644 --- a/src/fleximg/image/pixel_format.h +++ b/src/fleximg/image/pixel_format.h @@ -481,7 +481,7 @@ inline void convertFormat(const void *src, PixelFormatID srcFormat, void *dst, P (void)dstAux; // 現在の全呼び出し箇所で未使用 auto converter = resolveConverter(srcFormat, dstFormat, srcAux); if (converter) { - converter(dst, src, pixelCount); + converter(dst, src, static_cast(pixelCount)); } } diff --git a/src/fleximg/image/pixel_format/rgba8_straight.h b/src/fleximg/image/pixel_format/rgba8_straight.h index 9eed907..56cebd0 100644 --- a/src/fleximg/image/pixel_format/rgba8_straight.h +++ b/src/fleximg/image/pixel_format/rgba8_straight.h @@ -161,7 +161,7 @@ handle_dstA_255: { d += 16; dstA = d[3]; } while (--plimit); - auto pindex = (d - d_start); + auto pindex = static_cast(d - d_start); if (d != d_start) { pixelCount -= pindex >> 2; if (pixelCount <= 0) return; @@ -203,7 +203,7 @@ handle_dstA_0: { dstA = d[3]; s += 16; } while (--plimit); - auto pindex = (s - s_start); + auto pindex = static_cast(s - s_start); if (pindex) { pixelCount -= pindex >> 2; if (pixelCount <= 0) return; @@ -239,7 +239,7 @@ handle_srcA_0: { s += 16; srcA = s[3]; } while (--plimit); - auto pindex = (s - s_start); + auto pindex = static_cast(s - s_start); if (pindex) { pixelCount -= pindex >> 2; if (pixelCount <= 0) return; diff --git a/src/fleximg/image/viewport.h b/src/fleximg/image/viewport.h index fa8aa87..ab5762e 100644 --- a/src/fleximg/image/viewport.h +++ b/src/fleximg/image/viewport.h @@ -473,7 +473,7 @@ void copyRowDDABilinear(void *dst, const ViewPort &src, int_fast16_t count, int_ // フォーマット変換(必要な場合、in-place) if (converter) { - converter(quadBuffer, quadPtr, chunk * 4); + converter(quadBuffer, quadPtr, static_cast(chunk) * 4); } uint32_t *quadRGBA = quadBuffer; diff --git a/src/fleximg/nodes/distributor_node.h b/src/fleximg/nodes/distributor_node.h index 386dd06..bee7a30 100644 --- a/src/fleximg/nodes/distributor_node.h +++ b/src/fleximg/nodes/distributor_node.h @@ -40,7 +40,7 @@ class DistributorNode : public Node, public AffineCapability { public: explicit DistributorNode(int outputCount = 1) { - initPorts(1, outputCount); // 入力1、出力N + initPorts(1, static_cast(outputCount)); // 入力1、出力N } // ======================================== diff --git a/src/fleximg/nodes/matte_node.h b/src/fleximg/nodes/matte_node.h index ff03d6e..ff06bb0 100644 --- a/src/fleximg/nodes/matte_node.h +++ b/src/fleximg/nodes/matte_node.h @@ -474,7 +474,7 @@ RenderResponse &MatteNode::onPullProcess(const RenderRequest &request) (bgViewPort.y + srcY) * bgViewPort.stride + (bgViewPort.x + srcStartX) * srcBytesPerPixel; uint8_t *dstRow = static_cast(outView.data) + y * outView.stride + copyStartX * 4; - converter(dstRow, srcRow, copyWidth); + converter(dstRow, srcRow, static_cast(copyWidth)); } } } diff --git a/src/fleximg/nodes/sink_node.h b/src/fleximg/nodes/sink_node.h index 85fc7d7..95eeb2c 100644 --- a/src/fleximg/nodes/sink_node.h +++ b/src/fleximg/nodes/sink_node.h @@ -275,7 +275,7 @@ void SinkNode::onPushProcess(RenderResponse &input, const RenderRequest &request for (int_fast32_t y = 0; y < copyH; ++y) { const void *srcRow = inputView.pixelAt(srcX, srcY + static_cast(y)); void *dstRow = target_.pixelAt(dstX, dstY + static_cast(y)); - converter(dstRow, srcRow, static_cast(copyW)); + converter(dstRow, srcRow, static_cast(copyW)); } } }