Ignore:
Timestamp:
Jan 23, 2009, 6:44:15 PM (13 years ago)
Author:
charles
Message:

(trunk libT) fix some code that the newly-added gcc warnings didn't like

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/blocklist-test.c

    r7231 r7783  
    77#include "utils.h"
    88
    9 #define VERBOSE 0
     9#undef VERBOSE
    1010
    11 #define check( A ) \
     11#ifdef VERBOSE
     12  #define check( A ) \
    1213    { \
    1314        ++test; \
    1415        if( A ){ \
    15             if( VERBOSE ) \
    16                 fprintf( stderr, "PASS test #%d (%s, %d)\n", test, __FILE__,\
    17                          __LINE__ );\
     16            fprintf( stderr, "PASS test #%d (%s, %d)\n", test, __FILE__, __LINE__ ); \
    1817        } else { \
    19             if( VERBOSE ) \
    20                 fprintf( stderr, "FAIL test #%d (%s, %d)\n", test, __FILE__,\
    21                          __LINE__ );\
     18            fprintf( stderr, "FAIL test #%d (%s, %d)\n", test, __FILE__, __LINE__ ); \
    2219            return test; \
    2320        } \
    2421    }
     22#else
     23  #define check( A )\
     24    { \
     25        ++test; \
     26        if( !( A ) ){ \
     27            fprintf( stderr, "FAIL test #%d (%s, %d)\n", test, __FILE__, __LINE__ ); \
     28            return test; \
     29        } \
     30    }
     31#endif
    2532
    2633static void
     
    4653{
    4754#ifndef WIN32
    48     char *         tmpfile_txt = "/tmp/transmission-blocklist-test.txt";
    49     char *         tmpfile_bin = "/tmp/transmission-blocklist-test.bin";
     55    const char *   tmpfile_txt = "/tmp/transmission-blocklist-test.txt";
     56    const char *   tmpfile_bin = "/tmp/transmission-blocklist-test.bin";
    5057#else
    51     char *         tmpfile_txt = "transmission-blocklist-test.txt";
    52     char *         tmpfile_bin = "transmission-blocklist-test.bin";
     58    const char *   tmpfile_txt = "transmission-blocklist-test.txt";
     59    const char *   tmpfile_bin = "transmission-blocklist-test.bin";
    5360#endif
    5461    struct tr_address addr;
Note: See TracChangeset for help on using the changeset viewer.