[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [45229] trunk/blender/source: style cleanup: for creator.c & more useful assert message (file:line)

Campbell Barton ideasman42 at gmail.com
Wed Mar 28 07:09:54 CEST 2012


Revision: 45229
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=45229
Author:   campbellbarton
Date:     2012-03-28 05:09:50 +0000 (Wed, 28 Mar 2012)
Log Message:
-----------
style cleanup: for creator.c & more useful assert message (file:line)

Modified Paths:
--------------
    trunk/blender/source/blender/blenlib/BLI_utildefines.h
    trunk/blender/source/creator/creator.c

Modified: trunk/blender/source/blender/blenlib/BLI_utildefines.h
===================================================================
--- trunk/blender/source/blender/blenlib/BLI_utildefines.h	2012-03-28 05:03:24 UTC (rev 45228)
+++ trunk/blender/source/blender/blenlib/BLI_utildefines.h	2012-03-28 05:09:50 UTC (rev 45229)
@@ -293,8 +293,8 @@
 	(void)((!(a)) ?  (                                                        \
 		(                                                                     \
 		fprintf(stderr,                                                       \
-			"BLI_assert failed: %s, %s(), %d at \'%s\'\n",                    \
-			__FILE__, __func__, __LINE__, STRINGIFY(a)),                      \
+			"BLI_assert failed: %s:%d, %s(), at \'%s\'\n",                    \
+			__FILE__, __LINE__, __func__, STRINGIFY(a)),                      \
 		_BLI_DUMMY_ABORT(),                                                   \
 		NULL)) : NULL)
 #  else
@@ -302,7 +302,7 @@
 	(void)((!(a)) ?  (                                                        \
 		(                                                                     \
 		fprintf(stderr,                                                       \
-			"BLI_assert failed: %s, %d at \'%s\'\n",                          \
+			"BLI_assert failed: %s:%d, at \'%s\'\n",                          \
 			__FILE__, __LINE__, STRINGIFY(a)),                                \
 		_BLI_DUMMY_ABORT(),                                                   \
 		NULL)) : NULL)

Modified: trunk/blender/source/creator/creator.c
===================================================================
--- trunk/blender/source/creator/creator.c	2012-03-28 05:03:24 UTC (rev 45228)
+++ trunk/blender/source/creator/creator.c	2012-03-28 05:09:50 UTC (rev 45229)
@@ -59,7 +59,7 @@
 
 #include "BLI_args.h"
 #include "BLI_threads.h"
-#include "BLI_scanfill.h" // for BLI_setErrorCallBack, TODO, move elsewhere
+#include "BLI_scanfill.h" /* for BLI_setErrorCallBack, TODO, move elsewhere */
 #include "BLI_utildefines.h"
 #include "BLI_callbacks.h"
 
@@ -72,7 +72,7 @@
 #include "BKE_utildefines.h"
 #include "BKE_blender.h"
 #include "BKE_context.h"
-#include "BKE_depsgraph.h" // for DAG_on_visible_update
+#include "BKE_depsgraph.h" /* for DAG_on_visible_update */
 #include "BKE_font.h"
 #include "BKE_global.h"
 #include "BKE_main.h"
@@ -84,7 +84,7 @@
 #include "BKE_sound.h"
 #include "BKE_image.h"
 
-#include "IMB_imbuf.h"	// for IMB_init
+#include "IMB_imbuf.h"  /* for IMB_init */
 
 #ifdef WITH_PYTHON
 #include "BPY_extern.h"
@@ -130,7 +130,7 @@
 #include "libmv-capi.h"
 #endif
 
-// from buildinfo.c
+/* from buildinfo.c */
 #ifdef BUILD_DATE
 extern char build_date[];
 extern char build_time[];
