diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-09-10 05:55:58 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-09-10 05:55:58 +0400 |
commit | 61d40c38e0dd9961223c64c27caf09e8b9c5d488 (patch) | |
tree | b27aecb201f57d74d9283d4a52a56f9f06664555 /source/blender/editors/util | |
parent | eb9a7c21882214229626088a51ab3eed2393a1e0 (diff) |
code cleanup: use single define for undo string size, was 64 mostly, but 512 in the UI.
Diffstat (limited to 'source/blender/editors/util')
-rw-r--r-- | source/blender/editors/util/editmode_undo.c | 8 | ||||
-rw-r--r-- | source/blender/editors/util/undo.c | 6 |
2 files changed, 4 insertions, 10 deletions
diff --git a/source/blender/editors/util/editmode_undo.c b/source/blender/editors/util/editmode_undo.c index 18610d57bbd..9a3b0476205 100644 --- a/source/blender/editors/util/editmode_undo.c +++ b/source/blender/editors/util/editmode_undo.c @@ -29,8 +29,6 @@ * \ingroup edutil */ - - #include <stdlib.h> #include <string.h> #include <math.h> @@ -44,7 +42,7 @@ #include "BLI_dynstr.h" #include "BLI_utildefines.h" - +#include "BKE_blender.h" #include "BKE_context.h" #include "BKE_depsgraph.h" #include "BKE_global.h" @@ -82,8 +80,6 @@ static void error(const char *UNUSED(arg)) {} /* ****** XXX ***** */ - -#define MAXUNDONAME 64 typedef struct UndoElem { struct UndoElem *next, *prev; ID id; // copy of editmode object ID @@ -91,7 +87,7 @@ typedef struct UndoElem { int type; // type of edited object void *undodata; uintptr_t undosize; - char name[MAXUNDONAME]; + char name[BKE_UNDO_STR_MAX]; void * (*getdata)(bContext * C); void (*freedata)(void *); void (*to_editmode)(void *, void *, void *); diff --git a/source/blender/editors/util/undo.c b/source/blender/editors/util/undo.c index 4213ff68cf2..2ffad3ad796 100644 --- a/source/blender/editors/util/undo.c +++ b/source/blender/editors/util/undo.c @@ -74,8 +74,6 @@ #include "util_intern.h" -#define MAXUNDONAME 64 /* XXX, make common define */ - /* ***************** generic undo system ********************* */ void ED_undo_push(bContext *C, const char *str) @@ -283,7 +281,7 @@ static int ed_undo_exec(bContext *C, wmOperator *UNUSED(op)) static int ed_undo_push_exec(bContext *C, wmOperator *op) { - char str[MAXUNDONAME]; + char str[BKE_UNDO_STR_MAX]; RNA_string_get(op->ptr, "message", str); ED_undo_push(C, str); return OPERATOR_FINISHED; @@ -321,7 +319,7 @@ void ED_OT_undo_push(wmOperatorType *ot) ot->flag = OPTYPE_INTERNAL; - RNA_def_string(ot->srna, "message", "Add an undo step *function may be moved*", MAXUNDONAME, "Undo Message", ""); + RNA_def_string(ot->srna, "message", "Add an undo step *function may be moved*", BKE_UNDO_STR_MAX, "Undo Message", ""); } void ED_OT_redo(wmOperatorType *ot) |