]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
mod_fifo: Convert macro to fn and improve name
authorTravis Cross <tc@traviscross.com>
Sun, 25 May 2014 14:27:01 +0000 (14:27 +0000)
committerTravis Cross <tc@traviscross.com>
Wed, 28 May 2014 01:32:00 +0000 (01:32 +0000)
src/mod/applications/mod_fifo/mod_fifo.c

index 1b8c0c8fde544cb6e409996f14fb7db238e7d290..251f5961808e9610ba510d0a7bd62151c3731dbb 100644 (file)
@@ -508,7 +508,9 @@ static switch_status_t moh_on_dtmf(switch_core_session_t *session, void *input,
        return SWITCH_STATUS_SUCCESS;
 }
 
-#define check_string(s) if (!zstr(s) && !strcasecmp(s, "undef")) { s = NULL; }
+static inline void cleanup_fifo_arg(const char **s) {
+       if (!zstr(*s) && !strcasecmp(*s, "undef")) *s = NULL;
+}
 
 static int node_caller_count(fifo_node_t *node)
 {
@@ -2607,8 +2609,8 @@ SWITCH_STANDARD_APP(fifo_function)
                moh = NULL;
        }
 
-       check_string(announce);
-       check_string(moh);
+       cleanup_fifo_arg(&announce);
+       cleanup_fifo_arg(&moh);
        switch_assert(node);
 
        switch_core_media_bug_pause(session);