[Bf-blender-cvs] [a527bd5f48a] temp_bmesh_multires: Get rid of various __attribute__((optnone)) I had scattered throughout the code
Joseph Eagar
noreply at git.blender.org
Mon Apr 12 04:29:38 CEST 2021
Commit: a527bd5f48afdbcd46e9c84cb9b8c0b1ec3f3295
Author: Joseph Eagar
Date: Sun Apr 11 19:29:06 2021 -0700
Branches: temp_bmesh_multires
https://developer.blender.org/rBa527bd5f48afdbcd46e9c84cb9b8c0b1ec3f3295
Get rid of various __attribute__((optnone)) I had scattered throughout
the code
===================================================================
M source/blender/blenkernel/intern/brush.c
M source/blender/blenkernel/intern/customdata.c
M source/blender/blenkernel/intern/pbvh_bmesh.c
M source/blender/bmesh/intern/bmesh_log.c
===================================================================
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c
index d28c6b4d295..8388ac191b7 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -1778,6 +1778,8 @@ void BKE_brush_sculpt_reset(Brush *br)
case SCULPT_TOOL_SNAKE_HOOK:
br->alpha = 1.0f;
br->rake_factor = 1.0f;
+ br->dyntopo.inherit = DYNTOPO_INHERIT_BITMASK & ~(DYNTOPO_INHERIT_ALL | DYNTOPO_COLLAPSE);
+ br->dyntopo.flag |= DYNTOPO_COLLAPSE;
break;
case SCULPT_TOOL_THUMB:
br->size = 75;
@@ -1891,7 +1893,7 @@ void BKE_brush_sculpt_reset(Brush *br)
}
if (disable_dyntopo) {
- //disabled flag is never inherited
+ // disabled flag is never inherited
br->dyntopo.flag |= DYNTOPO_DISABLED;
}
@@ -1951,8 +1953,9 @@ void BKE_brush_sculpt_reset(Brush *br)
break;
case SCULPT_TOOL_SIMPLIFY:
- br->dyntopo.inherit = ((1<<17)-1) & ~(DYNTOPO_INHERIT_ALL|DYNTOPO_SUBDIVIDE|DYNTOPO_COLLAPSE);
- br->dyntopo.flag |= DYNTOPO_COLLAPSE|DYNTOPO_SUBDIVIDE;
+ br->dyntopo.inherit = DYNTOPO_INHERIT_BITMASK &
+ ~(DYNTOPO_INHERIT_ALL | DYNTOPO_SUBDIVIDE | DYNTOPO_COLLAPSE);
+ br->dyntopo.flag |= DYNTOPO_COLLAPSE | DYNTOPO_SUBDIVIDE;
br->autosmooth_factor = 0.02;
case SCULPT_TOOL_VCOL_BOUNDARY:
case SCULPT_TOOL_PAINT:
@@ -2597,10 +2600,10 @@ void BKE_brush_get_dyntopo(Brush *brush, Sculpt *sd, DynTopoSettings *out)
// detect unconverted file data
if (!out->inherit && !out->detail_range) {
- //reload default dyntopo settings
+ // reload default dyntopo settings
Brush brush2 = *brush;
- //don't copy heap allocd data
+ // don't copy heap allocd data
brush2.curve = NULL;
brush2.icon_imbuf = NULL;
brush2.gpencil_settings = NULL;
@@ -2611,7 +2614,7 @@ void BKE_brush_get_dyntopo(Brush *brush, Sculpt *sd, DynTopoSettings *out)
brush->dyntopo = *out = brush2.dyntopo;
- brush_free_data((ID*)&brush2);
+ brush_free_data((ID *)&brush2);
}
int inherit = out->inherit;
diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c
index c39082dbf46..54d7960e9b9 100644
--- a/source/blender/blenkernel/intern/customdata.c
+++ b/source/blender/blenkernel/intern/customdata.c
@@ -3818,7 +3818,7 @@ void CustomData_bmesh_set_default(CustomData *data, void **block)
}
}
-__attribute__((optnone)) void CustomData_bmesh_swap_data(CustomData *source,
+void CustomData_bmesh_swap_data(CustomData *source,
CustomData *dest,
void *src_block,
void **dest_block)
@@ -3882,7 +3882,7 @@ __attribute__((optnone)) void CustomData_bmesh_swap_data(CustomData *source,
}
}
-__attribute__ ((optnone)) void CustomData_bmesh_copy_data_exclude_by_type(const CustomData *source,
+void CustomData_bmesh_copy_data_exclude_by_type(const CustomData *source,
CustomData *dest,
void *src_block,
void **dest_block,
diff --git a/source/blender/blenkernel/intern/pbvh_bmesh.c b/source/blender/blenkernel/intern/pbvh_bmesh.c
index 4f5bc93923c..5f159a2916f 100644
--- a/source/blender/blenkernel/intern/pbvh_bmesh.c
+++ b/source/blender/blenkernel/intern/pbvh_bmesh.c
@@ -3275,7 +3275,7 @@ bool BKE_pbvh_bmesh_update_topology_nodes(PBVH *pbvh,
return modified;
}
-__attribute__((optnone)) static bool cleanup_valence_3_4(PBVH *pbvh,
+static bool cleanup_valence_3_4(PBVH *pbvh,
const float center[3],
const float view_normal[3],
float radius,
diff --git a/source/blender/bmesh/intern/bmesh_log.c b/source/blender/bmesh/intern/bmesh_log.c
index e6e1be15804..edfbab1d18c 100644
--- a/source/blender/bmesh/intern/bmesh_log.c
+++ b/source/blender/bmesh/intern/bmesh_log.c
@@ -257,7 +257,7 @@ static BMFace *bm_log_face_from_id(BMLog *log, uint id)
/************************ BMLogVert / BMLogFace ***********************/
-__attribute__((optnone)) static void bm_log_vert_customdata(
+static void bm_log_vert_customdata(
BMesh *bm, BMLog *log, BMLogEntry *entry, BMVert *v, BMLogVert *lv)
{
#ifdef CUSTOMDATA
@@ -329,12 +329,12 @@ static void vert_mask_set(BMVert *v, const float new_mask, const int cd_vert_mas
}
/* Update a BMLogVert with data from a BMVert */
-__attribute__((optnone)) static void bm_log_vert_bmvert_copy(BMLog *log,
- BMLog *entry,
- BMLogVert *lv,
- BMVert *v,
- const int cd_vert_mask_offset,
- bool copy_customdata)
+static void bm_log_vert_bmvert_copy(BMLog *log,
+ BMLog *entry,
+ BMLogVert *lv,
+ BMVert *v,
+ const int cd_vert_mask_offset,
+ bool copy_customdata)
{
copy_v3_v3(lv->co, v->co);
normal_float_to_short_v3(lv->no, v->no);
@@ -384,10 +384,7 @@ static BMLogFace *bm_log_face_alloc(BMLog *log, BMFace *f)
/************************ Helpers for undo/redo ***********************/
-__attribute__((optnone)) static void bm_log_verts_unmake(BMesh *bm,
- BMLog *log,
- GHash *verts,
- BMLogEntry *entry)
+static void bm_log_verts_unmake(BMesh *bm, BMLog *log, GHash *verts, BMLogEntry *entry)
{
const int cd_vert_mask_offset = CustomData_get_offset(&bm->vdata, CD_PAINT_MASK);
@@ -438,10 +435,7 @@ static void bm_log_faces_unmake(BMesh *bm, BMLog *log, GHash *faces, BMLogEntry
}
}
-__attribute__((optnone)) static void bm_log_verts_restore(BMesh *bm,
- BMLog *log,
- GHash *verts,
- BMLogEntry *entry)
+static void bm_log_verts_restore(BMesh *bm, BMLog *log, GHash *verts, BMLogEntry *entry)
{
const int cd_vert_mask_offset = CustomData_get_offset(&bm->vdata, CD_PAINT_MASK);
@@ -497,10 +491,7 @@ static void bm_log_faces_restore(BMesh *bm, BMLog *log, GHash *faces, BMLogEntry
}
}
-__attribute__((optnone)) static void bm_log_vert_values_swap(BMesh *bm,
- BMLog *log,
- GHash *verts,
- BMLogEntry *entry)
+static void bm_log_vert_values_swap(BMesh *bm, BMLog *log, GHash *verts, BMLogEntry *entry)
{
const int cd_vert_mask_offset = CustomData_get_offset(&bm->vdata, CD_PAINT_MASK);
@@ -1062,7 +1053,8 @@ static void bm_log_undo_intern(BMesh *bm, BMLog *log, BMLogEntry *entry)
bm_log_face_values_swap(log, entry->modified_faces, entry);
}
-void BM_log_undo(BMesh *bm, BMLog *log) {
+void BM_log_undo(BMesh *bm, BMLog *log)
+{
BMLogEntry *entry = log->current_entry;
log->bm = bm;
@@ -1249,9 +1241,7 @@ void BM_log_face_added(BMLog *log, BMFace *f)
* If there's a move record for the vertex, that's used as the
* vertices original location, then the move record is deleted.
*/
-__attribute__((optnone)) void BM_log_vert_removed(BMLog *log,
- BMVert *v,
- const int cd_vert_mask_offset)
+void BM_log_vert_removed(BMLog *log, BMVert *v, const int cd_vert_mask_offset)
{
BMLogEntry *entry = log->current_entry;
uint v_id = bm_log_vert_id_get(log, v);
More information about the Bf-blender-cvs
mailing list