|
From: <zw...@ma...> - 2009-05-11 05:59:21
|
Author: zwelch
Date: 2009-05-11 05:59:02 +0200 (Mon, 11 May 2009)
New Revision: 1706
Modified:
trunk/src/helper/binarybuffer.c
trunk/src/helper/command.c
trunk/src/helper/command.h
trunk/src/helper/configuration.c
trunk/src/helper/configuration.h
trunk/src/helper/fileio.c
trunk/src/helper/fileio.h
trunk/src/helper/log.c
trunk/src/helper/log.h
trunk/src/helper/options.c
trunk/src/helper/time_support.c
Log:
Audit and eliminate redundant helper #include directives.
Modified: trunk/src/helper/binarybuffer.c
===================================================================
--- trunk/src/helper/binarybuffer.c 2009-05-11 03:48:32 UTC (rev 1705)
+++ trunk/src/helper/binarybuffer.c 2009-05-11 03:59:02 UTC (rev 1706)
@@ -24,12 +24,7 @@
#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[] =
Modified: trunk/src/helper/command.c
===================================================================
--- trunk/src/helper/command.c 2009-05-11 03:48:32 UTC (rev 1705)
+++ trunk/src/helper/command.c 2009-05-11 03:59:02 UTC (rev 1706)
@@ -30,22 +30,14 @@
#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;
Modified: trunk/src/helper/command.h
===================================================================
--- trunk/src/helper/command.h 2009-05-11 03:48:32 UTC (rev 1705)
+++ trunk/src/helper/command.h 2009-05-11 03:59:02 UTC (rev 1706)
@@ -23,7 +23,16 @@
#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 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);
Modified: trunk/src/helper/configuration.c
===================================================================
--- trunk/src/helper/configuration.c 2009-05-11 03:48:32 UTC (rev 1705)
+++ trunk/src/helper/configuration.c 2009-05-11 03:59:02 UTC (rev 1706)
@@ -24,14 +24,9 @@
#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;
Modified: trunk/src/helper/configuration.h
===================================================================
--- trunk/src/helper/configuration.h 2009-05-11 03:48:32 UTC (rev 1705)
+++ trunk/src/helper/configuration.h 2009-05-11 03:59:02 UTC (rev 1706)
@@ -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);
Modified: trunk/src/helper/fileio.c
===================================================================
--- trunk/src/helper/fileio.c 2009-05-11 03:48:32 UTC (rev 1705)
+++ trunk/src/helper/fileio.c 2009-05-11 03:59:02 UTC (rev 1706)
@@ -27,21 +27,10 @@
#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];
Modified: trunk/src/helper/fileio.h
===================================================================
--- trunk/src/helper/fileio.h 2009-05-11 03:48:32 UTC (rev 1705)
+++ trunk/src/helper/fileio.h 2009-05-11 03:59:02 UTC (rev 1706)
@@ -28,15 +28,8 @@
#define FILEIO_MAX_ERROR_STRING (128)
-#include "types.h"
+#include "replacements.h"
-#include <stdio.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <ctype.h>
-
enum fileio_type
{
FILEIO_TEXT,
Modified: trunk/src/helper/log.c
===================================================================
--- trunk/src/helper/log.c 2009-05-11 03:48:32 UTC (rev 1705)
+++ trunk/src/helper/log.c 2009-05-11 03:59:02 UTC (rev 1706)
@@ -27,18 +27,10 @@
#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_
Modified: trunk/src/helper/log.h
===================================================================
--- trunk/src/helper/log.h 2009-05-11 03:48:32 UTC (rev 1705)
+++ trunk/src/helper/log.h 2009-05-11 03:59:02 UTC (rev 1706)
@@ -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.
Modified: trunk/src/helper/options.c
===================================================================
--- trunk/src/helper/options.c 2009-05-11 03:48:32 UTC (rev 1705)
+++ trunk/src/helper/options.c 2009-05-11 03:59:02 UTC (rev 1706)
@@ -24,18 +24,11 @@
#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;
Modified: trunk/src/helper/time_support.c
===================================================================
--- trunk/src/helper/time_support.c 2009-05-11 03:48:32 UTC (rev 1705)
+++ trunk/src/helper/time_support.c 2009-05-11 03:59:02 UTC (rev 1706)
@@ -27,13 +27,10 @@
#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)
{
|