mirror of
https://github.com/brl/mutter.git
synced 2024-11-26 18:11:05 -05:00
clutter/keyval: Fix keyval_name() transfer annotation
clutter_keyval_name() returns a pointer to a static array, not newly allocated memory. Add a transfer annotation to indicate that callers must not free the returned memory. While add it, make the return value const to stress further that callers shouldn't touch the returned memory. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3386>
This commit is contained in:
parent
03235773be
commit
dc8de3bfd5
@ -176,9 +176,9 @@ clutter_keys_keyval_compare (const void *pkey, const void *pbase)
|
||||
* clutter_keyval_name:
|
||||
* @keyval: A key value.
|
||||
*
|
||||
* Returns: (nullable): The corresponding symbolic name.
|
||||
* Returns: (nullable) (transfer none): The corresponding symbolic name.
|
||||
*/
|
||||
char *
|
||||
const char *
|
||||
clutter_keyval_name (unsigned int keyval)
|
||||
{
|
||||
static char buf[100];
|
||||
|
@ -35,6 +35,6 @@ void clutter_keyval_convert_case (unsigned int symbol,
|
||||
unsigned int *upper);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
char * clutter_keyval_name (unsigned int keyval);
|
||||
const char * clutter_keyval_name (unsigned int keyval);
|
||||
|
||||
G_END_DECLS
|
||||
|
Loading…
Reference in New Issue
Block a user