Turned all macros to functions. Marked everything as G_GNUC_PRINTF and
* include/glibtop/error.h: * lib/parameter.c: (glibtop_set_parameter_l): * lib/read_data.c: (glibtop_read_data_l): * sysdeps/common/error.c: (print_server_name), (glibtop_error_vr), (glibtop_error_io_vr), (glibtop_warn_vr), (glibtop_warn_io_vr), (glibtop_error_r), (glibtop_warn_r), (glibtop_error_io_r), (glibtop_warn_io_r), (glibtop_error), (glibtop_warn), (glibtop_error_io), (glibtop_warn_io): Turned all macros to functions. Marked everything as G_GNUC_PRINTF and fixed format bugs. * sysdeps/common/fsusage.c: Marked some functions as G_GNUC_INTERNAL
This commit is contained in:
@@ -28,42 +28,20 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
void glibtop_error_vr (glibtop *server, char *format, va_list args);
|
||||
void glibtop_warn_vr (glibtop *server, char *format, va_list args);
|
||||
void glibtop_error_vr (glibtop *server, const char *format, va_list args);
|
||||
void glibtop_warn_vr (glibtop *server, const char *format, va_list args);
|
||||
void glibtop_error_io_vr (glibtop *server, const char *format, int, va_list args);
|
||||
void glibtop_warn_io_vr (glibtop *server, const char *format, int, va_list args);
|
||||
|
||||
void glibtop_error_io_vr (glibtop *server, char *format, int, va_list args);
|
||||
void glibtop_warn_io_vr (glibtop *server, char *format, int, va_list args);
|
||||
void glibtop_error_r (glibtop *server, const char *format, ...) G_GNUC_PRINTF(2, 3);
|
||||
void glibtop_warn_r (glibtop *server, const char *format, ...) G_GNUC_PRINTF(2, 3);
|
||||
void glibtop_error_io_r (glibtop *server, const char *format, ...) G_GNUC_PRINTF(2, 3);
|
||||
void glibtop_warn_io_r (glibtop *server, const char *format, ...) G_GNUC_PRINTF(2, 3);
|
||||
|
||||
void G_GNUC_UNUSED glibtop_error_r (glibtop *server, char *format, ...);
|
||||
void G_GNUC_UNUSED glibtop_warn_r (glibtop *server, char *format, ...);
|
||||
void G_GNUC_UNUSED glibtop_error_io_r (glibtop *server, char *format, ...);
|
||||
void G_GNUC_UNUSED glibtop_warn_io_r (glibtop *server, char *format, ...);
|
||||
|
||||
|
||||
#ifdef __GNUC__
|
||||
|
||||
#define glibtop_error(p1, args...) glibtop_error_r(glibtop_global_server , p1 , ## args)
|
||||
#define glibtop_warn(p1, args...) glibtop_warn_r(glibtop_global_server , p1 , ## args)
|
||||
|
||||
#define glibtop_error_io(p1, args...) glibtop_error_io_r(glibtop_global_server , p1 , ## args)
|
||||
#define glibtop_warn_io(p1, args...) glibtop_warn_io_r(glibtop_global_server , p1 , ## args)
|
||||
|
||||
#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
||||
|
||||
#define glibtop_error(p1, ...) glibtop_error_r(glibtop_global_server , p1 , __VA_ARGS__)
|
||||
#define glibtop_warn(p1, ...) glibtop_warn_r(glibtop_global_server , p1 , __VA_ARGS__)
|
||||
|
||||
#define glibtop_error_io(p1, ...) glibtop_error_io_r(glibtop_global_server , p1 , __VA_ARGS__)
|
||||
#define glibtop_warn_io(p1, ...) glibtop_warn_io_r(glibtop_global_server , p1 , __VA_ARGS__)
|
||||
|
||||
#else /* no __GNUC__, no C99*/
|
||||
|
||||
void glibtop_error (char *format, ...);
|
||||
void glibtop_warn (char *format, ...);
|
||||
void glibtop_error_io (char *format, ...);
|
||||
void glibtop_warn_io (char *format, ...);
|
||||
|
||||
#endif /* no __GNUC__ */
|
||||
void glibtop_error (const char *format, ...) G_GNUC_PRINTF(1, 2);
|
||||
void glibtop_warn (const char *format, ...) G_GNUC_PRINTF(1, 2);
|
||||
void glibtop_error_io (const char *format, ...) G_GNUC_PRINTF(1, 2);
|
||||
void glibtop_warn_io (const char *format, ...) G_GNUC_PRINTF(1, 2);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
Reference in New Issue
Block a user