Cleanup: various non-functional C++ changes

This commit is contained in:
Campbell Barton 2023-08-19 23:44:21 +10:00
parent faa3ef6ad5
commit 5a8cb665e0
21 changed files with 27 additions and 29 deletions

View File

@ -20,7 +20,7 @@ extern "C" {
#include "BLI_strict_flags.h"
#include <string.h>
#include <cstring>
struct Knot {
Knot *next, *prev;

View File

@ -48,7 +48,7 @@
# include "BPY_extern.h"
#endif
#include <string.h>
#include <cstring>
#ifdef WITH_PYTHON
static ThreadMutex python_driver_lock = BLI_MUTEX_INITIALIZER;

View File

@ -6,12 +6,12 @@
* \ingroup bke
*/
#include <cfloat>
#include <climits>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <float.h>
#include "BLI_endian_switch.h"
#include "BLI_listbase.h"

View File

@ -9,7 +9,7 @@
#include "BKE_ocean.h"
#include "ocean_intern.h"
#include <math.h>
#include <cmath>
#ifdef WITH_OCEANSIM

View File

@ -24,7 +24,7 @@
#include "BLO_read_write.h"
#include <string.h>
#include <cstring>
static void speaker_init_data(ID *id)
{

View File

@ -33,7 +33,7 @@
#include "MEM_guardedalloc.h"
#include <string.h>
#include <cstring>
/* Statics */
static ListBase studiolights;

View File

@ -503,7 +503,7 @@ void BLO_blendfiledata_free(BlendFileData *bfd)
MEM_freeN(bfd);
}
void BLO_read_do_version_after_setup(struct Main *new_bmain, struct BlendFileReadReport *reports)
void BLO_read_do_version_after_setup(Main *new_bmain, BlendFileReadReport *reports)
{
do_versions_after_setup(new_bmain, reports);
}

View File

@ -28,7 +28,7 @@
#include "ED_anim_api.hh"
#include <string.h>
#include <cstring>
/* ----------------------- Getter functions ----------------------- */

View File

@ -1170,7 +1170,7 @@ void GRAPH_OT_blend_to_ease(wmOperatorType *ot)
static void match_slope_graph_keys(bAnimContext *ac, const float factor)
{
ListBase anim_data = {NULL, NULL};
ListBase anim_data = {nullptr, nullptr};
bool all_segments_valid = true;
@ -1216,7 +1216,7 @@ static void match_slope_modal_update(bContext *C, wmOperator *op)
reset_bezts(gso);
const float factor = slider_factor_get_and_remember(op);
match_slope_graph_keys(&gso->ac, factor);
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, nullptr);
}
static int match_slope_invoke(bContext *C, wmOperator *op, const wmEvent *event)
@ -1252,7 +1252,7 @@ static int match_slope_exec(bContext *C, wmOperator *op)
match_slope_graph_keys(&ac, factor);
/* Set notifier that keyframes have changed. */
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, nullptr);
return OPERATOR_FINISHED;
}

View File

@ -7,8 +7,8 @@
*/
#include <cfloat>
#include <math.h>
#include <string.h>
#include <cmath>
#include <cstring>
#include "BLI_kdtree.h"
#include "BLI_utildefines.h"

View File

@ -19,7 +19,7 @@
#include "openjpeg.h"
#include <string.h>
#include <cstring>
#define JP2_FILEHEADER_SIZE 12

View File

@ -27,9 +27,9 @@
#include "IMB_metadata.h"
#include "imbuf.h"
#include <cstring>
#include <jerror.h>
#include <jpeglib.h>
#include <string.h>
#include "IMB_colormanagement.h"
#include "IMB_colormanagement_intern.h"

View File

