Skip to content

Conversation

@18202781743
Copy link
Contributor

  1. Fixed incorrect bitwise AND operation in property status tracking
  2. Changed fetchAndAndOrdered(1 << index) to fetchAndAndOrdered(~(1 << index))
  3. This ensures proper bit clearing when unsetting property flags
  4. The change was made in both the generated header and the generator
    tool
  5. Without this fix, status tracking would incorrectly set bits instead
    of clearing them

fix: 修正 dconfig 状态跟踪中的位操作

  1. 修复了属性状态跟踪中错误的位与操作
  2. fetchAndAndOrdered(1 << index) 改为 fetchAndAndOrdered(~(1 << index))
  3. 确保在取消设置属性标志时能正确清除位
  4. 修改同时应用于生成的头部文件和生成器工具
  5. 若不修复此问题,状态跟踪会错误地设置位而非清除它们

1. Fixed incorrect bitwise AND operation in property status tracking
2. Changed `fetchAndAndOrdered(1 << index)` to `fetchAndAndOrdered(~(1
<< index))`
3. This ensures proper bit clearing when unsetting property flags
4. The change was made in both the generated header and the generator
tool
5. Without this fix, status tracking would incorrectly set bits instead
of clearing them

fix: 修正 dconfig 状态跟踪中的位操作

1. 修复了属性状态跟踪中错误的位与操作
2. 将 `fetchAndAndOrdered(1 << index)` 改为 `fetchAndAndOrdered(~(1
<< index))`
3. 确保在取消设置属性标志时能正确清除位
4. 修改同时应用于生成的头部文件和生成器工具
5. 若不修复此问题,状态跟踪会错误地设置位而非清除它们
@18202781743 18202781743 requested review from BLumia, mhduiy and zccrs May 8, 2025 08:58
@deepin-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

deepin-ci-robot added a commit to linuxdeepin/dtk6core that referenced this pull request May 8, 2025
Synchronize source files from linuxdeepin/dtkcore.

Source-pull-request: linuxdeepin/dtkcore#471
@deepin-ci-robot
Copy link
Contributor

deepin pr auto review

代码审查意见:

  1. 代码注释

    • dconfig_org_deepin_dtk_preference.hpp文件中,生成时间的注释应该更新为最新的生成时间,以反映最新的修改。
  2. 逻辑错误

    • dconfig_org_deepin_dtk_preference.hpp文件中,fetchAndAndOrdered函数的参数从1 << (index - 0)更改为~(1 << (index - 0))。这可能是为了实现相反的逻辑,即当onfalse时,清除对应位置的位。但是,需要确认这一更改是否符合预期的业务逻辑。
  3. 代码风格

    • tools/dconfig2cpp/main.cpp文件中,生成的代码风格应该保持一致,例如,if (on)else语句之间的缩进应该一致。
  4. 代码可读性

    • tools/dconfig2cpp/main.cpp文件中,生成的代码应该有适当的注释,解释每个步骤的目的,以提高代码的可读性。
  5. 性能考虑

    • 如果fetchAndAndOrdered函数的调用频率很高,考虑是否有必要优化这些操作,例如,通过批量处理来减少对原子操作的依赖。
  6. 安全性

    • 确保生成的代码没有引入任何安全漏洞,特别是如果这些代码会被直接嵌入到生产环境中。
  7. 测试

    • 对于任何逻辑更改,都应该有相应的单元测试来验证更改后的行为是否符合预期。

综上所述,代码的更改看起来是为了实现逻辑上的反转,但是需要确保这一更改是经过充分测试和验证的。同时,保持代码的注释、风格和可读性也是非常重要的。

@18202781743 18202781743 closed this May 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants