Cleanup: format

This commit is contained in:
2023-02-26 11:55:22 +13:00
parent 52ded6ab56
commit 86ceb6722f
12 changed files with 40 additions and 41 deletions

View File

@@ -15,7 +15,6 @@
#include "BLI_path_util.h"
#include "BLI_string.h"
/* Extended file attribute used by OneDrive to mark placeholder files. */
static const char *ONEDRIVE_RECALLONOPEN_ATTRIBUTE = "com.microsoft.OneDrive.RecallOnOpen";
@@ -188,7 +187,8 @@ const char *BLI_expand_tilde(const char *path_with_tilde)
return path_expanded;
}
char *BLI_current_working_dir(char *dir, const size_t maxncpy) {
char *BLI_current_working_dir(char *dir, const size_t maxncpy)
{
/* Can't just copy to the *dir pointer, as [path getCString gets grumpy.*/
static char path_expanded[PATH_MAX];
@autoreleasepool {
@@ -200,10 +200,11 @@ char *BLI_current_working_dir(char *dir, const size_t maxncpy) {
}
}
bool BLI_change_working_dir(const char* dir) {
bool BLI_change_working_dir(const char *dir)
{
@autoreleasepool {
NSString* path = [[NSString alloc] initWithUTF8String: dir];
if ([[NSFileManager defaultManager] changeCurrentDirectoryPath: path] == YES) {
NSString *path = [[NSString alloc] initWithUTF8String:dir];
if ([[NSFileManager defaultManager] changeCurrentDirectoryPath:path] == YES) {
return true;
}
else {

View File

@@ -89,7 +89,7 @@ TEST_F(ChangeWorkingDirectoryTest, change_working_directory)
* picks the true var folder, not the alias, meaning the below
* comparison always fails unless we prepend with the correct value. */
test_temp_dir = "/private" + test_temp_dir;
#endif // #ifdef __APPLE__
#endif // #ifdef __APPLE__
ASSERT_EQ(BLI_path_cmp_normalized(cwd, test_temp_dir.c_str()), 0)
<< "the path of the current working directory should equal the path of the temporary "

View File

@@ -117,10 +117,10 @@ void OVERLAY_edit_uv_init(OVERLAY_Data *vedata)
const bool show_modified_uvs = sima->flag & SI_DRAWSHADOW;
const bool is_tiled_image = image && (image->source == IMA_SRC_TILED);
const bool do_edges_only = (ts->uv_flag & UV_SYNC_SELECTION) ?
/* NOTE: Ignore #SCE_SELECT_EDGE because a single selected edge
* on the mesh may cause single UV vertices to be selected. */
false :
(ts->uv_selectmode == UV_SELECT_EDGE);
/* NOTE: Ignore #SCE_SELECT_EDGE because a single selected edge
* on the mesh may cause single UV vertices to be selected. */
false :
(ts->uv_selectmode == UV_SELECT_EDGE);
const bool do_faces = ((sima->flag & SI_NO_DRAWFACES) == 0);
const bool do_face_dots = (ts->uv_flag & UV_SYNC_SELECTION) ?
(ts->selectmode & SCE_SELECT_FACE) != 0 :

View File

@@ -9657,7 +9657,7 @@ static int ui_handle_viewlist_items_hover(const wmEvent *event, const ARegion *r
bool has_item = false;
LISTBASE_FOREACH (uiBlock *, block, &region->uiblocks) {
LISTBASE_FOREACH (uiBut *, but, &block->buttons) {
if (ELEM(but->type, UI_BTYPE_VIEW_ITEM,UI_BTYPE_LISTROW)) {
if (ELEM(but->type, UI_BTYPE_VIEW_ITEM, UI_BTYPE_LISTROW)) {
but->flag &= ~UI_ACTIVE;
has_item = true;
}

View File

@@ -4092,7 +4092,7 @@ static void widget_list_itembut(uiWidgetColors *wcol,
const float rad = widget_radius_from_zoom(zoom, wcol);
round_box_edges(&wtb, UI_CNR_ALL, rect, rad);
if (state->but_flag & UI_ACTIVE && !(state->but_flag & UI_SELECT)) {
if (state->but_flag & UI_ACTIVE && !(state->but_flag & UI_SELECT)) {
copy_v3_v3_uchar(wcol->inner, wcol->text);
wcol->inner[3] = 20;
}

View File

@@ -234,7 +234,6 @@ static void build_poly_connections(blender::AtomicDisjointSet &islands,
/* Polys are connected if they share edges. By connecting all edges of a loop (as long as they
* are not a seam) we can find connected faces. */
threading::parallel_for(polys.index_range(), 1024, [&](const IndexRange range) {
for (const int poly_index : range) {
if (hide_poly[poly_index]) {
continue;
@@ -259,9 +258,7 @@ static void build_poly_connections(blender::AtomicDisjointSet &islands,
islands.join(inner_mloop.e, outer_mloop.e);
}
}
}
});
}

View File

@@ -194,7 +194,8 @@ void USDMeshReader::read_object_data(Main *bmain, const double motionSampleTime)
Mesh *mesh = (Mesh *)object_->data;
is_initial_load_ = true;
const USDMeshReadParams params = create_mesh_read_params(motionSampleTime, import_params_.mesh_read_flag);
const USDMeshReadParams params = create_mesh_read_params(motionSampleTime,
import_params_.mesh_read_flag);
Mesh *read_mesh = this->read_mesh(mesh, params, nullptr);
@@ -850,7 +851,8 @@ Mesh *USDMeshReader::read_mesh(Mesh *existing_mesh,
}
}
read_mesh_sample(&settings, active_mesh, params.motion_sample_time, new_mesh || is_initial_load_);
read_mesh_sample(
&settings, active_mesh, params.motion_sample_time, new_mesh || is_initial_load_);
if (new_mesh) {
/* Here we assume that the number of materials doesn't change, i.e. that
@@ -862,7 +864,8 @@ Mesh *USDMeshReader::read_mesh(Mesh *existing_mesh,
bke::MutableAttributeAccessor attributes = active_mesh->attributes_for_write();
bke::SpanAttributeWriter<int> material_indices =
attributes.lookup_or_add_for_write_span<int>("material_index", ATTR_DOMAIN_FACE);
assign_facesets_to_material_indices(params.motion_sample_time, material_indices.span, &mat_map);
assign_facesets_to_material_indices(
params.motion_sample_time, material_indices.span, &mat_map);
material_indices.finish();
}
}