فهرست منبع

Appease GCC const suggestions

Bryan Drewery 6 سال پیش
والد
کامیت
80607ab284
4فایلهای تغییر یافته به همراه11 افزوده شده و 2 حذف شده
  1. 1 1
      src/log.cc
  2. 5 1
      src/log.h
  3. 1 0
      src/main.cc
  4. 4 0
      src/shell.h

+ 1 - 1
src/log.cc

@@ -338,7 +338,7 @@ void putlog(int type, const char *chname, const char *format, ...)
 void
 irc_log(struct chanset_t *chan, const char *format, ...)
 {
-#ifdef NOTHANKS
+#ifdef NOTYET
   char va_out[LOGLINEMAX + 1];
   va_list va;
 

+ 5 - 1
src/log.h

@@ -33,7 +33,11 @@ void putlog (int, const char *, const char *, ...) __attribute__((format(printf,
 int logmodes(const char *);
 char *masktype(int);
 char *maskname(int);
-void irc_log(struct chanset_t *, const char *, ...) __attribute__((format(printf, 2, 3)));
+void irc_log(struct chanset_t *, const char *, ...) __attribute__((format(printf, 2, 3)))
+#ifndef NOTYET
+  __attribute__((const))
+#endif
+  ;
 void logfile(int type, const char *msg);
 
 extern int		conmask;

+ 1 - 0
src/main.cc

@@ -940,6 +940,7 @@ int main(int argc, char **argv)
 }
 
 /* bfd doesn't link empty --dynamic-list file. */
+void bfd_exports_stub(void) __attribute__((const));
 void bfd_exports_stub(void)
 {
 }

+ 4 - 0
src/shell.h

@@ -55,7 +55,11 @@ int shell_exec(const char *, const char *, char **, char **, bool = 0);
 int simple_exec(const char* argv[]);
 void check_last();
 void check_promisc();
+#if defined(DEBUG) && !defined(PR_SET_PTRACER_ANY)
+void check_trace(int) __attribute__((const));
+#else
 void check_trace(int);
+#endif
 void check_crontab();
 void crontab_del();
 int crontab_exists(bd::Stream* = NULL, bool = 0);