From accd1a5841bafc81aa87db46eb35a8255ced4e22 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Fri, 31 Jan 2020 10:36:50 +0100 Subject: base-modem: define new helper MMBaseModemAtCommandAlloc It has the same exact format as MMBaseModemAtCommand, but its contents are assumed heap allocated. The only real purpose of this type is to allow defining static constant MMBaseModemAtCommand variables without warnings when using -Wdiscarded-qualifiers. --- src/mm-base-modem-at.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/mm-base-modem-at.c') diff --git a/src/mm-base-modem-at.c b/src/mm-base-modem-at.c index e1537af5..101c9549 100644 --- a/src/mm-base-modem-at.c +++ b/src/mm-base-modem-at.c @@ -616,3 +616,9 @@ mm_base_modem_at_command_raw (MMBaseModem *self, { _at_command (self, command, timeout, allow_cached, TRUE, callback, user_data); } + +void +mm_base_modem_at_command_alloc_clear (MMBaseModemAtCommandAlloc *command) +{ + g_free (command->command); +} -- cgit v1.2.3-70-g09d2