static int did_log_msg = TRUE;
+#ifndef PROTO /* prototype is in vim.h */
void
ch_log(channel_T *ch, const char *fmt, ...)
{
did_log_msg = TRUE;
}
}
+#endif
+
+ static void
+ch_error(channel_T *ch, const char *fmt, ...)
+#ifdef __GNUC__
+__attribute__((format(printf, 2, 3)))
+#endif
+ ;
static void
ch_error(channel_T *ch, const char *fmt, ...)
ch_close_part(channel, PART_IN);
}
else
- ch_log(channel, "Still %d more lines to write",
- buf->b_ml.ml_line_count - lnum + 1);
+ ch_log(channel, "Still %ld more lines to write",
+ (long)(buf->b_ml.ml_line_count - lnum + 1));
}
/*
else if (written > 1)
ch_log(channel, "written %d lines to channel", written);
if (lnum < buf->b_ml.ml_line_count)
- ch_log(channel, "Still %d more lines to write",
- buf->b_ml.ml_line_count - lnum);
+ ch_log(channel, "Still %ld more lines to write",
+ (long)(buf->b_ml.ml_line_count - lnum));
in_part->ch_buf_bot = lnum;
}
{
*rettv = item->jq_value;
if (tv->v_type == VAR_NUMBER)
- ch_log(channel, "Getting JSON message %d", tv->vval.v_number);
+ ch_log(channel, "Getting JSON message %ld",
+ (long)tv->vval.v_number);
remove_json_node(head, item);
return OK;
}
/* channel.c */
void ch_logfile(char_u *fname, char_u *opt);
int ch_log_active(void);
-void ch_log(channel_T *ch, const char *fmt, ...);
channel_T *add_channel(void);
int has_any_channel(void);
int channel_unref(channel_T *channel);
#define TERM_START_FORCEIT 2
#define TERM_START_SYSTEM 4
+/* Not generated automatically, to add extra attribute. */
+void ch_log(channel_T *ch, const char *fmt, ...)
+#ifdef __GNUC__
+__attribute__((format(printf, 2, 3)))
+#endif
+;
+
#endif /* VIM__H */