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/pjmedia/src/test/jbuf_test.c

    r3841 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 <stdio.h> 
     
    4848} test_cond_t; 
    4949 
    50 static pj_bool_t parse_test_headers(char *line, test_param_t *param,  
     50static pj_bool_t parse_test_headers(char *line, test_param_t *param, 
    5151                               test_cond_t *cond) 
    5252{ 
     
    5757        char mode_st[16]; 
    5858 
    59         sscanf(p+1, "%s %u %u %u", mode_st, &param->init_prefetch,  
     59        sscanf(p+1, "%s %u %u %u", mode_st, &param->init_prefetch, 
    6060               &param->min_prefetch, &param->max_prefetch); 
    6161        param->adaptive = (pj_ansi_stricmp(mode_st, "adaptive") == 0); 
     
    103103} 
    104104 
    105 static pj_bool_t process_test_data(char data, pjmedia_jbuf *jb,  
     105static pj_bool_t process_test_data(char data, pjmedia_jbuf *jb, 
    106106                                   pj_uint16_t *seq, pj_uint16_t *last_seq) 
    107107{ 
     
    156156 
    157157        pjmedia_jbuf_get_state(jb, &state); 
    158         printf("seq=%d\t%c\tsize=%d\tprefetch=%d\n",  
     158        printf("seq=%d\t%c\tsize=%d\tprefetch=%d\n", 
    159159               *last_seq, toupper(data), state.size, state.prefetch); 
    160160    } 
     161#else 
     162    PJ_UNUSED_ARG(print_state); /* Warning about variable set but unused */ 
    161163#endif 
    162164 
     
    171173    int rc = 0; 
    172174    const char* input_filename = "Jbtest.dat"; 
    173     const char* input_search_path[] = {  
     175    const char* input_search_path[] = { 
    174176        "../build", 
    175177        "pjmedia/build", 
     
    192194        } 
    193195    } 
    194      
     196 
    195197    /* Failed to open test data file. */ 
    196198    if (input == NULL) { 
     
    245247 
    246248        if (param.adaptive) { 
    247             pjmedia_jbuf_set_adaptive(jb,  
    248                                       param.init_prefetch,  
     249            pjmedia_jbuf_set_adaptive(jb, 
     250                                      param.init_prefetch, 
    249251                                      param.min_prefetch, 
    250252                                      param.max_prefetch); 
     
    255257#ifdef REPORT 
    256258        pjmedia_jbuf_get_state(jb, &state); 
    257         printf("Initial\tsize=%d\tprefetch=%d\tmin.pftch=%d\tmax.pftch=%d\n",  
    258                state.size, state.prefetch, state.min_prefetch,  
     259        printf("Initial\tsize=%d\tprefetch=%d\tmin.pftch=%d\tmax.pftch=%d\n", 
     260               state.size, state.prefetch, state.min_prefetch, 
    259261               state.max_prefetch); 
    260262#endif 
     
    264266        while (1) { 
    265267            char c; 
    266              
     268 
    267269            /* Get next line of test data */ 
    268270            if (!p || *p == 0) { 
     
    302304        printf("  size=%d prefetch=%d\n", state.size, state.prefetch); 
    303305        printf("  delay (min/max/avg/dev)=%d/%d/%d/%d ms\n", 
    304                state.min_delay, state.max_delay, state.avg_delay,  
     306               state.min_delay, state.max_delay, state.avg_delay, 
    305307               state.dev_delay); 
    306         printf("  lost=%d discard=%d empty=%d burst(avg)=%d\n",  
     308        printf("  lost=%d discard=%d empty=%d burst(avg)=%d\n", 
    307309               state.lost, state.discard, state.empty, state.avg_burst); 
    308310 
    309311        /* Evaluate test session */ 
    310312        if (cond.burst >= 0 && (int)state.avg_burst > cond.burst) { 
    311             printf("! 'Burst' should be %d, it is %d\n",  
     313            printf("! 'Burst' should be %d, it is %d\n", 
    312314                   cond.burst, state.avg_burst); 
    313315            rc |= 1; 
    314316        } 
    315317        if (cond.delay >= 0 && (int)state.avg_delay/JB_PTIME > cond.delay) { 
    316             printf("! 'Delay' should be %d, it is %d\n",  
     318            printf("! 'Delay' should be %d, it is %d\n", 
    317319                   cond.delay, state.avg_delay/JB_PTIME); 
    318320            rc |= 2; 
    319321        } 
    320322        if (cond.delay_min >= 0 && (int)state.min_delay/JB_PTIME > cond.delay_min) { 
    321             printf("! 'Minimum delay' should be %d, it is %d\n",  
     323            printf("! 'Minimum delay' should be %d, it is %d\n", 
    322324                   cond.delay_min, state.min_delay/JB_PTIME); 
    323325            rc |= 32; 
     
    329331        } 
    330332        if (cond.empty >= 0 && (int)state.empty > cond.empty) { 
    331             printf("! 'Empty' should be %d, it is %d\n",  
     333            printf("! 'Empty' should be %d, it is %d\n", 
    332334                   cond.empty, state.empty); 
    333335            rc |= 8; 
    334336        } 
    335337        if (cond.lost >= 0 && (int)state.lost > cond.lost) { 
    336             printf("! 'Lost' should be %d, it is %d\n",  
     338            printf("! 'Lost' should be %d, it is %d\n", 
    337339                   cond.lost, state.lost); 
    338340            rc |= 16; 
Note: See TracChangeset for help on using the changeset viewer.