Cleanup: comments/style

This commit is contained in:
Campbell Barton 2015-11-06 05:09:14 +11:00
parent 1adc196723
commit 7a09d15ade
11 changed files with 15 additions and 17 deletions

@ -2229,7 +2229,7 @@ static void softbody_calc_forcesEx(Scene *scene, Object *ob, float forcetime, fl
/* bproot= sb->bpoint; */ /* need this for proper spring addressing */ /* UNUSED */ /* bproot= sb->bpoint; */ /* need this for proper spring addressing */ /* UNUSED */
if (do_springcollision || do_aero) if (do_springcollision || do_aero)
sb_sfesf_threads_run(scene, ob, timenow, sb->totspring, NULL); sb_sfesf_threads_run(scene, ob, timenow, sb->totspring, NULL);
/* after spring scan because it uses Effoctors too */ /* after spring scan because it uses Effoctors too */
do_effector= pdInitEffectors(scene, ob, NULL, sb->effector_weights, true); do_effector= pdInitEffectors(scene, ob, NULL, sb->effector_weights, true);

@ -330,7 +330,7 @@ float BLI_easing_quint_ease_out(float time, float begin, float change, float dur
float BLI_easing_quint_ease_in_out(float time, float begin, float change, float duration) float BLI_easing_quint_ease_in_out(float time, float begin, float change, float duration)
{ {
if ((time /= duration / 2) < 1.0f) if ((time /= duration / 2) < 1.0f)
return change / 2 * time * time * time * time * time + begin; return change / 2 * time * time * time * time * time + begin;
time -= 2.0f; time -= 2.0f;
return change / 2 * (time * time * time * time * time + 2) + begin; return change / 2 * (time * time * time * time * time + 2) + begin;
} }

@ -140,10 +140,10 @@ static bool task_scheduler_thread_wait_pop(TaskScheduler *scheduler, Task **task
/* Assuming we can only have a void queue in 'exit' case here seems logical (we should only be here after /* Assuming we can only have a void queue in 'exit' case here seems logical (we should only be here after
* our worker thread has been woken up from a condition_wait(), which only happens after a new task was * our worker thread has been woken up from a condition_wait(), which only happens after a new task was
* added to the queue), but it is wrong. * added to the queue), but it is wrong.
* Waiting on condition may wake up the thread even if condition is not signaled (spurious wakeups), and some * Waiting on condition may wake up the thread even if condition is not signaled (spurious wake-ups), and some
* race condition may also empty the queue **after** condition has been signaled, but **before** awoken thread * race condition may also empty the queue **after** condition has been signaled, but **before** awoken thread
* reaches this point... * reaches this point...
* See http://stackoverflow.com/questions/8594591/why-does-pthread-cond-wait-have-spurious-wakeups * See http://stackoverflow.com/questions/8594591
* *
* So we only abort here if do_exit is set. * So we only abort here if do_exit is set.
*/ */
@ -399,7 +399,7 @@ TaskPool *BLI_task_pool_create(TaskScheduler *scheduler, void *userdata)
* \a BLI_task_pool_work_and_wait() on it to be sure it will be processed). * \a BLI_task_pool_work_and_wait() on it to be sure it will be processed).
* *
* \note Background pools are non-recursive (that is, you should not create other background pools in tasks assigned * \note Background pools are non-recursive (that is, you should not create other background pools in tasks assigned
* to a brackground pool, they could end never being executed, since the 'fallback' background thread is already * to a background pool, they could end never being executed, since the 'fallback' background thread is already
* busy with parent task in single-threaded context). * busy with parent task in single-threaded context).
*/ */
TaskPool *BLI_task_pool_create_background(TaskScheduler *scheduler, void *userdata) TaskPool *BLI_task_pool_create_background(TaskScheduler *scheduler, void *userdata)

@ -921,7 +921,6 @@ void BM_face_triangulate(
/* loop over calculated triangles and create new geometry */ /* loop over calculated triangles and create new geometry */
for (i = 0; i < totfilltri; i++) { for (i = 0; i < totfilltri; i++) {
/* the order is reverse, otherwise the normal is flipped */
BMLoop *l_tri[3] = { BMLoop *l_tri[3] = {
loops[tris[i][0]], loops[tris[i][0]],
loops[tris[i][1]], loops[tris[i][1]],

@ -1307,7 +1307,7 @@ void file_sfile_filepath_set(SpaceFile *sfile, const char *filepath)
BLI_split_dirfile(filepath, sfile->params->dir, sfile->params->file, BLI_split_dirfile(filepath, sfile->params->dir, sfile->params->file,
sizeof(sfile->params->dir), sizeof(sfile->params->file)); sizeof(sfile->params->dir), sizeof(sfile->params->file));
} }
else{ else {
BLI_split_dir_part(filepath, sfile->params->dir, sizeof(sfile->params->dir)); BLI_split_dir_part(filepath, sfile->params->dir, sizeof(sfile->params->dir));
} }
} }

@ -394,7 +394,7 @@ static int compare_direntry_generic(const FileListInternEntry *entry1, const Fil
} }
} }
else if (entry2->typeflag & FILE_TYPE_DIR) { else if (entry2->typeflag & FILE_TYPE_DIR) {
return 1; return 1;
} }
/* make sure "." and ".." are always first */ /* make sure "." and ".." are always first */
@ -1069,7 +1069,7 @@ static void filelist_cache_preview_runf(TaskPool *pool, void *taskdata, int UNUS
// printf("%s: %d - %s - %p\n", __func__, preview->index, preview->path, preview->img); // printf("%s: %d - %s - %p\n", __func__, preview->index, preview->path, preview->img);
BLI_assert(preview->flags & (FILE_TYPE_IMAGE | FILE_TYPE_MOVIE | FILE_TYPE_FTFONT | BLI_assert(preview->flags & (FILE_TYPE_IMAGE | FILE_TYPE_MOVIE | FILE_TYPE_FTFONT |
FILE_TYPE_BLENDER | FILE_TYPE_BLENDER_BACKUP | FILE_TYPE_BLENDERLIB)); FILE_TYPE_BLENDER | FILE_TYPE_BLENDER_BACKUP | FILE_TYPE_BLENDERLIB));
if (preview->flags & FILE_TYPE_IMAGE) { if (preview->flags & FILE_TYPE_IMAGE) {
source = THB_SOURCE_IMAGE; source = THB_SOURCE_IMAGE;

@ -622,7 +622,7 @@ static void draw_image_buffer_tiled(SpaceImage *sima, ARegion *ar, Scene *scene,
} }
else { else {
glaDrawPixelsSafe(x, y, dx, dy, dx, GL_LUMINANCE, GL_UNSIGNED_INT, glaDrawPixelsSafe(x, y, dx, dy, dx, GL_LUMINANCE, GL_UNSIGNED_INT,
(unsigned char*)rect + channel_offset); (unsigned char *)rect + channel_offset);
} }
} }
} }

