From: Nithin Raju Date: Tue, 9 Sep 2014 16:02:36 +0000 (-0700) Subject: datapath-windows: update CodingStyle guideline for variable names X-Git-Tag: v2.4.0~1447 X-Git-Url: http://git.cascardo.eti.br/?a=commitdiff_plain;h=ca98895532de3f672642633a78dcb13d2d283929;p=cascardo%2Fovs.git datapath-windows: update CodingStyle guideline for variable names During a review, it seemed that some of the conventions were not clear. Fixing them in this patch. Signed-off-by: Nithin Raju Reported-by: Samuel Ghinet Signed-off-by: Ben Pfaff Acked-by: Alin Gabriel Serdean Acked-by: Samuel Ghinet --- diff --git a/datapath-windows/CodingStyle b/datapath-windows/CodingStyle index 006adfd22..3550cdb06 100644 --- a/datapath-windows/CodingStyle +++ b/datapath-windows/CodingStyle @@ -40,8 +40,14 @@ guidelines: Use lower case to begin the name of a variable. + Do not use '_' to begin the name of the variable. '_' is to be used to begin + the parameters of a pre-processor macro. + Use upper case to begin the name of a function, enum, file name etc. + Static functions whose scope is limited to the file they are defined in can + be prefixed with '_'. This is not mandatory though. + For types, use all upper case for all letters with words separated by '_'. If camel casing is preferred, use upper case for the first letter. @@ -72,6 +78,13 @@ OvsDetectTunnelRxPkt(POVS_FORWARDING_CONTEXT ovsFwdCtx, return FALSE; } + For declaring variables of pointer type, use of the pointer data type +prefixed with 'P' is preferred over using '*'. This is not mandatory though, +and is only prescribed since it is a common practice in Windows. + + Example, #1 is preferred over #2 though #2 is also equally correct: + 1. PNET_BUFFER_LIST curNbl; + 2. NET_BUFFER_LIST *curNbl; COMMENTS