comparison include/freeDiameter/libfdproto.h @ 1027:0117a7746b21

Fix a number of errors and warnings introduced/highlighted by recent commits
author Sebastien Decugis <sdecugis@freediameter.net>
date Mon, 15 Apr 2013 15:17:07 +0800
parents beb375690453
children 000e1904074c
comparison
equal deleted inserted replaced
1026:beb375690453 1027:0117a7746b21
81 81
82 #ifdef DEBUG 82 #ifdef DEBUG
83 #include <libgen.h> /* for basename if --dbg_file is specified */ 83 #include <libgen.h> /* for basename if --dbg_file is specified */
84 #endif /* DEBUG */ 84 #endif /* DEBUG */
85 85
86 #ifdef SWIG
87 #define _ATTRIBUTE_PRINTFLIKE_(_f,_v)
88 #else
89 #define _ATTRIBUTE_PRINTFLIKE_(_f,_v) __attribute__ ((format (printf, _f, _v)))
90 #endif /* SWIG */
86 91
87 /*============================================================*/ 92 /*============================================================*/
88 /* CONSTANTS */ 93 /* CONSTANTS */
89 /*============================================================*/ 94 /*============================================================*/
90 95
125 * output medium is expected to support this encoding. 130 * output medium is expected to support this encoding.
126 * 131 *
127 * RETURN VALUE: 132 * RETURN VALUE:
128 * None. 133 * None.
129 */ 134 */
130 void fd_log ( int, const char *, ... ) __attribute__ ((format (printf, 2, 3))); 135 void fd_log ( int, const char *, ... ) _ATTRIBUTE_PRINTFLIKE_(2,3);
131 #define fd_log_debug(format,args...) fd_log(FD_LOG_DEBUG, format, ## args) 136 #define fd_log_debug(format,args...) fd_log(FD_LOG_DEBUG, format, ## args)
132 #define fd_log_notice(format,args...) fd_log(FD_LOG_NOTICE, format, ## args) 137 #define fd_log_notice(format,args...) fd_log(FD_LOG_NOTICE, format, ## args)
133 #define fd_log_error(format,args...) fd_log(FD_LOG_ERROR, format, ## args) 138 #define fd_log_error(format,args...) fd_log(FD_LOG_ERROR, format, ## args)
134 139
135 void fd_log_debug_fstr( FILE *, const char *, ... ); 140 void fd_log_debug_fstr( FILE *, const char *, ... );
781 786
782 /* Then join the thread */ 787 /* Then join the thread */
783 CHECK_POSIX( pthread_join(*th, &th_ret) ); 788 CHECK_POSIX( pthread_join(*th, &th_ret) );
784 789
785 if (th_ret == PTHREAD_CANCELED) { 790 if (th_ret == PTHREAD_CANCELED) {
786 TRACE_DEBUG(ANNOYING, "The thread %p was canceled", *th); 791 TRACE_DEBUG(ANNOYING, "The thread %p was canceled", (void *)*th);
787 } else { 792 } else {
788 TRACE_DEBUG(CALL, "The thread %p returned %p", *th, th_ret); 793 TRACE_DEBUG(CALL, "The thread %p returned %p", (void *)*th, th_ret);
789 } 794 }
790 795
791 /* Clean the location */ 796 /* Clean the location */
792 *th = (pthread_t)NULL; 797 *th = (pthread_t)NULL;
793 798
2334 FD_MSG_LOG_SENT, /* message sent to another peer */ 2339 FD_MSG_LOG_SENT, /* message sent to another peer */
2335 FD_MSG_LOG_NODELIVER, /* message could not be delivered to any peer */ 2340 FD_MSG_LOG_NODELIVER, /* message could not be delivered to any peer */
2336 FD_MSG_LOG_TIMING /* profiling messages */ 2341 FD_MSG_LOG_TIMING /* profiling messages */
2337 }; 2342 };
2338 #define FD_MSG_LOG_MAX FD_MSG_LOG_TIMING 2343 #define FD_MSG_LOG_MAX FD_MSG_LOG_TIMING
2339 void fd_msg_log( enum fd_msg_log_cause cause, struct msg * msg, const char * prefix_format, ... ) __attribute__ ((format (printf, 3, 4))); 2344 void fd_msg_log( enum fd_msg_log_cause cause, struct msg * msg, const char * prefix_format, ... ) _ATTRIBUTE_PRINTFLIKE_(3,4);
2340 2345
2341 /* configure the msg_log facility */ 2346 /* configure the msg_log facility */
2342 enum fd_msg_log_method { 2347 enum fd_msg_log_method {
2343 FD_MSG_LOGTO_NONE = 0, /* The message is not dumped. This is the default. */ 2348 FD_MSG_LOGTO_NONE = 0, /* The message is not dumped. This is the default. */
2344 FD_MSG_LOGTO_DEBUGONLY, /* Simply log the message with other debug information, at the INFO level. */ 2349 FD_MSG_LOGTO_DEBUGONLY, /* Simply log the message with other debug information, at the INFO level. */
"Welcome to our mercurial repository"