Skip to contentSkip to conversation

libxl: CODING_STYLE: Explicitly deprecate #ifdef

PATCH In review Ian Jackson 3 participants 4 messages Oct 12, 2021 – Oct 13, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libxl: CODING_STYLE: Explicitly deprecate #ifdef

We don't use ifdefs in the main code. Actually document this.

---
 tools/libs/light/CODING_STYLE | 10 ++++++++++
 1 file changed, 10 insertions(+)
tools/libs/light/CODING_STYLE +10 -0
index 3d572f6925..c2342c9d3b 100644
@@ -121,6 +121,16 @@ permitted exceptions to the usual libxl code formatting rules.
 
 
 
+ARCHITECTURE-SPECIFIC CODE, CONDITIONAL COMPILATION
+---------------------------------------------------
+
+Architecture-specific code should be isolated in libxl_<arch>.c,
+with a function call interface, whereever possible.
+
+#ifdefs should be avoided, and in any case not interspersed through
+the primary functional code.
+
+
 IDEMPOTENT DATA STRUCTURE CONSTRUCTION/DESTRUCTION
 --------------------------------------------------
 
Signature · 1 line
2.20.1
Acked-by on v1 1/1
#1 lore raw
Quoted 12 lines · Ian Jackson

We don't use ifdefs in the main code. Actually document this.

---
 tools/libs/light/CODING_STYLE | 10 ++++++++++
 1 file changed, 10 insertions(+)
tools/libs/light/CODING_STYLE +0 -0
index 3d572f6925..c2342c9d3b 100644

tools/libs/light/CODING_STYLE permitted exceptions to the usual libxl code formatting rules. · line 128

Quoted 8 lines
tools/libs/light/CODING_STYLE +5 -0
@@ -121,6 +121,16 @@ permitted exceptions to the usual libxl code formatting rules.
 
 
 
+ARCHITECTURE-SPECIFIC CODE, CONDITIONAL COMPILATION
+---------------------------------------------------
+
+Architecture-specific code should be isolated in libxl_<arch>.c,
+with a function call interface, whereever possible.

s/whereever/wherever/ ?

tools/libs/light/CODING_STYLE permitted exceptions to the usual libxl code formatting rules. · line 136

Quoted 8 lines
tools/libs/light/CODING_STYLE +5 -0
+
+#ifdefs should be avoided, and in any case not interspersed through
+the primary functional code.
+
+
 IDEMPOTENT DATA STRUCTURE CONSTRUCTION/DESTRUCTION
 --------------------------------------------------
 

Sounds good,

Signature · 1 line
Anthony PERARD
#2 lore raw

Re: [PATCH] libxl: CODING_STYLE: Explicitly deprecate #ifdef [and 1 more messages]

Anthony PERARD writes ("Re: [PATCH] libxl: CODING_STYLE: Explicitly deprecate #ifdef"):

Quoted 5 lines · Ian Jackson

tools/libs/light/CODING_STYLE permitted exceptions to the usual libxl code formatting rules. · line 128

Quoted 2 lines
tools/libs/light/CODING_STYLE +2 -0
+Architecture-specific code should be isolated in libxl_<arch>.c,
+with a function call interface, whereever possible.

s/whereever/wherever/ ?

Fixed, thanks.

Quoted 1 line

Juergen Gross writes ("Re: [PATCH] libxl: CODING_STYLE: Explicitly deprecate #ifdef"):

Quoted 1 line

And committed.

Thanks,
Ian.