Enable printf warnings on npw_printf and friends
Also fix two errors they catch.
This commit is contained in:
parent
04cdf540b8
commit
cddf8a2914
3
Makefile
3
Makefile
|
@ -154,7 +154,10 @@ libxpcom_OBJECTS = $(libxpcom_RAWSRCS:%.c=libxpcom-%.o)
|
|||
libxpcom_CFLAGS = $(PIC_CFLAGS)
|
||||
ifeq ($(build_biarch),yes)
|
||||
libxpcom_CFLAGS += -I$(LSB_INC_DIR)
|
||||
libxpcom_CFLAGS += -I$(LSB_INC_DIR)/glib-2.0
|
||||
libxpcom_LDFLAGS = -L$(LSB_OBJ_DIR)
|
||||
else
|
||||
libxpcom_CFLAGS += $(GLIB_CFLAGS)
|
||||
endif
|
||||
|
||||
libnoxshm_LIBRARY = libnoxshm.so
|
||||
|
|
|
@ -21,18 +21,19 @@
|
|||
#ifndef DEBUG_H
|
||||
#define DEBUG_H
|
||||
|
||||
#include <glib.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern void npw_dprintf(const char *format, ...) attribute_hidden;
|
||||
extern G_GNUC_PRINTF(1, 2) void npw_dprintf(const char *format, ...) attribute_hidden;
|
||||
|
||||
extern void npw_indent(int inc) attribute_hidden;
|
||||
extern void npw_idprintf(int inc, const char *format, ...) attribute_hidden;
|
||||
extern G_GNUC_PRINTF(2, 3) void npw_idprintf(int inc, const char *format, ...) attribute_hidden;
|
||||
|
||||
extern void npw_printf(const char *format, ...) attribute_hidden;
|
||||
extern G_GNUC_PRINTF(1, 2) void npw_printf(const char *format, ...) attribute_hidden;
|
||||
extern void npw_vprintf(const char *format, va_list args) attribute_hidden;
|
||||
|
||||
#if DEBUG
|
||||
|
|
|
@ -4662,7 +4662,7 @@ static int handle_NPP_Print(rpc_connection_t *connection)
|
|||
// send back the printed data
|
||||
if (printer.fp) {
|
||||
long file_size = ftell(printer.fp);
|
||||
D(bug(" writeback data [%d bytes]\n", file_size));
|
||||
D(bug(" writeback data [%ld bytes]\n", file_size));
|
||||
rewind(printer.fp);
|
||||
if (file_size > 0) {
|
||||
NPPrintData printData;
|
||||
|
@ -5066,7 +5066,7 @@ static int do_main(int argc, char **argv, const char *connection_path)
|
|||
D(bug(" Plugin viewer pid: %d\n", getpid()));
|
||||
|
||||
thread_check_init();
|
||||
D(bug(" Plugin main thread: %p\n", g_main_thread));
|
||||
D(bug(" Plugin main thread: %p\n", (void*)g_main_thread));
|
||||
|
||||
// Cleanup environment, the program may fork/exec a native shell
|
||||
// script and having 32-bit libraries in LD_PRELOAD is not right,
|
||||
|
|
|
@ -21,6 +21,8 @@
|
|||
#ifndef UTILS_H
|
||||
#define UTILS_H
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
@ -46,7 +48,7 @@ extern const char *string_of_NPNURLVariable(int variable) attribute_hidden;
|
|||
// Misc utility functions
|
||||
extern void npw_perror(const char *prefix, int error) attribute_hidden;
|
||||
extern const char *npw_strerror(int error) attribute_hidden;
|
||||
extern char *npw_asprintf(const char *format, ...) attribute_hidden;
|
||||
extern G_GNUC_PRINTF(1, 2) char *npw_asprintf(const char *format, ...) attribute_hidden;
|
||||
extern void npw_close_all_open_files(void) attribute_hidden;
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
Loading…
Reference in New Issue