Skip to content

fix(libobs): explicit uint32_t cast for sampler BorderColor (#1816) - #1821

Merged
zackees merged 1 commit into
masterfrom
fix/1816-sampler-sign-conversion
Oct 22, 2026
Merged

zackees merged 1 commit into
masterfrom
fix/1816-sampler-sign-conversion

Conversation

@zackees

@zackees zackees commented Oct 22, 2026

Copy link
Copy Markdown
Member

Fixes #1816 (master RED: every Fast Gate rust-test lane fails on the x86_64-pc-windows-gnu oracle build).

libobs/graphics/shader-sampler-convert.c.h (internal, not an installed public header) assigned strtol() to uint32_t border_color. On LLP64 long is 32-bit, so the oracle's STRICT_FLAGS -Wsign-conversion -Werror fails. Fix: explicit (uint32_t) cast, matching the (int) cast on MaxAnisotropy two lines above. Identical conversion semantics, so C behaviour is unchanged. No C tests or public headers touched; no warning suppression added.

Local RED evidence (32-bit long reproduces the mingw case): gcc -m32 -Wsign-conversion -Werror on the original statement -> error: conversion to 'uint32_t' from 'long int' may change the sign of the result [-Werror=sign-conversion]; with the cast it compiles clean, and the oracle unit rust/obs-c-oracle/oracle/shader_sampler_convert.c compiles with no sign-conversion diagnostics under -m32. ./lint passes.

On LLP64 (windows-gnu) long is 32-bit, so assigning strtol() to the
uint32_t border_color trips -Wsign-conversion in the strict oracle build.
The explicit cast is the same conversion the implicit one did; behaviour
is unchanged. Matches the (int) cast on MaxAnisotropy two lines above.

Fixes #1816
@zackees
zackees enabled auto-merge October 22, 2026 19:45
@zackees
zackees added this pull request to the merge queue Oct 22, 2026
Merged via the queue into master with commit 9f37f66 Oct 22, 2026
30 checks passed
@zackees
zackees deleted the fix/1816-sampler-sign-conversion branch October 26, 2026 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

bug: shader sampler C oracle fails strict sign-conversion compilation after #1750

1 participant