[PATCHES] SMB2 client quota support

Uri Simchoni uri at samba.org
Sun Oct 2 17:45:52 UTC 2016


On 09/27/2016 05:00 PM, Andreas Schneider wrote:
> On Monday, 26 September 2016 13:05:14 CEST Jeremy Allison wrote:
>> 1). Hate this reformatting... :-)
>>
>> [PATCH 07/19] s3-libsmb: make parse_user_quota_record() public
>>
>> -static bool parse_user_quota_record(const uint8_t *rdata,
>> -                                   unsigned int rdata_count,
>> -                                   unsigned int *offset,
>> -                                   SMB_NTQUOTA_STRUCT *pqt)
>> +bool parse_user_quota_record(const uint8_t *rdata, unsigned int
>> rdata_count, +                            unsigned int *offset,
>> SMB_NTQUOTA_STRUCT *pqt)
>>
>> I much prefer the
>>
>> function(arg1
>> 	       arg2,
>> 	       arg3.
>> 	       arg4)
>>
>> style. But that's just a personal thing :-).
>>
> 
> If this isn't in our CodingStyle guideline, we should add it! We prefer this, 
> so if you change an argument, you can directly see which argument changed in a 
> patch.
> 
> 
> Cheers,
> 
> 
> 	Andreas
> 
See attached (split to 3 parts, so pick and choose...)

Uri
-------------- next part --------------
>From 69c5fbda7b30e56d2988ebd09700f54900ce6122 Mon Sep 17 00:00:00 2001
From: Uri Simchoni <uri at samba.org>
Date: Sun, 2 Oct 2016 20:37:37 +0300
Subject: [PATCH 1/3] README.Coding: Remove an extra space

Signed-off-by: Uri Simchoni <uri at samba.org>
---
 README.Coding | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.Coding b/README.Coding
index 2b011a6..74dbc6e 100644
--- a/README.Coding
+++ b/README.Coding
@@ -189,7 +189,7 @@ characters or less with whitespace.  For example,
 The previous example is intended to illustrate alignment of function
 parameters across lines and not as encourage for gratuitous line
 splitting.  Never split a line before columns 70 - 79 unless you
-have a really good reason.  Be smart about formatting.
+have a really good reason. Be smart about formatting.
 
 
 If, switch, & Code blocks
-- 
2.5.5


>From 1afc7261252149ec7912c8dcf1b480cb0158bb8b Mon Sep 17 00:00:00 2001
From: Uri Simchoni <uri at samba.org>
Date: Sun, 2 Oct 2016 20:40:06 +0300
Subject: [PATCH 2/3] README.Coding: Add rule about function declaration
 indentation

Signed-off-by: Uri Simchoni <uri at samba.org>
---
 README.Coding | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/README.Coding b/README.Coding
index 74dbc6e..024b487 100644
--- a/README.Coding
+++ b/README.Coding
@@ -191,6 +191,12 @@ parameters across lines and not as encourage for gratuitous line
 splitting.  Never split a line before columns 70 - 79 unless you
 have a really good reason. Be smart about formatting.
 
+One exception to the previous rule is function declarations and
+definitions. In function declarations and definitions, either the
+declaration is a one-liner, or each parameter is listed on its own
+line. The rationale is that if there are many parameters, we want to
+each one in its own line to make tracking interface changes easier.
+
 
 If, switch, & Code blocks
 -------------------------
-- 
2.5.5


>From c962038fb89a00b0ac7fadad03ea8ed715f399ec Mon Sep 17 00:00:00 2001
From: Uri Simchoni <uri at samba.org>
Date: Sun, 2 Oct 2016 20:41:45 +0300
Subject: [PATCH 3/3] README.Coding: Add clang-format style file

Add how the coding style is represented in clang-format directives.

Signed-off-by: Uri Simchoni <uri at samba.org>
---
 README.Coding | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/README.Coding b/README.Coding
index 024b487..d401ca4 100644
--- a/README.Coding
+++ b/README.Coding
@@ -90,6 +90,16 @@ displaying trailing whitespace:
   set textwidth=80
   autocmd BufNewFile,BufRead *.c,*.h exec 'match Todo /\%>' . &textwidth . 'v.\+/'
 
+clang-format
+------------
+BasedOnStyle: LLVM
+IndentWidth: 8
+UseTab: true
+BreakBeforeBraces: Linux
+AllowShortIfStatementsOnASingleLine: false
+IndentCaseLabels: false
+BinPackParameters: false
+
 
 =========================
 FAQ & Statement Reference
-- 
2.5.5



More information about the samba-technical mailing list