[Bf-blender-cvs] [560ee80] multiview: 169 Style-Cleanup (thanks Campbell Barton)

Dalai Felinto noreply at git.blender.org
Thu Sep 18 11:55:18 CEST 2014


Commit: 560ee8028612afa4f20fe6a6b753f930453d7678
Author: Dalai Felinto
Date:   Thu Sep 18 11:34:04 2014 +0200
Branches: multiview
https://developer.blender.org/rB560ee8028612afa4f20fe6a6b753f930453d7678

169 Style-Cleanup (thanks Campbell Barton)

===================================================================

M	source/blender/blenkernel/intern/camera.c
M	source/blender/blenkernel/intern/image.c
M	source/blender/blenkernel/intern/scene.c
M	source/blender/blenlib/intern/path_util.c
M	source/blender/blenloader/intern/versioning_270.c
M	source/blender/compositor/nodes/COM_ImageNode.cpp
M	source/blender/compositor/nodes/COM_OutputFileNode.cpp
M	source/blender/compositor/operations/COM_OutputFileMultiViewOperation.cpp
M	source/blender/editors/render/render_opengl.c
M	source/blender/editors/space_image/image_buttons.c
M	source/blender/editors/space_image/image_ops.c
M	source/blender/editors/space_node/drawnode.c
M	source/blender/imbuf/intern/openexr/openexr_api.cpp
M	source/blender/imbuf/intern/openexr/openexr_multi.h
M	source/blender/imbuf/intern/stereoimbuf.c
M	source/blender/makesrna/intern/rna_scene.c
M	source/blender/nodes/composite/nodes/node_composite_switchview.c
M	source/blender/windowmanager/intern/wm_draw.c
M	source/blender/windowmanager/intern/wm_stereo.c

===================================================================

diff --git a/source/blender/blenkernel/intern/camera.c b/source/blender/blenkernel/intern/camera.c
index 1f55eed..777c2c6 100644
--- a/source/blender/blenkernel/intern/camera.c
+++ b/source/blender/blenkernel/intern/camera.c
@@ -697,10 +697,10 @@ void BKE_camera_stereo_matrices(Object *camera, float r_viewmat[4][4], float *r_
 			angle = -angle;
 		}
 
-		transmat[0][0] = cosf(angle * 2.0f * fac);
-		transmat[2][0] =-sinf(angle * 2.0f * fac);
-		transmat[0][2] = sinf(angle * 2.0f * fac);
-		transmat[2][2] = cosf(angle * 2.0f * fac);
+		transmat[0][0] =  cosf(angle * 2.0f * fac);
+		transmat[2][0] = -sinf(angle * 2.0f * fac);
+		transmat[0][2] =  sinf(angle * 2.0f * fac);
+		transmat[2][2] =  cosf(angle * 2.0f * fac);
 	}
 
 	/* translation */
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index fdbd433..55190d0 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -411,7 +411,7 @@ static void copy_image_packedfiles(ListBase *lbn, ListBase *lbo)
 	ImagePackedFile *imapf, *imapfn;
 	lbn->first = lbn->last = NULL;
 	imapf = lbo->first;
