Audit and eliminate redundant helper #include directives.
authorzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Mon, 11 May 2009 03:59:02 +0000 (03:59 +0000)
committerzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Mon, 11 May 2009 03:59:02 +0000 (03:59 +0000)
git-svn-id: svn://svn.berlios.de/openocd/trunk@1706 b42882b7-edfa-0310-969c-e2dbd0fdcd60

src/helper/binarybuffer.c
src/helper/command.c
src/helper/command.h
src/helper/configuration.c
src/helper/configuration.h
src/helper/fileio.c
src/helper/fileio.h
src/helper/log.c
src/helper/log.h
src/helper/options.c
src/helper/time_support.c

index ab8218ca2f8f6ffa61e0039bd90b0b977bb6ddf4..87b9fa795dace2bb22813b67aadf64416933cc28 100644 (file)
 #include "config.h"
 #endif
 
-#include <stdlib.h>
-#include <string.h>
-
-#include "types.h"
 #include "log.h"
-
 #include "binarybuffer.h"
 
 const unsigned char bit_reverse_table256[] =
index ecab9bdc25ee1f55b9139d8a5ad71e15667f0b86..cb576bb39d461961c49d05a7cd8bcc154279d94c 100644 (file)
 #include "config.h"
 #endif
 
-#include "replacements.h"
+// @todo the inclusion of target.h here is a layering violation
 #include "target.h"
 #include "command.h"
 #include "configuration.h"
-
 #include "log.h"
 #include "time_support.h"
 #include "jim-eventloop.h"
 
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <errno.h>
 
 int fast_and_dangerous = 0;
 Jim_Interp *interp = NULL;
index 49609a685f8cb7d15797bdc9fcfc223efdbaa931..5fc0a283ea6b1a403ef73816db8c6715eec12f99 100644 (file)
 #ifndef COMMAND_H
 #define COMMAND_H
 
+/* Integrate the JIM TCL interpretor into the command processing. */
+#if BUILD_ECOSBOARD
 #include <stdio.h>
+#include <stdarg.h>
+/* Jim is provied by eCos */
+#include <cyg/jimtcl/jim.h>
+#else
+#define JIM_EMBEDDED
+#include "jim.h"
+#endif
 
 enum command_mode
 {
@@ -87,16 +96,6 @@ extern void process_jim_events(void);
 
 extern int fast_and_dangerous;
 
-/* Integrate the JIM TCL interpretor into the command processing. */
-#include <stdarg.h>
-#if BUILD_ECOSBOARD
-/* Jim is provied by eCos */
-#include <cyg/jimtcl/jim.h>
-#else
-#define JIM_EMBEDDED
-#include "jim.h"
-#endif
-
 extern Jim_Interp *interp;
 
 void register_jim(command_context_t *context, const char *name, int (*cmd)(Jim_Interp *interp, int argc, Jim_Obj *const *argv), const char *help);
index e33a2e1688946dd3c8ea912c95531775bfffee62..d1395e6ad4fb21e1184aed27911f5bb45d83b09d 100644 (file)
 #include "config.h"
 #endif
 
-#include "types.h"
-#include "command.h"
 #include "configuration.h"
 #include "log.h"
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
 
 static size_t num_config_files;
 static char** config_file_names;
index 109bd1004917cf1956f12fe5126192a21b0624c5..e75c70306ec442ef067ff9e79ebffd9d90d4613c 100644 (file)
@@ -24,7 +24,6 @@
 #define CONFIGURATION_H
 
 #include "command.h"
-#include "types.h"
 
 extern int parse_cmdline_args(struct command_context_s *cmd_ctx, int argc, char *argv[]);
 extern int parse_config_file(struct command_context_s *cmd_ctx);
index 070c0ac5e62fcd990fe55b41e954004d98916609..3a11152598038b6c4cf8f5225fb4c95887161825 100644 (file)
 #include "config.h"
 #endif
 
-#include "types.h"
-#include "replacements.h"
 #include "log.h"
 #include "configuration.h"
-
 #include "fileio.h"
 
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <ctype.h>
-
 static inline int fileio_open_local(fileio_t *fileio)
 {
        char access[4];
index c764082e9e37e1ebe349a94c10596685784f8d21..36e749b26c3ea5aefcc5a37c8d46f6b07667dcfa 100644 (file)
 
 #define FILEIO_MAX_ERROR_STRING                (128)
 
-#include "types.h"
-
-#include <stdio.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <ctype.h>
+#include "replacements.h"
 
 enum fileio_type
 {
index b6bb3479ab44bb70e90f76e03a9da4eafd482030..794f45485831d099488d5d603f58165d8e8ab980 100644 (file)
 #include "config.h"
 #endif
 
-#include "replacements.h"
-
 #include "log.h"
-#include "configuration.h"
 #include "time_support.h"
-#include "command.h"
 #include "server.h"
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
 #include <stdarg.h>
 
 #ifdef _DEBUG_FREE_SPACE_
index a790018f0ed2cb7b0fa9e003b30f1062a75bbd43..4f781991c257dd5221674052ac6d6db7de688ce8 100644 (file)
@@ -29,8 +29,6 @@
 #include "replacements.h"
 #include "command.h"
 
-#include <stdarg.h>
-
 /* logging priorities 
  * LOG_LVL_SILENT - turn off all output. In lieu of try+catch this can be used as a 
  *                  feeble ersatz.
index 109419b39a9188fb0eda254ad51e0ec7de82b449..801bd11b2606708ffb981afeef3682596582afe0 100644 (file)
 #include "config.h"
 #endif
 
-#include "replacements.h"
-
-#include "types.h"
-#include "command.h"
 #include "configuration.h"
 #include "log.h"
 #include "server.h"
 
-#include <stdio.h>
-#include <stdlib.h>
 #include <getopt.h>
-#include <string.h>
 
 static int help_flag, version_flag;
 
index bc52e9ca53472853d5e181c10340d8bf67143c1d..7a9a80010533a173231a70c15896ee3eac727b8a 100644 (file)
 #include "config.h"
 #endif
 
-#include "replacements.h"
 #include "time_support.h"
 #include "log.h"
 
-#include <stdlib.h>
-
 
 /* calculate difference between two struct timeval values */
 int timeval_subtract(struct timeval *result, struct timeval *x, struct timeval *y)