uncrustify:如何将多行 C 函数调用的参数组合到一行上?
uncrustify: how to combine arguments of multiline C function call on to a single line?
我正在使用uncrustify 0.69.0(我还不能编译0.71.0(。我有以下几点:
sendto(cmd_sock, buf, strlen(buf),
0, (struct sockaddr *)&fromCmd,
sizeof(struct sockaddr_in));
我想解脱将它们合并为一行:
sendto(cmd_sock, buf, strlen(buf), 0, (struct sockaddr *)&fromCmd, sizeof(struct sockaddr_in));
这个 2012 年的旧问题类似,但在更旧版本的 uncrustify 中存在并且没有解决方案: 解脱脱壳折叠多行函数调用 今天有解决方案吗?
2020-07-27- 我试图发表评论,但它限制了我基本上没有任何价值。所以我正在更新我原来的问题.... 奇怪 - 在我的配置文件中找不到nl_func_call_args....但这是:
# Whether to add a newline after each ',' in a function call if '(' and ')'
# are in different lines.
nl_func_call_args_multi_line = false # true/false
请注意,这些选项不允许"删除"。 在我回到 .67 的所有配置文件中进行搜索找不到nl_func_call_args.如果删除任何 .uncrustify.cfg 并运行 uncrustify --update-config 将找不到nl_func_call_args。当我获得新版本的 uncrustify 时,我总是运行默认值并分析更改的内容。这是我信任配置的唯一方法。我最初的问题仍然存在。这是关于为 C 代码创建标准。我看到很多疯狂的函数调用格式,尤其是近年来。使其成形的唯一方法是首先删除所有多行废话。然后,如果需要,我可以编辑为更好的格式。否则,我正在编辑每条臭行。为了记录,我从1981年开始写C,几乎100%遵守K&R。我有一些偏差。我也使用 VI,所以原始 VI 中的所有格式功能我仍然希望代码遵守,以便此编辑器正常工作。 问候 奥尔杜尼克斯盖
# Add or remove newline after each ',' in a function call.
nl_func_call_args = remove # ignore/add/remove/force
该选项于 2016-06-27 (796b5ba5( 引入
相关文章:
- 用c++从输入文件中读取另一行
- 读取文件的最后一行并输入到链接列表时出错
- 如何在OMNET++中指定与命令行参数组合的输出文件名
- 可组合的lambda/std::函数与std::可选
- 我正在使用嵌套的while循环来解析具有多行的文本文件,但由于某种原因,它只通过第一行,我不知道为什么
- 从C++dll访问C#中的一行主要参数
- 如何将两个不同矢量的同一位置的两个元素组合在一起
- 混合组合和继承的C++问题
- 我需要将多个函数组合为一个函数
- 在C++中,我如何接受不同于同一行的用户输入
- 构建可组合有向图(扫描仪生成器的汤普森构造算法)
- 如何从一行中读取特定数量的字符?(C++)
- 通过组合不同的类型来创建唯一的id
- 用常见虚拟函数实现的任意组合来实现派生类的正确方法是什么
- uncrustify:如何将多行 C 函数调用的参数组合到一行上?
- 在输出时,我对如何将数量和单词组合在一行感到非常困惑
- 在2D数组的每一行中找到所有可能的组合
- 最后一行欧普特两个组合输出问题?如果其他语句
- 当从表视图中选择一行时,为组合框指定一个int值
- C++将字符串组合在一行中作为参数