Repository navigation
build(libobs-opengl): make the conversions explicit (#2625) - #2871
Merged
Merged
Conversation
RED: the target now compiles with -Wconversion, -Wsign-conversion and -Wfloat-conversion instead of inheriting the global -Wno-* pins. The Tier 2 replay of the target's unity TUs reports the implicit conversions that were hidden.
GREEN: the 89 -Wsign-conversion diagnostics the RED commit exposed are stated at their boundaries in the target's 12 translation units. - gl-helpers/gl-subsystem: the GL entry points take GLint/GLsizei/GLenum/ GLuint, so texture dimensions, mip levels, offsets, buffer sizes and the bound framebuffer/attribute ids convert once at the call. - gl-egl-common: EGLAttrib takes the upper 32 bits of a DRM modifier, and the allocation sizes and device counts are explicit. - gl-x11-egl: the X visual id and the pixmap target are explicit. - gl-shader: the info-log lengths and the attribute index arithmetic are explicit size_t. No behaviour change: every cast keeps the value the code already computed. The global -Wno-conversion / -Wno-sign-conversion / -Wno-float-conversion stay until every target is ratcheted.
MCPVOT
pushed a commit
to MCPVOT/obs-studio
that referenced
this pull request
Oct 30, 2026
…t#2879) (obs-rust#2880) The macOS branch of device_stage_texture() is inside #ifdef __APPLE__, so the Linux replay behind obs-rust#2871 never compiled it and missed two -Wsign-conversion diagnostics: the framebuffer restore passes a GLint binding to gl_bind_framebuffer(GLuint), and glReadPixels takes GLsizei widths from uint32_t stage-surface dimensions. State both at the call; the values are unchanged (a read-framebuffer binding is a non-negative name).
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.
Slice of #2625: the conversion groups on
libobs-opengl, with every conversion in the target's own translation units stated at the call site.RED
915ec4f64adds the three-W*conversionenablers to thelibobs-opengltarget only. The target's two unity translation units (build/opengl.core+.h.c,build/opengl.nix+.h.c) replay with the global-Wno-conversion/-Wno-sign-conversion/-Wno-float-conversionpins dropped and report 89 diagnostics, all-Wsign-conversion, in 12 files:gl-helpers.c.hgl-texture3d.c.hgl-egl-common.c.hgl-subsystem.c.hgl-vertexbuffer.c.hgl-shader.c.hgl-texture2d.c.hgl-x11-egl.c.hgl-texturecube.c.hgl-zstencil.c.hgl-indexbuffer.c.hgl-stagesurf.c.hGREEN
f4dd3f5ccstates each one at its boundary:gl-helpers/gl-subsystem: the GL entry points takeGLint/GLsizei/GLenum/GLuint, so texture dimensions, mip levels, copy offsets, mapped buffer sizes, the bound framebuffer id and the vertex attribute ids convert once at the call. The viewport'sbase_height - y - heightstays signed through the assignment.gl-texture2d/gl-texture3d/gl-texturecube/gl-zstencil: the internal format (GLenumin the texture struct,GLintin the GL call), the per-mip dimensions and the mip level are explicit.gl-egl-common:EGLAttribtakes the upper 32 bits of a DRM modifier as its own signed 64-bit type; the format/modifier allocation sizes and the device count are explicit.gl-x11-egl: the X visual id (xcb_visualid_t) and the pixmap target (EGLint) are explicit.gl-shader: the info-log lengths and the attribute index arithmetic are explicitsize_t.Every cast keeps the value the code already computed; there is no pragma and no per-file
-Wno-*.Evidence
ci/warning_findings.py --language c, compdb of the configured tree, three pins dropped).obs-rust-linux-validate:e756cdba69646bd5at this tip (target objects rebuilt):ninja libobs-opengl→RC=0, nowarning:/error:lines,libobs-opengl.solinked../lintclean (clang-format, gersemi, the repo Dylints).The global pins stay until every target is ratcheted; this slice only removes them from this target's flag list. MSVC is unaffected, since the generator expression does not match it.
Refs #2625. No
docs/features.mdline: build tooling only.