@ -800,7 +800,7 @@ static Base *outline_delete_hierarchy(bContext *C, Scene *scene, Base *base)
Object *parent; Object *parent;
if (!base) { if (!base) {
return NULL; return NULL;
} }
for (child_base = scene->base.first; child_base; child_base = base_next) { for (child_base = scene->base.first; child_base; child_base = base_next) {

@ -3858,8 +3858,7 @@ static int sequencer_export_subtitles_invoke(bContext *C, wmOperator *op, const
static int sequencer_export_subtitles_exec(bContext *C, wmOperator *op) static int sequencer_export_subtitles_exec(bContext *C, wmOperator *op)
{ {
Scene *scene = CTX_data_scene(C); Scene *scene = CTX_data_scene(C);
Sequence *seq = BKE_sequencer_active_get(scene); Sequence *seq, *seq_next;
Sequence *seq_next;
Editing *ed = BKE_sequencer_editing_get(scene, false); Editing *ed = BKE_sequencer_editing_get(scene, false);
ListBase text_seq = {0}; ListBase text_seq = {0};
int iter = 0; int iter = 0;

@ -5574,7 +5574,7 @@ static void slide_origdata_interp_data_vert(
float (*faces_center)[3] = BLI_array_alloca(faces_center, l_num); float (*faces_center)[3] = BLI_array_alloca(faces_center, l_num);
BMLoop *l; BMLoop *l;
BM_ITER_ELEM_INDEX (l, &liter, sv->v, BM_LOOPS_OF_VERT, j) {; BM_ITER_ELEM_INDEX (l, &liter, sv->v, BM_LOOPS_OF_VERT, j) {
BM_face_calc_center_mean(l->f, faces_center[j]); BM_face_calc_center_mean(l->f, faces_center[j]);
} }

@ -30,9 +30,9 @@ namespace Freestyle {
string SceneHash::toString() string SceneHash::toString()
{ {
stringstream ss; stringstream ss;
ss << hex << _sum; ss << hex << _sum;
return ss.str(); return ss.str();
} }
void SceneHash::visitNodeSceneRenderLayer(NodeSceneRenderLayer& node) void SceneHash::visitNodeSceneRenderLayer(NodeSceneRenderLayer& node)