From b9c7dc238676cf387615910797cce4244158c7f6 Mon Sep 17 00:00:00 2001 From: Mattias Axelsson Date: Fri, 20 Sep 2024 16:57:31 +0200 Subject: [PATCH] Upgrade SDK to 12.0 and make storage_id pointer const --- Dockerfile | 4 ++-- app/sd_disk_storage.c | 10 ++++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index b200cbd0..ef0ae013 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,8 +8,8 @@ ARG SLIRP4NETNS_VERSION=1.2.3 ARG REPO=axisecp ARG ARCH=armv7hf -ARG VERSION=1.14 -ARG UBUNTU_VERSION=22.04 +ARG VERSION=master # TODO: Change to 12.0 before merging +ARG UBUNTU_VERSION=24.04 ARG NATIVE_SDK=acap-native-sdk FROM ${REPO}/${NATIVE_SDK}:${VERSION}-${ARCH}-ubuntu${UBUNTU_VERSION} AS sdk_image diff --git a/app/sd_disk_storage.c b/app/sd_disk_storage.c index 6e4faad3..bdbb39e4 100644 --- a/app/sd_disk_storage.c +++ b/app/sd_disk_storage.c @@ -10,7 +10,7 @@ struct sd_disk_storage { AXStorage* handle; }; -static bool event_status_or_log(gchar* storage_id, AXStorageStatusEventId event) { +static bool event_status_or_log(const gchar* storage_id, AXStorageStatusEventId event) { GError* error = NULL; bool value = ax_storage_get_status(storage_id, event, &error); if (error) { @@ -79,7 +79,7 @@ void sd_disk_storage_free(struct sd_disk_storage* storage) { free(storage); } -static void subscribe_cb(gchar* storage_id, gpointer storage_void_ptr, GError* error) { +static void subscribe_cb(const gchar* storage_id, gpointer storage_void_ptr, GError* error) { struct sd_disk_storage* storage = storage_void_ptr; if (error) { @@ -110,10 +110,8 @@ static bool subscribe(struct sd_disk_storage* storage, const char* storage_id) { if (strcmp(node->data, storage_id) == 0) { found = true; if (!(storage->subscription_id = - ax_storage_subscribe(node->data, subscribe_cb, storage, &error))) { - log_error("Failed to subscribe to events of %s: %s", - (char*)node->data, - error->message); + ax_storage_subscribe(storage_id, subscribe_cb, storage, &error))) { + log_error("Failed to subscribe to events of %s: %s", storage_id, error->message); g_clear_error(&error); return false; }