diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-08-13 10:30:04 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-08-13 10:30:04 +0400 |
commit | bf52b68dcd1864fd35309f9aae19f146da5b774e (patch) | |
tree | aea9cce847b38dce0f76e61991d490c71e51502c /source/blender/windowmanager/intern/wm.c | |
parent | e50ef6da2dba248ef9fcf14a10d67ef003649e5a (diff) |
minor changes to rna/python.
- raise an exception when python calls is_property_set(name) or is_property_hidden(name) and the property does not exist.
- added BLI_findstring_ptr(), which finds a named item in a listbase where that name is a pointer to a string.
- replaced inline for loops with calls to BLI_findstring_ptr() and IDP_GetPropertyFromGroup().
Diffstat (limited to 'source/blender/windowmanager/intern/wm.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/windowmanager/intern/wm.c b/source/blender/windowmanager/intern/wm.c index fcf8951d796..8d36711032b 100644 --- a/source/blender/windowmanager/intern/wm.c +++ b/source/blender/windowmanager/intern/wm.c @@ -26,7 +26,8 @@ * ***** END GPL LICENSE BLOCK ***** */ -#include "string.h" +#include <string.h> +#include <stddef.h> #include "DNA_windowmanager_types.h" @@ -149,9 +150,9 @@ MenuType *WM_menutype_find(const char *idname, int quiet) MenuType* mt; if (idname[0]) { - for(mt=menutypes.first; mt; mt=mt->next) - if(strcmp(idname, mt->idname)==0) - return mt; + mt= BLI_findstring(&menutypes, idname, offsetof(MenuType, idname)); + if(mt) + return mt; } if(!quiet) |