@@ -172,7 +172,7 @@
 {
 	static int count = 0;
 	
-	G.afbreek = 1;	/* forces render loop to read queue, not sure if its needed */
+	G.afbreek = 1;  /* forces render loop to read queue, not sure if its needed */
 	
 	if (sig == 2) {
 		if (count) {
@@ -187,17 +187,17 @@
 
 static int print_version(int UNUSED(argc), const char **UNUSED(argv), void *UNUSED(data))
 {
-	printf (BLEND_VERSION_STRING_FMT);
+	printf(BLEND_VERSION_STRING_FMT);
 #ifdef BUILD_DATE
-	printf ("\tbuild date: %s\n", build_date);
-	printf ("\tbuild time: %s\n", build_time);
-	printf ("\tbuild revision: %s\n", build_rev);
-	printf ("\tbuild platform: %s\n", build_platform);
-	printf ("\tbuild type: %s\n", build_type);
-	printf ("\tbuild c flags: %s\n", build_cflags);
-	printf ("\tbuild c++ flags: %s\n", build_cxxflags);
-	printf ("\tbuild link flags: %s\n", build_linkflags);
-	printf ("\tbuild system: %s\n", build_system);
+	printf("\tbuild date: %s\n", build_date);
+	printf("\tbuild time: %s\n", build_time);
+	printf("\tbuild revision: %s\n", build_rev);
+	printf("\tbuild platform: %s\n", build_platform);
+	printf("\tbuild type: %s\n", build_type);
+	printf("\tbuild c flags: %s\n", build_cflags);
+	printf("\tbuild c++ flags: %s\n", build_cxxflags);
+	printf("\tbuild link flags: %s\n", build_linkflags);
+	printf("\tbuild system: %s\n", build_system);
 #endif
 	exit(0);
 
@@ -206,12 +206,12 @@
 
 static int print_help(int UNUSED(argc), const char **UNUSED(argv), void *data)
 {
-	bArgs *ba = (bArgs*)data;
+	bArgs *ba = (bArgs *)data;
 
-	printf (BLEND_VERSION_STRING_FMT);
-	printf ("Usage: blender [args ...] [file] [args ...]\n\n");
+	printf(BLEND_VERSION_STRING_FMT);
+	printf("Usage: blender [args ...] [file] [args ...]\n\n");
 
-	printf ("Render Options:\n");
+	printf("Render Options:\n");
 	BLI_argsPrintArgDoc(ba, "--background");
 	BLI_argsPrintArgDoc(ba, "--render-anim");
 	BLI_argsPrintArgDoc(ba, "--scene");
@@ -223,28 +223,28 @@
 	BLI_argsPrintArgDoc(ba, "--engine");
 	
 	printf("\n");
-	printf ("Format Options:\n");
+	printf("Format Options:\n");
 	BLI_argsPrintArgDoc(ba, "--render-format");
 	BLI_argsPrintArgDoc(ba, "--use-extension");
 	BLI_argsPrintArgDoc(ba, "--threads");
 
 	printf("\n");
-	printf ("Animation Playback Options:\n");
+	printf("Animation Playback Options:\n");
 	BLI_argsPrintArgDoc(ba, "-a");
 				
 	printf("\n");
-	printf ("Window Options:\n");
+	printf("Window Options:\n");
 	BLI_argsPrintArgDoc(ba, "--window-border");
 	BLI_argsPrintArgDoc(ba, "--window-borderless");
 	BLI_argsPrintArgDoc(ba, "--window-geometry");
 	BLI_argsPrintArgDoc(ba, "--start-console");
 
 	printf("\n");
-	printf ("Game Engine Specific Options:\n");
+	printf("Game Engine Specific Options:\n");
 	BLI_argsPrintArgDoc(ba, "-g");
 
 	printf("\n");
-	printf ("Misc Options:\n");
+	printf("Misc Options:\n");
 	BLI_argsPrintArgDoc(ba, "--debug");
 	BLI_argsPrintArgDoc(ba, "--debug-fpe");
 	printf("\n");
@@ -284,40 +284,40 @@
 
 	BLI_argsPrintArgDoc(ba, "--");
 
-	printf ("Other Options:\n");
+	printf("Other Options:\n");
 	BLI_argsPrintOtherDoc(ba);
 
-	printf ("Argument Parsing:\n");
-	printf ("\targuments must be separated by white space. eg\n");
-	printf ("\t\t\"blender -ba test.blend\"\n");
-	printf ("\t...will ignore the 'a'\n");
-	printf ("\t\t\"blender -b test.blend -f8\"\n");
-	printf ("\t...will ignore 8 because there is no space between the -f and the frame value\n\n");
+	printf("Argument Parsing:\n");
+	printf("\targuments must be separated by white space. eg\n");
+	printf("\t\t\"blender -ba test.blend\"\n");
+	printf("\t...will ignore the 'a'\n");
+	printf("\t\t\"blender -b test.blend -f8\"\n");
+	printf("\t...will ignore 8 because there is no space between the -f and the frame value\n\n");
 
-	printf ("Argument Order:\n");
-	printf ("Arguments are executed in the order they are given. eg\n");
-	printf ("\t\t\"blender --background test.blend --render-frame 1 --render-output /tmp\"\n");
-	printf ("\t...will not render to /tmp because '--render-frame 1' renders before the output path is set\n");
-	printf ("\t\t\"blender --background --render-output /tmp test.blend --render-frame 1\"\n");
-	printf ("\t...will not render to /tmp because loading the blend file overwrites the render output that was set\n");
-	printf ("\t\t\"blender --background test.blend --render-output /tmp --render-frame 1\" works as expected.\n\n");
+	printf("Argument Order:\n");
+	printf("Arguments are executed in the order they are given. eg\n");
+	printf("\t\t\"blender --background test.blend --render-frame 1 --render-output /tmp\"\n");
+	printf("\t...will not render to /tmp because '--render-frame 1' renders before the output path is set\n");
+	printf("\t\t\"blender --background --render-output /tmp test.blend --render-frame 1\"\n");
+	printf("\t...will not render to /tmp because loading the blend file overwrites the render output that was set\n");
+	printf("\t\t\"blender --background test.blend --render-output /tmp --render-frame 1\" works as expected.\n\n");
 
-	printf ("\nEnvironment Variables:\n");
-	printf ("  $BLENDER_USER_CONFIG      Directory for user configuration files.\n");
-	printf ("  $BLENDER_USER_SCRIPTS     Directory for user scripts.\n");
-	printf ("  $BLENDER_SYSTEM_SCRIPTS   Directory for system wide scripts.\n");
-	printf ("  $Directory for user data files (icons, translations, ..).\n");
-	printf ("  $BLENDER_SYSTEM_DATAFILES Directory for system wide data files.\n");
-	printf ("  $BLENDER_SYSTEM_PYTHON    Directory for system python libraries.\n");
+	printf("\nEnvironment Variables:\n");
+	printf("  $BLENDER_USER_CONFIG      Directory for user configuration files.\n");
+	printf("  $BLENDER_USER_SCRIPTS     Directory for user scripts.\n");
+	printf("  $BLENDER_SYSTEM_SCRIPTS   Directory for system wide scripts.\n");
+	printf("  $Directory for user data files (icons, translations, ..).\n");
+	printf("  $BLENDER_SYSTEM_DATAFILES Directory for system wide data files.\n");
+	printf("  $BLENDER_SYSTEM_PYTHON    Directory for system python libraries.\n");
 #ifdef WIN32
-	printf ("  $TEMP                     Store temporary files here.\n");
+	printf("  $TEMP                     Store temporary files here.\n");
 #else
-	printf ("  $TMP or $TMPDIR           Store temporary files here.\n");
+	printf("  $TMP or $TMPDIR           Store temporary files here.\n");
 #endif
 #ifdef WITH_SDL
-	printf ("  $SDL_AUDIODRIVER          LibSDL audio driver - alsa, esd, dma.\n");
+	printf("  $SDL_AUDIODRIVER          LibSDL audio driver - alsa, esd, dma.\n");
 #endif
-	printf ("  $PYTHONHOME               Path to the python directory, eg. /usr/lib/python.\n\n");
+	printf("  $PYTHONHOME               Path to the python directory, eg. /usr/lib/python.\n\n");
 
 	exit(0);
 
@@ -351,7 +351,7 @@
 
 static int debug_mode(int UNUSED(argc), const char **UNUSED(argv), void *data)
 {
-	G.f |= G_DEBUG;		/* std output printf's */
+	G.f |= G_DEBUG;  /* std output printf's */
 	printf(BLEND_VERSION_STRING_FMT);
 	MEM_set_memory_debug();
 
@@ -375,14 +375,14 @@
 	signal(SIGFPE, fpe_handler);
 
 # if defined(__linux__) && defined(__GNUC__)
-	feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW );
-# endif	/* defined(__linux__) && defined(__GNUC__) */
+	feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW);
+# endif /* defined(__linux__) && defined(__GNUC__) */
 # if defined(OSX_SSE_FPE)
 	/* OSX uses SSE for floating point by default, so here 
 	 * use SSE instructions to throw floating point exceptions */
-	_MM_SET_EXCEPTION_MASK(_MM_MASK_MASK &~
-			(_MM_MASK_OVERFLOW|_MM_MASK_INVALID|_MM_MASK_DIV_ZERO));
-# endif	/* OSX_SSE_FPE */
+	_MM_SET_EXCEPTION_MASK(_MM_MASK_MASK & ~
+	                       (_MM_MASK_OVERFLOW | _MM_MASK_INVALID | _MM_MASK_DIV_ZERO));

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list