Repository navigation
windows: initialize descriptor lookup tables with memset - #862
Merged
Merged
Conversation
Replace the per-element initialization loops with explicit memset calls. Compilers already synthesized these calls at higher optimization levels, so this makes the intent explicit without changing behavior. On Windows, int is a 32-bit two's complement type, so filling each byte with 0xFF represents -1. C23 also mandates two's complement (N2218). Assisted-by: deepseek-harness:deepseek-flash
Contributor
Author
|
Closing as redundant: the descriptor initialization change is now required by #860 once the standard-symbol shim is removed. |
Youw
approved these changes
Nov 25, 2026
Youw
reviewed
Nov 25, 2026
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.
Use explicit
memsetcalls for the descriptor reconstruction lookup tables instead of per-element initialization loops.The loops are equivalent on Windows:
intis 32-bit two's complement, so filling each byte with0xFFrepresents-1. Higher optimization levels already turn those loops intomemsetcalls, so this makes the initialization explicit without changing behavior. C23 also mandates two's complement (N2218); the Windows compiler ABIs targeted by HIDAPI have the same representation.Assisted-by: deepseek-harness:deepseek-flash