Skip to content

Conversation

dongly
Copy link
Contributor

@dongly dongly commented Mar 30, 2022

拉取/合并请求描述:(PR description)

[

修复 gcc 带参数 " -W" 编译出现的一些警告

  • 编译环境: ARM GCC V10.2.1
  • BSP: STM32F407
    ]

以下的内容不应该在提交PR时的message修改,修改下述message,PR会被直接关闭。请在提交PR后,浏览器查看PR并对以下检查项逐项check,没问题后逐条在页面上打钩。
The following content must not be changed in the submitted PR message. Otherwise, the PR will be closed immediately. After submitted PR, please use a web browser to visit PR, and check items one by one, and ticked them if no problem.

当前拉取/合并请求的状态 Intent for your PR

必须选择一项 Choose one (Mandatory):

  • 本拉取/合并请求是一个草稿版本 This PR is for a code-review and is intended to get feedback
  • 本拉取/合并请求是一个成熟版本 This PR is mature, and ready to be integrated into the repo

代码质量 Code Quality:

我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:

  • 已经仔细查看过代码改动的对比 Already check the difference between PR and old code
  • 代码风格正确,包括缩进空格,命名及其他风格 Style guide is adhered to, including spacing, naming and other styles
  • 没有垃圾代码,代码尽量精简,不包含#if 0代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up
  • 所有变更均有原因及合理的,并且不会影响到其他软件组件代码或BSP All modifications are justified and not affect other components or BSP
  • 对难懂代码均提供对应的注释 I've commented appropriately where code is tricky
  • 本拉取/合并请求代码是高质量的 Code in this PR is of high quality
  • 本拉取/合并使用formatting等源码格式化工具确保格式符合RT-Thread代码规范 This PR complies with RT-Thread code specification

@@ -279,10 +279,10 @@ static void stm32_pin_mode(rt_device_t dev, rt_base_t pin, rt_base_t mode)

rt_inline rt_int32_t bit2bitno(rt_uint32_t bit)
{
rt_uint8_t i;
rt_int32_t i;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i的取值范围只有 0 ~ 32 有必要 32 位吗?

@dongly
Copy link
Contributor Author

dongly commented Mar 30, 2022

格式化规范的问题已经解决,我自己定义的clang-format,不小心用在这了
(另,在vscode用astyle总觉得不顺手 :-) )

@dongly dongly force-pushed the fix_warning branch 3 times, most recently from 08f46a7 to ddb5eb3 Compare March 30, 2022 09:29
@mysterywolf
Copy link
Member

https://github.com/mysterywolf/formatting 用这个格式化 这个是专门设计给rtt格式化用的

@dongly
Copy link
Contributor Author

dongly commented Mar 31, 2022

已修改,尽量只改符号,或尽量小的类型

@BernardXiong BernardXiong added the discussion This PR/issue needs to be discussed later label Apr 4, 2022
@dongly
Copy link
Contributor Author

dongly commented Apr 6, 2022

已更新

@dongly dongly force-pushed the fix_warning branch 3 times, most recently from e5302bb to 2976c2e Compare April 6, 2022 15:11
@mysterywolf
Copy link
Member

麻烦再 解决一下冲突 我们再review一下

@dongly dongly force-pushed the fix_warning branch 3 times, most recently from 0659759 to 14c3075 Compare April 30, 2022 08:49
@dongly
Copy link
Contributor Author

dongly commented Apr 30, 2022

已更新

@mysterywolf mysterywolf requested a review from Guozhanxin April 30, 2022 19:51
@mysterywolf mysterywolf added v4.1.1 and removed discussion This PR/issue needs to be discussed later labels Apr 30, 2022
@dongly
Copy link
Contributor Author

dongly commented Jul 7, 2022

冲突已经再次解决,请review @mysterywolf

@mysterywolf
Copy link
Member

请ping我的邮箱 [email protected] 我拉你进群

@BernardXiong BernardXiong added the +1 Agree +1 label Jul 30, 2022
@mysterywolf
Copy link
Member

这份PR开会时再讨论一下细节,期望在4.1.1发布之前合进去 @Guozhanxin

@mysterywolf
Copy link
Member

@dongly 请再耐心等待一下,冲突的问题目前先不需要解决。

@mysterywolf mysterywolf added the +2 Agree +2 label Aug 2, 2022
@mysterywolf
Copy link
Member

@dongly 如果有新的修改请不要强制推送,我帮你改了一部分,如果一旦强制推送,我修改的部分就没了

rt_err_t result;

for (int i = 0; i < obj_num; i++)
for (rt_size_t i = 0; i < sizeof(i2c_obj) / sizeof(struct stm32_i2c); i++)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里为啥要合并起来呀,感觉可读性还不如之前

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

节省一个内部变量

{
0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x21, 0x0d, 0x0a,
};

const static struct romfs_dirent _dummy[] =
static const struct romfs_dirent _dummy[] =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这部分代码是脚本自动生成的,如果要修改,后面最好把tool目录下的脚本也修改了。要不然下次生成又被还原了。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这就是下一个pr了

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这块应该是要改一下脚本吧 脚本生成的有问题 确实应该是static关键字在前 const在后

Copy link
Member

@mysterywolf mysterywolf Aug 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

确认了 脚本没啥问题

@mysterywolf mysterywolf merged commit 3363586 into RT-Thread:master Aug 2, 2022
@dongly dongly deleted the fix_warning branch August 3, 2022 02:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
important +1 Agree +1 +2 Agree +2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants