Ignore:
Timestamp:
Feb 4, 2014 10:13:56 AM (10 years ago)
Author:
bennylp
Message:

Misc (re #1630): Fixing warnings about variable set but not used with recent gcc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjnath/src/pjnath-test/ice_test.c

    r4412 r4728  
    11/* $Id$ */ 
    2 /*  
     2/* 
    33 * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com) 
    44 * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> 
     
    1616 * You should have received a copy of the GNU General Public License 
    1717 * along with this program; if not, write to the Free Software 
    18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA  
     18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
    1919 */ 
    2020#include "test.h" 
     
    113113 
    114114static void ice_on_rx_data(pj_ice_strans *ice_st, 
    115                            unsigned comp_id,  
     115                           unsigned comp_id, 
    116116                           void *pkt, pj_size_t size, 
    117117                           const pj_sockaddr_t *src_addr, 
    118118                           unsigned src_addr_len); 
    119 static void ice_on_ice_complete(pj_ice_strans *ice_st,  
     119static void ice_on_ice_complete(pj_ice_strans *ice_st, 
    120120                                pj_ice_strans_op op, 
    121121                                pj_status_t status); 
     
    202202    return PJ_SUCCESS; 
    203203} 
    204                               
     204 
    205205/* Create test session */ 
    206206static int create_sess(pj_stun_config *stun_cfg, 
     
    239239        return -10; 
    240240    } 
    241     sess->server->turn_respond_allocate =  
     241    sess->server->turn_respond_allocate = 
    242242        sess->server->turn_respond_refresh = PJ_TRUE; 
    243243 
     
    319319 
    320320static void ice_on_rx_data(pj_ice_strans *ice_st, 
    321                            unsigned comp_id,  
     321                           unsigned comp_id, 
    322322                           void *pkt, pj_size_t size, 
    323323                           const pj_sockaddr_t *src_addr, 
     
    336336 
    337337 
    338 static void ice_on_ice_complete(pj_ice_strans *ice_st,  
     338static void ice_on_ice_complete(pj_ice_strans *ice_st, 
    339339                                pj_ice_strans_op op, 
    340340                                pj_status_t status) 
     
    437437    for (; i<max_cnt; ++i) { 
    438438        if (ept1->cfg.comp_cnt>i && 
    439             pj_ice_strans_get_valid_pair(ept1->ice, i+1) != NULL)  
     439            pj_ice_strans_get_valid_pair(ept1->ice, i+1) != NULL) 
    440440        { 
    441441            PJ_LOG(3,(THIS_FILE, INDENT "err: ice1 shouldn't have valid pair " 
     
    444444        } 
    445445        if (ept2->cfg.comp_cnt>i && 
    446             pj_ice_strans_get_valid_pair(ept2->ice, i+1) != NULL)  
     446            pj_ice_strans_get_valid_pair(ept2->ice, i+1) != NULL) 
    447447        { 
    448448            PJ_LOG(3,(THIS_FILE, INDENT "err: ice2 shouldn't have valid pair " 
     
    464464                                    pj_gettimeofday(&t); \ 
    465465                                    if (expr) { \ 
    466                                         rc = PJ_SUCCESS; \ 
     466                                        RC = PJ_SUCCESS; \ 
    467467                                        break; \ 
    468468                                    } \ 
     
    478478    struct test_sess *sess = (struct test_sess *) data; 
    479479    pj_stun_config *stun_cfg = sess->stun_cfg; 
    480      
     480 
    481481    /* Wait until negotiation is complete on both endpoints */ 
    482482#define ALL_DONE    (sess->param->worker_quit || \ 
     
    484484                         sess->callee.result.nego_status!=PJ_EPENDING)) 
    485485    WAIT_UNTIL(sess->param->worker_timeout, ALL_DONE, rc); 
    486      
     486    PJ_UNUSED_ARG(rc); 
    487487    return 0; 
    488488} 
     
    539539    } 
    540540    /* Init ICE on caller */ 
    541     rc = pj_ice_strans_init_ice(sess->caller.ice, sess->caller.cfg.role,  
     541    rc = pj_ice_strans_init_ice(sess->caller.ice, sess->caller.cfg.role, 
    542542                                &sess->caller.ufrag, &sess->caller.pass); 
    543543    if (rc != PJ_SUCCESS) { 
     
    548548 
    549549    /* Init ICE on callee */ 
    550     rc = pj_ice_strans_init_ice(sess->callee.ice, sess->callee.cfg.role,  
     550    rc = pj_ice_strans_init_ice(sess->callee.ice, sess->callee.cfg.role, 
    551551                                &sess->callee.ufrag, &sess->callee.pass); 
    552552    if (rc != PJ_SUCCESS) { 
     
    597597        goto on_destroy; 
    598598    } 
    599      
     599 
    600600    WAIT_UNTIL(30000, ALL_DONE, rc); 
    601601    if (!ALL_DONE) { 
     
    691691        struct test_cfg  ua1; 
    692692        struct test_cfg  ua2; 
    693     } sess_cfg[] =  
     693    } sess_cfg[] = 
    694694    { 
    695695        /*  Role    comp#   host?   stun?   turn?   flag?  ans_del snd_del des_del */ 
     
    741741    /* Simple test first with host candidate */ 
    742742    if (1) { 
    743         struct sess_cfg_t cfg =  
     743        struct sess_cfg_t cfg = 
    744744        { 
    745745            "Basic with host candidates", 
     
    750750        }; 
    751751 
    752         rc = perform_test(cfg.title, &stun_cfg, cfg.server_flag,  
     752        rc = perform_test(cfg.title, &stun_cfg, cfg.server_flag, 
    753753                          &cfg.ua1, &cfg.ua2); 
    754754        if (rc != 0) 
     
    757757        cfg.ua1.comp_cnt = 2; 
    758758        cfg.ua2.comp_cnt = 2; 
    759         rc = perform_test("Basic with host candidates, 2 components",  
    760                           &stun_cfg, cfg.server_flag,  
    761                           &cfg.ua1, &cfg.ua2); 
    762         if (rc != 0) 
    763             goto on_return; 
    764     } 
    765      
     759        rc = perform_test("Basic with host candidates, 2 components", 
     760                          &stun_cfg, cfg.server_flag, 
     761                          &cfg.ua1, &cfg.ua2); 
     762        if (rc != 0) 
     763            goto on_return; 
     764    } 
     765 
    766766    /* Simple test first with srflx candidate */ 
    767767    if (1) { 
    768         struct sess_cfg_t cfg =  
     768        struct sess_cfg_t cfg = 
    769769        { 
    770770            "Basic with srflx candidates", 
     
    775775        }; 
    776776 
    777         rc = perform_test(cfg.title, &stun_cfg, cfg.server_flag,  
     777        rc = perform_test(cfg.title, &stun_cfg, cfg.server_flag, 
    778778                          &cfg.ua1, &cfg.ua2); 
    779779        if (rc != 0) 
     
    783783        cfg.ua2.comp_cnt = 2; 
    784784 
    785         rc = perform_test("Basic with srflx candidates, 2 components",  
    786                           &stun_cfg, cfg.server_flag,  
     785        rc = perform_test("Basic with srflx candidates, 2 components", 
     786                          &stun_cfg, cfg.server_flag, 
    787787                          &cfg.ua1, &cfg.ua2); 
    788788        if (rc != 0) 
     
    792792    /* Simple test with relay candidate */ 
    793793    if (1) { 
    794         struct sess_cfg_t cfg =  
     794        struct sess_cfg_t cfg = 
    795795        { 
    796796            "Basic with relay candidates", 
     
    801801        }; 
    802802 
    803         rc = perform_test(cfg.title, &stun_cfg, cfg.server_flag,  
     803        rc = perform_test(cfg.title, &stun_cfg, cfg.server_flag, 
    804804                          &cfg.ua1, &cfg.ua2); 
    805805        if (rc != 0) 
     
    809809        cfg.ua2.comp_cnt = 2; 
    810810 
    811         rc = perform_test("Basic with relay candidates, 2 components",  
    812                           &stun_cfg, cfg.server_flag,  
     811        rc = perform_test("Basic with relay candidates, 2 components", 
     812                          &stun_cfg, cfg.server_flag, 
    813813                          &cfg.ua1, &cfg.ua2); 
    814814        if (rc != 0) 
     
    818818    /* Failure test with STUN resolution */ 
    819819    if (1) { 
    820         struct sess_cfg_t cfg =  
     820        struct sess_cfg_t cfg = 
    821821        { 
    822822            "STUN resolution failure", 
     
    835835        cfg.ua2.client_flag |= DEL_ON_ERR; 
    836836 
    837         rc = perform_test("STUN resolution failure with destroy on callback",  
    838                           &stun_cfg, cfg.server_flag,  
     837        rc = perform_test("STUN resolution failure with destroy on callback", 
     838                          &stun_cfg, cfg.server_flag, 
    839839                          &cfg.ua1, &cfg.ua2); 
    840840        if (rc != 0) 
     
    844844    /* Failure test with TURN resolution */ 
    845845    if (1) { 
    846         struct sess_cfg_t cfg =  
     846        struct sess_cfg_t cfg = 
    847847        { 
    848848            "TURN allocation failure", 
     
    853853        }; 
    854854 
    855         rc = perform_test(cfg.title, &stun_cfg, cfg.server_flag,  
     855        rc = perform_test(cfg.title, &stun_cfg, cfg.server_flag, 
    856856                          &cfg.ua1, &cfg.ua2); 
    857857        if (rc != 0) 
     
    861861        cfg.ua2.client_flag |= DEL_ON_ERR; 
    862862 
    863         rc = perform_test("TURN allocation failure with destroy on callback",  
    864                           &stun_cfg, cfg.server_flag,  
     863        rc = perform_test("TURN allocation failure with destroy on callback", 
     864                          &stun_cfg, cfg.server_flag, 
    865865                          &cfg.ua1, &cfg.ua2); 
    866866        if (rc != 0) 
     
    871871    /* STUN failure, testing TURN deallocation */ 
    872872    if (1) { 
    873         struct sess_cfg_t cfg =  
     873        struct sess_cfg_t cfg = 
    874874        { 
    875875            "STUN failure, testing TURN deallocation", 
     
    888888        cfg.ua2.client_flag |= DEL_ON_ERR; 
    889889 
    890         rc = perform_test("STUN failure, testing TURN deallocation (cb)",  
    891                           &stun_cfg, cfg.server_flag,  
     890        rc = perform_test("STUN failure, testing TURN deallocation (cb)", 
     891                          &stun_cfg, cfg.server_flag, 
    892892                          &cfg.ua1, &cfg.ua2); 
    893893        if (rc != 0) 
     
    909909                pj_ice_sess_role        ua1; 
    910910                pj_ice_sess_role        ua2; 
    911             } role[] =  
     911            } role[] = 
    912912            { 
    913913                { ROLE1, ROLE2}, 
     
    937937                        char title[120]; 
    938938 
    939                         sprintf(title,  
    940                                 "%s/%s, %dms answer delay, %d vs %d components",  
     939                        sprintf(title, 
     940                                "%s/%s, %dms answer delay, %d vs %d components", 
    941941                                pj_ice_sess_role_name(role[j].ua1), 
    942942                                pj_ice_sess_role_name(role[j].ua2), 
     
    944944 
    945945                        cfg->ua2.comp_cnt = k2; 
    946                         rc = perform_test(title, &stun_cfg, cfg->server_flag,  
     946                        rc = perform_test(title, &stun_cfg, cfg->server_flag, 
    947947                                          &cfg->ua1, &cfg->ua2); 
    948948                        if (rc != 0) 
     
    10221022    unsigned i; 
    10231023    int rc; 
    1024      
     1024 
    10251025    pool = pj_pool_create(mem, NULL, 512, 512, NULL); 
    10261026    rc = create_stun_config(pool, &stun_cfg); 
     
    10291029        return -7; 
    10301030    } 
    1031      
     1031 
    10321032    for (i = 0; i < LOOP; i++) { 
    10331033        PJ_LOG(3,(THIS_FILE, INDENT "Test %d of %d", i+1, LOOP)); 
     
    10391039    /* Avoid compiler warning */ 
    10401040    goto on_return; 
    1041      
     1041 
    10421042on_return: 
    10431043    destroy_stun_config(&stun_cfg); 
Note: See TracChangeset for help on using the changeset viewer.