<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, May 5, 2024 at 11:38 PM Stephen Hemminger <<a href="mailto:stephen@networkplumber.org">stephen@networkplumber.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Sun, 5 May 2024 22:42:57 +0300<br>
Abdullah Ömer Yamaç <<a href="mailto:aomeryamac@gmail.com" target="_blank">aomeryamac@gmail.com</a>> wrote:<br>
<br>
> > Also, this looks wrong. The initialized arrays looked better before.<br>
> ><br>
> ><br>
> > -static const char *tuntap_types[ETH_TUNTAP_TYPE_MAX] = {<br>
> > - "UNKNOWN", "TUN", "TAP"<br>
> > -};<br>
> > +static const char *tuntap_types[ETH_TUNTAP_TYPE_MAX] = {"UNKNOWN", "TUN",<br>
> > "TAP"};<br>
> ><br>
> > -static const char *valid_arguments[] = {<br>
> > - ETH_TAP_IFACE_ARG,<br>
> > - ETH_TAP_REMOTE_ARG,<br>
> > - ETH_TAP_MAC_ARG,<br>
> > - ETH_TAP_PERSIST_ARG,<br>
> > - NULL<br>
> > -};<br>
> > +static const char *valid_arguments[] = {ETH_TAP_IFACE_ARG,<br>
> > ETH_TAP_REMOTE_ARG, ETH_TAP_MAC_ARG,<br>
> > + ETH_TAP_PERSIST_ARG, NULL};<br>
> > <br>
> <br>
> I am confused about these variables. tuntap_types list values in a single<br>
> line, but valid_arguments' values are listed separately.<br>
> So, it is getting more complex to handle both of them. What should we do,<br>
> do you have any idea?<br>
<br>
Ignore the initialized lists for now. It should be possible to have it generate something<br>
like <br>
<br>
static const char *tuntap_types[ETH_TUNTAP_TYPE_MAX] = {<br>
"UNKNOWN", "TUN", "TAP"<br>
};<br>
<br>
With the following changes result looks better. You got the format wrong for the ForEach list.<br>
<br>
diff --git a/.clang-format b/.clang-format<br>
index 16164ef1de..d16185c049 100644<br>
--- a/.clang-format<br>
+++ b/.clang-format<br>
@@ -1,12 +1,20 @@<br>
---<br>
BasedOnStyle: LLVM<br>
<br>
+AttributeMacros:<br>
+ - __rte_aligned<br>
+ - __rte_packed<br>
+ - __rte_may_alias<br>
+ - __rte_deprecated<br>
+ - __rte_weak<br>
+ - __rte_unused<br>
+ - __rte_restrict<br>
+<br>
# Place opening and closing parentheses on the same line for control statements<br>
BreakBeforeBraces: Custom<br>
BraceWrapping:<br>
- AfterFunction: false<br>
+ AfterFunction: true<br>
AfterControlStatement: false<br>
- AfterEnum: false<br>
<br></blockquote><div>These are ok for me. </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
# Set maximum line length to 100 characters<br>
ColumnLimit: 100<br>
@@ -41,98 +49,117 @@ AlwaysBreakAfterReturnType: TopLevelDefinitions<br>
# Always break before multiline string literals<br>
AlignEscapedNewlines: Left<br>
<br>
-# Foreach macros<br></blockquote><div>In the clang documentation, it says "ForEachMacros (List of Strings)" and gives an example: "ForEachMacros: ['RANGES_FOR', 'FOREACH']"</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">...<br>
+ObjCSpaceAfterProperty: true<br>
+IndentGotoLabels: false<br></blockquote><div>These are also ok for me.<br><br>If you agree on the for-each part, then I will send the new patch. <br>Thanks</div></div></div>