Cleanup: use enum for local versioning enum

This commit is contained in:
Campbell Barton 2022-03-11 09:27:37 +11:00
parent e3de755ae3
commit d449deec21
5 changed files with 16 additions and 12 deletions

View File

@ -1838,7 +1838,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
Image *image = blo_do_versions_newlibadr(fd, tex->id.lib, tex->ima);
if (image && (image->flag & IMA_DO_PREMUL) == 0) {
const int IMA_IGNORE_ALPHA = (1 << 12);
enum { IMA_IGNORE_ALPHA = (1 << 12) };
image->flag |= IMA_IGNORE_ALPHA;
}
}

View File

@ -1550,7 +1550,7 @@ void do_versions_after_linking_280(Main *bmain, ReportList *UNUSED(reports))
if (!MAIN_VERSION_ATLEAST(bmain, 280, 69)) {
/* Unify DOF settings (EEVEE part only) */
const int SCE_EEVEE_DOF_ENABLED = (1 << 7);
enum { SCE_EEVEE_DOF_ENABLED = (1 << 7) };
LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
if (STREQ(scene->r.engine, RE_engine_id_BLENDER_EEVEE)) {
if (scene->eevee.flag & SCE_EEVEE_DOF_ENABLED) {
@ -2312,7 +2312,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
} \
} \
((void)0)
const int SCE_EEVEE_DOF_ENABLED = (1 << 7);
enum { SCE_EEVEE_DOF_ENABLED = (1 << 7) };
IDProperty *props = IDP_GetPropertyFromGroup(scene->layer_properties,
RE_engine_id_BLENDER_EEVEE);
// EEVEE_GET_BOOL(props, volumetric_enable, SCE_EEVEE_VOLUMETRIC_ENABLED);
@ -4032,7 +4032,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
if (!MAIN_VERSION_ATLEAST(bmain, 280, 70)) {
/* New image alpha modes. */
LISTBASE_FOREACH (Image *, image, &bmain->images) {
const int IMA_IGNORE_ALPHA = (1 << 12);
enum { IMA_IGNORE_ALPHA = (1 << 12) };
if (image->flag & IMA_IGNORE_ALPHA) {
image->alpha_mode = IMA_ALPHA_IGNORE;
image->flag &= ~IMA_IGNORE_ALPHA;

View File

@ -701,8 +701,10 @@ static void panels_remove_x_closed_flag_recursive(Panel *panel)
static void do_versions_point_attributes(CustomData *pdata)
{
/* Change to generic named float/float3 attributes. */
const int CD_LOCATION = 43;
const int CD_RADIUS = 44;
enum {
CD_LOCATION = 43,
CD_RADIUS = 44,
};
for (int i = 0; i < pdata->totlayer; i++) {
CustomDataLayer *layer = &pdata->layers[i];

View File

@ -1483,7 +1483,7 @@ void blo_do_versions_300(FileData *fd, Library *UNUSED(lib), Main *bmain)
{
/* The #SCE_SNAP_SEQ flag has been removed in favor of the #SCE_SNAP which can be used for each
* snap_flag member individually. */
const int SCE_SNAP_SEQ = (1 << 7);
enum { SCE_SNAP_SEQ = (1 << 7) };
if (!MAIN_VERSION_ATLEAST(bmain, 300, 1)) {
/* Set default value for the new bisect_threshold parameter in the mirror modifier. */

View File

@ -330,7 +330,7 @@ static void image_node_colorspace(bNode *node)
return;
}
const int SHD_COLORSPACE_NONE = 0;
enum { SHD_COLORSPACE_NONE = 0 };
Image *image = (Image *)node->id;
if (color_space == SHD_COLORSPACE_NONE) {
STRNCPY(image->colorspace_settings.name,
@ -1362,10 +1362,12 @@ void blo_do_versions_cycles(FileData *UNUSED(fd), Library *UNUSED(lib), Main *bm
void do_versions_after_linking_cycles(Main *bmain)
{
const int DENOISER_AUTO = 0;
const int DENOISER_NLM = 1;
const int DENOISER_OPTIX = 2;
const int DENOISER_OPENIMAGEDENOISE = 4;
enum {
DENOISER_AUTO = 0,
DENOISER_NLM = 1,
DENOISER_OPTIX = 2,
DENOISER_OPENIMAGEDENOISE = 4,
};
if (!MAIN_VERSION_ATLEAST(bmain, 280, 66)) {
/* Shader node tree changes. After lib linking so we have all the typeinfo