From 8268a4be71fe326b5b7b43e5e55ef751844dddbc Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 16 Oct 2010 14:32:17 +0000 Subject: most unused arg warnings corrected. - removed deprecated bitmap arg from IMB_allocImBuf (plugins will need updating). - mostly tagged UNUSED() since some of these functions look like they may need to have the arguments used later. --- source/blender/editors/util/editmode_undo.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'source/blender/editors/util/editmode_undo.c') diff --git a/source/blender/editors/util/editmode_undo.c b/source/blender/editors/util/editmode_undo.c index 290c8a64881..debb8cedd07 100644 --- a/source/blender/editors/util/editmode_undo.c +++ b/source/blender/editors/util/editmode_undo.c @@ -37,6 +37,7 @@ #include "DNA_object_types.h" #include "DNA_screen_types.h" +#include "BKE_utildefines.h" #include "BKE_context.h" #include "BKE_depsgraph.h" #include "BKE_global.h" @@ -74,7 +75,7 @@ void undo_editmode_menu(void) // history menu /* ********************************************************************* */ /* ****** XXX ***** */ -void error(const char *dummy) {} +void error(const char *UNUSED(arg)) {} /* ****** XXX ***** */ @@ -341,7 +342,7 @@ void undo_editmode_menu(bContext *C) if(event>0) undo_number(C, event); } -static void do_editmode_undohistorymenu(bContext *C, void *arg, int event) +static void do_editmode_undohistorymenu(bContext *C, void *UNUSED(arg), int event) { Object *obedit= CTX_data_edit_object(C); @@ -351,7 +352,7 @@ static void do_editmode_undohistorymenu(bContext *C, void *arg, int event) } -uiBlock *editmode_undohistorymenu(bContext *C, ARegion *ar, void *arg_unused) +uiBlock *editmode_undohistorymenu(bContext *C, ARegion *ar, void *UNUSED(arg)) { uiBlock *block; UndoElem *uel; -- cgit v1.2.3 From 51dcbdde033f6e8e55c4b1b4a47ca0624a6571ee Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 17 Nov 2010 09:45:45 +0000 Subject: use 'const char *' by default with RNA functions except when the value is flagged as PROP_THICK_WRAP. Also use const char in many other parts of blenders code. Currently this gives warnings for setting operator id, label and description since these are an exception and allocated beforehand. --- source/blender/editors/util/editmode_undo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/util/editmode_undo.c') diff --git a/source/blender/editors/util/editmode_undo.c b/source/blender/editors/util/editmode_undo.c index debb8cedd07..2b9b8c7f162 100644 --- a/source/blender/editors/util/editmode_undo.c +++ b/source/blender/editors/util/editmode_undo.c @@ -56,7 +56,7 @@ Add this in your local code: -void undo_editmode_push(bContext *C, char *name, +void undo_editmode_push(bContext *C, const char *name, void * (*getdata)(bContext *C), // use context to retrieve current editdata void (*freedata)(void *), // pointer to function freeing data void (*to_editmode)(void *, void *), // data to editmode conversion @@ -109,7 +109,7 @@ static void undo_restore(UndoElem *undo, void *editdata) } /* name can be a dynamic string */ -void undo_editmode_push(bContext *C, char *name, +void undo_editmode_push(bContext *C, const char *name, void * (*getdata)(bContext *C), void (*freedata)(void *), void (*to_editmode)(void *, void *), -- cgit v1.2.3 From b110c7c8f2c5fafa6412e01d21d751a884bfe8b2 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sun, 5 Dec 2010 18:59:23 +0000 Subject: Dependency graph: changed DAG_id_flush_update to DAG_id_tag_update. Now it only tags the ID and does the actual flush/update delayed, before the next redraw. For objects the update was already delayed, just flushing wasn't yet. This should help performance in python and animation editors, by making calls to RNA property update quicker. Still need to add calls in a few places where this was previously avoided due to bad performance. --- source/blender/editors/util/editmode_undo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/editors/util/editmode_undo.c') diff --git a/source/blender/editors/util/editmode_undo.c b/source/blender/editors/util/editmode_undo.c index 2b9b8c7f162..6b0d5b7f172 100644 --- a/source/blender/editors/util/editmode_undo.c +++ b/source/blender/editors/util/editmode_undo.c @@ -269,7 +269,7 @@ void undo_editmode_step(bContext *C, int step) EM_selectmode_to_scene(CTX_data_scene(C), obedit); } - DAG_id_flush_update(&obedit->id, OB_RECALC_DATA); + DAG_id_tag_update(&obedit->id, OB_RECALC_DATA); /* XXX notifiers */ } -- cgit v1.2.3 From 8f21a43535cb200c0569566a1b012aec883aa53c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 7 Jan 2011 18:36:47 +0000 Subject: split BKE_utildefines.h, now it only has blender specific defines like GS() MAKE_ID, FILE_MAXDIR, moved the generic defines to BLI_utildefines.h. no functional changes. --- source/blender/editors/util/editmode_undo.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source/blender/editors/util/editmode_undo.c') diff --git a/source/blender/editors/util/editmode_undo.c b/source/blender/editors/util/editmode_undo.c index 6b0d5b7f172..1a4cf14dff6 100644 --- a/source/blender/editors/util/editmode_undo.c +++ b/source/blender/editors/util/editmode_undo.c @@ -37,15 +37,15 @@ #include "DNA_object_types.h" #include "DNA_screen_types.h" +#include "BLI_blenlib.h" +#include "BLI_dynstr.h" +#include "BLI_utildefines.h" + #include "BKE_utildefines.h" #include "BKE_context.h" #include "BKE_depsgraph.h" #include "BKE_global.h" -#include "BLI_blenlib.h" -#include "BLI_dynstr.h" - - #include "ED_mesh.h" #include "UI_interface.h" -- cgit v1.2.3 From 89c9aaaa25cc7ce60c305d8e30e1c008cb117cf1 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 7 Jan 2011 19:18:31 +0000 Subject: remove references to BKE_utildefines where its not needed. - move GS() define into DNA_ID.h - add BLI_utildefines as an automatic include with makesrna generated files. --- source/blender/editors/util/editmode_undo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/editors/util/editmode_undo.c') diff --git a/source/blender/editors/util/editmode_undo.c b/source/blender/editors/util/editmode_undo.c index 1a4cf14dff6..cff30f12369 100644 --- a/source/blender/editors/util/editmode_undo.c +++ b/source/blender/editors/util/editmode_undo.c @@ -41,7 +41,7 @@ #include "BLI_dynstr.h" #include "BLI_utildefines.h" -#include "BKE_utildefines.h" + #include "BKE_context.h" #include "BKE_depsgraph.h" #include "BKE_global.h" -- cgit v1.2.3 From 604d029ddf164e87eb453d83c59e65c2f16f8879 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Wed, 12 Jan 2011 18:00:23 +0000 Subject: Bugfix #25570 The tool-redo depends on a working undo system, so it can rewind a step and then redo operator with new settings. When a user disables undo, this won't work. Now the properties for redo operator (toolbar, F6) will grey out when a redo isn't possible. --- source/blender/editors/util/editmode_undo.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'source/blender/editors/util/editmode_undo.c') diff --git a/source/blender/editors/util/editmode_undo.c b/source/blender/editors/util/editmode_undo.c index cff30f12369..85f343e3311 100644 --- a/source/blender/editors/util/editmode_undo.c +++ b/source/blender/editors/util/editmode_undo.c @@ -314,6 +314,20 @@ void undo_editmode_name(bContext *C, const char *undoname) } } +/* undoname optionally, if NULL it just checks for existing undo steps */ +int undo_editmode_valid(const char *undoname) +{ + if(undoname) { + UndoElem *uel; + + for(uel= undobase.last; uel; uel= uel->prev) { + if(strcmp(undoname, uel->name)==0) + break; + } + return uel != NULL; + } + return undobase.last != undobase.first; +} /* ************** for interaction with menu/pullown */ -- cgit v1.2.3 From 8b7482892b2ecb456be60b42fe1625156d19e954 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 14 Feb 2011 17:55:27 +0000 Subject: made most variables which are only used in a single file and not defined in header static for blenlib, blenkernel and editors. --- source/blender/editors/util/editmode_undo.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source/blender/editors/util/editmode_undo.c') diff --git a/source/blender/editors/util/editmode_undo.c b/source/blender/editors/util/editmode_undo.c index 85f343e3311..767a2adacb2 100644 --- a/source/blender/editors/util/editmode_undo.c +++ b/source/blender/editors/util/editmode_undo.c @@ -46,11 +46,14 @@ #include "BKE_depsgraph.h" #include "BKE_global.h" +#include "ED_util.h" #include "ED_mesh.h" #include "UI_interface.h" #include "UI_resources.h" +#include "util_intern.h" + /* ***************** generic editmode undo system ********************* */ /* @@ -75,7 +78,7 @@ void undo_editmode_menu(void) // history menu /* ********************************************************************* */ /* ****** XXX ***** */ -void error(const char *UNUSED(arg)) {} +static void error(const char *UNUSED(arg)) {} /* ****** XXX ***** */ -- cgit v1.2.3 From 5b607701a7541c328cc058e10bd7a8c6d0c998ab Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Wed, 23 Feb 2011 10:52:22 +0000 Subject: doxygen: prevent GPL license block from being parsed as doxygen comment. --- source/blender/editors/util/editmode_undo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/editors/util/editmode_undo.c') diff --git a/source/blender/editors/util/editmode_undo.c b/source/blender/editors/util/editmode_undo.c index 767a2adacb2..08f801b8039 100644 --- a/source/blender/editors/util/editmode_undo.c +++ b/source/blender/editors/util/editmode_undo.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** -- cgit v1.2.3