fix(input): correct batch overflow handling - #853
Closed
qiin2333 wants to merge 1 commit into
Closed
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📜 Recent review details⏰ Context from checks skipped due to timeout. (1)
🧰 Additional context used📓 Path-based instructions (1)src/**/*.{cpp,c,h}⚙️ CodeRabbit configuration file
Files:
🔇 Additional comments (1)
Summary by CodeRabbit
Walkthrough修正输入消息批处理中相对鼠标移动、垂直滚轮和水平滚轮的 16-bit 加法溢出判断,使批处理仅在发生溢出时终止。 Changes输入批处理溢出判断
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
改了啥呀
为啥要改
__builtin_add_overflow()在发生溢出时返回true,原代码却对结果取反了。这个小小的!把逻辑整个颠倒:正常输入无法合批,极端溢出反而可能写入回绕结果。杂鱼 bug 这次乖乖退场啦。修复后,高频鼠标和滚轮输入可以按设计合并;发生溢出时则保留两个独立事件,避免位移或滚动量回绕。
验证
git diff --check:通过SHRT_MAX + 1、SHRT_MIN - 1均通过cc1plus.exe启动即返回0xC0000139;备用 Clang 检查被工程现有工具链/依赖兼容问题阻断,未出现由本补丁导致的诊断