Repository navigation
fix(libobs): explicit uint32_t cast for sampler BorderColor (#1816) - #1821
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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) assignedstrtol()touint32_t border_color. On LLP64longis 32-bit, so the oracle'sSTRICT_FLAGS-Wsign-conversion -Werrorfails. 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 -Werroron 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 unitrust/obs-c-oracle/oracle/shader_sampler_convert.ccompiles with no sign-conversion diagnostics under -m32../lintpasses.