[PATCH 02/32] lib/analogy: Rearrange includes and harmonize license headers

Florian Bezdeka <[email protected]>
Newsgroups dev.linux.lists.xenomai
Message-ID <[email protected]>
Moving to "from local to global" should help us to keep headers
self-contained. Some parts of the codebase were already migrated,
lib/analogy was still missing.

While at it: Harmonzie license headers. doxygen reported a warning
while generating the docs.

Signed-off-by: Florian Bezdeka <[email protected]>
---
 lib/analogy/async.c       |  6 +++---
 lib/analogy/calibration.c | 18 ++++++++----------
 lib/analogy/calibration.h |  4 +++-
 lib/analogy/descriptor.c  |  7 ++++---
 lib/analogy/info.c        |  6 +++---
 lib/analogy/internal.h    |  3 ++-
 lib/analogy/math.c        | 10 +++-------
 lib/analogy/range.c       |  4 ++--
 lib/analogy/root_leaf.h   |  4 +---
 lib/analogy/sync.c        |  7 +++----
 lib/analogy/sys.c         |  5 +++--
 11 files changed, 35 insertions(+), 39 deletions(-)

diff --git a/lib/analogy/async.c b/lib/analogy/async.c
index 39d2109ab49c546f16eb7f7bdb9fd527fc205002..2632a180010dc71469a79c18199fd440ab1e74ce 100644
--- a/lib/analogy/async.c
+++ b/lib/analogy/async.c
@@ -14,16 +14,16 @@
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
-
+ *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
  */
 
-#include <errno.h>
-#include <rtdm/analogy.h>
 #include "internal.h"
 
+#include <rtdm/analogy.h>
+
 /**
  * @ingroup analogy_lib_level1
  * @defgroup analogy_lib_async1 Asynchronous acquisition API
diff --git a/lib/analogy/calibration.c b/lib/analogy/calibration.c
index 7ae5ef61c7b8706bd17c11b59392ded13ab9c0e0..9876e3f73d15a311a90866beba1e0978fb6bf7a1 100644
--- a/lib/analogy/calibration.c
+++ b/lib/analogy/calibration.c
@@ -14,22 +14,20 @@
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
-
+ *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
  */
 
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <math.h>
-#include <rtdm/analogy.h>
-#include <stdio.h>
-#include <errno.h>
-#include "iniparser/iniparser.h"
-#include "boilerplate/ancillaries.h"
 #include "calibration.h"
