summary refs log tree commit diff stats
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/hexchat-plugin.h24
-rw-r--r--src/common/server.c2
-rw-r--r--src/common/server.h2
-rw-r--r--src/common/text.c4
-rw-r--r--src/common/text.h4
5 files changed, 26 insertions, 10 deletions
diff --git a/src/common/hexchat-plugin.h b/src/common/hexchat-plugin.h
index 61597181..002c0c49 100644
--- a/src/common/hexchat-plugin.h
+++ b/src/common/hexchat-plugin.h
@@ -88,11 +88,19 @@ struct _hexchat_plugin
 	void (*hexchat_print) (hexchat_plugin *ph,
 	     const char *text);
 	void (*hexchat_printf) (hexchat_plugin *ph,
-	      const char *format, ...);
+	      const char *format, ...)
+#ifdef __GNUC__
+	__attribute__((format(printf, 2, 3)))
+#endif
+	;
 	void (*hexchat_command) (hexchat_plugin *ph,
 	       const char *command);
 	void (*hexchat_commandf) (hexchat_plugin *ph,
-		const char *format, ...);
+		const char *format, ...)
+#ifdef __GNUC__
+	__attribute__((format(printf, 2, 3)))
+#endif
+	;
 	int (*hexchat_nickcmp) (hexchat_plugin *ph,
 	       const char *s1,
 	       const char *s2);
@@ -254,7 +262,11 @@ hexchat_print (hexchat_plugin *ph,
 
 void
 hexchat_printf (hexchat_plugin *ph,
-	      const char *format, ...);
+	      const char *format, ...)
+#ifdef __GNUC__
+	__attribute__((format(printf, 2, 3)))
+#endif
+;
 
 void
 hexchat_command (hexchat_plugin *ph,
@@ -262,7 +274,11 @@ hexchat_command (hexchat_plugin *ph,
 
 void
 hexchat_commandf (hexchat_plugin *ph,
-		const char *format, ...);
+		const char *format, ...)
+#ifdef __GNUC__
+	__attribute__((format(printf, 2, 3)))
+#endif
+;
 
 int
 hexchat_nickcmp (hexchat_plugin *ph,
diff --git a/src/common/server.c b/src/common/server.c
index eea7ce08..98785937 100644
--- a/src/common/server.c
+++ b/src/common/server.c
@@ -273,7 +273,7 @@ tcp_send (server *serv, char *buf)
 }*/
 
 void
-tcp_sendf (server *serv, char *fmt, ...)
+tcp_sendf (server *serv, const char *fmt, ...)
 {
 	va_list args;
 	/* keep this buffer in BSS. Converting UTF-8 to ISO-8859-x might make the
diff --git a/src/common/server.h b/src/common/server.h
index 08aeca56..90e9a9c1 100644
--- a/src/common/server.h
+++ b/src/common/server.h
@@ -25,7 +25,7 @@ extern GSList *serv_list;
 /* eventually need to keep the tcp_* functions isolated to server.c */
 int tcp_send_len (server *serv, char *buf, int len);
 int tcp_send (server *serv, char *buf);
-void tcp_sendf (server *serv, char *fmt, ...);
+void tcp_sendf (server *serv, const char *fmt, ...) G_GNUC_PRINTF (2, 3);
 int tcp_send_real (void *ssl, int sok, char *encoding, int using_irc, char *buf, int len);
 
 server *server_new (void);
diff --git a/src/common/text.c b/src/common/text.c
index ec407833..22467c99 100644
--- a/src/common/text.c
+++ b/src/common/text.c
@@ -927,7 +927,7 @@ PrintText (session *sess, char *text)
 }
 
 void
-PrintTextf (session *sess, char *format, ...)
+PrintTextf (session *sess, const char *format, ...)
 {
 	va_list args;
 	char *buf;
@@ -941,7 +941,7 @@ PrintTextf (session *sess, char *format, ...)
 }
 
 void
-PrintTextTimeStampf (session *sess, time_t timestamp, char *format, ...)
+PrintTextTimeStampf (session *sess, time_t timestamp, const char *format, ...)
 {
 	va_list args;
 	char *buf;
diff --git a/src/common/text.h b/src/common/text.h
index a9fd9d4e..9a385167 100644
--- a/src/common/text.h
+++ b/src/common/text.h
@@ -43,8 +43,8 @@ void scrollback_load (session *sess);
 int text_word_check (char *word, int len);
 void PrintText (session *sess, char *text);
 void PrintTextTimeStamp (session *sess, char *text, time_t timestamp);
-void PrintTextf (session *sess, char *format, ...);
-void PrintTextTimeStampf (session *sess, time_t timestamp, char *format, ...);
+void PrintTextf (session *sess, const char *format, ...) G_GNUC_PRINTF (2, 3);
+void PrintTextTimeStampf (session *sess, time_t timestamp, const char *format, ...) G_GNUC_PRINTF (3, 4);
 void log_close (session *sess);
 void log_open_or_close (session *sess);
 void load_text_events (void);