@ -22,7 +22,7 @@
#include "MEM_guardedalloc.h"
#include <string.h>
#include <cstring>
void IMB_blend_color_byte(uchar dst[4],
const uchar src1[4],

View File

@ -941,7 +941,7 @@ void import_mesh_skel_bindings(Main *bmain, Object *mesh_obj, const pxr::UsdPrim
const pxr::TfToken interp = joint_weights_primvar.GetInterpolation();
/* Sanity check: we expect only vertex or constant interpolation. */
if (interp != pxr::UsdGeomTokens->vertex && interp != pxr::UsdGeomTokens->constant) {
if (!ELEM(interp, pxr::UsdGeomTokens->vertex, pxr::UsdGeomTokens->constant)) {
WM_reportf(RPT_WARNING,
"%s: Unexpected joint weights interpolation type %s for prim %s",
__func__,
@ -986,7 +986,7 @@ void import_mesh_skel_bindings(Main *bmain, Object *mesh_obj, const pxr::UsdPrim
return;
}
if (BKE_object_defgroup_data_create(static_cast<ID *>(mesh_obj->data)) == NULL) {
if (BKE_object_defgroup_data_create(static_cast<ID *>(mesh_obj->data)) == nullptr) {
WM_reportf(RPT_WARNING,
"%s: Error creating deform group data for mesh %s",
__func__,

View File

@ -67,10 +67,10 @@ static bool file_older(const char *file1, const char *file2)
}
if (stat(file1, &st1)) {
return 0;
return false;
}
if (stat(file2, &st2)) {
return 0;
return false;
}
return (st1.st_mtime < st2.st_mtime);

View File

@ -5174,7 +5174,7 @@ static void def_sh_tex_noise(StructRNA *srna)
RNA_def_property_update(prop, 0, "rna_ShaderNode_socket_update");
prop = RNA_def_property(srna, "normalize", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "normalize", 0);
RNA_def_property_boolean_sdna(prop, nullptr, "normalize", 0);
RNA_def_property_ui_text(prop, "Normalize", "Normalize outputs to 0.0 to 1.0 range");
RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
}

View File

@ -131,7 +131,7 @@ static void rna_def_usd_hook(BlenderRNA *brna)
///* Properties --------------------- */
RNA_define_verify_sdna(0); /* not in sdna */
RNA_define_verify_sdna(false); /* not in sdna */
prop = RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, nullptr, "idname");

View File

@ -184,9 +184,7 @@ static void node_shader_update_hair_principled(bNodeTree *ntree, bNode *node)
else if (STREQ(sock->name, "Aspect Ratio")) {
bke::nodeSetSocketAvailability(ntree, sock, model == SHD_PRINCIPLED_HAIR_HUANG);
}
else if (STREQ(sock->name, "Reflection") || STREQ(sock->name, "Transmission") ||
STREQ(sock->name, "Secondary Reflection"))
{
else if (STR_ELEM(sock->name, "Reflection", "Transmission", "Secondary Reflection")) {
bke::nodeSetSocketAvailability(ntree, sock, model == SHD_PRINCIPLED_HAIR_HUANG);
}
}

View File

@ -62,7 +62,7 @@ void Render::display_update(RenderResult *render_result, rcti *rect)
}
}
void Render::current_scene_update(struct Scene *scene)
void Render::current_scene_update(Scene *scene)
{
if (current_scene_update_cb) {
current_scene_update_cb(suh, scene);
@ -105,7 +105,7 @@ bool Render::test_break()
return test_break_cb(tbh);
}
bool Render::prepare_viewlayer(struct ViewLayer *view_layer, struct Depsgraph *depsgraph)
bool Render::prepare_viewlayer(ViewLayer *view_layer, Depsgraph *depsgraph)
{
if (!prepare_viewlayer_cb) {
return true;

View File

@ -39,7 +39,7 @@
#include "SEQ_transform.h"
#include "SEQ_utils.h"
#include <string.h>
#include <cstring>
bool SEQ_edit_sequence_swap(Scene *scene, Sequence *seq_a, Sequence *seq_b, const char **error_str)
{

View File

@ -26,7 +26,7 @@
#include "wm_xr_intern.h"
#include <string.h>
#include <cstring>
/* -------------------------------------------------------------------- */
/** \name XR-Action API