+#include "boilerplate/ancillaries.h"
+#include "iniparser/iniparser.h"
+
+#include <math.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <unistd.h>
 
 #define CHK(func, ...)								\
 do {										\
diff --git a/lib/analogy/calibration.h b/lib/analogy/calibration.h
index 5d881b51c65af9b373f2a08ae5d1ef0dd50924e1..8bd7210b411f780add1f5e7953af69fda7629687 100644
--- a/lib/analogy/calibration.h
+++ b/lib/analogy/calibration.h
@@ -13,7 +13,7 @@
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
-
+ *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
@@ -22,6 +22,8 @@
 #ifndef __ANALOGY_CALIBRATION_H__
 #define __ANALOGY_CALIBRATION_H__
 
+#include <rtdm/analogy.h>
+
 /*
  * internal definitions between the xenomai utils and the library.
  * no need to expose them to the USER
diff --git a/lib/analogy/descriptor.c b/lib/analogy/descriptor.c
index de3ef9e99bdd12cd2ecaeb3a72d7c1398d5ca099..a4be8ea9468bc57e2df580672972d932187e4c96 100644
--- a/lib/analogy/descriptor.c
+++ b/lib/analogy/descriptor.c
@@ -14,17 +14,18 @@
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
-
+ *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
  */
 
-#include <string.h>
-#include <rtdm/analogy.h>
 #include "internal.h"
 #include "root_leaf.h"
 
+#include <rtdm/analogy.h>
+#include <string.h>
+
 #ifndef DOXYGEN_CPP
 
 static void a4l_root_setup(a4l_root_t * rt,
diff --git a/lib/analogy/info.c b/lib/analogy/info.c
index a68e4a33f89d12b894c2301b60a6e8a6045dca93..a2602a18e45e62897a9a0d850d1a0f83d3cf2052 100644
--- a/lib/analogy/info.c
+++ b/lib/analogy/info.c
@@ -13,16 +13,16 @@
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
-
+ *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
  */
 
-#include <errno.h>
-#include <rtdm/analogy.h>
 #include "internal.h"
 
+#include <rtdm/analogy.h>
+
 #ifndef DOXYGEN_CPP
 
 int a4l_sys_devinfo(int fd, a4l_dvinfo_t * info)
diff --git a/lib/analogy/internal.h b/lib/analogy/internal.h
index da8b6585bf3384fa1cd0d2f215e53328990952ad..9d0584022a1caeab71fdaa32fef11437749e09b2 100644
--- a/lib/analogy/internal.h
+++ b/lib/analogy/internal.h
@@ -13,11 +13,12 @@
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
-
+ *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
  */
+
 #ifndef __ANALOGY_LIB_INTERNAL__
 #define __ANALOGY_LIB_INTERNAL__
 
diff --git a/lib/analogy/math.c b/lib/analogy/math.c
index 8a26d2e1deedb4732afd802afddd9c6c5674e272..8c1ea5ded491c4581e157f04407edb78f0c2d0e4 100644
--- a/lib/analogy/math.c
+++ b/lib/analogy/math.c
@@ -1,5 +1,3 @@
-#include <math.h>
-
 /*
  * Copyright (C) 2014 Gilles Chanteperdrix <[email protected]>.
  *
@@ -12,18 +10,16 @@
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
-
+ *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
  */
 
-#include <stdlib.h>
 #include <errno.h>
-#include <string.h>
-#include <assert.h>
-
+#include <math.h>
 #include <rtdm/analogy.h>
+#include <stdlib.h>
 
 struct vec {
 	unsigned dim;
diff --git a/lib/analogy/range.c b/lib/analogy/range.c
index 573bde32768dc382b4eb817508c3bd616247a7e0..1ccfc955345a0f4dc8db9003b6b1347d7221bf1d 100644
--- a/lib/analogy/range.c
+++ b/lib/analogy/range.c
@@ -14,14 +14,14 @@
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
-
+ *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
  */
 
-#include <errno.h>
 #include "internal.h"
+
 #include <rtdm/analogy.h>
 
 #ifndef DOXYGEN_CPP
diff --git a/lib/analogy/root_leaf.h b/lib/analogy/root_leaf.h
index 6c58001855932ae01d7f27049fc0281373f91a15..3690b5ff69522afb6e7a65c52ec87aed5fc854c0 100644
--- a/lib/analogy/root_leaf.h
+++ b/lib/analogy/root_leaf.h
@@ -14,7 +14,7 @@
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
-
+ *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
@@ -25,8 +25,6 @@
 
 #ifndef DOXYGEN_CPP
 
-#include <errno.h>
-
 struct a4l_leaf {
 	unsigned int id;
 	unsigned int nb_leaf;
diff --git a/lib/analogy/sync.c b/lib/analogy/sync.c
index fee5fc9e20636a7e5923c802fa1563a7fdbc5038..95bc2c75b892f4d30a41cf20f073b421320a5c10 100644
--- a/lib/analogy/sync.c
+++ b/lib/analogy/sync.c
@@ -14,17 +14,16 @@
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
-
+ *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
  */
 
-#include <stdarg.h>
-#include <errno.h>
-#include <rtdm/analogy.h>
 #include "internal.h"
 
+#include <rtdm/analogy.h>
+
 /*!
  * @ingroup analogy_lib
  * @defgroup analogy_lib_level1 Level 1 API
diff --git a/lib/analogy/sys.c b/lib/analogy/sys.c
index 165c41d7907d4276eeab98e6445995937a19e2b4..710b2d2ffbbe5afb12dcbe195679e94884129dd2 100644
--- a/lib/analogy/sys.c
+++ b/lib/analogy/sys.c
@@ -14,7 +14,7 @@
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
-
+ *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
@@ -37,9 +37,10 @@
  * This interface should not be used directly by applications.
  */
 
-#include <rtdm/analogy.h>
 #include "internal.h"
 
+#include <rtdm/analogy.h>
+
 /*!
  * @ingroup analogy_lib_syscall
  * @defgroup analogy_lib_core Basic Syscall API

-- 
2.54.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.