helper: Remove src/helper from include dirs
authorYasushi SHOJI <yashi@spacecubics.com>
Sun, 29 Aug 2021 09:18:01 +0000 (18:18 +0900)
committerAntonio Borneo <borneo.antonio@gmail.com>
Sat, 2 Oct 2021 13:18:15 +0000 (13:18 +0000)
The header files under src/helper/ can currently be included with
either

    #include <bits.h>
    or
    #include <helper/bits.h>

This is because we specify both "src/" and "src/helper/" directories
as include directories.  Some files name under "src/helper/", such as
types.h, log.h, and util.h are too generic and could be ambiguous
depending on the search path.

This commit remove "src/helper/" from our include dir and make C files
include explicitly.

Change-Id: I38fc9b96ba01a513d4a72757d40007e21b502f25
Signed-off-by: Yasushi SHOJI <yashi@spacecubics.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/6507
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
15 files changed:
Makefile.am
src/flash/nor/psoc6.c
src/flash/nor/stm32l4x.c
src/helper/command.h
src/helper/jim-nvp.c
src/jtag/drivers/libusb_helper.c
src/rtos/rtos.h
src/server/server.c
src/target/armv7m_trace.h
src/target/mips64_pracc.c
src/target/riscv/riscv-011.c
src/target/riscv/riscv-013.c
src/target/riscv/riscv.c
src/target/riscv/riscv_semihosting.c
src/target/target_type.h

index 3858093b66f43009e3432ddf6d88f271fcdfd5ed..7e5e22973768324ffbc239b5b7988f3ea0209fa4 100644 (file)
@@ -36,7 +36,6 @@ AM_CFLAGS = $(GCC_WARNINGS)
 AM_CPPFLAGS = $(HOST_CPPFLAGS)\
                          -I$(top_srcdir)/src \
                          -I$(top_builddir)/src \
-                         -I$(top_srcdir)/src/helper \
                          -DPKGDATADIR=\"$(pkgdatadir)\" \
                          -DBINDIR=\"$(bindir)\"
 
index a929d33043379332349accf395eb8385982ddea8..8a4121950d0ac47fdeefe160fff3e4c7077df5d4 100644 (file)
 #include <time.h>
 
 #include "imp.h"
-#include <target/arm_adi_v5.h>
+#include "helper/time_support.h"
+#include "target/arm_adi_v5.h"
 #include "target/target.h"
 #include "target/cortex_m.h"
 #include "target/breakpoints.h"
 #include "target/target_type.h"
-#include "time_support.h"
 #include "target/algorithm.h"
 
 /**************************************************************************************************
index a363cd42dea95a7884a6692d24e05390da2f2d6a..e5100a0159bcba06b3e9053db54231c32ccc08db 100644 (file)
 #include "imp.h"
 #include <helper/align.h>
 #include <helper/binarybuffer.h>
+#include <helper/bits.h>
 #include <target/algorithm.h>
 #include <target/arm_adi_v5.h>
 #include <target/cortex_m.h>
-#include "bits.h"
 #include "stm32l4x.h"
 
 /* STM32L4xxx series for reference.
index f3870198369dc69877655f2bc4fe0be3c5d5a4cc..fb9e50c85e86728ad4b0c7f8512b11d73a103828 100644 (file)
@@ -24,8 +24,8 @@
 
 #include <stdint.h>
 #include <stdbool.h>
-#include <jim-nvp.h>
 
+#include <helper/jim-nvp.h>
 #include <helper/list.h>
 #include <helper/types.h>
 
index e21bc680d8349871c8509ef1a0639ecfee3b80b0..738ed7943ef82163509d6b7f609833625bb2fbe0 100644 (file)
@@ -41,8 +41,8 @@
  * official policies, either expressed or implied, of the Jim Tcl Project.
  */
 
+#include "jim-nvp.h"
 #include <string.h>
-#include <jim-nvp.h>
 
 int jim_get_nvp(Jim_Interp *interp,
        Jim_Obj *objptr, const struct jim_nvp *nvp_table, const struct jim_nvp **result)
index f285bdcac6097846438f25e84d3db035568cbe08..3308d8742c805d1e0ad08b3a45eda54d5bbb1381 100644 (file)
@@ -20,9 +20,9 @@
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
+#include <helper/log.h>
 #include <jtag/drivers/jtag_usb_common.h>
 #include "libusb_helper.h"
