trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From iga...@apache.org
Subject [13/21] git commit: TS-1314: Apply static to Main.cc
Date Fri, 21 Sep 2012 10:04:40 GMT
TS-1314: Apply static to Main.cc


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/1a3fda6f
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/1a3fda6f
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/1a3fda6f

Branch: refs/heads/3.2.x
Commit: 1a3fda6fdaaf7063c0b0d06bd471776c819b01e3
Parents: 1055f7f
Author: James Peach <jpeach@apache.org>
Authored: Tue Jun 26 21:34:50 2012 -0700
Committer: Igor Galić <i.galic@brainsware.org>
Committed: Fri Sep 21 08:49:04 2012 +0200

----------------------------------------------------------------------
 proxy/Main.cc    |   65 ++++++++++++++++++++++---------------------------
 proxy/signals.cc |    1 -
 2 files changed, 29 insertions(+), 37 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1a3fda6f/proxy/Main.cc
----------------------------------------------------------------------
diff --git a/proxy/Main.cc b/proxy/Main.cc
index 7bbc914..f21cabe 100644
--- a/proxy/Main.cc
+++ b/proxy/Main.cc
@@ -117,25 +117,26 @@ extern "C" int plock(int);
 
 #define DEFAULT_REMOTE_MANAGEMENT_FLAG    0
 
-int version_flag = DEFAULT_VERSION_FLAG;
-int stack_trace_flag = DEFAULT_STACK_TRACE_FLAG;
+static void * mgmt_restart_shutdown_callback(void *, char *, int data_len);
+static bool xmlBandwidthSchemaRead(XMLNode * node);
 
-int number_of_processors = ink_number_of_processors();
-int num_of_net_threads = DEFAULT_NUMBER_OF_THREADS;
+static int version_flag = DEFAULT_VERSION_FLAG;
+
+static int const number_of_processors = ink_number_of_processors();
+static int num_of_net_threads = DEFAULT_NUMBER_OF_THREADS;
 extern int num_of_cluster_threads;
-int num_of_udp_threads = DEFAULT_NUMBER_OF_UDP_THREADS;
-int num_accept_threads  = DEFAULT_NUM_ACCEPT_THREADS;
-int num_task_threads = DEFAULT_NUM_TASK_THREADS;
-int run_test_hook = 0;
-char http_accept_port_descriptor[TS_ARG_MAX + 1];
+static int num_of_udp_threads = DEFAULT_NUMBER_OF_UDP_THREADS;
+static int num_accept_threads  = DEFAULT_NUM_ACCEPT_THREADS;
+static int num_task_threads = DEFAULT_NUM_TASK_THREADS;
+static int run_test_hook = 0;
+static char http_accept_port_descriptor[TS_ARG_MAX + 1];
 #define TS_ARG_MAX_STR_FMT "S" TS_ARG_MAX_STR
 int http_accept_file_descriptor = NO_FD;
-int ssl_accept_file_descriptor = NO_FD;
-char core_file[255] = "";
-bool enable_core_file_p = false; // Enable core file dump?
+static char core_file[255] = "";
+static bool enable_core_file_p = false; // Enable core file dump?
 int command_flag = DEFAULT_COMMAND_FLAG;
 #if TS_HAS_TESTS
-char regression_test[1024] = "";
+static char regression_test[1024] = "";
 #endif
 int auto_clear_hostdb_flag = 0;
 int lock_process = DEFAULT_LOCK_PROCESS;
@@ -146,7 +147,7 @@ char cluster_host[MAXDNAME + 1] = DEFAULT_CLUSTER_HOST;
 
 //         = DEFAULT_CLUSTER_PORT_NUMBER;
 char proxy_name[MAXDNAME + 1] = "unknown";
-char command_string[512] = "";
+static char command_string[512] = "";
 int remote_management_flag = DEFAULT_REMOTE_MANAGEMENT_FLAG;
 
 char management_directory[PATH_NAME_MAX+1];      // Layout->sysconfdir
@@ -155,18 +156,16 @@ char system_runtime_dir[PATH_NAME_MAX + 1];  // Layout->runtimedir
 char system_config_directory[PATH_NAME_MAX + 1]; // Layout->sysconfdir
 char system_log_dir[PATH_NAME_MAX + 1];          // Layout->logdir
 
-int logging_port_override = 0;
-char logging_server_override[256] = " do not override";
-char error_tags[1024] = "";
-char action_tags[1024] = "";
-int show_statistics = 0;
-int history_info_enabled = 1;
+static char error_tags[1024] = "";
+static char action_tags[1024] = "";
+static int show_statistics = 0;
+static int history_info_enabled = 1;
 //inkcoreapi Diags *diags = NULL;
