Cleanup: declare const variables
This commit is contained in:
@@ -97,8 +97,12 @@ GHOST_TSuccess GHOST_DisplayManager::findMatch(uint8_t display,
|
||||
GHOST_ASSERT(m_settingsInitialized,
|
||||
"GHOST_DisplayManager::findMatch(): m_settingsInitialized=false");
|
||||
|
||||
int criteria[4] = {
|
||||
int(setting.xPixels), int(setting.yPixels), int(setting.bpp), int(setting.frequency)};
|
||||
const int criteria[4] = {
|
||||
int(setting.xPixels),
|
||||
int(setting.yPixels),
|
||||
int(setting.bpp),
|
||||
int(setting.frequency),
|
||||
};
|
||||
int capabilities[4];
|
||||
double field, score;
|
||||
double best = 1e12; /* A big number. */
|
||||
|
||||
@@ -62,7 +62,7 @@ static void init_curve_deform(const Object *ob_curve, const Object *ob_target, C
|
||||
static bool calc_curve_deform(
|
||||
const Object *ob_curve, float co[3], const short axis, const CurveDeform *cd, float r_quat[4])
|
||||
{
|
||||
Curve *cu = ob_curve->data;
|
||||
const Curve *cu = ob_curve->data;
|
||||
float fac, loc[4], dir[3], new_quat[4], radius;
|
||||
short index;
|
||||
const bool is_neg_axis = (axis > 2);
|
||||
|
||||
@@ -722,7 +722,7 @@ static bool lib_query_unused_ids_tag_recurse(Main *bmain,
|
||||
if (ELEM(GS(id->name), ID_IM)) {
|
||||
/* Images which have a 'viewer' source (e.g. render results) should not be considered as
|
||||
* orphaned/unused data. */
|
||||
Image *image = (Image *)id;
|
||||
const Image *image = (Image *)id;
|
||||
if (image->source == IMA_SRC_VIEWER) {
|
||||
id_relations->tags |= MAINIDRELATIONS_ENTRY_TAGS_PROCESSED;
|
||||
return false;
|
||||
|
||||
@@ -345,7 +345,7 @@ static bool icon_merge(struct IconMergeContext *context,
|
||||
return false;
|
||||
}
|
||||
|
||||
struct IconInfo *read_icon_info = icon_merge_context_info_for_icon_head(context, &head);
|
||||
const struct IconInfo *read_icon_info = icon_merge_context_info_for_icon_head(context, &head);
|
||||
if (read_icon_info != NULL) {
|
||||
printf(
|
||||
"Conflicting icon files %s and %s\n", path_basename(file_src), read_icon_info->file_name);
|
||||
|
||||
@@ -429,7 +429,7 @@ static void make_histogram_view_from_ibuf_byte_fn(void *__restrict userdata,
|
||||
const int y,
|
||||
const TaskParallelTLS *__restrict tls)
|
||||
{
|
||||
MakeHistogramViewData *data = static_cast<MakeHistogramViewData *>(userdata);
|
||||
const MakeHistogramViewData *data = static_cast<MakeHistogramViewData *>(userdata);
|
||||
const ImBuf *ibuf = data->ibuf;
|
||||
const uchar *src = ibuf->byte_buffer.data;
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ void RNA_api_workspace_tool(StructRNA *srna)
|
||||
PropertyRNA *parm;
|
||||
FunctionRNA *func;
|
||||
|
||||
static EnumPropertyItem options_items[] = {
|
||||
static const EnumPropertyItem options_items[] = {
|
||||
{TOOLREF_FLAG_FALLBACK_KEYMAP, "KEYMAP_FALLBACK", 0, "Fallback", ""},
|
||||
{0, nullptr, 0, nullptr, nullptr},
|
||||
};
|
||||
|
||||
@@ -151,7 +151,7 @@ static void seq_animation_duplicate(Scene *scene, Sequence *seq, ListBase *dst,
|
||||
return;
|
||||
}
|
||||
|
||||
GSET_FOREACH_BEGIN (FCurve *, fcu, fcurves) {
|
||||
GSET_FOREACH_BEGIN (const FCurve *, fcu, fcurves) {
|
||||
FCurve *fcu_cpy = BKE_fcurve_copy(fcu);
|
||||
BLI_addtail(dst, fcu_cpy);
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ void SEQ_sound_update(Scene *scene, bSound *sound)
|
||||
|
||||
float SEQ_sound_pitch_get(const Scene *scene, const Sequence *seq)
|
||||
{
|
||||
Sequence *meta_parent = seq_sequence_lookup_meta_by_seq(scene, seq);
|
||||
const Sequence *meta_parent = seq_sequence_lookup_meta_by_seq(scene, seq);
|
||||
if (meta_parent != NULL) {
|
||||
return seq->speed_factor * SEQ_sound_pitch_get(scene, meta_parent);
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
Sequence *SEQ_select_active_get(Scene *scene)
|
||||
{
|
||||
Editing *ed = SEQ_editing_get(scene);
|
||||
const Editing *ed = SEQ_editing_get(scene);
|
||||
|
||||
if (ed == NULL) {
|
||||
return NULL;
|
||||
|
||||
@@ -613,7 +613,7 @@ void SEQ_transform_offset_after_frame(Scene *scene,
|
||||
|
||||
bool SEQ_transform_is_locked(ListBase *channels, Sequence *seq)
|
||||
{
|
||||
SeqTimelineChannel *channel = SEQ_channel_get_by_index(channels, seq->machine);
|
||||
const SeqTimelineChannel *channel = SEQ_channel_get_by_index(channels, seq->machine);
|
||||
return seq->flag & SEQ_LOCK ||
|
||||
(SEQ_channel_is_locked(channel) && ((seq->flag & SEQ_IGNORE_CHANNEL_LOCK) == 0));
|
||||
}
|
||||
@@ -636,7 +636,7 @@ void SEQ_image_transform_origin_offset_pixelspace_get(const Scene *scene,
|
||||
float r_origin[2])
|
||||
{
|
||||
float image_size[2];
|
||||
StripElem *strip_elem = seq->strip->stripdata;
|
||||
const StripElem *strip_elem = seq->strip->stripdata;
|
||||
if (strip_elem == NULL) {
|
||||
image_size[0] = scene->r.xsch;
|
||||
image_size[1] = scene->r.ysch;
|
||||
@@ -663,7 +663,7 @@ static void seq_image_transform_quad_get_ex(const Scene *scene,
|
||||
float r_quad[4][2])
|
||||
{
|
||||
StripTransform *transform = seq->strip->transform;
|
||||
StripCrop *crop = seq->strip->crop;
|
||||
const StripCrop *crop = seq->strip->crop;
|
||||
|
||||
int image_size[2] = {scene->r.xsch, scene->r.ysch};
|
||||
if (ELEM(seq->type, SEQ_TYPE_MOVIE, SEQ_TYPE_IMAGE)) {
|
||||
|
||||
Reference in New Issue
Block a user