[Bf-blender-cvs] [39eb0516169] master: Cleanup: indentation

Campbell Barton noreply at git.blender.org
Wed Aug 29 17:25:00 CEST 2018


Commit: 39eb05161690510ecec4c30129a9f8d5532d39c9
Author: Campbell Barton
Date:   Thu Aug 30 01:31:20 2018 +1000
Branches: master
https://developer.blender.org/rB39eb05161690510ecec4c30129a9f8d5532d39c9

Cleanup: indentation

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

M	source/blender/blenkernel/intern/pointcache.c
M	source/blender/blenloader/intern/readfile.c
M	source/blender/compositor/intern/COM_Debug.cpp
M	source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp
M	source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp
M	source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp
M	source/blender/freestyle/intern/python/BPy_FrsMaterial.cpp
M	source/blender/freestyle/intern/python/BPy_StrokeAttribute.cpp
M	source/blender/freestyle/intern/python/Interface0D/BPy_SVertex.cpp
M	source/blender/freestyle/intern/python/Interface0D/CurvePoint/BPy_StrokeVertex.cpp
M	source/blender/freestyle/intern/python/Interface1D/FEdge/BPy_FEdgeSharp.cpp
M	source/blender/freestyle/intern/view_map/FEdgeXDetector.cpp
M	source/blender/freestyle/intern/view_map/ViewMap.h
M	source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp
M	source/blender/render/intern/source/bake_api.c
M	source/blender/render/intern/source/convertblender.c
M	source/blender/render/intern/source/render_result.c
M	source/blender/render/intern/source/render_texture.c
M	source/blender/render/intern/source/shadeoutput.c

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

diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c
index 104f8482635..7311b17134d 100644
--- a/source/blender/blenkernel/intern/pointcache.c
+++ b/source/blender/blenkernel/intern/pointcache.c
@@ -2977,117 +2977,116 @@ void BKE_ptcache_id_clear(PTCacheID *pid, int mode, unsigned int cfra)
 
 	/* clear all files in the temp dir with the prefix of the ID and the ".bphys" suffix */
 	switch (mode) {
-	case PTCACHE_CLEAR_ALL:
-	case PTCACHE_CLEAR_BEFORE:
-	case PTCACHE_CLEAR_AFTER:
-		if (pid->cache->flag & PTCACHE_DISK_CACHE) {
-			ptcache_path(pid, path);
-
-			dir = opendir(path);
-			if (dir==NULL)
-				return;
+		case PTCACHE_CLEAR_ALL:
+		case PTCACHE_CLEAR_BEFORE:
+		case PTCACHE_CLEAR_AFTER:
+			if (pid->cache->flag & PTCACHE_DISK_CACHE) {
+				ptcache_path(pid, path);
+
+				dir = opendir(path);
+				if (dir==NULL)
+					return;
+
+				len = ptcache_filename(pid, filename, cfra, 0, 0); /* no path */
+				/* append underscore terminator to ensure we don't match similar names
+				 * from objects whose names start with the same prefix
+				 */
+				if (len < sizeof(filename) - 2) {
+					BLI_strncpy(filename + len, "_", sizeof(filename) - 2 - len);
+					len += 1;
+				}
 
-			len = ptcache_filename(pid, filename, cfra, 0, 0); /* no path */
-			/* append underscore terminator to ensure we don't match similar names
-			 * from objects whose names start with the same prefix
-			 */
-			if (len < sizeof(filename) - 2) {
-				BLI_strncpy(filename + len, "_", sizeof(filename) - 2 - len);
-				len += 1;
-			}
+				BLI_snprintf(ext, sizeof(ext), "_%02u%s", pid->stack_index, fext);
 
-			BLI_snprintf(ext, sizeof(ext), "_%02u%s", pid->stack_index, fext);
-
-			while ((de = readdir(dir)) != NULL) {
-				if (strstr(de->d_name, ext)) { /* do we have the right extension?*/
-					if (STREQLEN(filename, de->d_name, len)) { /* do we have the right prefix */
-						if (mode == PTCACHE_CLEAR_ALL) {
-							pid->cache->last_exact = MIN2(pid->cache->startframe, 0);
-							BLI_join_dirfile(path_full, sizeof(path_full), path, de->d_name);
-							BLI_delete(path_full, false, false);
-						}
-						else {
-							/* read the number of the file */
-							const int frame = ptcache_frame_from_filename(de->d_name, ext);
-
-							if (frame != -1) {
-								if ((mode == PTCACHE_CLEAR_BEFORE && frame < cfra) ||
-								    (mode == PTCACHE_CLEAR_AFTER && frame > cfra))
-								{
-
-									BLI_join_dirfile(path_full, sizeof(path_full), path, de->d_name);
-									BLI_delete(path_full, false, false);
-									if (pid->cache->cached_frames && frame >=sta && frame <= end)
-										pid->cache->cached_frames[frame-sta] = 0;
+				while ((de = readdir(dir)) != NULL) {
+					if (strstr(de->d_name, ext)) { /* do we have the right extension?*/
+						if (STREQLEN(filename, de->d_name, len)) { /* do we have the right prefix */
+							if (mode == PTCACHE_CLEAR_ALL) {
+								pid->cache->last_exact = MIN2(pid->cache->startframe, 0);
+								BLI_join_dirfile(path_full, sizeof(path_full), path, de->d_name);
+								BLI_delete(path_full, false, false);
+							}
+							else {
+								/* read the number of the file */
+								const int frame = ptcache_frame_from_filename(de->d_name, ext);
+
+								if (frame != -1) {
+									if ((mode == PTCACHE_CLEAR_BEFORE && frame < cfra) ||
+									    (mode == PTCACHE_CLEAR_AFTER && frame > cfra))
+									{
+										BLI_join_dirfile(path_full, sizeof(path_full), path, de->d_name);
+										BLI_delete(path_full, false, false);
+										if (pid->cache->cached_frames && frame >=sta && frame <= end)
+											pid->cache->cached_frames[frame-sta] = 0;
+									}
 								}
 							}
 						}
 					}
 				}
-			}
-			closedir(dir);
-
-			if (mode == PTCACHE_CLEAR_ALL && pid->cache->cached_frames)
-				memset(pid->cache->cached_frames, 0, MEM_allocN_len(pid->cache->cached_frames));
-		}
-		else {
-			PTCacheMem *pm= pid->cache->mem_cache.first;
-			PTCacheMem *link= NULL;
-
-			if (mode == PTCACHE_CLEAR_ALL) {
-				/*we want startframe if the cache starts before zero*/
-				pid->cache->last_exact = MIN2(pid->cache->startframe, 0);
-				for (; pm; pm=pm->next) {
-					ptcache_data_free(pm);
-					ptcache_extra_free(pm);
-				}
-				BLI_freelistN(&pid->cache->mem_cache);
+				closedir(dir);
 
-				if (pid->cache->cached_frames)
+				if (mode == PTCACHE_CLEAR_ALL && pid->cache->cached_frames)
 					memset(pid->cache->cached_frames, 0, MEM_allocN_len(pid->cache->cached_frames));
 			}
 			else {
-				while (pm) {
-					if ((mode == PTCACHE_CLEAR_BEFORE && pm->frame < cfra) ||
-					    (mode == PTCACHE_CLEAR_AFTER && pm->frame > cfra))
-					{
-						link = pm;
-						if (pid->cache->cached_frames && pm->frame >=sta && pm->frame <= end)
-							pid->cache->cached_frames[pm->frame-sta] = 0;
+				PTCacheMem *pm= pid->cache->mem_cache.first;
+				PTCacheMem *link= NULL;
+
+				if (mode == PTCACHE_CLEAR_ALL) {
+					/*we want startframe if the cache starts before zero*/
+					pid->cache->last_exact = MIN2(pid->cache->startframe, 0);
+					for (; pm; pm=pm->next) {
 						ptcache_data_free(pm);
 						ptcache_extra_free(pm);
-						pm = pm->next;
-						BLI_freelinkN(&pid->cache->mem_cache, link);
 					}
-					else
-						pm = pm->next;
+					BLI_freelistN(&pid->cache->mem_cache);
+
+					if (pid->cache->cached_frames)
+						memset(pid->cache->cached_frames, 0, MEM_allocN_len(pid->cache->cached_frames));
+				}
+				else {
+					while (pm) {
+						if ((mode == PTCACHE_CLEAR_BEFORE && pm->frame < cfra) ||
+						    (mode == PTCACHE_CLEAR_AFTER && pm->frame > cfra))
+						{
+							link = pm;
+							if (pid->cache->cached_frames && pm->frame >=sta && pm->frame <= end)
+								pid->cache->cached_frames[pm->frame-sta] = 0;
+							ptcache_data_free(pm);
+							ptcache_extra_free(pm);
+							pm = pm->next;
+							BLI_freelinkN(&pid->cache->mem_cache, link);
+						}
+						else
+							pm = pm->next;
+					}
 				}
 			}
-		}
-		break;
+			break;
 
-	case PTCACHE_CLEAR_FRAME:
-		if (pid->cache->flag & PTCACHE_DISK_CACHE) {
-			if (BKE_ptcache_id_exist(pid, cfra)) {
-				ptcache_filename(pid, filename, cfra, 1, 1); /* no path */
-				BLI_delete(filename, false, false);
+		case PTCACHE_CLEAR_FRAME:
+			if (pid->cache->flag & PTCACHE_DISK_CACHE) {
+				if (BKE_ptcache_id_exist(pid, cfra)) {
+					ptcache_filename(pid, filename, cfra, 1, 1); /* no path */
+					BLI_delete(filename, false, false);
+				}
 			}
-		}
-		else {
-			PTCacheMem *pm = pid->cache->mem_cache.first;
+			else {
+				PTCacheMem *pm = pid->cache->mem_cache.first;
 
-			for (; pm; pm=pm->next) {
-				if (pm->frame == cfra) {
-					ptcache_data_free(pm);
-					ptcache_extra_free(pm);
-					BLI_freelinkN(&pid->cache->mem_cache, pm);
-					break;
+				for (; pm; pm=pm->next) {
+					if (pm->frame == cfra) {
+						ptcache_data_free(pm);
+						ptcache_extra_free(pm);
+						BLI_freelinkN(&pid->cache->mem_cache, pm);
+						break;
+					}
 				}
 			}
-		}
-		if (pid->cache->cached_frames && cfra >= sta && cfra <= end)
-			pid->cache->cached_frames[cfra-sta] = 0;
-		break;
+			if (pid->cache->cached_frames && cfra >= sta && cfra <= end)
+				pid->cache->cached_frames[cfra-sta] = 0;
+			break;
 	}
 
 	BKE_ptcache_update_info(pid);
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index bdfae79a1d0..08a45f367f4 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -7851,32 +7851,32 @@ static void lib_link_linestyle(FileData *fd, Main *main)
 
 			for (m = linestyle->color_modifiers.first; m; m = m->next) {
 				switch (m->type) {
-				case LS_MODIFIER_DISTANCE_FROM_OBJECT:
-					{
-						LineStyleColorModifier_DistanceFromObject *cm = (LineStyleColorModifier_DistanceFromObject *)m;
-						cm->target = newlibadr(fd, linestyle->id.lib, cm->target);
-					}
-					break;
+					case LS_MODIFIER_DISTANCE_FROM_OBJECT:
+						{
+							LineStyleColorModifier_DistanceFromObject *cm = (LineStyleColorModifier_DistanceFromObject *)m;
+							cm->target = newlibadr(fd, linestyle->id.lib, cm->target);
+						}
+						break;
 				}
 			}
 			for (m = linestyle->alpha_modifiers.first; m; m = m->next) {
 				switch (m->type) {
-				case LS_MODIFIER_DISTANCE_FROM_OBJECT:
-					{
-						LineStyleAlphaModifier_DistanceFromObject *am = (LineStyleAlphaModifier_DistanceFromObject *)m;
-						am->target = newlibadr(fd, linestyle->id.lib, am->target);
-					}
-					break;
+					case LS_MODIFIER_DISTANCE_FROM_OBJECT:
+						{
+							LineStyleAlphaModifier_DistanceFromObject *am = (LineStyleAlphaModifier_DistanceFromObject *)m;
+							am->target = newlibadr(fd, linestyle->id.lib, am->target);
+						}
+						break;
 				}
 			}
 			for (m = linestyle->thickness_modifiers.first; m; m = m->next) {
 				switch (m->type) {
-				case LS_MODIFIER_DISTANCE_FROM_OBJECT:
-					{
-						LineStyleThicknessModifier_DistanceFromObject *tm = (LineStyleThicknessModifier_DistanceFromObject *)m;
-						tm->target = newlibadr(fd, linestyle->id.lib, tm->target);
-					}
-					break;
+					case LS_MODIFIER_DISTANCE_FROM_OBJECT:
+						{
+							LineStyleThicknessModifier_DistanceFromObject *tm = (LineStyleThicknessModifier_DistanceFromObject *)m;
+							tm->target = newlibadr(fd, linestyle->id.lib, tm->target);
+						}
+						break;
 				}
 			}
 			for (int a = 0; a < MAX_MTEX; a++) {
@@ -7899,171 +7899,171 @@ static void lib_link_linestyle(FileData *fd, Main *main)
 static void direct_link_linestyle_color_modifier(FileData *fd, LineStyleModifier *modifier)
 {
 	switch (modifier->type) {
-	case LS_MODIFIER_ALONG_STROKE:
-		{
-			LineStyleColorModifier_AlongStroke *m = (LineStyleColorModifier_AlongStroke *)modifier;
-			m->color_ramp = newdataadr(fd, m->color_ramp);
-		}
-		break;
-	case LS_MODIFIER_DISTANCE_FROM_CAMERA:
-		{
-			LineStyleColorModifier_DistanceFromCamera *m = (LineStyleColorModifier_DistanceFromCamera *)modifier;
-			m->color_ramp = newdataadr(fd, m->color_ramp);
-		}
-		break;
-	case LS_MODIFIER_DISTANCE_FROM_OBJECT:
-		{
-			LineStyleColorModifier_DistanceFromObject *m = (LineStyleColorModifier_DistanceFromObject *)modifier;
-	

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list