[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [50652] trunk/blender: use the format attribute in more places, disable X11 options when building with GHOST_SDL

Campbell Barton ideasman42 at gmail.com
Sun Sep 16 12:39:19 CEST 2012


Revision: 50652
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=50652
Author:   campbellbarton
Date:     2012-09-16 10:39:19 +0000 (Sun, 16 Sep 2012)
Log Message:
-----------
use the format attribute in more places, disable X11 options when building with GHOST_SDL

Modified Paths:
--------------
    trunk/blender/CMakeLists.txt
    trunk/blender/intern/string/STR_String.h
    trunk/blender/intern/string/intern/STR_String.cpp
    trunk/blender/source/blender/blenlib/BLI_dynstr.h
    trunk/blender/source/blender/blenlib/BLI_string.h
    trunk/blender/source/blender/blenloader/intern/readfile.c
    trunk/blender/source/blender/editors/interface/interface_regions.c

Modified: trunk/blender/CMakeLists.txt
===================================================================
--- trunk/blender/CMakeLists.txt	2012-09-16 08:25:31 UTC (rev 50651)
+++ trunk/blender/CMakeLists.txt	2012-09-16 10:39:19 UTC (rev 50652)
@@ -378,6 +378,8 @@
 
 if(WITH_GHOST_SDL OR WITH_HEADLESS)
 	set(WITH_GHOST_XDND OFF)
+	set(WITH_X11_XF86VMODE OFF)
+	set(WITH_X11_XINPUT OFF)
 endif()
 
 if(MINGW)

Modified: trunk/blender/intern/string/STR_String.h
===================================================================
--- trunk/blender/intern/string/STR_String.h	2012-09-16 08:25:31 UTC (rev 50651)
+++ trunk/blender/intern/string/STR_String.h	2012-09-16 10:39:19 UTC (rev 50652)
@@ -88,8 +88,16 @@
 	inline ~STR_String()											{ delete[] this->m_data; }
 
 	// Operations
-	STR_String&			Format(const char *fmt, ...);				// Set formatted text to string
-	STR_String&			FormatAdd(const char *fmt, ...);			// Add formatted text to string
+	STR_String&			Format(const char *fmt, ...)				// Set formatted text to string
+#ifdef __GNUC__
+	__attribute__ ((format(printf, 2, 3)))
+#endif
+	;
+	STR_String&			FormatAdd(const char *fmt, ...)				// Add formatted text to string
+#ifdef __GNUC__
+	__attribute__ ((format(printf, 2, 3)))
+#endif
+	;
 	inline void			Clear()										{ this->m_len = this->m_data[0] = 0; }
 	inline const STR_String	& Reverse()
 	{
@@ -208,12 +216,10 @@
 #endif
 };
 
-inline  STR_String operator+(rcSTR_String    lhs, rcSTR_String   rhs)	{ return STR_String(lhs.ReadPtr(), lhs.Length(), rhs.ReadPtr(), rhs.Length()); }
-inline  STR_String operator+(rcSTR_String    lhs, char        rhs)		{ return STR_String(lhs.ReadPtr(), lhs.Length(), &rhs, 1); }
-inline  STR_String operator+(char            lhs, rcSTR_String   rhs)	{ return STR_String(&lhs, 1, rhs.ReadPtr(), rhs.Length()); }
-inline  STR_String operator+(rcSTR_String    lhs, const char *rhs)		{ return STR_String(lhs.ReadPtr(), lhs.Length(), rhs, strlen(rhs)); }
-inline  STR_String operator+(const char      *lhs, rcSTR_String   rhs)	{ return STR_String(lhs, strlen(lhs), rhs.ReadPtr(), rhs.Length()); }
+inline  STR_String operator+(rcSTR_String    lhs, rcSTR_String rhs)	{ return STR_String(lhs.ReadPtr(), lhs.Length(), rhs.ReadPtr(), rhs.Length()); }
+inline  STR_String operator+(rcSTR_String    lhs, char         rhs)	{ return STR_String(lhs.ReadPtr(), lhs.Length(), &rhs, 1); }
+inline  STR_String operator+(char            lhs, rcSTR_String rhs)	{ return STR_String(&lhs, 1, rhs.ReadPtr(), rhs.Length()); }
+inline  STR_String operator+(rcSTR_String    lhs, const char  *rhs)	{ return STR_String(lhs.ReadPtr(), lhs.Length(), rhs, strlen(rhs)); }
+inline  STR_String operator+(const char     *lhs, rcSTR_String rhs)	{ return STR_String(lhs, strlen(lhs), rhs.ReadPtr(), rhs.Length()); }
 
-
 #endif //__STR_STRING_H__
-

Modified: trunk/blender/intern/string/intern/STR_String.cpp
===================================================================
--- trunk/blender/intern/string/intern/STR_String.cpp	2012-09-16 08:25:31 UTC (rev 50651)
+++ trunk/blender/intern/string/intern/STR_String.cpp	2012-09-16 10:39:19 UTC (rev 50652)
@@ -738,4 +738,3 @@
 	return this->m_len + sizeof(this->m_len);
 }
 #endif
-

Modified: trunk/blender/source/blender/blenlib/BLI_dynstr.h
===================================================================
--- trunk/blender/source/blender/blenlib/BLI_dynstr.h	2012-09-16 08:25:31 UTC (rev 50651)
+++ trunk/blender/source/blender/blenlib/BLI_dynstr.h	2012-09-16 10:39:19 UTC (rev 50652)
@@ -80,7 +80,11 @@
 __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.

Modified: trunk/blender/source/blender/blenlib/BLI_string.h
===================================================================
--- trunk/blender/source/blender/blenlib/BLI_string.h	2012-09-16 08:25:31 UTC (rev 50651)
+++ trunk/blender/source/blender/blenlib/BLI_string.h	2012-09-16 10:39:19 UTC (rev 50652)
@@ -144,7 +144,11 @@
 /*
  * 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

Modified: trunk/blender/source/blender/blenloader/intern/readfile.c
===================================================================
--- trunk/blender/source/blender/blenloader/intern/readfile.c	2012-09-16 08:25:31 UTC (rev 50651)
+++ trunk/blender/source/blender/blenloader/intern/readfile.c	2012-09-16 10:39:19 UTC (rev 50652)
@@ -248,7 +248,13 @@
  * 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 */
 	

Modified: trunk/blender/source/blender/editors/interface/interface_regions.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_regions.c	2012-09-16 08:25:31 UTC (rev 50651)
+++ trunk/blender/source/blender/editors/interface/interface_regions.c	2012-09-16 10:39:19 UTC (rev 50652)
@@ -2576,6 +2576,11 @@
 }
 
 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;
 	char *s, buf[512];




More information about the Bf-blender-cvs mailing list