-	while(imapf) {
+	while (imapf) {
 		imapfn = MEM_mallocN(sizeof(ImagePackedFile), "Image Packed Files (copy)");
 		BLI_strncpy(imapfn->filepath, imapf->filepath, sizeof(imapfn->filepath));
 
@@ -428,7 +428,7 @@ static void copy_image_views(ListBase *lbn, ListBase *lbo)
 	ImageView *iv, *ivn;
 	lbn->first = lbn->last = NULL;
 	iv = lbo->first;
-	while(iv) {
+	while (iv) {
 		ivn = MEM_dupallocN(iv);
 		BLI_addtail(lbn, ivn);
 		iv = iv->next;
@@ -440,7 +440,7 @@ static void copy_image_anims(ListBase *lbn, ListBase *lbo)
 	ImageAnim *ia, *ian;
 	lbn->first = lbn->last = NULL;
 	ia = lbo->first;
-	while(ia) {
+	while (ia) {
 		ian = MEM_dupallocN(ia);
 		ian->anim = NULL;
 		BLI_addtail(lbn, ian);
@@ -774,7 +774,7 @@ Image *BKE_image_load_exists(const char *filepath)
 
 			if (BLI_path_cmp(strtest, str) == 0) {
 				if ((BKE_image_has_anim(ima) == false) ||
-					(ima->id.us == 0))
+				    (ima->id.us == 0))
 				{
 					BLI_strncpy(ima->name, filepath, sizeof(ima->name));    /* for stringcode */
 					ima->id.us++;                                       /* officially should not, it doesn't link here! */
@@ -2982,7 +2982,7 @@ static size_t image_num_files(Image *ima)
 	if (!is_multiview) {
 		return 1;
 	}
-	else if(ima->views_format == R_IMF_VIEWS_STEREO_3D){
+	else if (ima->views_format == R_IMF_VIEWS_STEREO_3D) {
 		return 1;
 	}
 	/* R_IMF_VIEWS_INDIVIDUAL */
@@ -3171,7 +3171,7 @@ static ImBuf *image_load_movie_file(Image *ima, ImageUser *iuser, int frame)
 	ibuf = MEM_mallocN(sizeof(ImBuf *) * totviews, "Image Views (movie) Imbufs");
 
 	if ((BKE_image_has_anim(ima) == false) ||
-		BLI_countlist(&ima->anims) != totfiles)
+	    BLI_countlist(&ima->anims) != totfiles)
 	{
 		image_free_anims(ima);
 
@@ -3504,8 +3504,10 @@ static ImBuf *image_get_render_result(Image *ima, ImageUser *iuser, void **lock_
 
 			for (rpass = rl->passes.first; rpass; rpass = rpass->next) {
 				if (passtype == rpass->passtype &&
-					actview == rpass->view_id)
+				    actview == rpass->view_id)
+				{
 					break;
+				}
 			}
 
 			if (rpass) {
@@ -3608,7 +3610,7 @@ static size_t image_get_multiview_index(Image *ima, ImageUser *iuser)
 	if (is_multilayer) {
 		return iuser ? iuser->multi_index : IMA_NO_INDEX;
 	}
-	else if (is_backdrop){
+	else if (is_backdrop) {
 		if ((ima->flag & IMA_IS_STEREO)) {
 			/* backdrop hackaround (since there is no iuser */
 			return ima->eye;
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index 6d2d437..ddcdc2e 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -1887,8 +1887,7 @@ bool BKE_scene_remove_render_view(Scene *scene, SceneRenderView *srv)
 	if (act == -1) {
 		return false;
 	}
-	else if (scene->r.views.first == scene->r.views.last)
-	{
+	else if (scene->r.views.first == scene->r.views.last) {
 		/* ensure 1 view is kept */
 		return false;
 	}
diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c
index 2d2b704..d73dd5f 100644
--- a/source/blender/blenlib/intern/path_util.c
+++ b/source/blender/blenlib/intern/path_util.c
@@ -874,8 +874,8 @@ static void ensure_view(char *path)
 		/* found a period */
 		if (period && period > file) {
 			char *p = file;
-			for (p=file+len+1; p > period; p--) {
-				*p = *(p-1);
+			for (p = file + len + 1; p > period; p--) {
+				*p = *(p - 1);
 			}
 			*p = '%';
 		}
@@ -919,7 +919,7 @@ bool BLI_path_view(char *path, const char *view)
 		char tmp[FILE_MAX];
 		const int len = BLI_snprintf(tmp, sizeof(tmp) - 1, "%.*s%s%s", ch_sta, path, view, path + ch_end);
 
-		BLI_strncpy(path, tmp, len+1);
+		BLI_strncpy(path, tmp, len + 1);
 		strip_view_char((char *) BLI_last_slash(path));
 
 		return true;
diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c
index 75ad387..9845ee6 100644
--- a/source/blender/blenloader/intern/versioning_270.c
+++ b/source/blender/blenloader/intern/versioning_270.c
@@ -402,11 +402,11 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
 				for (sa = screen->areabase.first; sa; sa = sa->next) {
 					SpaceLink *sl;
 
-					for (sl = sa->spacedata.first; sl; sl= sl->next) {
+					for (sl = sa->spacedata.first; sl; sl = sl->next) {
 						switch (sl->spacetype) {
 							case SPACE_VIEW3D:
 							{
-								View3D *v3d = (View3D*) sl;
+								View3D *v3d = (View3D *)sl;
 								v3d->stereo_camera = STEREO_3D_ID;
 								break;
 							}
diff --git a/source/blender/compositor/nodes/COM_ImageNode.cpp b/source/blender/compositor/nodes/COM_ImageNode.cpp
index 9ae8b9b..558d737 100644
--- a/source/blender/compositor/nodes/COM_ImageNode.cpp
+++ b/source/blender/compositor/nodes/COM_ImageNode.cpp
@@ -95,7 +95,7 @@ void ImageNode::convertToOperations(NodeConverter &converter, const CompositorCo
 					NodeOperation *operation = NULL;
 					socket = this->getOutputSocket(index);
 					bNodeSocket *bnodeSocket = socket->getbNodeSocket();
-					RenderPass *rpass = (RenderPass*) BLI_findstring(&rl->passes, bnodeSocket->identifier, offsetof(RenderPass, internal_name));
+					RenderPass *rpass = (RenderPass *)BLI_findstring(&rl->passes, bnodeSocket->identifier, offsetof(RenderPass, internal_name));
 
 					int view = (rpass ? rpass->view_id : 0);
 
diff --git a/source/blender/compositor/nodes/COM_OutputFileNode.cpp b/source/blender/compositor/nodes/COM_OutputFileNode.cpp
index a6a4688..eb574b0 100644
--- a/source/blender/compositor/nodes/COM_OutputFileNode.cpp
+++ b/source/blender/compositor/nodes/COM_OutputFileNode.cpp
@@ -55,7 +55,8 @@ void OutputFileNode::convertToOperations(NodeConverter &converter, const Composi
 		if (is_multiview && storage->format.views_format == R_IMF_VIEWS_MULTIVIEW) {
 			outputOperation = new OutputOpenExrMultiLayerMultiViewOperation(
 			        context.getRenderData(), context.getbNodeTree(), storage->base_path, storage->format.exr_codec, context.getViewName());
-		} else {
+		}
+		else {
 			outputOperation = new OutputOpenExrMultiLayerOperation(
 		          context.getRenderData(), context.getbNodeTree(), storage->base_path, storage->format.exr_codec, context.getViewName());
 		}
diff --git a/source/blender/compositor/operations/COM_OutputFileMultiViewOperation.cpp b/source/blender/compositor/operations/COM_OutputFileMultiViewOperation.cpp
index c9e802b..16a180e 100644
--- a/source/blender/compositor/operations/COM_OutputFileMultiViewOperation.cpp
+++ b/source/blender/compositor/operations/COM_OutputFileMultiViewOperation.cpp
@@ -38,9 +38,9 @@
 #include "MEM_guardedalloc.h"
 
 extern "C" {
-	#include "IMB_imbuf.h"
-	#include "IMB_colormanagement.h"
-	#include "IMB_imbuf_types.h"
+#include "IMB_imbuf.h"
+#include "IMB_colormanagement.h"
+#include "IMB_imbuf_types.h"
 }
 
 /************************************  OpenEXR Singlelayer Multiview *****************************************/
@@ -53,7 +53,7 @@ OutputOpenExrSingleLayerMultiViewOperation::OutputOpenExrSingleLayerMultiViewOpe
 {
 }
 
-void *OutputOpenExrSingleLayerMultiViewOperation::get_handle(const char* filename)
+void *OutputOpenExrSingleLayerMultiViewOperation::get_handle(const char *filename)
 {
 	size_t width = this->getWidth();
 	size_t height = this->getHeight();
@@ -81,8 +81,7 @@ void *OutputOpenExrSingleLayerMultiViewOperation::get_handle(const char* filenam
 
 		/* prepare the file with all the channels */
 
-		if (IMB_exr_begin_write(exrhandle, filename, width, height, this->m_format->exr_codec) == 0)
-		{
+		if (IMB_exr_begin_write(exrhandle, filename, width, height, this->m_format->exr_codec) == 0) {
 			printf("Error Writing Singlelayer Multiview Openexr\n");
 			IMB_exr_close(exrhandle);
 		}
@@ -135,7 +134,7 @@ OutputOpenExrMultiLayerMultiViewOperation::OutputOpenExrMultiLayerMultiViewOpera
 {
 }
 
-void *OutputOpenExrMultiLayerMultiViewOperation::get_handle(const char* filename)
+void *OutputOpenExrMultiLayerMultiViewOperation::get_handle(const char *filename)
 {
 	unsigned int width = this->getWidth();
 	unsigned int height = this->getHeight();
@@ -231,7 +230,7 @@ OutputStereoOperation::OutputStereoOperation(
 	this->m_channels = get_datatype_size(datatype);
 }
 
-void *OutputStereoOperation::get_handle(const char* filename)
+void *OutputStereoOperation::get_handle(const char *filename)
 {
 	size_t width = this->getWidth();
 	size_t height = this->getHeight();
@@ -284,7 +283,7 @@ void OutputStereoOperation::deinitExecution()
 			/* get rectf from EXR */
 			for (i = 0; i < 2; i++) {
 				float *rectf = IMB_exr_channel_rect(exrhandle, NULL, this->m_name, names[i]);
-				ibuf[i]= IMB_allocImBuf(width, height, this->m_format->planes, 0);
+				ibuf[i] = IMB_allocImBuf(width, height, this->m_format->planes, 0);
 
 				ibuf[i]->channels = this->m_channels;
 				ibuf[i]->rect_float = rectf;
diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c
index 595c27f..682f1ef 100644
--- a/source/blender/editors/render/render_opengl.c
+++ b/source/blender/editors/render/render_openg

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list