diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-10-19 10:33:42 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-10-19 10:35:39 +0300 |
commit | 9c8255d486c1271f20d33debf2a9e9ce883b5019 (patch) | |
tree | b1f5af7bbe48f7cbc59a1a422c0a95f4ed764da9 /source/blender/blenkernel | |
parent | 695dc07cb12222678f035537c554bee39d4d7d23 (diff) |
Cleanup: use 'e' prefix for enum types
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_main.h | 6 | ||||
-rw-r--r-- | source/blender/blenkernel/BKE_report.h | 20 | ||||
-rw-r--r-- | source/blender/blenkernel/BKE_undo_system.h | 18 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/main.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/report.c | 20 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/undo_system.c | 14 |
6 files changed, 40 insertions, 40 deletions
diff --git a/source/blender/blenkernel/BKE_main.h b/source/blender/blenkernel/BKE_main.h index 3108dfd5d8f..68b1b55f47f 100644 --- a/source/blender/blenkernel/BKE_main.h +++ b/source/blender/blenkernel/BKE_main.h @@ -90,12 +90,12 @@ typedef struct MainIDRelationsEntry { } MainIDRelationsEntry; /* MainIDRelationsEntry.tags */ -typedef enum MainIDRelationsEntryTags { +typedef enum eMainIDRelationsEntryTags { /* Generic tag marking the entry as to be processed. */ MAINIDRELATIONS_ENTRY_TAGS_DOIT = 1 << 0, /* Generic tag marking the entry as processed. */ MAINIDRELATIONS_ENTRY_TAGS_PROCESSED = 1 << 1, -} MainIDRelationsEntryTags; +} eMainIDRelationsEntryTags; typedef struct MainIDRelations { /* Mapping from an ID pointer to all of its parents (IDs using it) and children (IDs it uses). @@ -209,7 +209,7 @@ void BKE_main_unlock(struct Main *bmain); void BKE_main_relations_create(struct Main *bmain, const short flag); void BKE_main_relations_free(struct Main *bmain); void BKE_main_relations_tag_set(struct Main *bmain, - const MainIDRelationsEntryTags tag, + const eMainIDRelationsEntryTags tag, const bool value); struct GSet *BKE_main_gset_create(struct Main *bmain, struct GSet *gset); diff --git a/source/blender/blenkernel/BKE_report.h b/source/blender/blenkernel/BKE_report.h index 5b22918e84c..ec2e8d0f875 100644 --- a/source/blender/blenkernel/BKE_report.h +++ b/source/blender/blenkernel/BKE_report.h @@ -40,27 +40,27 @@ extern "C" { void BKE_reports_init(ReportList *reports, int flag); void BKE_reports_clear(ReportList *reports); -void BKE_report(ReportList *reports, ReportType type, const char *message); -void BKE_reportf(ReportList *reports, ReportType type, const char *format, ...) +void BKE_report(ReportList *reports, eReportType type, const char *message); +void BKE_reportf(ReportList *reports, eReportType type, const char *format, ...) ATTR_PRINTF_FORMAT(3, 4); void BKE_reports_prepend(ReportList *reports, const char *prepend); void BKE_reports_prependf(ReportList *reports, const char *prepend, ...) ATTR_PRINTF_FORMAT(2, 3); -ReportType BKE_report_print_level(ReportList *reports); -void BKE_report_print_level_set(ReportList *reports, ReportType level); +eReportType BKE_report_print_level(ReportList *reports); +void BKE_report_print_level_set(ReportList *reports, eReportType level); -ReportType BKE_report_store_level(ReportList *reports); -void BKE_report_store_level_set(ReportList *reports, ReportType level); +eReportType BKE_report_store_level(ReportList *reports); +void BKE_report_store_level_set(ReportList *reports, eReportType level); -char *BKE_reports_string(ReportList *reports, ReportType level); -void BKE_reports_print(ReportList *reports, ReportType level); +char *BKE_reports_string(ReportList *reports, eReportType level); +void BKE_reports_print(ReportList *reports, eReportType level); Report *BKE_reports_last_displayable(ReportList *reports); -bool BKE_reports_contain(ReportList *reports, ReportType level); +bool BKE_reports_contain(ReportList *reports, eReportType level); -const char *BKE_report_type_str(ReportType type); +const char *BKE_report_type_str(eReportType type); bool BKE_report_write_file_fp(FILE *fp, ReportList *reports, const char *header); bool BKE_report_write_file(const char *filepath, ReportList *reports, const char *header); diff --git a/source/blender/blenkernel/BKE_undo_system.h b/source/blender/blenkernel/BKE_undo_system.h index 2973a432723..2a90211f8e0 100644 --- a/source/blender/blenkernel/BKE_undo_system.h +++ b/source/blender/blenkernel/BKE_undo_system.h @@ -102,11 +102,11 @@ typedef enum eUndoStepDir { STEP_INVALID = 0, } eUndoStepDir; -typedef enum UndoPushReturn { +typedef enum eUndoPushReturn { UNDO_PUSH_RET_FAILURE = 0, UNDO_PUSH_RET_SUCCESS = (1 << 0), UNDO_PUSH_RET_OVERRIDE_CHANGED = (1 << 1), -} UndoPushReturn; +} eUndoPushReturn; typedef void (*UndoTypeForEachIDRefFn)(void *user_data, struct UndoRefID *id_ref); @@ -156,7 +156,7 @@ typedef struct UndoType { } UndoType; /** #UndoType.flag bitflags. */ -typedef enum UndoTypeFlags { +typedef enum eUndoTypeFlags { /** * This undo type `encode` callback needs a valid context, it will fail otherwise. * \note Callback is still supposed to properly deal with a NULL context pointer. @@ -169,7 +169,7 @@ typedef enum UndoTypeFlags { * This is typically used for undo systems that store both before/after states. */ UNDOTYPE_FLAG_DECODE_ACTIVE_STEP = 1 << 1, -} UndoTypeFlags; +} eUndoTypeFlags; /* Expose since we need to perform operations on specific undo types (rarely). */ extern const UndoType *BKE_UNDOSYS_TYPE_IMAGE; @@ -204,11 +204,11 @@ UndoStep *BKE_undosys_step_push_init_with_type(UndoStack *ustack, const UndoType *ut); UndoStep *BKE_undosys_step_push_init(UndoStack *ustack, struct bContext *C, const char *name); -UndoPushReturn BKE_undosys_step_push_with_type(UndoStack *ustack, - struct bContext *C, - const char *name, - const UndoType *ut); -UndoPushReturn BKE_undosys_step_push(UndoStack *ustack, struct bContext *C, const char *name); +eUndoPushReturn BKE_undosys_step_push_with_type(UndoStack *ustack, + struct bContext *C, + const char *name, + const UndoType *ut); +eUndoPushReturn BKE_undosys_step_push(UndoStack *ustack, struct bContext *C, const char *name); UndoStep *BKE_undosys_step_find_by_name_with_type(UndoStack *ustack, const char *name, diff --git a/source/blender/blenkernel/intern/main.c b/source/blender/blenkernel/intern/main.c index 583feacc04b..a5de0bc99c8 100644 --- a/source/blender/blenkernel/intern/main.c +++ b/source/blender/blenkernel/intern/main.c @@ -328,7 +328,7 @@ void BKE_main_relations_free(Main *bmain) /** Set or clear given `tag` in all relation entries of given `bmain`. */ void BKE_main_relations_tag_set(struct Main *bmain, - const MainIDRelationsEntryTags tag, + const eMainIDRelationsEntryTags tag, const bool value) { if (bmain->relations == NULL) { diff --git a/source/blender/blenkernel/intern/report.c b/source/blender/blenkernel/intern/report.c index c877ec6b6b0..90e7ca3f11a 100644 --- a/source/blender/blenkernel/intern/report.c +++ b/source/blender/blenkernel/intern/report.c @@ -37,7 +37,7 @@ #include "BKE_global.h" /* G.background only */ #include "BKE_report.h" -const char *BKE_report_type_str(ReportType type) +const char *BKE_report_type_str(eReportType type) { switch (type) { case RPT_DEBUG: @@ -101,7 +101,7 @@ void BKE_reports_clear(ReportList *reports) BLI_listbase_clear(&reports->list); } -void BKE_report(ReportList *reports, ReportType type, const char *_message) +void BKE_report(ReportList *reports, eReportType type, const char *_message) { Report *report; int len; @@ -129,7 +129,7 @@ void BKE_report(ReportList *reports, ReportType type, const char *_message) } } -void BKE_reportf(ReportList *reports, ReportType type, const char *_format, ...) +void BKE_reportf(ReportList *reports, eReportType type, const char *_format, ...) { DynStr *ds; Report *report; @@ -215,7 +215,7 @@ void BKE_reports_prependf(ReportList *reports, const char *_prepend, ...) } } -ReportType BKE_report_print_level(ReportList *reports) +eReportType BKE_report_print_level(ReportList *reports) { if (!reports) { return RPT_ERROR; @@ -224,7 +224,7 @@ ReportType BKE_report_print_level(ReportList *reports) return reports->printlevel; } -void BKE_report_print_level_set(ReportList *reports, ReportType level) +void BKE_report_print_level_set(ReportList *reports, eReportType level) { if (!reports) { return; @@ -233,7 +233,7 @@ void BKE_report_print_level_set(ReportList *reports, ReportType level) reports->printlevel = level; } -ReportType BKE_report_store_level(ReportList *reports) +eReportType BKE_report_store_level(ReportList *reports) { if (!reports) { return RPT_ERROR; @@ -242,7 +242,7 @@ ReportType BKE_report_store_level(ReportList *reports) return reports->storelevel; } -void BKE_report_store_level_set(ReportList *reports, ReportType level) +void BKE_report_store_level_set(ReportList *reports, eReportType level) { if (!reports) { return; @@ -251,7 +251,7 @@ void BKE_report_store_level_set(ReportList *reports, ReportType level) reports->storelevel = level; } -char *BKE_reports_string(ReportList *reports, ReportType level) +char *BKE_reports_string(ReportList *reports, eReportType level) { Report *report; DynStr *ds; @@ -279,7 +279,7 @@ char *BKE_reports_string(ReportList *reports, ReportType level) return cstring; } -void BKE_reports_print(ReportList *reports, ReportType level) +void BKE_reports_print(ReportList *reports, eReportType level) { char *cstring = BKE_reports_string(reports, level); @@ -305,7 +305,7 @@ Report *BKE_reports_last_displayable(ReportList *reports) return NULL; } -bool BKE_reports_contain(ReportList *reports, ReportType level) +bool BKE_reports_contain(ReportList *reports, eReportType level) { Report *report; if (reports != NULL) { diff --git a/source/blender/blenkernel/intern/undo_system.c b/source/blender/blenkernel/intern/undo_system.c index db5184edfd2..26d37489e35 100644 --- a/source/blender/blenkernel/intern/undo_system.c +++ b/source/blender/blenkernel/intern/undo_system.c @@ -346,7 +346,7 @@ static bool undosys_stack_push_main(UndoStack *ustack, const char *name, struct CLOG_INFO(&LOG, 1, "'%s'", name); bContext *C_temp = CTX_create(); CTX_data_main_set(C_temp, bmain); - UndoPushReturn ret = BKE_undosys_step_push_with_type( + eUndoPushReturn ret = BKE_undosys_step_push_with_type( ustack, C_temp, name, BKE_UNDOSYS_TYPE_MEMFILE); CTX_free(C_temp); return (ret & UNDO_PUSH_RET_SUCCESS); @@ -500,17 +500,17 @@ UndoStep *BKE_undosys_step_push_init(UndoStack *ustack, bContext *C, const char /** * \param C: Can be NULL from some callers if their encoding function doesn't need it */ -UndoPushReturn BKE_undosys_step_push_with_type(UndoStack *ustack, - bContext *C, - const char *name, - const UndoType *ut) +eUndoPushReturn BKE_undosys_step_push_with_type(UndoStack *ustack, + bContext *C, + const char *name, + const UndoType *ut) { BLI_assert((ut->flags & UNDOTYPE_FLAG_NEED_CONTEXT_FOR_ENCODE) == 0 || C != NULL); UNDO_NESTED_ASSERT(false); undosys_stack_validate(ustack, false); bool is_not_empty = ustack->step_active != NULL; - UndoPushReturn retval = UNDO_PUSH_RET_FAILURE; + eUndoPushReturn retval = UNDO_PUSH_RET_FAILURE; /* Might not be final place for this to be called - probably only want to call it from some * undo handlers, not all of them? */ @@ -602,7 +602,7 @@ UndoPushReturn BKE_undosys_step_push_with_type(UndoStack *ustack, return (retval | UNDO_PUSH_RET_SUCCESS); } -UndoPushReturn BKE_undosys_step_push(UndoStack *ustack, bContext *C, const char *name) +eUndoPushReturn BKE_undosys_step_push(UndoStack *ustack, bContext *C, const char *name) { UNDO_NESTED_ASSERT(false); const UndoType *ut = ustack->step_init ? ustack->step_init->type : |