All pastes #623438 Raw Edit

Untitled

public text v1 · immutable
·published 2007-07-17 16:26 UTC
rendered paste body
channel.c: In function âast_channel_spy_count_by_typeâ:
channel.c:1489: warning: value computed is not used
channel.c: In function âast_channel_spy_count_by_type_runningâ:
channel.c:1507: warning: value computed is not used

void ast_channel_spy_count_by_type(struct ast_channel *chan, const char *type, int *count)
{
        *count = 0;
        struct ast_channel_spy *spy = NULL;

        ast_log(LOG_NOTICE,"Passed type is this: %s \n", type);

        if (!chan->spies) {
                ast_log(LOG_NOTICE,"Argh! How come !chan->spies is true! \n");
                return;
        }

        AST_LIST_TRAVERSE_SAFE_BEGIN(&chan->spies->list, spy, list) {
                ast_log(LOG_NOTICE,"The spies are of type: %s \n", spy->type);
//              if (spy->type == type) {
                if (strcmp(spy->type, type)) {
                        ast_log(LOG_NOTICE,"Found one! %i", *count);
                        *count++;
                }
        }
        AST_LIST_TRAVERSE_SAFE_END;
        return;
}

/* Count number of channel spies by type that are running */
void ast_channel_spy_count_by_type_running(struct ast_channel *chan, const char *type, int *count)
{
        *count = 0;
        struct ast_channel_spy *spy = NULL;

        if (!chan->spies)
                return;

        AST_LIST_TRAVERSE_SAFE_BEGIN(&chan->spies->list, spy, list) {
                if ((spy->type == type) && (spy->status == CHANSPY_RUNNING))
                        *count++;
        }
        AST_LIST_TRAVERSE_SAFE_END;
        return;

}