Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-11-17 12:45:45 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-11-17 12:45:45 +0300
commit51dcbdde033f6e8e55c4b1b4a47ca0624a6571ee (patch)
tree18315acbbe218deeea38c22ab41027df7d2cb06f /source/blender/windowmanager/intern
parentacc883da83b5fa7839a094e8dbf259077ca64f2e (diff)
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.
Diffstat (limited to 'source/blender/windowmanager/intern')
-rw-r--r--source/blender/windowmanager/intern/wm_dragdrop.c8
-rw-r--r--source/blender/windowmanager/intern/wm_files.c2
-rw-r--r--source/blender/windowmanager/intern/wm_keymap.c20
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c8
4 files changed, 19 insertions, 19 deletions
diff --git a/source/blender/windowmanager/intern/wm_dragdrop.c b/source/blender/windowmanager/intern/wm_dragdrop.c
index 18b1e7239ed..0b2d35eb8bb 100644
--- a/source/blender/windowmanager/intern/wm_dragdrop.c
+++ b/source/blender/windowmanager/intern/wm_dragdrop.c
@@ -167,7 +167,7 @@ void WM_event_drag_image(wmDrag *drag, ImBuf *imb, float scale, int sx, int sy)
}
-static char *dropbox_active(bContext *C, ListBase *handlers, wmDrag *drag, wmEvent *event)
+static const char *dropbox_active(bContext *C, ListBase *handlers, wmDrag *drag, wmEvent *event)
{
wmEventHandler *handler= handlers->first;
for(; handler; handler= handler->next) {
@@ -183,12 +183,12 @@ static char *dropbox_active(bContext *C, ListBase *handlers, wmDrag *drag, wmEve
}
/* return active operator name when mouse is in box */
-static char *wm_dropbox_active(bContext *C, wmDrag *drag, wmEvent *event)
+static const char *wm_dropbox_active(bContext *C, wmDrag *drag, wmEvent *event)
{
wmWindow *win= CTX_wm_window(C);
ScrArea *sa= CTX_wm_area(C);
ARegion *ar= CTX_wm_region(C);
- char *name;
+ const char *name;
name= dropbox_active(C, &win->handlers, drag, event);
if(name) return name;
@@ -218,7 +218,7 @@ static void wm_drop_operator_options(bContext *C, wmDrag *drag, wmEvent *event)
strcpy(drag->opname, "Paste name");
}
else {
- char *opname= wm_dropbox_active(C, drag, event);
+ const char *opname= wm_dropbox_active(C, drag, event);
if(opname) {
BLI_strncpy(drag->opname, opname, FILE_MAX);
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index e6d750ce8c1..35efca94fc5 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -262,7 +262,7 @@ static void wm_init_userdef(bContext *C)
if(U.tempdir[0]) BLI_where_is_temp(btempdir, 1);
}
-void WM_read_file(bContext *C, char *name, ReportList *reports)
+void WM_read_file(bContext *C, const char *name, ReportList *reports)
{
int retval;
diff --git a/source/blender/windowmanager/intern/wm_keymap.c b/source/blender/windowmanager/intern/wm_keymap.c
index 628c2aa1922..a005da43a9a 100644
--- a/source/blender/windowmanager/intern/wm_keymap.c
+++ b/source/blender/windowmanager/intern/wm_keymap.c
@@ -75,7 +75,7 @@ void WM_keymap_properties_reset(wmKeyMapItem *kmi, struct IDProperty *properties
keymap_properties_set(kmi);
}
-wmKeyConfig *WM_keyconfig_new(wmWindowManager *wm, char *idname)
+wmKeyConfig *WM_keyconfig_new(wmWindowManager *wm, const char *idname)
{
wmKeyConfig *keyconf;
@@ -86,7 +86,7 @@ wmKeyConfig *WM_keyconfig_new(wmWindowManager *wm, char *idname)
return keyconf;
}
-wmKeyConfig *WM_keyconfig_new_user(wmWindowManager *wm, char *idname)
+wmKeyConfig *WM_keyconfig_new_user(wmWindowManager *wm, const char *idname)
{
wmKeyConfig *keyconf = WM_keyconfig_new(wm, idname);
@@ -222,7 +222,7 @@ wmKeyMapItem *WM_keymap_verify_item(wmKeyMap *keymap, char *idname, int type, in
}
/* always add item */
-wmKeyMapItem *WM_keymap_add_item(wmKeyMap *keymap, char *idname, int type, int val, int modifier, int keymodifier)
+wmKeyMapItem *WM_keymap_add_item(wmKeyMap *keymap, const char *idname, int type, int val, int modifier, int keymodifier)
{
wmKeyMapItem *kmi= MEM_callocN(sizeof(wmKeyMapItem), "keymap entry");
@@ -265,7 +265,7 @@ void WM_keymap_remove_item(wmKeyMap *keymap, wmKeyMapItem *kmi)
space/region ids are same as DNA_space_types.h */
/* gets free'd in wm.c */
-wmKeyMap *WM_keymap_list_find(ListBase *lb, char *idname, int spaceid, int regionid)
+wmKeyMap *WM_keymap_list_find(ListBase *lb, const char *idname, int spaceid, int regionid)
{
wmKeyMap *km;
@@ -277,7 +277,7 @@ wmKeyMap *WM_keymap_list_find(ListBase *lb, char *idname, int spaceid, int regio
return NULL;
}
-wmKeyMap *WM_keymap_find(wmKeyConfig *keyconf, char *idname, int spaceid, int regionid)
+wmKeyMap *WM_keymap_find(wmKeyConfig *keyconf, const char *idname, int spaceid, int regionid)
{
wmKeyMap *km= WM_keymap_list_find(&keyconf->keymaps, idname, spaceid, regionid);
@@ -292,7 +292,7 @@ wmKeyMap *WM_keymap_find(wmKeyConfig *keyconf, char *idname, int spaceid, int re
return km;
}
-wmKeyMap *WM_keymap_find_all(const bContext *C, char *idname, int spaceid, int regionid)
+wmKeyMap *WM_keymap_find_all(const bContext *C, const char *idname, int spaceid, int regionid)
{
wmWindowManager *wm = CTX_wm_manager(C);
wmKeyConfig *keyconf;
@@ -323,7 +323,7 @@ wmKeyMap *WM_keymap_find_all(const bContext *C, char *idname, int spaceid, int r
/* modal maps get linked to a running operator, and filter the keys before sending to modal() callback */
-wmKeyMap *WM_modalkeymap_add(wmKeyConfig *keyconf, char *idname, EnumPropertyItem *items)
+wmKeyMap *WM_modalkeymap_add(wmKeyConfig *keyconf, const char *idname, EnumPropertyItem *items)
{
wmKeyMap *km= WM_keymap_find(keyconf, idname, 0, 0);
km->flag |= KEYMAP_MODAL;
@@ -332,7 +332,7 @@ wmKeyMap *WM_modalkeymap_add(wmKeyConfig *keyconf, char *idname, EnumPropertyIte
return km;
}
-wmKeyMap *WM_modalkeymap_get(wmKeyConfig *keyconf, char *idname)
+wmKeyMap *WM_modalkeymap_get(wmKeyConfig *keyconf, const char *idname)
{
wmKeyMap *km;
@@ -362,7 +362,7 @@ wmKeyMapItem *WM_modalkeymap_add_item(wmKeyMap *km, int type, int val, int modif
return kmi;
}
-void WM_modalkeymap_assign(wmKeyMap *km, char *opname)
+void WM_modalkeymap_assign(wmKeyMap *km, const char *opname)
{
wmOperatorType *ot= WM_operatortype_find(opname, 0);
@@ -757,7 +757,7 @@ wmKeyMapItem *WM_keymap_item_find_id(wmKeyMap *keymap, int id)
/* Guess an appropriate keymap from the operator name */
/* Needs to be kept up to date with Keymap and Operator naming */
-wmKeyMap *WM_keymap_guess_opname(const bContext *C, char *opname)
+wmKeyMap *WM_keymap_guess_opname(const bContext *C, const char *opname)
{
wmKeyMap *km=NULL;
SpaceLink *sl = CTX_wm_space_data(C);
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index 4a0aaecfbf9..599e9ece704 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -317,7 +317,7 @@ static int wm_macro_cancel(bContext *C, wmOperator *op)
}
/* Names have to be static for now */
-wmOperatorType *WM_operatortype_append_macro(char *idname, char *name, int flag)
+wmOperatorType *WM_operatortype_append_macro(const char *idname, const char *name, int flag)
{
wmOperatorType *ot;
@@ -654,7 +654,7 @@ int WM_menu_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
/* generic enum search invoke popup */
-static void operator_enum_search_cb(const struct bContext *C, void *arg_ot, char *str, uiSearchItems *items)
+static void operator_enum_search_cb(const struct bContext *C, void *arg_ot, const char *str, uiSearchItems *items)
{
wmOperatorType *ot = (wmOperatorType *)arg_ot;
PropertyRNA *prop= ot->prop;
@@ -1281,7 +1281,7 @@ static void operator_call_cb(struct bContext *C, void *UNUSED(arg1), void *arg2)
WM_operator_name_call(C, ot->idname, WM_OP_INVOKE_DEFAULT, NULL);
}
-static void operator_search_cb(const struct bContext *C, void *UNUSED(arg), char *str, uiSearchItems *items)
+static void operator_search_cb(const struct bContext *C, void *UNUSED(arg), const char *str, uiSearchItems *items)
{
wmOperatorType *ot = WM_operatortype_first();
@@ -3124,7 +3124,7 @@ void wm_operatortype_free(void)
wm_operatortype_free_macro(ot);
if(ot->ext.srna) /* python operator, allocs own string */
- MEM_freeN(ot->idname);
+ MEM_freeN((void *)ot->idname);
}
BLI_freelistN(&global_ops);