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 | |
parent | eb9a7c21882214229626088a51ab3eed2393a1e0 (diff) |
code cleanup: use single define for undo string size, was 64 mostly, but 512 in the UI.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/BKE_blender.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/blender.c | 3 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_paint.c | 1 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_undo.c | 9 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 2 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_undo.c | 8 | ||||
-rw-r--r-- | source/blender/editors/util/editmode_undo.c | 8 | ||||
-rw-r--r-- | source/blender/editors/util/undo.c | 6 |
8 files changed, 16 insertions, 23 deletions
diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h index 0e7bdbbb4dd..1e67027ae8c 100644 --- a/source/blender/blenkernel/BKE_blender.h +++ b/source/blender/blenkernel/BKE_blender.h @@ -83,6 +83,8 @@ void BKE_userdef_free(void); void set_blender_test_break_cb(void (*func)(void) ); int blender_test_break(void); +#define BKE_UNDO_STR_MAX 64 + /* global undo */ extern void BKE_write_undo(struct bContext *C, const char *name); extern void BKE_undo_step(struct bContext *C, int step); diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c index 04b135df798..09519f68415 100644 --- a/source/blender/blenkernel/intern/blender.c +++ b/source/blender/blenkernel/intern/blender.c @@ -463,11 +463,10 @@ int blender_test_break(void) #define UNDO_DISK 0 -#define MAXUNDONAME 64 typedef struct UndoElem { struct UndoElem *next, *prev; char str[FILE_MAX]; - char name[MAXUNDONAME]; + char name[BKE_UNDO_STR_MAX]; MemFile memfile; uintptr_t undosize; } UndoElem; diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index dfd2783fad6..4e281b96fc3 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -27,7 +27,6 @@ * \ingroup edgpencil */ - #include <stdio.h> #include <stddef.h> #include <stdlib.h> diff --git a/source/blender/editors/gpencil/gpencil_undo.c b/source/blender/editors/gpencil/gpencil_undo.c index 61f7e1bb86f..fa9f5196866 100644 --- a/source/blender/editors/gpencil/gpencil_undo.c +++ b/source/blender/editors/gpencil/gpencil_undo.c @@ -25,6 +25,10 @@ * ***** END GPL LICENSE BLOCK ***** */ +/** \file blender/editors/gpencil/gpencil_undo.c + * \ingroup edgpencil + */ + #include <stdlib.h> #include <string.h> @@ -34,6 +38,7 @@ #include "DNA_listBase.h" #include "DNA_windowmanager_types.h" +#include "BKE_blender.h" #include "BKE_context.h" #include "BKE_gpencil.h" @@ -46,12 +51,10 @@ #include "gpencil_intern.h" -#define MAXUNDONAME 64 - typedef struct bGPundonode { struct bGPundonode *next, *prev; - char name[MAXUNDONAME]; + char name[BKE_UNDO_STR_MAX]; struct bGPdata *gpd; } bGPundonode; diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 23fb480cd1f..822794aae7b 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -197,7 +197,7 @@ typedef struct uiAfterFunc { bContextStore *context; - char undostr[512]; + char undostr[BKE_UNDO_STR_MAX]; int autokey; } uiAfterFunc; diff --git a/source/blender/editors/sculpt_paint/paint_undo.c b/source/blender/editors/sculpt_paint/paint_undo.c index 8e6c87c1510..f5b9aa742c6 100644 --- a/source/blender/editors/sculpt_paint/paint_undo.c +++ b/source/blender/editors/sculpt_paint/paint_undo.c @@ -23,7 +23,6 @@ * \brief Undo system for painting and sculpting. */ - #include <stdlib.h> #include <string.h> @@ -35,7 +34,7 @@ #include "DNA_userdef_types.h" - +#include "BKE_blender.h" #include "BKE_context.h" #include "BKE_global.h" @@ -43,11 +42,9 @@ #include "paint_intern.h" -#define MAXUNDONAME 64 - typedef struct UndoElem { struct UndoElem *next, *prev; - char name[MAXUNDONAME]; + char name[BKE_UNDO_STR_MAX]; uintptr_t undosize; ListBase elems; @@ -272,4 +269,3 @@ void ED_undo_paint_free(void) undo_stack_free(&ImageUndoStack); undo_stack_free(&MeshUndoStack); } - 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) |