From 03b2371387dcae9f801cabbc1819b1d7e3350829 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 14 Aug 2019 23:29:46 +1000 Subject: Cleanup: move trailing comments to avoid wrapping code Some statements were split across multiple lines because of their trailing comments. In most cases it's clearer to put the comments above. --- source/blender/blenkernel/intern/pointcache.c | 31 +++++++++++---------------- 1 file changed, 12 insertions(+), 19 deletions(-) (limited to 'source/blender/blenkernel/intern/pointcache.c') diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index 2d42406520d..13d0f1adb84 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -2073,10 +2073,9 @@ static int ptcache_path(PTCacheID *pid, char *filename) file[i - 6] = '\0'; } - BLI_snprintf(filename, - MAX_PTCACHE_PATH, - "//" PTCACHE_PATH "%s", - file); /* add blend file name to pointcache dir */ + /* Add blend file name to pointcache dir. */ + BLI_snprintf(filename, MAX_PTCACHE_PATH, "//" PTCACHE_PATH "%s", file); + BLI_path_abs(filename, blendfilename); return BLI_add_slash(filename); /* new strlen() */ } @@ -2130,24 +2129,17 @@ static int ptcache_filename(PTCacheID *pid, char *filename, int cfra, short do_p if (pid->cache->flag & PTCACHE_EXTERNAL) { if (pid->cache->index >= 0) { - BLI_snprintf(newname, - MAX_PTCACHE_FILE, - "_%06d_%02u%s", - cfra, - pid->stack_index, - ext); /* always 6 chars */ + /* Always 6 chars. */ + BLI_snprintf(newname, MAX_PTCACHE_FILE, "_%06d_%02u%s", cfra, pid->stack_index, ext); } else { - BLI_snprintf(newname, MAX_PTCACHE_FILE, "_%06d%s", cfra, ext); /* always 6 chars */ + /* Always 6 chars. */ + BLI_snprintf(newname, MAX_PTCACHE_FILE, "_%06d%s", cfra, ext); } } else { - BLI_snprintf(newname, - MAX_PTCACHE_FILE, - "_%06d_%02u%s", - cfra, - pid->stack_index, - ext); /* always 6 chars */ + /* Always 6 chars. */ + BLI_snprintf(newname, MAX_PTCACHE_FILE, "_%06d_%02u%s", cfra, pid->stack_index, ext); } len += 16; } @@ -2178,8 +2170,9 @@ static PTCacheFile *ptcache_file_open(PTCacheID *pid, int mode, int cfra) fp = BLI_fopen(filename, "rb"); } else if (mode == PTCACHE_FILE_WRITE) { - BLI_make_existing_file( - filename); /* will create the dir if needs be, same as //textures is created */ + /* Will create the dir if needs be, same as "//textures" is created. */ + BLI_make_existing_file(filename); + fp = BLI_fopen(filename, "wb"); } else if (mode == PTCACHE_FILE_UPDATE) { -- cgit v1.2.3