-#include "log.h"
 
 /*
  * comment from libusb:
index dc7a64f43ea7bb8b2a600fc2cc7d282d68895e91..8309de4028272bd6746b6c5def735cb07f9d9daa 100644 (file)
@@ -21,7 +21,7 @@
 
 #include "server/server.h"
 #include "target/target.h"
-#include <jim-nvp.h>
+#include <helper/jim-nvp.h>
 
 typedef int64_t threadid_t;
 typedef int64_t symbol_address_t;
index 64acd36894ab666f82c1667cf32a7d07baa213d0..3f579bfc641a79bf02477d03389b34360d7674ad 100644 (file)
 #endif
 
 #include "server.h"
+#include <helper/time_support.h>
 #include <target/target.h>
 #include <target/target_request.h>
 #include <target/openrisc/jsp_server.h>
 #include "openocd.h"
 #include "tcl_server.h"
 #include "telnet_server.h"
-#include "time_support.h"
 
 #include <signal.h>
 
index eaee6a48f1efab20218d929f321b704bb4a8baa6..7e4977aba72a67f95b91cfca368c93558312bb2c 100644 (file)
@@ -18,8 +18,8 @@
 #ifndef OPENOCD_TARGET_ARMV7M_TRACE_H
 #define OPENOCD_TARGET_ARMV7M_TRACE_H
 
+#include <helper/command.h>
 #include <target/target.h>
-#include <command.h>
 
 /**
  * @file
index b2af39cede7032b89b937eb9ed9f53e819c941c6..9583ad767edc897fa22dc569877f587f3195880f 100644 (file)
@@ -20,7 +20,7 @@
 #include "mips64.h"
 #include "mips64_pracc.h"
 
-#include "time_support.h"
+#include <helper/time_support.h>
 
 #define STACK_DEPTH    32
 
index 7a5e990ca5735f376b3cbadc39f8c36ab7aa54b4..86a95f63507caf40a01d682f784a51f4c86e72f2 100644 (file)
@@ -16,7 +16,7 @@
 #include "target/target.h"
 #include "target/algorithm.h"
 #include "target/target_type.h"
-#include "log.h"
+#include <helper/log.h>
 #include "jtag/jtag.h"
 #include "target/register.h"
 #include "target/breakpoints.h"
index 24fb79ccf0ec0fc7ca6c1cc3069bf2602145e92c..fdebdd413d9ff0b00960c9a8af210042476e69b2 100644 (file)
@@ -16,7 +16,7 @@
 #include "target/target.h"
 #include "target/algorithm.h"
 #include "target/target_type.h"
-#include "log.h"
+#include <helper/log.h>
 #include "jtag/jtag.h"
 #include "target/register.h"
 #include "target/breakpoints.h"
index 8f1f398b3ea708b8319e1a3c1e06f2224a4a75c3..07fb95550c99cf379753e4b3c37be67f34755425 100644 (file)
@@ -8,14 +8,14 @@
 #include "config.h"
 #endif
 
+#include <helper/log.h>
+#include <helper/time_support.h>
 #include "target/target.h"
 #include "target/algorithm.h"
 #include "target/target_type.h"
-#include "log.h"
 #include "jtag/jtag.h"
 #include "target/register.h"
 #include "target/breakpoints.h"
-#include "helper/time_support.h"
 #include "riscv.h"
 #include "gdb_regs.h"
 #include "rtos/rtos.h"
@@ -1870,10 +1870,10 @@ static int riscv_checksum_memory(struct target *target,
        LOG_DEBUG("address=0x%" TARGET_PRIxADDR "; count=0x%" PRIx32, address, count);
 
        static const uint8_t riscv32_crc_code[] = {
-#include "../../contrib/loaders/checksum/riscv32_crc.inc"
+#include "contrib/loaders/checksum/riscv32_crc.inc"
        };
        static const uint8_t riscv64_crc_code[] = {
-#include "../../contrib/loaders/checksum/riscv64_crc.inc"
+#include "contrib/loaders/checksum/riscv64_crc.inc"
        };
 
        static const uint8_t *crc_code;
index 90b8ddb4fcb8ac107ebcb0cd244beef2f5aaf7f8..0072b9afe7fbd5fcb6215bd3c2303eeb6fdd7c4e 100644 (file)
@@ -41,7 +41,7 @@
 #include "config.h"
 #endif
 
-#include "log.h"
+#include <helper/log.h>
 
 #include "target/target.h"
 #include "target/semihosting_common.h"
index cf30cf8cc69e88b72f6f30fda4baa6a5afd9b884..d6b6086b3c59467305a9db5ae444f71402c1f9f2 100644 (file)
@@ -25,7 +25,7 @@
 #ifndef OPENOCD_TARGET_TARGET_TYPE_H
 #define OPENOCD_TARGET_TARGET_TYPE_H
 
-#include <jim-nvp.h>
+#include <helper/jim-nvp.h>
 
 struct target;