You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ma...@apache.org on 2016/04/28 02:14:40 UTC

[41/50] [abbrv] incubator-mynewt-core git commit: formatting typos, license pointers

formatting typos, license pointers


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/4f9a1f84
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/4f9a1f84
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/4f9a1f84

Branch: refs/heads/master
Commit: 4f9a1f840911d8dbffb5e06dcc23f4f3e6e042d9
Parents: 3bdb018
Author: Sterling Hughes <st...@apache.org>
Authored: Sun Apr 24 10:02:26 2016 -0700
Committer: Sterling Hughes <st...@apache.org>
Committed: Sun Apr 24 10:02:26 2016 -0700

----------------------------------------------------------------------
 CODING_STANDARDS.md | 84 ++++++++++++++++++++++++++++++------------------
 1 file changed, 52 insertions(+), 32 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/4f9a1f84/CODING_STANDARDS.md
----------------------------------------------------------------------
diff --git a/CODING_STANDARDS.md b/CODING_STANDARDS.md
index 5d1e5f3..4727f1e 100644
--- a/CODING_STANDARDS.md
+++ b/CODING_STANDARDS.md
@@ -5,6 +5,40 @@ all subprojects of Apache Mynewt.  This covers C and Assembly coding
 conventions, *only*.  Other languages (such as Go), have their own 
 coding conventions.
 
+## Headers
+
+* All files that are newly written, should have the Apache License clause
+at the top of them.
+
+* For files that are copied from another source, but contain an Apache 
+compatible license, the original license header shall be maintained.
+
+* For more information on applying the Apache license, the definitive 
+source is here: http://www.apache.org/dev/apply-license.html
+
+* The Apache License clause for the top of files is as follows:
+
+```no-highlight
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+```
+
 ## Whitespace and Braces
 
 * Code must be indented to 4 spaces, tabs should not be used.
@@ -24,7 +58,7 @@ code blocks, i.e., do:
     }
 ```
 
-not: 
+Not: 
 
 ```
     if (x) 
@@ -45,7 +79,7 @@ not:
     }
 ```
 
-Bad:
+Not:
 
 ```
     for (i = 0; i < 10; i++) 
@@ -81,14 +115,19 @@ not:
 * When you have to wrap a long statement, put the operator at the end of the 
   line.  i.e.:
 
+```
     if (x &&
         y == 10 &&
         b)
-  Not:
+```
+
+Not:
 
+```
     if (x
         && y == 10
         && b)
+```
 
 ## Comments
 
@@ -97,12 +136,16 @@ not:
 * When using a single line comment, put it above the line of code that you 
 intend to comment, i.e., do:
 
+```
     /* check variable */
     if (a) {
+```
 
-and not: 
+Not:
 
+```
     if (a) { /* check variable */
+```
 
 
 * All public APIs should be commented with Doxygen style comments describing 
@@ -112,35 +155,12 @@ purpose, parameters and return values.  Private APIs need not be documented.
 ## Header files
 
 * Header files must contain the following structure:
-    * Apache License
+    * Apache License (see above)
     * ```#ifdef``` aliasing, to prevent multiple includes
     * ```#include``` directives for other required header files
     * ```#ifdef __cplusplus``` wrappers to maintain C++ friendly APIs
     * Contents of the header file
 
-* The Apache License clause is as follows:
-
-```no-highlight
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-```
-
 * ```#ifdef``` aliasing, shall be in the following format, where
 the package name is "os" and the file name is "callout.h": 
 
@@ -174,7 +194,7 @@ followed by the '_' character, i.e.:
     os_callout_init(&c)
 ```
 
-not:
+Not:
 
 ```
     callout_init(c)
@@ -188,7 +208,7 @@ not:
     rc = function(a)
 ```
 
-not: 
+Not: 
 
 ```
     rc = function (a)
@@ -201,7 +221,7 @@ not:
     rc = function(a, b)
 ```
 
-not: 
+Not: 
 
 ```
     rc = function(a,b)
@@ -215,7 +235,7 @@ not:
     {
 ```
 
-not: 
+Not: 
 
 ```
     static void *function(int var1, int var2)