Warning fixes (const char *, (void)).
authortwisti <none@none>
Tue, 4 Jan 2005 11:35:10 +0000 (11:35 +0000)
committertwisti <none@none>
Tue, 4 Jan 2005 11:35:10 +0000 (11:35 +0000)
src/toolbox/logging.c
src/toolbox/logging.h

index 011a4ac8e4f653c4ce05dff801d808426ae7a8b2..d4650b5c938a8779039835866d1f14185fbbdb3e 100644 (file)
@@ -26,7 +26,7 @@
 
    Authors: Reinhard Grafl
 
-   $Id: logging.c 1761 2004-12-15 15:48:43Z twisti $
+   $Id: logging.c 1848 2005-01-04 11:35:10Z twisti $
 
 */
 
@@ -51,7 +51,7 @@ FILE *logfile = NULL;
 
 
 
-void log_init(char *fname)
+void log_init(const char *fname)
 {
        if (fname) {
                if (fname[0]) {
@@ -67,7 +67,7 @@ Writes logtext to the protocol file (if opened) or to stdout.
 
 **************************************************************************/
 
-void dolog(char *txt, ...)
+void dolog(const char *txt, ...)
 {
        char logtext[MAXLOGTEXT];
        va_list ap;
@@ -93,7 +93,7 @@ Writes logtext to the protocol file (if opened) or to stdout.
 
 **************************************************************************/
 
-void dolog_plain(char *txt, ...)
+void dolog_plain(const char *txt, ...)
 {
        char logtext[MAXLOGTEXT];
        va_list ap;
@@ -115,7 +115,7 @@ void dolog_plain(char *txt, ...)
 
 /********************* Function: log_text ********************************/
 
-void log_text(char *text)
+void log_text(const char *text)
 {
        dolog("%s", text);
 }
@@ -123,7 +123,7 @@ void log_text(char *text)
 
 /******************** Function: log_plain *******************************/
 
-void log_plain(char *text)
+void log_plain(const char *text)
 {
        dolog_plain("%s", text);
 }
@@ -131,7 +131,7 @@ void log_plain(char *text)
 
 /****************** Function: get_logfile *******************************/
 
-FILE *get_logfile()
+FILE *get_logfile(void)
 {
        return (logfile) ? logfile : stdout;
 }
@@ -139,7 +139,7 @@ FILE *get_logfile()
 
 /****************** Function: log_flush *********************************/
 
-void log_flush()
+void log_flush(void)
 {
        fflush(get_logfile());
 }
@@ -147,7 +147,7 @@ void log_flush()
 
 /********************* Function: log_nl *********************************/
 
-void log_nl()
+void log_nl(void)
 {
        log_plain("\n");
        fflush(get_logfile());
@@ -156,7 +156,7 @@ void log_nl()
 
 /********************* Function: log_cputime ****************************/
 
-void log_cputime()
+void log_cputime(void)
 {
        s8 t;
        int sec, usec;
@@ -234,7 +234,7 @@ Like dolog(), but terminates the program immediately.
 
 **************************************************************************/
 
-void error(char *txt, ...)
+void error(const char *txt, ...)
 {
        char logtext[MAXLOGTEXT];
        va_list ap;
@@ -259,7 +259,7 @@ void error(char *txt, ...)
 
 ***************************************************************************/
 
-void panic(char *txt)
+void panic(const char *txt)
 {
        error("%s", txt);
 }
index 2f4dfad650f7374d83298b54773ba9e45ef3cdf8..90270045a504f0434d7df59206766f6292dbd4eb 100644 (file)
@@ -26,7 +26,7 @@
 
    Authors: Reinhard Grafl
 
-   $Id: logging.h 1793 2004-12-21 10:14:35Z twisti $
+   $Id: logging.h 1848 2005-01-04 11:35:10Z twisti $
 
 */
 
 
 /* function prototypes ********************************************************/
 
-void log_init(char *fname);
-void log_text(char *txt);
-void log_plain(char *txt); /* same as log_text without "LOG: " and newline */
-void log_flush(void);      /* fflush logfile */
-void log_nl(void);         /* newline and fflush */
+void log_init(const char *fname);
+void log_text(const char *txt);
+
+/* same as log_text without "LOG: " and newline */
+void log_plain(const char *txt);
+
+/* fflush logfile */
+void log_flush(void);
+
+/* newline and fflush */
+void log_nl(void);
 
 void log_cputime(void);
 
 void log_message_class(const char *msg, classinfo *c);
 void log_message_method(const char *msg, methodinfo *m);
 
-void dolog(char *txt, ...);
-void dolog_plain(char *txt, ...); /* same as dolog without "LOG: " and newline*/
-void error(char *txt, ...);
+void dolog(const char *txt, ...);
+
+/* same as dolog without "LOG: " and newline*/
+void dolog_plain(const char *txt, ...);
+
+void error(const char *txt, ...);
 
 /* XXX this is just a quick hack on darwin */
 #if !defined(__DARWIN__)
-void panic(char *txt);
+void panic(const char *txt);
 #endif
 
 FILE *get_logfile(void);                        /* return the current logfile */