summaryrefslogtreecommitdiff
path: root/apps/shortcuts.c
diff options
context:
space:
mode:
authorAidan MacDonald <amachronic@protonmail.com>2022-10-15 23:55:39 +0100
committerAidan MacDonald <amachronic@protonmail.com>2023-01-13 10:32:54 +0000
commit1e9ad3ca0d9bf3e917eb2beb460421155144760a (patch)
tree752590b42f338f03223e024fc5b642ac9a8a5598 /apps/shortcuts.c
parent3301c5aa6db76832dbb9af8f72d29b348190fd91 (diff)
downloadrockbox-1e9ad3ca0d9bf3e917eb2beb460421155144760a.tar.gz
rockbox-1e9ad3ca0d9bf3e917eb2beb460421155144760a.zip
Remove buflib allocation names, part two
Remove allocation names from the buflib API and fix up all callers. Change-Id: I3df922e258d5f0d711d70e72b56b4ed634fb0f5a
Diffstat (limited to 'apps/shortcuts.c')
-rw-r--r--apps/shortcuts.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/apps/shortcuts.c b/apps/shortcuts.c
index 3f13d0c1b3..2e10bad00f 100644
--- a/apps/shortcuts.c
+++ b/apps/shortcuts.c
@@ -128,8 +128,7 @@ static struct shortcut* get_shortcut(int index)
128 128
129 if (first_handle == 0) 129 if (first_handle == 0)
130 { 130 {
131 first_handle = core_alloc_ex("shortcuts_head", 131 first_handle = core_alloc_ex(sizeof(struct shortcut_handle), &shortcut_ops);
132 sizeof(struct shortcut_handle), &shortcut_ops);
133 if (first_handle <= 0) 132 if (first_handle <= 0)
134 return NULL; 133 return NULL;
135 h = core_get_data(first_handle); 134 h = core_get_data(first_handle);
@@ -146,11 +145,9 @@ static struct shortcut* get_shortcut(int index)
146 } while (handle_count > 0 && current_handle > 0); 145 } while (handle_count > 0 && current_handle > 0);
147 if (handle_count > 0 && handle_index == 0) 146 if (handle_count > 0 && handle_index == 0)
148 { 147 {
149 char buf[32];
150 snprintf(buf, sizeof buf, "shortcuts_%d", index/SHORTCUTS_PER_HANDLE);
151 /* prevent invalidation of 'h' during compaction */ 148 /* prevent invalidation of 'h' during compaction */
152 ++buflib_move_lock; 149 ++buflib_move_lock;
153 h->next_handle = core_alloc_ex(buf, sizeof(struct shortcut_handle), &shortcut_ops); 150 h->next_handle = core_alloc_ex(sizeof(struct shortcut_handle), &shortcut_ops);
154 --buflib_move_lock; 151 --buflib_move_lock;
155 if (h->next_handle <= 0) 152 if (h->next_handle <= 0)
156 return NULL; 153 return NULL;
@@ -390,7 +387,7 @@ void shortcuts_init(void)
390 fd = open_utf8(SHORTCUTS_FILENAME, O_RDONLY); 387 fd = open_utf8(SHORTCUTS_FILENAME, O_RDONLY);
391 if (fd < 0) 388 if (fd < 0)
392 return; 389 return;
393 first_handle = core_alloc_ex("shortcuts_head", sizeof(struct shortcut_handle), &shortcut_ops); 390 first_handle = core_alloc_ex(sizeof(struct shortcut_handle), &shortcut_ops);
394 if (first_handle <= 0) { 391 if (first_handle <= 0) {
395 close(fd); 392 close(fd);
396 return; 393 return;