From e84b300d9e2f0a34a75d6e295e12ed1e095e9f09 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 16 Sep 2012 10:39:19 +0000 Subject: use the format attribute in more places, disable X11 options when building with GHOST_SDL --- source/blender/blenlib/BLI_dynstr.h | 6 +++++- source/blender/blenlib/BLI_string.h | 6 +++++- source/blender/blenloader/intern/readfile.c | 6 ++++++ source/blender/editors/interface/interface_regions.c | 5 +++++ 4 files changed, 21 insertions(+), 2 deletions(-) (limited to 'source/blender') diff --git a/source/blender/blenlib/BLI_dynstr.h b/source/blender/blenlib/BLI_dynstr.h index 3b7f2d6bbaf..1fa0a3aee8a 100644 --- a/source/blender/blenlib/BLI_dynstr.h +++ b/source/blender/blenlib/BLI_dynstr.h @@ -80,7 +80,11 @@ void BLI_dynstr_appendf(DynStr *ds, const char *format, ...) __attribute__ ((format(printf, 2, 3))) #endif ; -void BLI_dynstr_vappendf(DynStr *ds, const char *format, va_list args); +void BLI_dynstr_vappendf(DynStr *ds, const char *format, va_list args) +#ifdef __GNUC__ +__attribute__ ((format(printf, 2, 0))) +#endif +; /** * Find the length of a DynStr. diff --git a/source/blender/blenlib/BLI_string.h b/source/blender/blenlib/BLI_string.h index b3d0df04eb1..666c74ca36f 100644 --- a/source/blender/blenlib/BLI_string.h +++ b/source/blender/blenlib/BLI_string.h @@ -144,7 +144,11 @@ __attribute__((nonnull)) /* * Replacement for vsnprintf */ -size_t BLI_vsnprintf(char *buffer, size_t count, const char *format, va_list arg); +size_t BLI_vsnprintf(char *buffer, size_t count, const char *format, va_list arg) +#ifdef __GNUC__ +__attribute__ ((format(printf, 3, 0))) +#endif +; /* * Print formatted string into a newly mallocN'd string diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index c6483442b00..9eaed7cd20e 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -248,6 +248,12 @@ static void convert_tface_mt(FileData *fd, Main *main); * bit kludge but better then doubling up on prints, * we could alternatively have a versions of a report function which forces printing - campbell */ + +static void BKE_reportf_wrap(ReportList *reports, ReportType type, const char *format, ...) +#ifdef __GNUC__ +__attribute__ ((format(printf, 3, 4))) +#endif +; static void BKE_reportf_wrap(ReportList *reports, ReportType type, const char *format, ...) { char fixed_buf[1024]; /* should be long enough */ diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index d5300bffe6f..30d9a9a5ba1 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -2575,6 +2575,11 @@ static void confirm_cancel_operator(void *opv) WM_operator_free(opv); } +static void vconfirm_opname(bContext *C, const char *opname, const char *title, const char *itemfmt, va_list ap) +#ifdef __GNUC__ +__attribute__ ((format(printf, 4, 0))) +#endif +; static void vconfirm_opname(bContext *C, const char *opname, const char *title, const char *itemfmt, va_list ap) { uiPopupBlockHandle *handle; -- cgit v1.2.3