-inkcoreapi DiagsConfig *diagsConfig = NULL;
+static inkcoreapi DiagsConfig *diagsConfig = NULL;
 HttpBodyFactory *body_factory = NULL;
-int diags_init = 0;             // used by process manager
+static int diags_init = 0;             // used by process manager
 
-char vingid_flag[255] = "";
+static char vingid_flag[255] = "";
 
 static int accept_mss = 0;
 static int cmd_line_dprintf_level = 0;  // default debug output level fro ink_dprintf function
@@ -176,7 +175,6 @@ AppVersionInfo appVersionInfo;  // Build info for this application
 #if TS_HAS_TESTS
 extern int run_TestHook();
 #endif
-void deinitSubAgent();
 
 const Version version = {
   {CACHE_DB_MAJOR_VERSION, CACHE_DB_MINOR_VERSION},     // cacheDB
@@ -677,7 +675,7 @@ cmd_clear(char *cmd)
 
 static int cmd_help(char *cmd);
 
-static struct CMD
+static const struct CMD
 {
   const char *n;                      // name
   const char *d;                      // description (part of a line)
@@ -736,13 +734,11 @@ commands[] = {
       "EXAMPLES: help help\n"
       "          help commit\n" "\n" "Provide a short description of a command (like this).\n",
cmd_help},};
 
-#define N_CMDS ((int)(sizeof(commands)/sizeof(commands[0])))
-
 static int
 cmd_index(char *p)
 {
   p += strspn(p, " \t");
-  for (int c = 0; c < N_CMDS; c++) {
+  for (int c = 0; c < SIZE(commands); c++) {
     const char *l = commands[c].n;
     while (l) {
       const char *s = strchr(l, '/');
@@ -766,7 +762,7 @@ cmd_help(char *cmd)
   printf("HELP\n\n");
   cmd = skip(cmd, true);
   if (!cmd) {
-    for (i = 0; i < N_CMDS; i++) {
+    for (i = 0; i < SIZE(commands); i++) {
       printf("%15s  %s\n", commands[i].n, commands[i].d);
     }
   } else {
@@ -1220,7 +1216,7 @@ chdir_root()
 }
 
 
-int
+static int
 getNumSSLThreads(void)
 {
   int num_of_ssl_threads = 0;
@@ -1300,7 +1296,7 @@ adjust_num_of_net_threads(void)
  * Change the uid and gid to what is in the passwd entry for supplied user name.
  * @param user User name in the passwd file to change the uid and gid to.
  */
-void
+static void
 change_uid_gid(const char *user)
 {
   struct passwd pwbuf;
@@ -1560,7 +1556,6 @@ main(int argc, char **argv)
 
   {
     XMLDom schema;
-    bool xmlBandwidthSchemaRead(XMLNode * node);
     //char *configPath = TS_ConfigReadString("proxy.config.config_dir");
     char *filename = TS_ConfigReadString("proxy.config.bandwidth_mgmt.filename");
     char bwFilename[PATH_NAME_MAX];
@@ -1798,8 +1793,6 @@ main(int argc, char **argv)
     ///////////////////////////////////////////
     updateManager.start();
 
-    void *mgmt_restart_shutdown_callback(void *, char *, int data_len);
-
     pmgmt->registerMgmtCallback(MGMT_EVENT_SHUTDOWN, mgmt_restart_shutdown_callback, NULL);
     pmgmt->registerMgmtCallback(MGMT_EVENT_RESTART, mgmt_restart_shutdown_callback, NULL);
 
@@ -1832,7 +1825,7 @@ main(int argc, char **argv)
 }
 
 
-bool
+static bool
 xmlBandwidthSchemaRead(XMLNode * node)
 {
   XMLNode *child, *c2;
@@ -1919,7 +1912,7 @@ REGRESSION_TEST(Hdrs) (RegressionTest * t, int atype, int *pstatus)
{
 }
 #endif
 
-void *
+static void *
 mgmt_restart_shutdown_callback(void *, char *, int data_len)
 {
   NOWARN_UNUSED(data_len);

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1a3fda6f/proxy/signals.cc
----------------------------------------------------------------------
diff --git a/proxy/signals.cc b/proxy/signals.cc
index 4daf6e3..6634ef3 100644
--- a/proxy/signals.cc
+++ b/proxy/signals.cc
@@ -47,7 +47,6 @@ typedef void (*SigActionFunc_t) (int sig);
 #endif
 
 int exited_children = 0;
-extern int stack_trace_flag;
 
 static volatile int sigusr1_received = 0;
 extern int fastmemtotal;


Mime
View raw message