[or-cvs] r16775: {tor} Make severity args to add_*_log() functions be const (tor/trunk/src/common)

nickm at seul.org nickm at seul.org
Fri Sep 5 19:52:44 UTC 2008


Author: nickm
Date: 2008-09-05 15:52:44 -0400 (Fri, 05 Sep 2008)
New Revision: 16775

Modified:
   tor/trunk/src/common/log.c
   tor/trunk/src/common/log.h
Log:
Make severity args to add_*_log() functions be const

Modified: tor/trunk/src/common/log.c
===================================================================
--- tor/trunk/src/common/log.c	2008-09-05 18:01:10 UTC (rev 16774)
+++ tor/trunk/src/common/log.c	2008-09-05 19:52:44 UTC (rev 16775)
@@ -497,7 +497,7 @@
 /** Add a log handler named <b>name</b> to send all messages in <b>severity</b>
  * to <b>stream</b>. Copies <b>severity</b>. Helper: does no locking. */
 static void
-add_stream_log_impl(log_severity_list_t *severity,
+add_stream_log_impl(const log_severity_list_t *severity,
                     const char *name, FILE *stream)
 {
   logfile_t *lf;
@@ -515,7 +515,7 @@
  * to <b>stream</b>. Steals a reference to <b>severity</b>; the caller must
  * not use it after calling this function. */
 void
-add_stream_log(log_severity_list_t *severity,
+add_stream_log(const log_severity_list_t *severity,
                const char *name, FILE *stream)
 {
   LOCK_LOGS();
@@ -551,7 +551,7 @@
  * to the function <b>cb</b>.
  */
 int
-add_callback_log(log_severity_list_t *severity, log_callback cb)
+add_callback_log(const log_severity_list_t *severity, log_callback cb)
 {
   logfile_t *lf;
   lf = tor_malloc_zero(sizeof(logfile_t));
@@ -640,7 +640,7 @@
  * (by fopen).
  */
 int
-add_file_log(log_severity_list_t *severity, const char *filename)
+add_file_log(const log_severity_list_t *severity, const char *filename)
 {
   FILE *f;
   logfile_t *lf;
@@ -667,7 +667,7 @@
  * Add a log handler to send messages to they system log facility.
  */
 int
-add_syslog_log(log_severity_list_t *severity)
+add_syslog_log(const log_severity_list_t *severity)
 {
   logfile_t *lf;
   if (syslog_count++ == 0)

Modified: tor/trunk/src/common/log.h
===================================================================
--- tor/trunk/src/common/log.h	2008-09-05 18:01:10 UTC (rev 16774)
+++ tor/trunk/src/common/log.h	2008-09-05 19:52:44 UTC (rev 16775)
@@ -120,13 +120,13 @@
                               log_severity_list_t *severity_out);
 void set_log_severity_config(int minSeverity, int maxSeverity,
                              log_severity_list_t *severity_out);
-void add_stream_log(log_severity_list_t *severity, const char *name,
+void add_stream_log(const log_severity_list_t *severity, const char *name,
                     FILE *stream);
-int add_file_log(log_severity_list_t *severity, const char *filename);
+int add_file_log(const log_severity_list_t *severity, const char *filename);
 #ifdef HAVE_SYSLOG_H
-int add_syslog_log(log_severity_list_t *severity);
+int add_syslog_log(const log_severity_list_t *severity);
 #endif
-int add_callback_log(log_severity_list_t *severity, log_callback cb);
+int add_callback_log(const log_severity_list_t *severity, log_callback cb);
 int get_min_log_level(void);
 void switch_logs_debug(void);
 void logs_free_all(void);



More information about the tor-commits mailing list