diff options
author | Campbell Barton <campbell@blender.org> | 2022-05-20 06:31:41 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-05-20 06:35:28 +0300 |
commit | 838806be2869d0a91f1cd611ae0f9050e6847044 (patch) | |
tree | 1ba7289758c221b5ecac2cc9dc1491a708056c70 /source/blender/windowmanager/WM_api.h | |
parent | 780ad443fdfe2f381a646da5cc36e81459e46e3f (diff) |
WM: return the string length from operator name conversion
- In some cases it avoids using strlen on the result.
- Use ATTR_NONNULL for all arguments.
- Remove NULL pointer check for WM_operator_bl_idname src argument.
- Rename from/to to src/dst.
Diffstat (limited to 'source/blender/windowmanager/WM_api.h')
-rw-r--r-- | source/blender/windowmanager/WM_api.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index 268382ec923..59d40ce840f 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -895,12 +895,14 @@ char *WM_prop_pystring_assign(struct bContext *C, int index); /** * Convert: `some.op` -> `SOME_OT_op` or leave as-is. + * \return the length of `dst`. */ -void WM_operator_bl_idname(char *to, const char *from); +size_t WM_operator_bl_idname(char *dst, const char *src) ATTR_NONNULL(1, 2); /** * Convert: `SOME_OT_op` -> `some.op` or leave as-is. + * \return the length of `dst`. */ -void WM_operator_py_idname(char *to, const char *from); +size_t WM_operator_py_idname(char *dst, const char *src) ATTR_NONNULL(1, 2); /** * Sanity check to ensure #WM_operator_bl_idname won't fail. * \returns true when there are no problems with \a idname, otherwise report an error. |