diff --git a/intern/rigidbody/RBI_api.h b/intern/rigidbody/RBI_api.h index 570b0de6f31..7273a517490 100644 --- a/intern/rigidbody/RBI_api.h +++ b/intern/rigidbody/RBI_api.h @@ -261,7 +261,7 @@ void RB_dworld_add_constraint(rbDynamicsWorld *world, rbConstraint *con, int dis /* Remove Rigid Body Constraint from simulation world */ void RB_dworld_remove_constraint(rbDynamicsWorld *world, rbConstraint *con); -rbConstraint *RB_constraint_new_point(float pivot[3], rbRigidBody *rb1, rbRigidBody *rb2); +rbConstraint *RB_constraint_new_point(const float pivot[3], rbRigidBody *rb1, rbRigidBody *rb2); rbConstraint *RB_constraint_new_fixed(float pivot[3], float orn[4], rbRigidBody *rb1, diff --git a/intern/rigidbody/rb_bullet_api.cpp b/intern/rigidbody/rb_bullet_api.cpp index 835707fdb6a..00cc0f83b82 100644 --- a/intern/rigidbody/rb_bullet_api.cpp +++ b/intern/rigidbody/rb_bullet_api.cpp @@ -940,8 +940,8 @@ static void make_constraint_transforms(btTransform &transform1, btTransform &transform2, btRigidBody *body1, btRigidBody *body2, - float pivot[3], - float orn[4]) + const float pivot[3], + const float orn[4]) { btTransform pivot_transform = btTransform(); pivot_transform.setIdentity(); @@ -952,7 +952,7 @@ static void make_constraint_transforms(btTransform &transform1, transform2 = body2->getWorldTransform().inverse() * pivot_transform; } -rbConstraint *RB_constraint_new_point(float pivot[3], rbRigidBody *rb1, rbRigidBody *rb2) +rbConstraint *RB_constraint_new_point(const float pivot[3], rbRigidBody *rb1, rbRigidBody *rb2) { btRigidBody *body1 = rb1->body; btRigidBody *body2 = rb2->body; diff --git a/source/blender/blenkernel/intern/subdiv_ccg.cc b/source/blender/blenkernel/intern/subdiv_ccg.cc index c45cf0e8811..6bba5465ea1 100644 --- a/source/blender/blenkernel/intern/subdiv_ccg.cc +++ b/source/blender/blenkernel/intern/subdiv_ccg.cc @@ -116,7 +116,7 @@ static void subdiv_ccg_init_layers(SubdivCCG &subdiv_ccg, const SubdivToCCGSetti } /* TODO(sergey): Make it more accessible function. */ -static int topology_refiner_count_face_corners(OpenSubdiv_TopologyRefiner *topology_refiner) +static int topology_refiner_count_face_corners(const OpenSubdiv_TopologyRefiner *topology_refiner) { const int num_faces = topology_refiner->getNumFaces(); int num_corners = 0; @@ -130,7 +130,7 @@ static int topology_refiner_count_face_corners(OpenSubdiv_TopologyRefiner *topol * function. */ static void subdiv_ccg_alloc_elements(SubdivCCG &subdiv_ccg, Subdiv &subdiv) { - OpenSubdiv_TopologyRefiner *topology_refiner = subdiv.topology_refiner; + const OpenSubdiv_TopologyRefiner *topology_refiner = subdiv.topology_refiner; const int64_t element_size = element_size_bytes_get(subdiv_ccg); /* Allocate memory for surface grids. */ const int64_t num_grids = topology_refiner_count_face_corners(topology_refiner); @@ -268,7 +268,7 @@ static bool subdiv_ccg_evaluate_grids(SubdivCCG &subdiv_ccg, SubdivCCGMaskEvaluator *mask_evaluator) { using namespace blender; - OpenSubdiv_TopologyRefiner *topology_refiner = subdiv.topology_refiner; + const OpenSubdiv_TopologyRefiner *topology_refiner = subdiv.topology_refiner; const int num_faces = topology_refiner->getNumFaces(); const Span face_ptex_offset(face_ptex_offset_get(&subdiv), subdiv_ccg.faces.size()); threading::parallel_for(IndexRange(num_faces), 1024, [&](const IndexRange range) { @@ -939,7 +939,7 @@ static void subdiv_ccg_affected_face_adjacency(SubdivCCG &subdiv_ccg, blender::Set &adjacent_edges) { Subdiv *subdiv = subdiv_ccg.subdiv; - OpenSubdiv_TopologyRefiner *topology_refiner = subdiv->topology_refiner; + const OpenSubdiv_TopologyRefiner *topology_refiner = subdiv->topology_refiner; Vector face_vertices; Vector face_edges; @@ -1196,7 +1196,7 @@ static int adjacent_vertex_index_from_coord(const SubdivCCG &subdiv_ccg, const SubdivCCGCoord &coord) { Subdiv *subdiv = subdiv_ccg.subdiv; - OpenSubdiv_TopologyRefiner *topology_refiner = subdiv->topology_refiner; + const OpenSubdiv_TopologyRefiner *topology_refiner = subdiv->topology_refiner; const int face_index = subdiv_ccg.grid_to_face_map[coord.grid_index]; const IndexRange face = subdiv_ccg.faces[face_index]; @@ -1217,7 +1217,7 @@ static void neighbor_coords_corner_vertex_get(const SubdivCCG &subdiv_ccg, SubdivCCGNeighbors &r_neighbors) { Subdiv *subdiv = subdiv_ccg.subdiv; - OpenSubdiv_TopologyRefiner *topology_refiner = subdiv->topology_refiner; + const OpenSubdiv_TopologyRefiner *topology_refiner = subdiv->topology_refiner; const int adjacent_vertex_index = adjacent_vertex_index_from_coord(subdiv_ccg, coord); const int num_vertex_edges = topology_refiner->getNumVertexEdges(adjacent_vertex_index); @@ -1271,7 +1271,7 @@ static void neighbor_coords_corner_vertex_get(const SubdivCCG &subdiv_ccg, static int adjacent_edge_index_from_coord(const SubdivCCG &subdiv_ccg, const SubdivCCGCoord &coord) { Subdiv *subdiv = subdiv_ccg.subdiv; - OpenSubdiv_TopologyRefiner *topology_refiner = subdiv->topology_refiner; + const OpenSubdiv_TopologyRefiner *topology_refiner = subdiv->topology_refiner; const int face_index = subdiv_ccg.grid_to_face_map[coord.grid_index]; const IndexRange face = subdiv_ccg.faces[face_index]; @@ -1299,7 +1299,7 @@ static int adjacent_edge_point_index_from_coord(const SubdivCCG &subdiv_ccg, const int adjacent_edge_index) { Subdiv *subdiv = subdiv_ccg.subdiv; - OpenSubdiv_TopologyRefiner *topology_refiner = subdiv->topology_refiner; + const OpenSubdiv_TopologyRefiner *topology_refiner = subdiv->topology_refiner; const int adjacent_vertex_index = adjacent_vertex_index_from_coord(subdiv_ccg, coord); int edge_vertices_indices[2]; @@ -1398,7 +1398,7 @@ static void neighbor_coords_edge_get(const SubdivCCG &subdiv_ccg, int duplicate_i = num_adjacent_faces; for (int i = 0; i < num_adjacent_faces; ++i) { - SubdivCCGCoord *boundary_coords = adjacent_edge->boundary_coords[i]; + const SubdivCCGCoord *boundary_coords = adjacent_edge->boundary_coords[i]; /* One step into the grid from the edge for each adjacent face. */ SubdivCCGCoord grid_coord = boundary_coords[point_index]; r_neighbors.coords[i + 2] = coord_step_inside_from_boundary(subdiv_ccg, grid_coord); diff --git a/source/blender/blenkernel/intern/subdiv_topology.cc b/source/blender/blenkernel/intern/subdiv_topology.cc index 7705ac5e1dd..563a7d912bb 100644 --- a/source/blender/blenkernel/intern/subdiv_topology.cc +++ b/source/blender/blenkernel/intern/subdiv_topology.cc @@ -19,7 +19,7 @@ namespace blender::bke::subdiv { int topology_num_fvar_layers_get(const Subdiv *subdiv) { #ifdef WITH_OPENSUBDIV - OpenSubdiv_TopologyRefiner *topology_refiner = subdiv->topology_refiner; + const OpenSubdiv_TopologyRefiner *topology_refiner = subdiv->topology_refiner; return topology_refiner->getNumFVarChannels(); #else UNUSED_VARS(subdiv); diff --git a/source/blender/blenlib/BLI_expr_pylike_eval.h b/source/blender/blenlib/BLI_expr_pylike_eval.h index 1fd6fcdd85f..35aca54b389 100644 --- a/source/blender/blenlib/BLI_expr_pylike_eval.h +++ b/source/blender/blenlib/BLI_expr_pylike_eval.h @@ -33,15 +33,15 @@ void BLI_expr_pylike_free(struct ExprPyLike_Parsed *expr); /** * Check if the parsing result is valid for evaluation. */ -bool BLI_expr_pylike_is_valid(struct ExprPyLike_Parsed *expr); +bool BLI_expr_pylike_is_valid(const struct ExprPyLike_Parsed *expr); /** * Check if the parsed expression always evaluates to the same value. */ -bool BLI_expr_pylike_is_constant(struct ExprPyLike_Parsed *expr); +bool BLI_expr_pylike_is_constant(const struct ExprPyLike_Parsed *expr); /** * Check if the parsed expression uses the parameter with the given index. */ -bool BLI_expr_pylike_is_using_param(struct ExprPyLike_Parsed *expr, int index); +bool BLI_expr_pylike_is_using_param(const struct ExprPyLike_Parsed *expr, int index); /** * Compile the expression and return the result. * diff --git a/source/blender/blenlib/intern/expr_pylike_eval.c b/source/blender/blenlib/intern/expr_pylike_eval.c index 2938f499768..69837eaac35 100644 --- a/source/blender/blenlib/intern/expr_pylike_eval.c +++ b/source/blender/blenlib/intern/expr_pylike_eval.c @@ -116,17 +116,17 @@ void BLI_expr_pylike_free(ExprPyLike_Parsed *expr) } } -bool BLI_expr_pylike_is_valid(ExprPyLike_Parsed *expr) +bool BLI_expr_pylike_is_valid(const ExprPyLike_Parsed *expr) { return expr != NULL && expr->ops_count > 0; } -bool BLI_expr_pylike_is_constant(ExprPyLike_Parsed *expr) +bool BLI_expr_pylike_is_constant(const ExprPyLike_Parsed *expr) { return expr != NULL && expr->ops_count == 1 && expr->ops[0].opcode == OPCODE_CONST; } -bool BLI_expr_pylike_is_using_param(ExprPyLike_Parsed *expr, int index) +bool BLI_expr_pylike_is_using_param(const ExprPyLike_Parsed *expr, int index) { int i; diff --git a/source/blender/windowmanager/intern/wm_gesture.cc b/source/blender/windowmanager/intern/wm_gesture.cc index 29bdcee9cb9..9108355ba99 100644 --- a/source/blender/windowmanager/intern/wm_gesture.cc +++ b/source/blender/windowmanager/intern/wm_gesture.cc @@ -201,7 +201,7 @@ static void wm_gesture_draw_line(wmGesture *gt) static void wm_gesture_draw_rect(wmGesture *gt) { - rcti *rect = (rcti *)gt->customdata; + const rcti *rect = static_cast(gt->customdata); uint shdr_pos = GPU_vertformat_attr_add( immVertexFormat(), "pos", GPU_COMP_I32, 2, GPU_FETCH_INT_TO_FLOAT); @@ -242,7 +242,7 @@ static void wm_gesture_draw_rect(wmGesture *gt) static void wm_gesture_draw_circle(wmGesture *gt) { - rcti *rect = (rcti *)gt->customdata; + const rcti *rect = static_cast(gt->customdata); GPU_blend(GPU_BLEND_ALPHA); @@ -384,7 +384,7 @@ static void wm_gesture_draw_lasso(wmGesture *gt, bool filled) static void wm_gesture_draw_cross(wmWindow *win, wmGesture *gt) { - rcti *rect = (rcti *)gt->customdata; + const rcti *rect = static_cast(gt->customdata); const int winsize_x = WM_window_pixels_x(win); const int winsize_y = WM_window_pixels_y(win); diff --git a/source/blender/windowmanager/intern/wm_gesture_ops.cc b/source/blender/windowmanager/intern/wm_gesture_ops.cc index 65d057ce579..6c0fc8fe6fb 100644 --- a/source/blender/windowmanager/intern/wm_gesture_ops.cc +++ b/source/blender/windowmanager/intern/wm_gesture_ops.cc @@ -127,7 +127,7 @@ static int UNUSED_FUNCTION(gesture_modal_state_from_operator)(wmOperator *op) static bool gesture_box_apply_rect(wmOperator *op) { wmGesture *gesture = static_cast(op->customdata); - rcti *rect = static_cast(gesture->customdata); + const rcti *rect = static_cast(gesture->customdata); if (rect->xmin == rect->xmax || rect->ymin == rect->ymax) { return false; @@ -319,7 +319,7 @@ int WM_gesture_circle_invoke(bContext *C, wmOperator *op, const wmEvent *event) static void gesture_circle_apply(bContext *C, wmOperator *op) { wmGesture *gesture = static_cast(op->customdata); - rcti *rect = static_cast(gesture->customdata); + const rcti *rect = static_cast(gesture->customdata); if (gesture->wait_for_input && (gesture->modal_state == GESTURE_MODAL_NOP)) { return; @@ -710,7 +710,7 @@ void WM_OT_lasso_gesture(wmOperatorType *ot) static bool gesture_straightline_apply(bContext *C, wmOperator *op) { wmGesture *gesture = static_cast(op->customdata); - rcti *rect = static_cast(gesture->customdata); + const rcti *rect = static_cast(gesture->customdata); if (rect->xmin == rect->xmax && rect->ymin == rect->ymax) { return false;