Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

移除 types 的位域,使得多语言标准下均能保证有相同的 ABI #129

Merged
merged 1 commit into from
Jul 20, 2024

Conversation

zhaoxi-scut
Copy link
Member

Pull Request 合并请求准备清单

详情参见此处

  • 我同意在 Apache 2 开源许可下为本项目做贡献
  • 此 pull request 是在正确的分支上提出的
  • 此 pull request 有对应的错误报告或其他待改进的内容
  • 我本地的 RMVL 进行了单元测试、性能测试,有对应的测试数据
  • 我提交的 feature 有很好的文档记录,并且可以使用 CMake 项目构建示例代码

具体内容

rm::RMStatus 类型移除 C++20 标准下位域初始化的写法,统一移除位域,改为使用简单的组合,即

//! 状态类型
struct RMStatus
{
    ArmorSizeType ArmorSizeTypeID{};
    RuneType RuneTypeID{};
    CompensateType CompensateTypeID{};
    RobotType RobotTypeID{};
    TagType TagTypeID{};

    /* code */
};

解决过程

此问题出现在测试通过 gcc 和 CMake 使用 RMVL文档的过程中,图像中并未显示出绘制过的线条,在经过控制台标准输出之后,发现需要绘制的 4 个角点均为 (0, 0) 或其他乱码:

const auto &corners = p_combo->getCorners();
printf("combo: (%f, %f), (%f, %f), (%f, %f), (%f, %f)\n",
       corners[0].x, corners[0].y,
       corners[1].x, corners[1].y,
       corners[2].x, corners[2].y,
       corners[3].x, corners[3].y);
// 结果如下
// combo: (0.000000, 0.000000), (0.000000, 0.000000), (0.000000, 0.000000), (0.000000, 0.000000)

最后发现是 rm::RMStatus 的问题

@zhaoxi-scut zhaoxi-scut added the bug 代码上、功能上存在严重漏洞... label Jul 20, 2024
@zhaoxi-scut zhaoxi-scut added this to the 1.4.0 milestone Jul 20, 2024
@zhaoxi-scut zhaoxi-scut merged commit 6d79e69 into cv-rmvl:master Jul 20, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 代码上、功能上存在严重漏洞...
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant