diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-03-08 06:48:45 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-03-08 06:54:23 +0300 |
commit | a1bc7729f20b8a8250f938d768ab2d104c41af54 (patch) | |
tree | 733edf2a4be6eef6dc1dcd8f82f108aeeb9b3940 /source/blender/editors | |
parent | b4f5128b21f1e1348defc68a96f4d4c2b1053fbe (diff) |
Cleanup: use ofs instead of offs as an abbreviation for offset
Used for local structs/variables,
since `ofs` is by far the most widely used abbreviation.
Diffstat (limited to 'source/blender/editors')
10 files changed, 68 insertions, 73 deletions
diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c index 2ab809c3633..7adddf8f4ae 100644 --- a/source/blender/editors/animation/anim_markers.c +++ b/source/blender/editors/animation/anim_markers.c @@ -762,9 +762,9 @@ static void ed_marker_move_update_header(bContext *C, wmOperator *op) Scene *scene = CTX_data_scene(C); MarkerMove *mm = op->customdata; TimeMarker *marker, *selmarker = NULL; - const int offs = RNA_int_get(op->ptr, "frames"); + const int ofs = RNA_int_get(op->ptr, "frames"); char str[UI_MAX_DRAW_STR]; - char str_offs[NUM_STR_REP_LEN]; + char str_ofs[NUM_STR_REP_LEN]; int totmark; const bool use_time = ed_marker_move_use_time(mm); @@ -776,27 +776,27 @@ static void ed_marker_move_update_header(bContext *C, wmOperator *op) } if (hasNumInput(&mm->num)) { - outputNumInput(&mm->num, str_offs, &scene->unit); + outputNumInput(&mm->num, str_ofs, &scene->unit); } else if (use_time) { - BLI_snprintf(str_offs, sizeof(str_offs), "%.2f", FRA2TIME(offs)); + BLI_snprintf(str_ofs, sizeof(str_ofs), "%.2f", FRA2TIME(ofs)); } else { - BLI_snprintf(str_offs, sizeof(str_offs), "%d", offs); + BLI_snprintf(str_ofs, sizeof(str_ofs), "%d", ofs); } if (totmark == 1 && selmarker) { /* we print current marker value */ if (use_time) { BLI_snprintf( - str, sizeof(str), TIP_("Marker %.2f offset %s"), FRA2TIME(selmarker->frame), str_offs); + str, sizeof(str), TIP_("Marker %.2f offset %s"), FRA2TIME(selmarker->frame), str_ofs); } else { - BLI_snprintf(str, sizeof(str), TIP_("Marker %d offset %s"), selmarker->frame, str_offs); + BLI_snprintf(str, sizeof(str), TIP_("Marker %d offset %s"), selmarker->frame, str_ofs); } } else { - BLI_snprintf(str, sizeof(str), TIP_("Marker offset %s"), str_offs); + BLI_snprintf(str, sizeof(str), TIP_("Marker offset %s"), str_ofs); } ED_area_status_text(CTX_wm_area(C), str); @@ -907,12 +907,12 @@ static void ed_marker_move_apply(bContext *C, wmOperator *op) #endif MarkerMove *mm = op->customdata; TimeMarker *marker; - int a, offs; + int a, ofs; - offs = RNA_int_get(op->ptr, "frames"); + ofs = RNA_int_get(op->ptr, "frames"); for (a = 0, marker = mm->markers->first; marker; marker = marker->next) { if (marker->flag & SELECT) { - marker->frame = mm->oldframe[a] + offs; + marker->frame = mm->oldframe[a] + ofs; a++; } } diff --git a/source/blender/editors/armature/armature_select.c b/source/blender/editors/armature/armature_select.c index 60fe8ee7dee..226253cc063 100644 --- a/source/blender/editors/armature/armature_select.c +++ b/source/blender/editors/armature/armature_select.c @@ -644,8 +644,8 @@ static int selectbuffer_ret_hits_12(uint *UNUSED(buffer), const int hits12) static int selectbuffer_ret_hits_5(uint *buffer, const int hits12, const int hits5) { - const int offs = 4 * hits12; - memcpy(buffer, buffer + offs, 4 * hits5 * sizeof(uint)); + const int ofs = 4 * hits12; + memcpy(buffer, buffer + ofs, 4 * hits5 * sizeof(uint)); return hits5; } @@ -704,17 +704,12 @@ static EditBone *get_nearest_editbonepoint( goto cache_end; } else if (hits12 > 0) { - int offs; + int ofs; - offs = 4 * hits12; + ofs = 4 * hits12; BLI_rcti_init_pt_radius(&rect, vc->mval, 5); - const int hits5 = view3d_opengl_select_with_id_filter(vc, - buffer + offs, - MAXPICKBUF - offs, - &rect, - select_mode, - select_filter, - select_id_ignore); + const int hits5 = view3d_opengl_select_with_id_filter( + vc, buffer + ofs, MAXPICKBUF - ofs, &rect, select_mode, select_filter, select_id_ignore); if (hits5 == 1) { hits = selectbuffer_ret_hits_5(buffer, hits12, hits5); diff --git a/source/blender/editors/armature/pose_slide.c b/source/blender/editors/armature/pose_slide.c index d636f0d68af..93d36abe792 100644 --- a/source/blender/editors/armature/pose_slide.c +++ b/source/blender/editors/armature/pose_slide.c @@ -873,12 +873,12 @@ static void pose_slide_draw_status(tPoseSlideOp *pso) if (hasNumInput(&pso->num)) { Scene *scene = pso->scene; - char str_offs[NUM_STR_REP_LEN]; + char str_ofs[NUM_STR_REP_LEN]; - outputNumInput(&pso->num, str_offs, &scene->unit); + outputNumInput(&pso->num, str_ofs, &scene->unit); BLI_snprintf( - status_str, sizeof(status_str), "%s: %s | %s", mode_str, str_offs, limits_str); + status_str, sizeof(status_str), "%s: %s | %s", mode_str, str_ofs, limits_str); } else { BLI_snprintf(status_str, diff --git a/source/blender/editors/gpencil/gpencil_interpolate.c b/source/blender/editors/gpencil/gpencil_interpolate.c index 7c541f61d75..3b7c80cee07 100644 --- a/source/blender/editors/gpencil/gpencil_interpolate.c +++ b/source/blender/editors/gpencil/gpencil_interpolate.c @@ -599,10 +599,10 @@ static void gpencil_interpolate_status_indicators(bContext *C, tGPDinterpolate * BLI_strncpy(msg_str, TIP_("GPencil Interpolation: "), UI_MAX_DRAW_STR); if (hasNumInput(&p->num)) { - char str_offs[NUM_STR_REP_LEN]; + char str_ofs[NUM_STR_REP_LEN]; - outputNumInput(&p->num, str_offs, &scene->unit); - BLI_snprintf(status_str, sizeof(status_str), "%s%s", msg_str, str_offs); + outputNumInput(&p->num, str_ofs, &scene->unit); + BLI_snprintf(status_str, sizeof(status_str), "%s%s", msg_str, str_ofs); } else { BLI_snprintf(status_str, diff --git a/source/blender/editors/gpencil/gpencil_primitive.c b/source/blender/editors/gpencil/gpencil_primitive.c index b29ef2e7ee2..dfff0ce639e 100644 --- a/source/blender/editors/gpencil/gpencil_primitive.c +++ b/source/blender/editors/gpencil/gpencil_primitive.c @@ -466,10 +466,10 @@ static void gpencil_primitive_status_indicators(bContext *C, tGPDprimitive *tgpi GP_STROKE_BOX, GP_STROKE_POLYLINE)) { if (hasNumInput(&tgpi->num)) { - char str_offs[NUM_STR_REP_LEN]; + char str_ofs[NUM_STR_REP_LEN]; - outputNumInput(&tgpi->num, str_offs, &scene->unit); - BLI_snprintf(status_str, sizeof(status_str), "%s: %s", msg_str, str_offs); + outputNumInput(&tgpi->num, str_ofs, &scene->unit); + BLI_snprintf(status_str, sizeof(status_str), "%s: %s", msg_str, str_ofs); } else { if (tgpi->flag == IN_PROGRESS) { diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 042f10ddded..834be49b2b3 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -5246,8 +5246,8 @@ static bool ui_numedit_but_SLI(uiBut *but, (but->softmax - but->softmin + but->a1); } else { - const float offs = (BLI_rctf_size_y(&but->rect) / 2.0f); - cursor_x_range = (BLI_rctf_size_x(&but->rect) - offs); + const float ofs = (BLI_rctf_size_y(&but->rect) / 2.0f); + cursor_x_range = (BLI_rctf_size_x(&but->rect) - ofs); } f = (mx_fl - data->dragstartx) / cursor_x_range + data->dragfstart; diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index 06b87dd857f..1d7d10b6d0c 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -3667,16 +3667,16 @@ static void widget_progressbar( /* round corners */ const float value = but_progressbar->progress; - const float offs = wcol->roundness * BLI_rcti_size_y(&rect_prog); + const float ofs = wcol->roundness * BLI_rcti_size_y(&rect_prog); float w = value * BLI_rcti_size_x(&rect_prog); /* Ensure minimum size. */ - w = MAX2(w, offs); + w = MAX2(w, ofs); rect_bar.xmax = rect_bar.xmin + w; - round_box_edges(&wtb, roundboxalign, &rect_prog, offs); - round_box_edges(&wtb_bar, roundboxalign, &rect_bar, offs); + round_box_edges(&wtb, roundboxalign, &rect_prog, ofs); + round_box_edges(&wtb_bar, roundboxalign, &rect_bar, ofs); wtb.draw_outline = true; widgetbase_draw(&wtb, wcol); @@ -3733,9 +3733,9 @@ static void widget_numslider( widget_init(&wtb1); /* Backdrop first. */ - const float offs = wcol->roundness * BLI_rcti_size_y(rect); - const float toffs = offs * 0.75f; - round_box_edges(&wtb, roundboxalign, rect, offs); + const float ofs = wcol->roundness * BLI_rcti_size_y(rect); + const float toffs = ofs * 0.75f; + round_box_edges(&wtb, roundboxalign, rect, ofs); wtb.draw_outline = false; widgetbase_draw(&wtb, wcol); @@ -3768,13 +3768,13 @@ static void widget_numslider( const float width = (float)BLI_rcti_size_x(rect); factor_ui = factor * width; - if (factor_ui <= offs) { + if (factor_ui <= ofs) { /* Left part only. */ roundboxalign_slider &= ~(UI_CNR_TOP_RIGHT | UI_CNR_BOTTOM_RIGHT); - rect1.xmax = rect1.xmin + offs; - factor_discard = factor_ui / offs; + rect1.xmax = rect1.xmin + ofs; + factor_discard = factor_ui / ofs; } - else if (factor_ui <= width - offs) { + else if (factor_ui <= width - ofs) { /* Left part + middle part. */ roundboxalign_slider &= ~(UI_CNR_TOP_RIGHT | UI_CNR_BOTTOM_RIGHT); rect1.xmax = rect1.xmin + factor_ui; @@ -3784,7 +3784,7 @@ static void widget_numslider( factor_discard = factor; } - round_box_edges(&wtb1, roundboxalign_slider, &rect1, offs); + round_box_edges(&wtb1, roundboxalign_slider, &rect1, ofs); wtb1.draw_outline = false; widgetbase_set_uniform_discard_factor(&wtb1, factor_discard); widgetbase_draw(&wtb1, wcol); diff --git a/source/blender/editors/space_graph/graph_slider_ops.c b/source/blender/editors/space_graph/graph_slider_ops.c index 3e52dc7377b..4174e1c63ae 100644 --- a/source/blender/editors/space_graph/graph_slider_ops.c +++ b/source/blender/editors/space_graph/graph_slider_ops.c @@ -187,11 +187,11 @@ static void decimate_draw_status_header(wmOperator *op, tDecimateGraphOp *dgo) strcpy(mode_str, TIP_("Decimate Keyframes")); if (hasNumInput(&dgo->num)) { - char str_offs[NUM_STR_REP_LEN]; + char str_ofs[NUM_STR_REP_LEN]; - outputNumInput(&dgo->num, str_offs, &dgo->scene->unit); + outputNumInput(&dgo->num, str_ofs, &dgo->scene->unit); - BLI_snprintf(status_str, sizeof(status_str), "%s: %s", mode_str, str_offs); + BLI_snprintf(status_str, sizeof(status_str), "%s: %s", mode_str, str_ofs); } else { float percentage = RNA_property_float_get(op->ptr, dgo->percentage_prop); diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index 9828368ccf7..31d3d0bc1bc 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -2112,7 +2112,7 @@ static void seq_draw_sfra_efra(Scene *scene, View2D *v2d) typedef struct CacheDrawData { struct View2D *v2d; - float stripe_offs; + float stripe_ofs_y; float stripe_ht; int cache_flag; GPUVertBuf *raw_vbo; @@ -2151,7 +2151,7 @@ static bool draw_cache_view_iter_fn(void *userdata, { CacheDrawData *drawdata = userdata; struct View2D *v2d = drawdata->v2d; - float stripe_bot, stripe_top, stripe_offs, stripe_ht; + float stripe_bot, stripe_top, stripe_ofs_y, stripe_ht; GPUVertBuf *vbo; size_t *vert_count; @@ -2164,27 +2164,27 @@ static bool draw_cache_view_iter_fn(void *userdata, vert_count = &drawdata->final_out_vert_count; } else if ((cache_type & SEQ_CACHE_STORE_RAW) && (drawdata->cache_flag & SEQ_CACHE_VIEW_RAW)) { - stripe_offs = drawdata->stripe_offs; + stripe_ofs_y = drawdata->stripe_ofs_y; stripe_ht = drawdata->stripe_ht; - stripe_bot = seq->machine + SEQ_STRIP_OFSBOTTOM + stripe_offs; + stripe_bot = seq->machine + SEQ_STRIP_OFSBOTTOM + stripe_ofs_y; stripe_top = stripe_bot + stripe_ht; vbo = drawdata->raw_vbo; vert_count = &drawdata->raw_vert_count; } else if ((cache_type & SEQ_CACHE_STORE_PREPROCESSED) && (drawdata->cache_flag & SEQ_CACHE_VIEW_PREPROCESSED)) { - stripe_offs = drawdata->stripe_offs; + stripe_ofs_y = drawdata->stripe_ofs_y; stripe_ht = drawdata->stripe_ht; - stripe_bot = seq->machine + SEQ_STRIP_OFSBOTTOM + (stripe_offs + stripe_ht) + stripe_offs; + stripe_bot = seq->machine + SEQ_STRIP_OFSBOTTOM + (stripe_ofs_y + stripe_ht) + stripe_ofs_y; stripe_top = stripe_bot + stripe_ht; vbo = drawdata->preprocessed_vbo; vert_count = &drawdata->preprocessed_vert_count; } else if ((cache_type & SEQ_CACHE_STORE_COMPOSITE) && (drawdata->cache_flag & SEQ_CACHE_VIEW_COMPOSITE)) { - stripe_offs = drawdata->stripe_offs; + stripe_ofs_y = drawdata->stripe_ofs_y; stripe_ht = drawdata->stripe_ht; - stripe_top = seq->machine + SEQ_STRIP_OFSTOP - stripe_offs; + stripe_top = seq->machine + SEQ_STRIP_OFSTOP - stripe_ofs_y; stripe_bot = stripe_top - stripe_ht; vbo = drawdata->composite_vbo; vert_count = &drawdata->composite_vert_count; @@ -2237,12 +2237,12 @@ static void draw_cache_view(const bContext *C) immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); float stripe_bot, stripe_top; - float stripe_offs = UI_view2d_region_to_view_y(v2d, 1.0f) - v2d->cur.ymin; + float stripe_ofs_y = UI_view2d_region_to_view_y(v2d, 1.0f) - v2d->cur.ymin; float stripe_ht = UI_view2d_region_to_view_y(v2d, 4.0f * UI_DPI_FAC * U.pixelsize) - v2d->cur.ymin; CLAMP_MAX(stripe_ht, 0.2f); - CLAMP_MIN(stripe_offs, stripe_ht / 2); + CLAMP_MIN(stripe_ofs_y, stripe_ht / 2); if (scene->ed->cache_flag & SEQ_CACHE_VIEW_FINAL_OUT) { stripe_bot = UI_view2d_region_to_view_y(v2d, V2D_SCROLL_HANDLE_HEIGHT); @@ -2262,7 +2262,7 @@ static void draw_cache_view(const bContext *C) continue; } - stripe_bot = seq->machine + SEQ_STRIP_OFSBOTTOM + stripe_offs; + stripe_bot = seq->machine + SEQ_STRIP_OFSBOTTOM + stripe_ofs_y; stripe_top = stripe_bot + stripe_ht; if (scene->ed->cache_flag & SEQ_CACHE_VIEW_RAW) { @@ -2271,7 +2271,7 @@ static void draw_cache_view(const bContext *C) immRectf(pos, seq->startdisp, stripe_bot, seq->enddisp, stripe_top); } - stripe_bot += stripe_ht + stripe_offs; + stripe_bot += stripe_ht + stripe_ofs_y; stripe_top = stripe_bot + stripe_ht; if (scene->ed->cache_flag & SEQ_CACHE_VIEW_PREPROCESSED) { @@ -2280,7 +2280,7 @@ static void draw_cache_view(const bContext *C) immRectf(pos, seq->startdisp, stripe_bot, seq->enddisp, stripe_top); } - stripe_top = seq->machine + SEQ_STRIP_OFSTOP - stripe_offs; + stripe_top = seq->machine + SEQ_STRIP_OFSTOP - stripe_ofs_y; stripe_bot = stripe_top - stripe_ht; if (scene->ed->cache_flag & SEQ_CACHE_VIEW_COMPOSITE) { @@ -2297,7 +2297,7 @@ static void draw_cache_view(const bContext *C) CacheDrawData userdata; userdata.v2d = v2d; - userdata.stripe_offs = stripe_offs; + userdata.stripe_ofs_y = stripe_ofs_y; userdata.stripe_ht = stripe_ht; userdata.cache_flag = scene->ed->cache_flag; userdata.raw_vert_count = 0; diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index 0605ea30806..7dc4a72e510 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -1673,8 +1673,8 @@ static int selectbuffer_ret_hits_15(uint *UNUSED(buffer), const int hits15) static int selectbuffer_ret_hits_9(uint *buffer, const int hits15, const int hits9) { - const int offs = 4 * hits15; - memcpy(buffer, buffer + offs, 4 * hits9 * sizeof(uint)); + const int ofs = 4 * hits15; + memcpy(buffer, buffer + ofs, 4 * hits9 * sizeof(uint)); return hits9; } @@ -1683,8 +1683,8 @@ static int selectbuffer_ret_hits_5(uint *buffer, const int hits9, const int hits5) { - const int offs = 4 * hits15 + 4 * hits9; - memcpy(buffer, buffer + offs, 4 * hits5 * sizeof(uint)); + const int ofs = 4 * hits15 + 4 * hits9; + memcpy(buffer, buffer + ofs, 4 * hits5 * sizeof(uint)); return hits5; } @@ -1726,30 +1726,30 @@ static int mixed_bones_object_selectbuffer(ViewContext *vc, goto finally; } else if (hits15 > 0) { - int offs; + int ofs; has_bones15 = selectbuffer_has_bones(buffer, hits15); - offs = 4 * hits15; + ofs = 4 * hits15; BLI_rcti_init_pt_radius(&rect, mval, 9); hits9 = view3d_opengl_select( - vc, buffer + offs, MAXPICKBUF - offs, &rect, select_mode, select_filter); + vc, buffer + ofs, MAXPICKBUF - ofs, &rect, select_mode, select_filter); if (hits9 == 1) { hits = selectbuffer_ret_hits_9(buffer, hits15, hits9); goto finally; } else if (hits9 > 0) { - has_bones9 = selectbuffer_has_bones(buffer + offs, hits9); + has_bones9 = selectbuffer_has_bones(buffer + ofs, hits9); - offs += 4 * hits9; + ofs += 4 * hits9; BLI_rcti_init_pt_radius(&rect, mval, 5); hits5 = view3d_opengl_select( - vc, buffer + offs, MAXPICKBUF - offs, &rect, select_mode, select_filter); + vc, buffer + ofs, MAXPICKBUF - ofs, &rect, select_mode, select_filter); if (hits5 == 1) { hits = selectbuffer_ret_hits_5(buffer, hits15, hits9, hits5); goto finally; } else if (hits5 > 0) { - has_bones5 = selectbuffer_has_bones(buffer + offs, hits5); + has_bones5 = selectbuffer_has_bones(buffer + ofs, hits5); } } |