Kaynağa Gözat

Merge branch 'maint'

* maint:
  Fix header symbol collision on FreeBSD 12
  Fix cast to long
Bryan Drewery 8 yıl önce
ebeveyn
işleme
730a91ddec
3 değiştirilmiş dosya ile 4 ekleme ve 1 silme
  1. 1 1
      src/cmds.cc
  2. 2 0
      src/debug.cc
  3. 1 0
      src/debug.h

+ 1 - 1
src/cmds.cc

@@ -4044,7 +4044,7 @@ static void rcmd_timesync(char *frombot, char *fromhand, char *fromidx, char *pa
   char tmp[100] = "";
   long net = atol(par);
 
-  simple_snprintf(tmp, sizeof(tmp), "NET: %li    ME: %li   DIFF: %d", net, (long)timesync + now, (int) ((timesync+now) - net));
+  simple_snprintf(tmp, sizeof(tmp), "NET: %li    ME: %li   DIFF: %d", net, (long)(timesync + now), (int) ((timesync+now) - net));
   botnet_send_cmdreply(conf.bot->nick, frombot, fromhand, fromidx, tmp);
 }
 

+ 2 - 0
src/debug.cc

@@ -108,6 +108,7 @@ void sdprintf (const char *format, ...)
 #endif
 }
 
+#ifdef DEBUG
 void _assert(int recoverable, const char *file, int line, const char *function,
     const char *exp, const char *format, ...)
 {
@@ -128,6 +129,7 @@ void _assert(int recoverable, const char *file, int line, const char *function,
         format != NULL ? msg : "");
     fatal(buf, recoverable);
 }
+#endif
 
 static void write_debug(bool fatal = 1)
 {

+ 1 - 0
src/debug.h

@@ -39,6 +39,7 @@ void init_signals();
 void init_debug();
 
 #ifdef DEBUG
+#undef _assert
 void _assert(int, const char *, int, const char *, const char *,
     const char *, ...) __attribute__((format(printf, 6, 7)));
 #define _ASSERT(recoverable, cond, msg...) do { \