diff options
72 files changed, 311 insertions, 239 deletions
diff --git a/source/blender/alembic/intern/abc_exporter.cc b/source/blender/alembic/intern/abc_exporter.cc index 56fb5a68402..f19e0257b1b 100644 --- a/source/blender/alembic/intern/abc_exporter.cc +++ b/source/blender/alembic/intern/abc_exporter.cc @@ -241,9 +241,9 @@ Alembic::Abc::TimeSamplingPtr AbcExporter::createTimeSampling(double step) getShutterSamples(step, true, samples); - Alembic::Abc::TimeSamplingType ts( - static_cast<uint32_t>(samples.size()), - 1.0 / m_settings.scene->r.frs_sec); /* TODO(Sybren): shouldn't we use the FPS macro here? */ + /* TODO(Sybren): shouldn't we use the FPS macro here? */ + Alembic::Abc::TimeSamplingType ts(static_cast<uint32_t>(samples.size()), + 1.0 / m_settings.scene->r.frs_sec); return TimeSamplingPtr(new Alembic::Abc::TimeSampling(ts, samples)); } diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c index 7283ade3ae5..6748a5324ac 100644 --- a/source/blender/blenfont/intern/blf_font.c +++ b/source/blender/blenfont/intern/blf_font.c @@ -619,8 +619,8 @@ static void blf_font_draw_buffer_ex( cbuf[0] = (unsigned char)((b_col_char[0] * a) + (cbuf[0] * (1.0f - a))); cbuf[1] = (unsigned char)((b_col_char[1] * a) + (cbuf[1] * (1.0f - a))); cbuf[2] = (unsigned char)((b_col_char[2] * a) + (cbuf[2] * (1.0f - a))); - cbuf[3] = (unsigned char)MIN2((int)cbuf[3] + (int)(a * 255), - 255); /* clamp to 255 */ + /* clamp to 255 */ + cbuf[3] = (unsigned char)MIN2((int)cbuf[3] + (int)(a * 255), 255); } } } diff --git a/source/blender/blenfont/intern/blf_glyph.c b/source/blender/blenfont/intern/blf_glyph.c index 66be94aaa06..c0a53cbf282 100644 --- a/source/blender/blenfont/intern/blf_glyph.c +++ b/source/blender/blenfont/intern/blf_glyph.c @@ -329,10 +329,10 @@ GlyphBLF *blf_glyph_add(FontBLF *font, unsigned int index, unsigned int c) /* Convert result from 1 bit per pixel to 8 bit per pixel */ /* Accum errors for later, fine if not interested beyond "ok vs any error" */ FT_Bitmap_New(&tempbitmap); - err += FT_Bitmap_Convert(font->ft_lib, - &slot->bitmap, - &tempbitmap, - 1); /* Does Blender use Pitch 1 always? It works so far */ + + /* Does Blender use Pitch 1 always? It works so far */ + err += FT_Bitmap_Convert(font->ft_lib, &slot->bitmap, &tempbitmap, 1); + err += FT_Bitmap_Copy(font->ft_lib, &tempbitmap, &slot->bitmap); err += FT_Bitmap_Done(font->ft_lib, &tempbitmap); } diff --git a/source/blender/blenkernel/BKE_material.h b/source/blender/blenkernel/BKE_material.h index b1200c7e608..c7d9a8350b3 100644 --- a/source/blender/blenkernel/BKE_material.h +++ b/source/blender/blenkernel/BKE_material.h @@ -103,8 +103,9 @@ void BKE_material_resize_id(struct Main *bmain, struct ID *id, short totcol, boo void BKE_material_append_id(struct Main *bmain, struct ID *id, struct Material *ma); struct Material *BKE_material_pop_id(struct Main *bmain, struct ID *id, + /* index is an int because of RNA. */ int index, - bool update_data); /* index is an int because of RNA */ + bool update_data); void BKE_material_clear_id(struct Main *bmain, struct ID *id, bool update_data); /* rendering */ diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h index f81fa2999ab..d9acbb3a843 100644 --- a/source/blender/blenkernel/BKE_node.h +++ b/source/blender/blenkernel/BKE_node.h @@ -310,9 +310,8 @@ typedef struct bNodeTreeType { /* callbacks */ void (*free_cache)(struct bNodeTree *ntree); void (*free_node_cache)(struct bNodeTree *ntree, struct bNode *node); - void (*foreach_nodeclass)(struct Scene *scene, - void *calldata, - bNodeClassCallback func); /* iteration over all node classes */ + /* Iteration over all node classes. */ + void (*foreach_nodeclass)(struct Scene *scene, void *calldata, bNodeClassCallback func); /* Check visibility in the node editor */ bool (*poll)(const struct bContext *C, struct bNodeTreeType *ntreetype); /* Select a node tree from the context */ diff --git a/source/blender/blenkernel/BKE_writeavi.h b/source/blender/blenkernel/BKE_writeavi.h index 3212bad75cb..7fc740a4a9b 100644 --- a/source/blender/blenkernel/BKE_writeavi.h +++ b/source/blender/blenkernel/BKE_writeavi.h @@ -53,10 +53,10 @@ typedef struct bMovieHandle { const char *suffix, struct ReportList *reports); void (*end_movie)(void *context_v); - void (*get_movie_path)(char *string, - struct RenderData *rd, - bool preview, - const char *suffix); /* optional */ + + /* Optional function. */ + void (*get_movie_path)(char *string, struct RenderData *rd, bool preview, const char *suffix); + void *(*context_create)(void); void (*context_free)(void *context_v); } bMovieHandle; diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c index 742e3634bf1..ea927ca9333 100644 --- a/source/blender/blenkernel/intern/armature.c +++ b/source/blender/blenkernel/intern/armature.c @@ -2707,8 +2707,9 @@ void BKE_pose_where_is_bone(struct Depsgraph *depsgraph, cob = BKE_constraints_make_evalob(depsgraph, scene, ob, pchan, CONSTRAINT_OBTYPE_BONE); /* Solve PoseChannel's Constraints */ - BKE_constraints_solve( - depsgraph, &pchan->constraints, cob, ctime); /* ctime doesn't alter objects */ + + /* ctime doesn't alter objects. */ + BKE_constraints_solve(depsgraph, &pchan->constraints, cob, ctime); /* cleanup after Constraint Solving * - applies matrix back to pchan, and frees temporary struct used diff --git a/source/blender/blenkernel/intern/collection.c b/source/blender/blenkernel/intern/collection.c index 25f2797915a..2031576190e 100644 --- a/source/blender/blenkernel/intern/collection.c +++ b/source/blender/blenkernel/intern/collection.c @@ -239,8 +239,9 @@ static Collection *collection_duplicate_recursive(Main *bmain, if (!do_hierarchy || collection_old->id.newid == NULL) { BKE_id_copy(bmain, &collection_old->id, (ID **)&collection_new); - id_us_min( - &collection_new->id); /* Copying add one user by default, need to get rid of that one. */ + + /* Copying add one user by default, need to get rid of that one. */ + id_us_min(&collection_new->id); if (do_hierarchy) { ID_NEW_SET(collection_old, collection_new); diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c index efdfa2c19bb..980e8043a42 100644 --- a/source/blender/blenkernel/intern/curve.c +++ b/source/blender/blenkernel/intern/curve.c @@ -2737,8 +2737,10 @@ void BKE_curve_bevelList_make(Object *ob, ListBase *nurbs, bool for_render) /* check if we will calculate tilt data */ do_tilt = CU_DO_TILT(cu, nu); - do_radius = CU_DO_RADIUS( - cu, nu); /* normal display uses the radius, better just to calculate them */ + + /* Normal display uses the radius, better just to calculate them. */ + do_radius = CU_DO_RADIUS(cu, nu); + do_weight = true; /* check we are a single point? also check we are not a surface and that the orderu is sane, diff --git a/source/blender/blenkernel/intern/dynamicpaint.c b/source/blender/blenkernel/intern/dynamicpaint.c index 1fb25375159..04cbdbb6bcd 100644 --- a/source/blender/blenkernel/intern/dynamicpaint.c +++ b/source/blender/blenkernel/intern/dynamicpaint.c @@ -4061,8 +4061,10 @@ static void dynamic_paint_paint_mesh_cell_point_cb_ex( hit_found = HIT_VOLUME; /* Mark hit info */ - madd_v3_v3v3fl( - hitCoord, ray_start, ray_dir, hit.dist); /* Calculate final hit coordinates */ + + /* Calculate final hit coordinates */ + madd_v3_v3v3fl(hitCoord, ray_start, ray_dir, hit.dist); + depth += dist * sample_factor; hitTri = f_index; } @@ -4113,8 +4115,10 @@ static void dynamic_paint_paint_mesh_cell_point_cb_ex( treeData->tree, ray_start, proj_ray, 0.0f, &hit, mesh_tris_spherecast_dp, treeData); if (hit.index != -1) { proxDist = hit.dist; - madd_v3_v3v3fl( - hitCo, ray_start, proj_ray, hit.dist); /* Calculate final hit coordinates */ + + /* Calculate final hit coordinates */ + madd_v3_v3v3fl(hitCo, ray_start, proj_ray, hit.dist); + tri = hit.index; } } diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c index 7cbd5b6b050..ffab82b75af 100644 --- a/source/blender/blenkernel/intern/effect.c +++ b/source/blender/blenkernel/intern/effect.c @@ -1338,8 +1338,9 @@ void BKE_sim_debug_data_clear_category(const char *category) BLI_ghashIterator_init(&iter, _sim_debug_data->gh); while (!BLI_ghashIterator_done(&iter)) { const SimDebugElement *elem = BLI_ghashIterator_getValue(&iter); - BLI_ghashIterator_step( - &iter); /* removing invalidates the current iterator, so step before removing */ + + /* Removing invalidates the current iterator, so step before removing. */ + BLI_ghashIterator_step(&iter); if (elem->category_hash == category_hash) { BLI_ghash_remove(_sim_debug_data->gh, elem, NULL, debug_element_free); diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c index 140d1f0d26c..9580ea763fb 100644 --- a/source/blender/blenkernel/intern/fcurve.c +++ b/source/blender/blenkernel/intern/fcurve.c @@ -506,8 +506,10 @@ static int binarysearch_bezt_index_ex( */ for (loopbreaker = 0; (start <= end) && (loopbreaker < maxloop); loopbreaker++) { /* compute and get midpoint */ - int mid = start + ((end - start) / - 2); /* we calculate the midpoint this way to avoid int overflows... */ + + /* We calculate the midpoint this way to avoid int overflows... */ + int mid = start + ((end - start) / 2); + float midfra = array[mid].vec[1][0]; /* check if exactly equal to midpoint */ diff --git a/source/blender/blenkernel/intern/fmodifier.c b/source/blender/blenkernel/intern/fmodifier.c index 4295a44098c..48c0258bf47 100644 --- a/source/blender/blenkernel/intern/fmodifier.c +++ b/source/blender/blenkernel/intern/fmodifier.c @@ -555,8 +555,10 @@ int BKE_fcm_envelope_find_index(FCM_EnvelopeData array[], */ for (loopbreaker = 0; (start <= end) && (loopbreaker < maxloop); loopbreaker++) { /* compute and get midpoint */ - int mid = start + ((end - start) / - 2); /* we calculate the midpoint this way to avoid int overflows... */ + + /* we calculate the midpoint this way to avoid int overflows... */ + int mid = start + ((end - start) / 2); + float midfra = array[mid].time; /* check if exactly equal to midpoint */ diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c index ed4c6848751..728f4890189 100644 --- a/source/blender/blenkernel/intern/gpencil.c +++ b/source/blender/blenkernel/intern/gpencil.c @@ -642,8 +642,10 @@ void BKE_gpencil_copy_data(bGPdata *gpd_dst, const bGPdata *gpd_src, const int U BLI_listbase_clear(&gpd_dst->layers); for (const bGPDlayer *gpl_src = gpd_src->layers.first; gpl_src; gpl_src = gpl_src->next) { /* make a copy of source layer and its data */ - bGPDlayer *gpl_dst = BKE_gpencil_layer_duplicate( - gpl_src); /* TODO here too could add unused flags... */ + + /* TODO here too could add unused flags... */ + bGPDlayer *gpl_dst = BKE_gpencil_layer_duplicate(gpl_src); + BLI_addtail(&gpd_dst->layers, gpl_dst); } } diff --git a/source/blender/blenkernel/intern/library_override.c b/source/blender/blenkernel/intern/library_override.c index fed90ad8982..e435f07e38d 100644 --- a/source/blender/blenkernel/intern/library_override.c +++ b/source/blender/blenkernel/intern/library_override.c @@ -703,9 +703,9 @@ void BKE_override_library_update(Main *bmain, ID *local) local->tag |= LIB_TAG_OVERRIDE_LIBRARY_REFOK; /* Full rebuild of Depsgraph! */ - DEG_on_visible_update( - bmain, - true); /* XXX Is this actual valid replacement for old DAG_relations_tag_update(bmain) ? */ + + /* XXX Is this actual valid replacement for old DAG_relations_tag_update(bmain) ? */ + DEG_on_visible_update(bmain, true); } /** Update all overrides from given \a bmain. */ diff --git a/source/blender/blenkernel/intern/library_query.c b/source/blender/blenkernel/intern/library_query.c index bf77c1417ea..ca3da0d89c7 100644 --- a/source/blender/blenkernel/intern/library_query.c +++ b/source/blender/blenkernel/intern/library_query.c @@ -1168,10 +1168,8 @@ bool BKE_library_id_can_use_idtype(ID *id_owner, const short id_type_used) case ID_CA: return ELEM(id_type_used, ID_OB); case ID_KE: - return ELEM(id_type_used, - ID_ME, - ID_CU, - ID_LT); /* Warning! key->from, could be more types in future? */ + /* Warning! key->from, could be more types in future? */ + return ELEM(id_type_used, ID_ME, ID_CU, ID_LT); case ID_SCR: return ELEM(id_type_used, ID_SCE); case ID_WO: @@ -1190,7 +1188,8 @@ bool BKE_library_id_can_use_idtype(ID *id_owner, const short id_type_used) case ID_MC: return ELEM(id_type_used, ID_GD, ID_IM); case ID_MSK: - return ELEM(id_type_used, ID_MC); /* WARNING! mask->parent.id, not typed. */ + /* WARNING! mask->parent.id, not typed. */ + return ELEM(id_type_used, ID_MC); case ID_LS: return (ELEM(id_type_used, ID_TE, ID_OB)); case ID_LP: diff --git a/source/blender/blenkernel/intern/main.c b/source/blender/blenkernel/intern/main.c index 170b8d0ab93..8e2c3a11ac0 100644 --- a/source/blender/blenkernel/intern/main.c +++ b/source/blender/blenkernel/intern/main.c @@ -485,16 +485,23 @@ int set_listbasepointers(Main *bmain, ListBase **lb) /* BACKWARDS! also watch order of free-ing! (mesh<->mat), first items freed last. * This is important because freeing data decreases user-counts of other data-blocks, * if this data is its self freed it can crash. */ - lb[INDEX_ID_LI] = &( - bmain->libraries); /* Libraries may be accessed from pretty much any other ID... */ + + /* Libraries may be accessed from pretty much any other ID. */ + lb[INDEX_ID_LI] = &(bmain->libraries); + lb[INDEX_ID_IP] = &(bmain->ipo); - lb[INDEX_ID_AC] = &( - bmain->actions); /* moved here to avoid problems when freeing with animato (aligorith) */ + + /* Moved here to avoid problems when freeing with animato (aligorith). */ + lb[INDEX_ID_AC] = &(bmain->actions); + lb[INDEX_ID_KE] = &(bmain->shapekeys); - lb[INDEX_ID_PAL] = &( - bmain->palettes); /* referenced by gpencil, so needs to be before that to avoid crashes */ - lb[INDEX_ID_GD] = &( - bmain->gpencils); /* referenced by nodes, objects, view, scene etc, before to free after. */ + + /* Referenced by gpencil, so needs to be before that to avoid crashes. */ + lb[INDEX_ID_PAL] = &(bmain->palettes); + + /* Referenced by nodes, objects, view, scene etc, before to free after. */ + lb[INDEX_ID_GD] = &(bmain->gpencils); + lb[INDEX_ID_NT] = &(bmain->nodetrees); lb[INDEX_ID_IM] = &(bmain->images); lb[INDEX_ID_TE] = &(bmain->textures); @@ -502,8 +509,7 @@ int set_listbasepointers(Main *bmain, ListBase **lb) lb[INDEX_ID_VF] = &(bmain->fonts); /* Important!: When adding a new object type, - * the specific data should be inserted here - */ + * the specific data should be inserted here. */ lb[INDEX_ID_AR] = &(bmain->armatures); diff --git a/source/blender/blenkernel/intern/mask.c b/source/blender/blenkernel/intern/mask.c index 8f8150b6a64..b6d61563fe8 100644 --- a/source/blender/blenkernel/intern/mask.c +++ b/source/blender/blenkernel/intern/mask.c @@ -892,8 +892,8 @@ void BKE_mask_copy_data(Main *UNUSED(bmain), { BLI_listbase_clear(&mask_dst->masklayers); - BKE_mask_layer_copy_list(&mask_dst->masklayers, - &mask_src->masklayers); /* TODO add unused flag to those as well. */ + /* TODO add unused flag to those as well. */ + BKE_mask_layer_copy_list(&mask_dst->masklayers, &mask_src->masklayers); /* enable fake user by default */ id_fake_user_set(&mask_dst->id); @@ -1766,10 +1766,10 @@ static void interp_weights_uv_v2_calc(float r_uv[2], { float pt_on_line[2]; r_uv[0] = closest_to_line_v2(pt_on_line, pt, pt_a, pt_b); + r_uv[1] = (len_v2v2(pt_on_line, pt) / len_v2v2(pt_a, pt_b)) * - ((line_point_side_v2(pt_a, pt_b, pt) < 0.0f) ? - -1.0f : - 1.0f); /* this line only sets the sign */ + /* This line only sets the sign. */ + ((line_point_side_v2(pt_a, pt_b, pt) < 0.0f) ? -1.0f : 1.0f); } static void interp_weights_uv_v2_apply(const float uv[2], diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index 0b06bfab2ab..2cc1083aba3 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -448,8 +448,9 @@ static float nlastrip_get_frame_actionclip(NlaStrip *strip, float cframe, short if (IS_EQF(strip->scale, 0.0f)) { strip->scale = 1.0f; } - scale = fabsf( - strip->scale); /* scale must be positive - we've got a special flag for reversing */ + + /* Scale must be positive - we've got a special flag for reversing. */ + scale = fabsf(strip->scale); /* length of referenced action */ actlength = strip->actend - strip->actstart; @@ -1280,9 +1281,9 @@ static void nlastrip_fix_resize_overlaps(NlaStrip *strip) * then offset everything else by the remaining defict to give the strip room */ nls->start = nls->end - 1.0f; - offset = ceilf( - strip->end - - nls->start); /* XXX: review whether preventing fractionals is good here... */ + + /* XXX: review whether preventing fractionals is good here... */ + offset = ceilf(strip->end - nls->start); /* apply necessary offset to ensure that the strip has enough space */ for (; nls; nls = nls->next) { @@ -1329,9 +1330,9 @@ static void nlastrip_fix_resize_overlaps(NlaStrip *strip) * then offset everything else by the remaining defict to give the strip room */ nls->end = nls->start + 1.0f; - offset = ceilf( - nls->end - - strip->start); /* XXX: review whether preventing fractionals is good here... */ + + /* XXX: review whether preventing fractionals is good here... */ + offset = ceilf(nls->end - strip->start); /* apply necessary offset to ensure that the strip has enough space */ for (; nls; nls = nls->next) { diff --git a/source/blender/blenkernel/intern/object_dupli.c b/source/blender/blenkernel/intern/object_dupli.c index 0dedbb7e934..7983fe54be5 100644 --- a/source/blender/blenkernel/intern/object_dupli.c +++ b/source/blender/blenkernel/intern/object_dupli.c @@ -762,8 +762,8 @@ static void make_duplis_particle_system(const DupliContext *ctx, ParticleSystem no_draw_flag |= PARS_NO_DISP; } - ctime = DEG_get_ctime( - ctx->depsgraph); /* NOTE: in old animsys, used parent object's timeoffset... */ + /* NOTE: in old animsys, used parent object's timeoffset... */ + ctime = DEG_get_ctime(ctx->depsgraph); totpart = psys->totpart; totchild = psys->totchild; diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index da00a044009..ffeba0148a2 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -1764,8 +1764,9 @@ void psys_particle_on_dm(Mesh *mesh_final, copy_v3_v3(nor, tmpnor); } - normalize_v3( - tmpnor); /* XXX Why not normalize tmpnor before copying it into nor??? -- mont29 */ + /* XXX Why not normalize tmpnor before copying it into nor??? -- mont29 */ + normalize_v3(tmpnor); + mul_v3_fl(tmpnor, -foffset); add_v3_v3(vec, tmpnor); } 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) { diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c index 2024a507ebb..20736e28a53 100644 --- a/source/blender/blenkernel/intern/softbody.c +++ b/source/blender/blenkernel/intern/softbody.c @@ -1731,8 +1731,8 @@ static int sb_detect_vertex_collisionCached(float opco[3], /* switch origin to be nv2*/ sub_v3_v3v3(edge1, nv1, nv2); sub_v3_v3v3(edge2, nv3, nv2); - sub_v3_v3v3( - dv1, opco, nv2); /* abuse dv1 to have vertex in question at *origin* of triangle */ + /* Abuse dv1 to have vertex in question at *origin* of triangle. */ + sub_v3_v3v3(dv1, opco, nv2); cross_v3_v3v3(d_nvect, edge2, edge1); /* n_mag = */ /* UNUSED */ normalize_v3(d_nvect); @@ -2087,9 +2087,12 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, if (scene->physics_settings.flag & PHYS_GLOBAL_GRAVITY) { float gravity[3]; copy_v3_v3(gravity, scene->physics_settings.gravity); + + /* Individual mass of node here. */ mul_v3_fl(gravity, sb_grav_force_scale(ob) * _final_mass(ob, bp) * - sb->effector_weights->global_gravity); /* individual mass of node here */ + sb->effector_weights->global_gravity); + add_v3_v3(bp->force, gravity); } @@ -2099,8 +2102,10 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, float kd; float force[3] = {0.0f, 0.0f, 0.0f}; float speed[3] = {0.0f, 0.0f, 0.0f}; - float eval_sb_fric_force_scale = sb_fric_force_scale( - ob); /* just for calling function once */ + + /* just for calling function once */ + float eval_sb_fric_force_scale = sb_fric_force_scale(ob); + pd_point_from_soft(scene, bp->pos, bp->vec, sb->bpoint - bp, &epoint); BKE_effectors_apply(effectors, NULL, sb->effector_weights, &epoint, force, speed); @@ -2743,9 +2748,10 @@ static void mesh_to_softbody(Scene *scene, Object *ob) build_bps_springlist(ob); /* scan for springs attached to bodypoints ONCE */ /* insert *other second order* springs if desired */ if (sb->secondspring > 0.0000001f) { - add_2nd_order_springs( - ob, sb->secondspring); /* exploits the first run of build_bps_springlist(ob);*/ - build_bps_springlist(ob); /* yes we need to do it again*/ + /* exploits the first run of build_bps_springlist(ob); */ + add_2nd_order_springs(ob, sb->secondspring); + /* yes we need to do it again. */ + build_bps_springlist(ob); } springs_from_mesh(ob); /* write the 'rest'-length of the springs */ if (ob->softflag & OB_SB_SELF) { diff --git a/source/blender/blenkernel/intern/unit.c b/source/blender/blenkernel/intern/unit.c index 375721057c3..e30ea687b13 100644 --- a/source/blender/blenkernel/intern/unit.c +++ b/source/blender/blenkernel/intern/unit.c @@ -734,8 +734,9 @@ static int unit_scale_str(char *str, len_name = strlen(replace_str); len_move = (len - (found_ofs + len_name)) + 1; /* 1+ to copy the string terminator */ - len_num = BLI_snprintf( - str_tmp, TEMP_STR_SIZE, "*%.9g" SEP_STR, unit->scalar / scale_pref); /* # removed later */ + + /* # removed later */ + len_num = BLI_snprintf(str_tmp, TEMP_STR_SIZE, "*%.9g" SEP_STR, unit->scalar / scale_pref); if (len_num > len_max) { len_num = len_max; @@ -748,8 +749,9 @@ static int unit_scale_str(char *str, if (len_move > 0) { /* resize the last part of the string */ - memmove( - str_found + len_num, str_found + len_name, len_move); /* may grow or shrink the string */ + + /* May grow or shrink the string. */ + memmove(str_found + len_num, str_found + len_name, len_move); } if (found_ofs + len_num > len_max) { diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index bcee606ea7b..23807de2537 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -679,8 +679,10 @@ static Main *blo_find_main(FileData *fd, const char *filepath, const char *relab /* Add library data-block itself to 'main' Main, since libraries are **never** linked data. * Fixes bug where you could end with all ID_LI data-blocks having the same name... */ lib = BKE_libblock_alloc(mainlist->first, ID_LI, BLI_path_basename(filepath), 0); - lib->id.us = ID_FAKE_USERS( - lib); /* Important, consistency with main ID reading code from read_libblock(). */ + + /* Important, consistency with main ID reading code from read_libblock(). */ + lib->id.us = ID_FAKE_USERS(lib); + BLI_strncpy(lib->name, filepath, sizeof(lib->name)); BLI_strncpy(lib->filepath, name1, sizeof(lib->filepath)); @@ -3367,8 +3369,10 @@ static void direct_link_workspace(FileData *fd, WorkSpace *workspace, const Main for (WorkSpaceDataRelation *relation = workspace->hook_layout_relations.first; relation; relation = relation->next) { - relation->parent = newglobadr( - fd, relation->parent); /* data from window - need to access through global oldnew-map */ + + /* data from window - need to access through global oldnew-map */ + relation->parent = newglobadr(fd, relation->parent); + relation->value = newdataadr(fd, relation->value); } @@ -9156,8 +9160,9 @@ static BHead *read_libblock(FileData *fd, Main *main, BHead *bhead, const int ta /* do after read_struct, for dna reconstruct */ lb = which_libbase(main, idcode); if (lb) { - oldnewmap_insert( - fd->libmap, bhead->old, id, bhead->code); /* for ID_LINK_PLACEHOLDER check */ + /* for ID_LINK_PLACEHOLDER check */ + oldnewmap_insert(fd->libmap, bhead->old, id, bhead->code); + BLI_addtail(lb, id); } else { @@ -9524,8 +9529,10 @@ static void lib_link_all(FileData *fd, Main *main) lib_link_material(fd, main); lib_link_texture(fd, main); lib_link_image(fd, main); - lib_link_ipo( - fd, main); /* XXX deprecated... still needs to be maintained for version patches still */ + + /* XXX deprecated... still needs to be maintained for version patches still. */ + lib_link_ipo(fd, main); + lib_link_key(fd, main); lib_link_world(fd, main); lib_link_light(fd, main); @@ -9539,8 +9546,10 @@ static void lib_link_all(FileData *fd, Main *main) lib_link_armature(fd, main); lib_link_action(fd, main); lib_link_vfont(fd, main); - lib_link_nodetree(fd, - main); /* has to be done after scene/materials, this will verify group nodes */ + + /* Has to be done after scene/materials, this will verify group nodes. */ + lib_link_nodetree(fd, main); + lib_link_palette(fd, main); lib_link_brush(fd, main); lib_link_paint_curve(fd, main); @@ -11585,8 +11594,8 @@ static void library_link_end(Main *mainl, BKE_main_id_tag_all(mainvar, LIB_TAG_NEW, false); - fix_relpaths_library(BKE_main_blendfile_path(mainvar), - mainvar); /* make all relative paths, relative to the open blend file */ + /* Make all relative paths, relative to the open blend file. */ + fix_relpaths_library(BKE_main_blendfile_path(mainvar), mainvar); /* Give a base to loose objects and collections. * Only directly linked objects & collections are instantiated by diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c index 254259b1542..52d1269dc1b 100644 --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@ -2852,9 +2852,9 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) navigation_region = MEM_callocN(sizeof(ARegion), "userpref navigation-region do_versions"); - BLI_insertlinkbefore(regionbase, - main_region, - navigation_region); /* order matters, addhead not addtail! */ + /* Order matters, addhead not addtail! */ + BLI_insertlinkbefore(regionbase, main_region, navigation_region); + navigation_region->regiontype = RGN_TYPE_NAV_BAR; navigation_region->alignment = RGN_ALIGN_LEFT; } diff --git a/source/blender/bmesh/operators/bmo_primitive.c b/source/blender/bmesh/operators/bmo_primitive.c index 287a7e93470..ff7dcc388b3 100644 --- a/source/blender/bmesh/operators/bmo_primitive.c +++ b/source/blender/bmesh/operators/bmo_primitive.c @@ -1560,9 +1560,10 @@ void BM_mesh_calc_uvs_cone(BMesh *bm, float inv_mat[4][4]; int loop_index; - mul_mat3_m4_v3( - mat, local_up); /* transform the upvector like we did the cone itself, without location. */ - normalize_v3(local_up); /* remove global scaling... */ + /* Transform the upvector like we did the cone itself, without location. */ + mul_mat3_m4_v3(mat, local_up); + /* Remove global scaling... */ + normalize_v3(local_up); invert_m4_m4(inv_mat, mat); diff --git a/source/blender/bmesh/operators/bmo_removedoubles.c b/source/blender/bmesh/operators/bmo_removedoubles.c index 616886deba1..d783842c017 100644 --- a/source/blender/bmesh/operators/bmo_removedoubles.c +++ b/source/blender/bmesh/operators/bmo_removedoubles.c @@ -80,10 +80,12 @@ static BMFace *remdoubles_createface(BMesh *bm, { BMEdge *e_new; - BMEdge **edges = BLI_array_alloca(edges, f->len); /* new ordered edges */ - BMVert **verts = BLI_array_alloca(verts, f->len); /* new ordered verts */ - BMLoop **loops = BLI_array_alloca( - loops, f->len); /* original ordered loops to copy attrs into the new face */ + /* New ordered edges. */ + BMEdge **edges = BLI_array_alloca(edges, f->len); + /* New ordered verts. */ + BMVert **verts = BLI_array_alloca(verts, f->len); + /* Original ordered loops to copy attributes into the new face. */ + BMLoop **loops = BLI_array_alloca(loops, f->len); STACK_DECLARE(edges); STACK_DECLARE(loops); diff --git a/source/blender/collada/MeshImporter.cpp b/source/blender/collada/MeshImporter.cpp index 657cce24a82..64031e10d77 100644 --- a/source/blender/collada/MeshImporter.cpp +++ b/source/blender/collada/MeshImporter.cpp @@ -1149,8 +1149,9 @@ Object *MeshImporter::create_mesh_object( BKE_mesh_assign_object(m_bmain, ob, new_mesh); BKE_mesh_calc_normals(new_mesh); - id_us_plus( - &old_mesh->id); /* Because BKE_mesh_assign_object would have already decreased it... */ + /* Because BKE_mesh_assign_object would have already decreased it... */ + id_us_plus(&old_mesh->id); + BKE_id_free_us(m_bmain, old_mesh); COLLADAFW::MaterialBindingArray &mat_array = geom->getMaterialBindings(); diff --git a/source/blender/draw/engines/eevee/eevee_lights.c b/source/blender/draw/engines/eevee/eevee_lights.c index d23287264b3..c15872b31fa 100644 --- a/source/blender/draw/engines/eevee/eevee_lights.c +++ b/source/blender/draw/engines/eevee/eevee_lights.c @@ -1166,9 +1166,8 @@ static void eevee_shadow_cascade_setup(Object *ob, /* Compute offset. */ sub_v2_v2(shadow_texco, shadow_origin); - mul_v2_fl(shadow_texco, - (2.0f * sh_data->radius[c]) / - linfo->shadow_cascade_size); /* Texture to light space. */ + /* Texture to light space. */ + mul_v2_fl(shadow_texco, (2.0f * sh_data->radius[c]) / linfo->shadow_cascade_size); /* Apply offset. */ add_v2_v2(center, shadow_texco); diff --git a/source/blender/draw/engines/eevee/eevee_mist.c b/source/blender/draw/engines/eevee/eevee_mist.c index 2e56b64bd50..7209651a1d4 100644 --- a/source/blender/draw/engines/eevee/eevee_mist.c +++ b/source/blender/draw/engines/eevee/eevee_mist.c @@ -66,8 +66,9 @@ void EEVEE_mist_output_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata) } /* Create FrameBuffer. */ - DRW_texture_ensure_fullscreen_2d( - &txl->mist_accum, GPU_R32F, 0); /* Should be enough precision for many samples. */ + + /* Should be enough precision for many samples. */ + DRW_texture_ensure_fullscreen_2d(&txl->mist_accum, GPU_R32F, 0); GPU_framebuffer_ensure_config(&fbl->mist_accum_fb, {GPU_ATTACHMENT_NONE, GPU_ATTACHMENT_TEXTURE(txl->mist_accum)}); diff --git a/source/blender/draw/engines/eevee/eevee_occlusion.c b/source/blender/draw/engines/eevee/eevee_occlusion.c index 49f62c6bf5e..924b3d3b19b 100644 --- a/source/blender/draw/engines/eevee/eevee_occlusion.c +++ b/source/blender/draw/engines/eevee/eevee_occlusion.c @@ -146,8 +146,8 @@ void EEVEE_occlusion_output_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata DefaultTextureList *dtxl = DRW_viewport_texture_list_get(); float clear[4] = {0.0f, 0.0f, 0.0f, 0.0f}; - DRW_texture_ensure_fullscreen_2d( - &txl->ao_accum, GPU_R32F, 0); /* Should be enough precision for many samples. */ + /* Should be enough precision for many samples. */ + DRW_texture_ensure_fullscreen_2d(&txl->ao_accum, GPU_R32F, 0); GPU_framebuffer_ensure_config(&fbl->ao_accum_fb, {GPU_ATTACHMENT_NONE, GPU_ATTACHMENT_TEXTURE(txl->ao_accum)}); diff --git a/source/blender/draw/engines/eevee/shaders/lights_lib.glsl b/source/blender/draw/engines/eevee/shaders/lights_lib.glsl index 2d14f52d7e6..c3643cccbfc 100644 --- a/source/blender/draw/engines/eevee/shaders/lights_lib.glsl +++ b/source/blender/draw/engines/eevee/shaders/lights_lib.glsl @@ -393,8 +393,8 @@ vec3 light_translucent(LightData ld, vec3 W, vec3 N, vec4 l_vector, float scale) return vec3(0.0); } - float range = abs(data.sh_far - - data.sh_near); /* Same factor as in get_cascade_world_distance(). */ + /* Same factor as in get_cascade_world_distance(). */ + float range = abs(data.sh_far - data.sh_near); vec4 shpos = shadows_cascade_data[scd_id].shadowmat[int(id)] * vec4(W, 1.0); float dist = shpos.z * range; diff --git a/source/blender/draw/engines/workbench/workbench_studiolight.c b/source/blender/draw/engines/workbench/workbench_studiolight.c index 944bca73993..1a09498b228 100644 --- a/source/blender/draw/engines/workbench/workbench_studiolight.c +++ b/source/blender/draw/engines/workbench/workbench_studiolight.c @@ -82,8 +82,9 @@ void studiolight_update_world(WORKBENCH_PrivateData *wpd, -sl->spherical_harmonics_coefs[3][i], sl->spherical_harmonics_coefs[2][i], -sl->spherical_harmonics_coefs[1][i]); - mul_v3_fl(wd->spherical_harmonics_coefs[i + 1], - M_1_PI * 1.5f); /* 1.5f is to improve the contrast a bit. */ + + /* 1.5f is to improve the contrast a bit. */ + mul_v3_fl(wd->spherical_harmonics_coefs[i + 1], M_1_PI * 1.5f); } /* Precompute as much as we can. See shader code for derivation. */ diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index c4bb5eec723..c93531bb6cc 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -1399,8 +1399,12 @@ static int separate_exec(bContext *C, wmOperator *op) } /* 2. Duplicate the object and data. */ - newbase = ED_object_add_duplicate( - bmain, scene, view_layer, oldbase, 0); /* 0 = fully linked. */ + newbase = ED_object_add_duplicate(bmain, + scene, + view_layer, + oldbase, + /* 0 = fully linked. */ + 0); DEG_relations_tag_update(bmain); newob = newbase->object; diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index f3ab0b45122..575e45565ff 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -4052,8 +4052,10 @@ static int gp_stroke_separate_exec(bContext *C, wmOperator *op) } /* add duplicate materials */ - ma = give_current_material( - ob, gps->mat_nr + 1); /* XXX same material can be in multiple slots */ + + /* XXX same material can be in multiple slots. */ + ma = give_current_material(ob, gps->mat_nr + 1); + idx = BKE_gpencil_object_material_ensure(bmain, ob_dst, ma); /* selected points mode */ diff --git a/source/blender/editors/interface/interface_utils.c b/source/blender/editors/interface/interface_utils.c index bf52cc625c2..9c8787d002f 100644 --- a/source/blender/editors/interface/interface_utils.c +++ b/source/blender/editors/interface/interface_utils.c @@ -417,8 +417,9 @@ void ui_rna_collection_search_cb(const struct bContext *C, } } - name = RNA_struct_name_get_alloc( - &itemptr, NULL, 0, NULL); /* could use the string length here */ + /* Could use the string length here. */ + name = RNA_struct_name_get_alloc(&itemptr, NULL, 0, NULL); + iconid = 0; if (itemptr.type && RNA_struct_is_ID(itemptr.type)) { iconid = ui_id_icon_get(C, itemptr.data, false); diff --git a/source/blender/editors/object/object_shader_fx.c b/source/blender/editors/object/object_shader_fx.c index 6212269c099..457d2421253 100644 --- a/source/blender/editors/object/object_shader_fx.c +++ b/source/blender/editors/object/object_shader_fx.c @@ -282,8 +282,9 @@ void OBJECT_OT_shaderfx_add(wmOperatorType *ot) ot->prop = RNA_def_enum( ot->srna, "type", rna_enum_object_shaderfx_type_items, eShaderFxType_Blur, "Type", ""); RNA_def_enum_funcs(ot->prop, shaderfx_add_itemf); - RNA_def_property_translation_context(ot->prop, - BLT_I18NCONTEXT_ID_ID); /* Abused, for "Light"... */ + + /* Abused, for "Light"... */ + RNA_def_property_translation_context(ot->prop, BLT_I18NCONTEXT_ID_ID); } /* -------------------------------------------------------------------- */ diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index 3e2d387bcec..a6728aef705 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -3504,8 +3504,8 @@ static bool paint_vertsel_circle_select(ViewContext *vc, bool changed = false; if (SEL_OP_USE_PRE_DESELECT(sel_op)) { - changed |= paintvert_deselect_all_visible( - ob, SEL_DESELECT, false); /* flush selection at the end */ + /* Flush selection at the end. */ + changed |= paintvert_deselect_all_visible(ob, SEL_DESELECT, false); } const bool select = (sel_op != SEL_OP_SUB); diff --git a/source/blender/gpu/GPU_batch.h b/source/blender/gpu/GPU_batch.h index 5b0cab220c0..365dd89a006 100644 --- a/source/blender/gpu/GPU_batch.h +++ b/source/blender/gpu/GPU_batch.h @@ -105,8 +105,9 @@ void GPU_batch_copy(GPUBatch *batch_dst, GPUBatch *batch_src); #define GPU_batch_create(prim, verts, elem) GPU_batch_create_ex(prim, verts, elem, 0) #define GPU_batch_init(batch, prim, verts, elem) GPU_batch_init_ex(batch, prim, verts, elem, 0) -void GPU_batch_clear( - GPUBatch *); /* Same as discard but does not free. (does not clal free callback) */ +/* Same as discard but does not free. (does not call free callback). */ +void GPU_batch_clear(GPUBatch *); + void GPU_batch_discard(GPUBatch *); /* verts & elem are not discarded */ void GPU_batch_vao_cache_clear(GPUBatch *); diff --git a/source/blender/gpu/GPU_matrix.h b/source/blender/gpu/GPU_matrix.h index 61622c40ff0..a424f3180de 100644 --- a/source/blender/gpu/GPU_matrix.h +++ b/source/blender/gpu/GPU_matrix.h @@ -52,12 +52,12 @@ void GPU_matrix_translate_3f(float x, float y, float z); void GPU_matrix_translate_3fv(const float vec[3]); void GPU_matrix_scale_3f(float x, float y, float z); void GPU_matrix_scale_3fv(const float vec[3]); -void GPU_matrix_rotate_3f(float deg, - float x, - float y, - float z); /* axis of rotation should be a unit vector */ -void GPU_matrix_rotate_3fv(float deg, - const float axis[3]); /* axis of rotation should be a unit vector */ + +/* Axis of rotation should be a unit vector. */ +void GPU_matrix_rotate_3f(float deg, float x, float y, float z); +/* Axis of rotation should be a unit vector. */ +void GPU_matrix_rotate_3fv(float deg, const float axis[3]); + void GPU_matrix_rotate_axis(float deg, char axis); /* TODO: enum for axis? */ void GPU_matrix_look_at(float eyeX, diff --git a/source/blender/gpu/GPU_vertex_buffer.h b/source/blender/gpu/GPU_vertex_buffer.h index 3e178e193dc..2d728422c42 100644 --- a/source/blender/gpu/GPU_vertex_buffer.h +++ b/source/blender/gpu/GPU_vertex_buffer.h @@ -87,9 +87,10 @@ void GPU_vertbuf_data_len_set(GPUVertBuf *, uint v_len); * should not be a problem. */ void GPU_vertbuf_attr_set(GPUVertBuf *, uint a_idx, uint v_idx, const void *data); -void GPU_vertbuf_attr_fill(GPUVertBuf *, - uint a_idx, - const void *data); /* tightly packed, non interleaved input data */ + +/* Tightly packed, non interleaved input data. */ +void GPU_vertbuf_attr_fill(GPUVertBuf *, uint a_idx, const void *data); + void GPU_vertbuf_attr_fill_stride(GPUVertBuf *, uint a_idx, uint stride, const void *data); /* For low level access only */ diff --git a/source/blender/gpu/intern/gpu_context.cpp b/source/blender/gpu/intern/gpu_context.cpp index 93df65006ff..17b86e3eec8 100644 --- a/source/blender/gpu/intern/gpu_context.cpp +++ b/source/blender/gpu/intern/gpu_context.cpp @@ -103,9 +103,11 @@ static void orphans_add(GPUContext *ctx, std::vector<GLuint> *orphan_list, GLuin static void orphans_clear(GPUContext *ctx) { - BLI_assert(ctx); /* need at least an active context */ - BLI_assert(pthread_equal(pthread_self(), - ctx->thread)); /* context has been activated by another thread! */ + /* need at least an active context */ + BLI_assert(ctx); + + /* context has been activated by another thread! */ + BLI_assert(pthread_equal(pthread_self(), ctx->thread)); ctx->orphans_mutex.lock(); if (!ctx->orphaned_vertarray_ids.empty()) { diff --git a/source/blender/gpu/intern/gpu_immediate.c b/source/blender/gpu/intern/gpu_immediate.c index 6b5c4836e83..0e3019ad122 100644 --- a/source/blender/gpu/intern/gpu_immediate.c +++ b/source/blender/gpu/intern/gpu_immediate.c @@ -220,8 +220,10 @@ void immBegin(GPUPrimType prim_type, uint vertex_len) /* does the current buffer have enough room? */ const uint available_bytes = IMM_BUFFER_SIZE - imm.buffer_offset; /* ensure vertex data is aligned */ - const uint pre_padding = padding( - imm.buffer_offset, imm.vertex_format.stride); /* might waste a little space, but it's safe */ + + /* Might waste a little space, but it's safe. */ + const uint pre_padding = padding(imm.buffer_offset, imm.vertex_format.stride); + if ((bytes_needed + pre_padding) <= available_bytes) { imm.buffer_offset += pre_padding; } diff --git a/source/blender/gpu/intern/gpu_vertex_format.c b/source/blender/gpu/intern/gpu_vertex_format.c index e745c525df6..493c6d3ec59 100644 --- a/source/blender/gpu/intern/gpu_vertex_format.c +++ b/source/blender/gpu/intern/gpu_vertex_format.c @@ -163,8 +163,10 @@ uint GPU_vertformat_attr_add(GPUVertFormat *format, /* 10_10_10 format intended for normals (xyz) or colors (rgb) * extra component packed.w can be manually set to { -2, -1, 0, 1 } */ assert(comp_len == 3 || comp_len == 4); - assert(fetch_mode == - GPU_FETCH_INT_TO_FLOAT_UNIT); /* not strictly required, may relax later */ + + /* Not strictly required, may relax later. */ + assert(fetch_mode == GPU_FETCH_INT_TO_FLOAT_UNIT); + break; default: /* integer types can be kept as int or converted/normalized to float */ diff --git a/source/blender/imbuf/intern/imageprocess.c b/source/blender/imbuf/intern/imageprocess.c index 1f180d0d9c1..49e9c4c54d2 100644 --- a/source/blender/imbuf/intern/imageprocess.c +++ b/source/blender/imbuf/intern/imageprocess.c @@ -110,8 +110,8 @@ void bicubic_interpolation(ImBuf *in, ImBuf *out, float u, float v, int xout, in return; } - pixel_from_buffer( - out, &outI, &outF, xout, yout); /* gcc warns these could be uninitialized, but its ok */ + /* gcc warns these could be uninitialized, but its ok. */ + pixel_from_buffer(out, &outI, &outF, xout, yout); bicubic_interpolation_color(in, outI, outF, u, v); } @@ -220,8 +220,8 @@ void bilinear_interpolation(ImBuf *in, ImBuf *out, float u, float v, int xout, i return; } - pixel_from_buffer( - out, &outI, &outF, xout, yout); /* gcc warns these could be uninitialized, but its ok */ + /* gcc warns these could be uninitialized, but its ok. */ + pixel_from_buffer(out, &outI, &outF, xout, yout); bilinear_interpolation_color(in, outI, outF, u, v); } @@ -332,8 +332,8 @@ void nearest_interpolation(ImBuf *in, ImBuf *out, float x, float y, int xout, in return; } - pixel_from_buffer( - out, &outI, &outF, xout, yout); /* gcc warns these could be uninitialized, but its ok */ + /* gcc warns these could be uninitialized, but its ok. */ + pixel_from_buffer(out, &outI, &outF, xout, yout); nearest_interpolation_color(in, outI, outF, x, y); } diff --git a/source/blender/imbuf/intern/openexr/openexr_api.cpp b/source/blender/imbuf/intern/openexr/openexr_api.cpp index c9883d5df86..f18eb2f7303 100644 --- a/source/blender/imbuf/intern/openexr/openexr_api.cpp +++ b/source/blender/imbuf/intern/openexr/openexr_api.cpp @@ -1215,9 +1215,9 @@ void IMB_exr_read_channels(void *handle) /* check if exr was saved with previous versions of blender which flipped images */ const StringAttribute *ta = data->ifile->header(0).findTypedAttribute<StringAttribute>( "BlenderMultiChannel"); - short flip = (ta && STREQLEN(ta->value().c_str(), - "Blender V2.43", - 13)); /* 'previous multilayer attribute, flipped */ + + /* 'previous multilayer attribute, flipped. */ + short flip = (ta && STREQLEN(ta->value().c_str(), "Blender V2.43", 13)); exr_printf( "\nIMB_exr_read_channels\n%s %-6s %-22s " diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index 30e24917b83..b0738b617f7 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -953,8 +953,10 @@ bool RNA_property_pointer_poll(PointerRNA *ptr, PropertyRNA *prop, PointerRNA *v bool RNA_property_editable(PointerRNA *ptr, PropertyRNA *prop); bool RNA_property_editable_info(PointerRNA *ptr, PropertyRNA *prop, const char **r_info); bool RNA_property_editable_index(PointerRNA *ptr, PropertyRNA *prop, int index); -bool RNA_property_editable_flag(PointerRNA *ptr, - PropertyRNA *prop); /* without lib check, only checks the flag */ + +/* without lib check, only checks the flag */ +bool RNA_property_editable_flag(PointerRNA *ptr, PropertyRNA *prop); + bool RNA_property_animateable(PointerRNA *ptr, PropertyRNA *prop); bool RNA_property_animated(PointerRNA *ptr, PropertyRNA *prop); bool RNA_property_overridable_get(PointerRNA *ptr, PropertyRNA *prop); diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index 3e4cb96a8e8..330d45c2fa5 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -6477,8 +6477,8 @@ char *RNA_string_get_alloc(PointerRNA *ptr, const char *name, char *fixedbuf, in PropertyRNA *prop = RNA_struct_find_property(ptr, name); if (prop) { - return RNA_property_string_get_alloc( - ptr, prop, fixedbuf, fixedlen, NULL); /* TODO, pass length */ + /* TODO, pass length */ + return RNA_property_string_get_alloc(ptr, prop, fixedbuf, fixedlen, NULL); } else { printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name); diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c index 310a335ba4c..644d0b712a2 100644 --- a/source/blender/makesrna/intern/rna_curve.c +++ b/source/blender/makesrna/intern/rna_curve.c @@ -1215,8 +1215,8 @@ static void rna_def_font(BlenderRNA *UNUSED(brna), StructRNA *srna) RNA_def_property_ui_text(prop, "Body Text", "Content of this text object"); RNA_def_property_string_funcs( prop, "rna_Curve_body_get", "rna_Curve_body_length", "rna_Curve_body_set"); - RNA_def_property_string_maxlength(prop, - 8192); /* note that originally str did not have a limit! */ + /* note that originally str did not have a limit! */ + RNA_def_property_string_maxlength(prop, 8192); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); prop = RNA_def_property(srna, "body_format", PROP_COLLECTION, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c index 2cb7c62b028..03ab9da2eff 100644 --- a/source/blender/makesrna/intern/rna_define.c +++ b/source/blender/makesrna/intern/rna_define.c @@ -724,8 +724,10 @@ void RNA_struct_free_extension(StructRNA *srna, ExtensionRNA *ext) #ifdef RNA_RUNTIME ext->free(ext->data); /* decref's the PyObject that the srna owns */ RNA_struct_blender_type_set(srna, NULL); /* this gets accessed again - XXX fixme */ - RNA_struct_py_type_set( - srna, NULL); /* NULL the srna's value so RNA_struct_free wont complain of a leak */ + + /* NULL the srna's value so RNA_struct_free wont complain of a leak */ + RNA_struct_py_type_set(srna, NULL); + #else (void)srna; (void)ext; diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c index f17e9ce28fe..631ad72e146 100644 --- a/source/blender/makesrna/intern/rna_rna.c +++ b/source/blender/makesrna/intern/rna_rna.c @@ -2824,8 +2824,10 @@ static void rna_def_number_property(StructRNA *srna, PropertyType type) prop = RNA_def_property(srna, "default_array", type, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); - RNA_def_property_array( - prop, RNA_MAX_ARRAY_DIMENSION); /* no fixed default length, important its not 0 though */ + + /* no fixed default length, important its not 0 though. */ + RNA_def_property_array(prop, RNA_MAX_ARRAY_DIMENSION); + RNA_def_property_flag(prop, PROP_DYNAMIC); RNA_def_property_dynamic_array_funcs( prop, "rna_NumberProperty_default_array_get_length"); /* same for all types */ diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c index d50f97e88ca..c8b039bd2d6 100644 --- a/source/blender/makesrna/intern/rna_ui_api.c +++ b/source/blender/makesrna/intern/rna_ui_api.c @@ -796,6 +796,7 @@ void RNA_api_ui_layout(StructRNA *srna) RNA_def_boolean(func, "emboss", true, "", "Draw the button itself, not just the icon/text"); RNA_def_int(func, "index", + /* RNA_NO_INDEX == -1 */ -1, -2, INT_MAX, @@ -803,7 +804,7 @@ void RNA_api_ui_layout(StructRNA *srna) "The index of this button, when set a single member of an array can be accessed, " "when set to -1 all array members are used", -2, - INT_MAX); /* RNA_NO_INDEX == -1 */ + INT_MAX); parm = RNA_def_property(func, "icon_value", PROP_INT, PROP_UNSIGNED); RNA_def_property_ui_text(parm, "Icon Value", "Override automatic icon of the item"); RNA_def_boolean(func, "invert_checkbox", false, "", "Draw checkbox value inverted"); diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index 1edda29a556..123ec9634c9 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -1514,8 +1514,10 @@ static StructRNA *rna_Operator_register(Main *bmain, /* create a new operator type */ dummyot.ext.srna = RNA_def_struct_ptr(&BLENDER_RNA, dummyot.idname, &RNA_Operator); - RNA_def_struct_flag(dummyot.ext.srna, - STRUCT_NO_IDPROPERTIES); /* operator properties are registered separately */ + + /* Operator properties are registered separately. */ + RNA_def_struct_flag(dummyot.ext.srna, STRUCT_NO_IDPROPERTIES); + RNA_def_struct_property_tags(dummyot.ext.srna, rna_enum_operator_property_tags); RNA_def_struct_translation_context(dummyot.ext.srna, dummyot.translation_context); dummyot.ext.data = data; diff --git a/source/blender/makesrna/intern/rna_wm_gizmo.c b/source/blender/makesrna/intern/rna_wm_gizmo.c index 38b6ac9ac52..534e3042768 100644 --- a/source/blender/makesrna/intern/rna_wm_gizmo.c +++ b/source/blender/makesrna/intern/rna_wm_gizmo.c @@ -870,9 +870,10 @@ static StructRNA *rna_GizmoGroup_register(Main *bmain, /* create a new gizmogroup type */ dummywgt.ext.srna = RNA_def_struct_ptr(&BLENDER_RNA, dummywgt.idname, &RNA_GizmoGroup); - RNA_def_struct_flag( - dummywgt.ext.srna, - STRUCT_NO_IDPROPERTIES); /* gizmogroup properties are registered separately */ + + /* Gizmo group properties are registered separately. */ + RNA_def_struct_flag(dummywgt.ext.srna, STRUCT_NO_IDPROPERTIES); + dummywgt.ext.data = data; dummywgt.ext.call = call; dummywgt.ext.free = free; diff --git a/source/blender/modifiers/intern/MOD_bevel.c b/source/blender/modifiers/intern/MOD_bevel.c index 309af4d4812..a05b7023392 100644 --- a/source/blender/modifiers/intern/MOD_bevel.c +++ b/source/blender/modifiers/intern/MOD_bevel.c @@ -214,8 +214,9 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes result = BKE_mesh_from_bmesh_for_eval_nomain(bm, NULL); - BLI_assert(bm->vtoolflagpool == NULL && bm->etoolflagpool == NULL && - bm->ftoolflagpool == NULL); /* make sure we never alloc'd these */ + /* Make sure we never alloc'd these. */ + BLI_assert(bm->vtoolflagpool == NULL && bm->etoolflagpool == NULL && bm->ftoolflagpool == NULL); + BM_mesh_free(bm); result->runtime.cd_dirty_vert |= CD_MASK_NORMAL; diff --git a/source/blender/modifiers/intern/MOD_boolean.c b/source/blender/modifiers/intern/MOD_boolean.c index 107622e33c0..dc4898c83ff 100644 --- a/source/blender/modifiers/intern/MOD_boolean.c +++ b/source/blender/modifiers/intern/MOD_boolean.c @@ -262,8 +262,9 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes BM_ITER_MESH (efa, &iter, bm, BM_FACES_OF_MESH) { mul_transposed_m3_v3(nmat, efa->no); normalize_v3(efa->no); - BM_elem_flag_enable( - efa, BM_FACE_TAG); /* temp tag to test which side split faces are from */ + + /* Temp tag to test which side split faces are from. */ + BM_elem_flag_enable(efa, BM_FACE_TAG); /* remap material */ if (LIKELY(efa->mat_nr < ob_src_totcol)) { diff --git a/source/blender/modifiers/intern/MOD_simpledeform.c b/source/blender/modifiers/intern/MOD_simpledeform.c index 8d511207b9b..d10d74da453 100644 --- a/source/blender/modifiers/intern/MOD_simpledeform.c +++ b/source/blender/modifiers/intern/MOD_simpledeform.c @@ -351,10 +351,8 @@ static void SimpleDeformModifier_do(SimpleDeformModifierData *smd, simpleDeform_callback(smd_factor, deform_axis, dcut_remap, co_remap); /* apply deform */ copy_v3_v3_unmap(co, co_remap, axis_map); - interp_v3_v3v3(vertexCos[i], - vertexCos[i], - co, - weight); /* Use vertex weight has coef of linear interpolation */ + /* Use vertex weight has coef of linear interpolation */ + interp_v3_v3v3(vertexCos[i], vertexCos[i], co, weight); if (transf) { BLI_space_transform_invert(transf, vertexCos[i]); diff --git a/source/blender/physics/intern/implicit_blender.c b/source/blender/physics/intern/implicit_blender.c index 93df51ce58d..c2eb7b465e1 100644 --- a/source/blender/physics/intern/implicit_blender.c +++ b/source/blender/physics/intern/implicit_blender.c @@ -1158,12 +1158,9 @@ bool BPH_mass_spring_solve_velocities(Implicit_Data *data, float dt, ImplicitSol double start = PIL_check_seconds_timer(); # endif - cg_filtered(data->dV, - data->A, - data->B, - data->z, - data->S, - result); /* conjugate gradient algorithm to solve Ax=b */ + /* Conjugate gradient algorithm to solve Ax=b. */ + cg_filtered(data->dV, data->A, data->B, data->z, data->S, result); + // cg_filtered_pre(id->dV, id->A, id->B, id->z, id->S, id->P, id->Pinv, id->bigI); # ifdef DEBUG_TIME diff --git a/source/blender/python/bmesh/bmesh_py_types.h b/source/blender/python/bmesh/bmesh_py_types.h index 460e7f82222..c61fdeab4b0 100644 --- a/source/blender/python/bmesh/bmesh_py_types.h +++ b/source/blender/python/bmesh/bmesh_py_types.h @@ -140,8 +140,8 @@ PyObject *BPy_BMFaceSeq_CreatePyObject(BMesh *bm); PyObject *BPy_BMLoopSeq_CreatePyObject(BMesh *bm); PyObject *BPy_BMIter_CreatePyObject(BMesh *bm); -PyObject *BPy_BMElem_CreatePyObject(BMesh *bm, - BMHeader *ele); /* just checks type and creates v/e/f/l */ +/* Just checks type and creates v/e/f/l. */ +PyObject *BPy_BMElem_CreatePyObject(BMesh *bm, BMHeader *ele); void *BPy_BMElem_PySeq_As_Array_FAST(BMesh **r_bm, PyObject *seq_fast, diff --git a/source/blender/python/bmesh/bmesh_py_types_customdata.c b/source/blender/python/bmesh/bmesh_py_types_customdata.c index 56c25edb7e4..a7f4e30b494 100644 --- a/source/blender/python/bmesh/bmesh_py_types_customdata.c +++ b/source/blender/python/bmesh/bmesh_py_types_customdata.c @@ -516,8 +516,10 @@ static PyObject *bpy_bmlayercollection_keys(BPy_BMLayerCollection *self) BPY_BM_CHECK_OBJ(self); data = bpy_bm_customdata_get(self->bm, self->htype); - index = CustomData_get_layer_index(data, - self->type); /* absolute, but no need to make relative */ + + /* Absolute, but no need to make relative. */ + index = CustomData_get_layer_index(data, self->type); + tot = (index != -1) ? CustomData_number_of_layers(data, self->type) : 0; ret = PyList_New(tot); diff --git a/source/blender/python/generic/idprop_py_api.c b/source/blender/python/generic/idprop_py_api.c index 30cad991b55..d10d281c1f9 100644 --- a/source/blender/python/generic/idprop_py_api.c +++ b/source/blender/python/generic/idprop_py_api.c @@ -1428,8 +1428,9 @@ static int BPy_IDArray_ass_slice(BPy_IDArray *self, int begin, int end, PyObject size = (end - begin); alloc_len = size * elem_size; - vec = MEM_mallocN(alloc_len, - "array assignment"); /* NOTE: we count on int/float being the same size here */ + /* NOTE: we count on int/float being the same size here */ + vec = MEM_mallocN(alloc_len, "array assignment"); + if (PyC_AsArray(vec, seq, size, py_type, is_double, "slice assignment: ") == -1) { MEM_freeN(vec); return -1; diff --git a/source/blender/python/intern/bpy_operator.c b/source/blender/python/intern/bpy_operator.c index aef4ab6667a..5e3b000c604 100644 --- a/source/blender/python/intern/bpy_operator.c +++ b/source/blender/python/intern/bpy_operator.c @@ -252,8 +252,9 @@ static PyObject *pyop_call(PyObject *UNUSED(self), PyObject *args) ReportList *reports; reports = MEM_mallocN(sizeof(ReportList), "wmOperatorReportList"); - BKE_reports_init(reports, - RPT_STORE | RPT_OP_HOLD); /* own so these don't move into global reports */ + + /* Own so these don't move into global reports. */ + BKE_reports_init(reports, RPT_STORE | RPT_OP_HOLD); #ifdef BPY_RELEASE_GIL /* release GIL, since a thread could be started from an operator diff --git a/source/blender/python/intern/bpy_props.c b/source/blender/python/intern/bpy_props.c index 70bfa76e344..9e734123caa 100644 --- a/source/blender/python/intern/bpy_props.c +++ b/source/blender/python/intern/bpy_props.c @@ -2931,8 +2931,8 @@ static PyObject *BPy_StringProperty(PyObject *self, PyObject *args, PyObject *kw prop = RNA_def_property(srna, id, PROP_STRING, subtype); if (maxlen != 0) { - RNA_def_property_string_maxlength(prop, - maxlen + 1); /* +1 since it includes null terminator */ + /* +1 since it includes null terminator. */ + RNA_def_property_string_maxlength(prop, maxlen + 1); } if (def && def[0]) { RNA_def_property_string_default(prop, def); diff --git a/source/blender/python/intern/bpy_rna_anim.c b/source/blender/python/intern/bpy_rna_anim.c index fb9454bf108..7a3499d0295 100644 --- a/source/blender/python/intern/bpy_rna_anim.c +++ b/source/blender/python/intern/bpy_rna_anim.c @@ -455,8 +455,8 @@ PyObject *pyrna_struct_keyframe_delete(BPy_StructRNA *self, PyObject *args, PyOb NlaStrip *strip = (NlaStrip *)ptr.data; FCurve *fcu = list_find_fcurve(&strip->fcurves, RNA_property_identifier(prop), index); - BLI_assert(fcu != - NULL); /* NOTE: This should be true, or else we wouldn't be able to get here */ + /* NOTE: This should be true, or else we wouldn't be able to get here. */ + BLI_assert(fcu != NULL); if (BKE_fcurve_is_protected(fcu)) { BKE_reportf( diff --git a/source/blender/python/intern/bpy_rna_array.c b/source/blender/python/intern/bpy_rna_array.c index 9d8fff5dfe4..a8312d89ef8 100644 --- a/source/blender/python/intern/bpy_rna_array.c +++ b/source/blender/python/intern/bpy_rna_array.c @@ -554,8 +554,9 @@ static int py_to_array(PyObject *seq, /* not freeing allocated mem, RNA_parameter_list_free() will do this */ ParameterDynAlloc *param_alloc = (ParameterDynAlloc *)param_data; param_alloc->array_tot = (int)totitem; - param_alloc->array = MEM_callocN(item_size * totitem, - "py_to_array dyn"); /* freeing param list will free */ + + /* freeing param list will free */ + param_alloc->array = MEM_callocN(item_size * totitem, "py_to_array dyn"); data = param_alloc->array; } diff --git a/source/blender/python/mathutils/mathutils.h b/source/blender/python/mathutils/mathutils.h index c9d0dee044f..70bd3a64481 100644 --- a/source/blender/python/mathutils/mathutils.h +++ b/source/blender/python/mathutils/mathutils.h @@ -96,16 +96,16 @@ int EXPP_VectorsAreEqual(const float *vecA, const float *vecB, int size, int flo typedef struct Mathutils_Callback Mathutils_Callback; -typedef int (*BaseMathCheckFunc)(BaseMathObject *); /* checks the user is still valid */ -typedef int (*BaseMathGetFunc)(BaseMathObject *, int); /* gets the vector from the user */ -typedef int (*BaseMathSetFunc)(BaseMathObject *, - int); /* sets the users vector values once its modified */ -typedef int (*BaseMathGetIndexFunc)(BaseMathObject *, - int, - int); /* same as above but only for an index */ -typedef int (*BaseMathSetIndexFunc)(BaseMathObject *, - int, - int); /* same as above but only for an index */ +/** Checks the user is still valid. */ +typedef int (*BaseMathCheckFunc)(BaseMathObject *); +/** Gets the vector from the user. */ +typedef int (*BaseMathGetFunc)(BaseMathObject *, int); +/** Sets the users vector values once its modified. */ +typedef int (*BaseMathSetFunc)(BaseMathObject *, int); +/** Same as above but only for an index. */ +typedef int (*BaseMathGetIndexFunc)(BaseMathObject *, int, int); +/** Same as above but only for an index. */ +typedef int (*BaseMathSetIndexFunc)(BaseMathObject *, int, int); struct Mathutils_Callback { BaseMathCheckFunc check; diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index 5d6e405dd5d..cf87afa2a34 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -420,11 +420,14 @@ int WM_operator_call_py(struct bContext *C, struct ReportList *reports, const bool is_undo); +/* Used for keymap and macro items. */ void WM_operator_properties_alloc(struct PointerRNA **ptr, struct IDProperty **properties, - const char *opstring); /* used for keymap and macro items */ -void WM_operator_properties_sanitize( - struct PointerRNA *ptr, const bool no_context); /* make props context sensitive or not */ + const char *opstring); + +/* Make props context sensitive or not. */ +void WM_operator_properties_sanitize(struct PointerRNA *ptr, const bool no_context); + bool WM_operator_properties_default(struct PointerRNA *ptr, const bool do_update); void WM_operator_properties_reset(struct wmOperator *op); void WM_operator_properties_create(struct PointerRNA *ptr, const char *opstring); diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 88a4c13c4ca..832bf1e9b6d 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -1406,8 +1406,10 @@ static int wm_operator_invoke(bContext *C, if (WM_operator_poll(C, ot)) { wmWindowManager *wm = CTX_wm_manager(C); - wmOperator *op = wm_operator_create( - wm, ot, properties, reports); /* if reports == NULL, they'll be initialized */ + + /* if reports == NULL, they'll be initialized */ + wmOperator *op = wm_operator_create(wm, ot, properties, reports); + const bool is_nested_call = (wm->op_undo_depth != 0); if (event != NULL) { diff --git a/source/blender/windowmanager/intern/wm_operator_props.c b/source/blender/windowmanager/intern/wm_operator_props.c index f22b5d07686..fcb55d3f801 100644 --- a/source/blender/windowmanager/intern/wm_operator_props.c +++ b/source/blender/windowmanager/intern/wm_operator_props.c @@ -512,8 +512,9 @@ void WM_operator_properties_checker_interval_from_op(struct wmOperator *op, op_params->nth = nth; op_params->skip = skip; - op_params->offset = mod_i(offset, - nth + skip); /* so input of offset zero ends up being (nth - 1) */ + + /* So input of offset zero ends up being (nth - 1). */ + op_params->offset = mod_i(offset, nth + skip); } bool WM_operator_properties_checker_interval_test(const struct CheckerIntervalParams *op_params, diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index c984191076c..089f57c122e 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -1653,12 +1653,13 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar 0.5f * U.widget_unit, U.dpi_fac * 501, U.dpi_fac * 250, + /* Button owns the imbuf now. */ ibuf, 0.0, 0.0, 0, 0, - ""); /* button owns the imbuf now */ + ""); UI_but_func_set(but, wm_block_splash_close, block, NULL); UI_block_func_set(block, wm_block_splash_refreshmenu, block, NULL); diff --git a/tests/gtests/blenlib/BLI_string_test.cc b/tests/gtests/blenlib/BLI_string_test.cc index bffd38016a7..b63b591b39a 100644 --- a/tests/gtests/blenlib/BLI_string_test.cc +++ b/tests/gtests/blenlib/BLI_string_test.cc @@ -401,8 +401,8 @@ TEST(string, StrFormatByteUnits) BLI_str_format_byte_unit(size_str, size = -1024, true); EXPECT_STREQ("-1 KB", size_str); - BLI_str_format_byte_unit( - size_str, size = 9223372036854775807, true); /* LLONG_MAX - largest possible value */ + /* LLONG_MAX - largest possible value */ + BLI_str_format_byte_unit(size_str, size = 9223372036854775807, true); EXPECT_STREQ("9223.372 PB", size_str); BLI_str_format_byte_unit(size_str, size = -9223372036854775807, true); EXPECT_STREQ("-9223.372 PB", size_str); @@ -428,8 +428,8 @@ TEST(string, StrFormatByteUnits) BLI_str_format_byte_unit(size_str, size = -1024, false); EXPECT_STREQ("-1 KiB", size_str); - BLI_str_format_byte_unit( - size_str, size = 9223372036854775807, false); /* LLONG_MAX - largest possible value */ + /* LLONG_MAX - largest possible value */ + BLI_str_format_byte_unit(size_str, size = 9223372036854775807, false); EXPECT_STREQ("8192.0 PiB", size_str); BLI_str_format_byte_unit(size_str, size = -9223372036854775807, false); EXPECT_STREQ("-8192.0 PiB", size_str); |