Changeset 13722


Ignore:
Timestamp:
Dec 30, 2012, 10:06:45 PM (9 years ago)
Author:
jordan
Message:

make tr_info.webseedCount and tr_info.trackerCount unsigned.

Location:
trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/details.c

    r13683 r13722  
    13521352    /* step 2: add any new webseeds */
    13531353    for (i=0; i<n; ++i) {
    1354         int j;
     1354        unsigned int j;
    13551355        const tr_torrent * tor = torrents[i];
    13561356        const tr_info * inf = tr_torrentInfo (tor);
     
    13761376    /* step 3: update the webseeds */
    13771377    for (i=0; i<n; ++i) {
    1378         int j;
     1378        unsigned int j;
    13791379        tr_torrent * tor = torrents[i];
    13801380        const tr_info * inf = tr_torrentInfo (tor);
     
    21602160get_editable_tracker_list (GString * gstr, const tr_torrent * tor)
    21612161{
    2162     int i;
     2162    unsigned int i;
    21632163    int tier = 0;
    21642164    const tr_info * inf = tr_torrentInfo (tor);
  • trunk/gtk/filter.c

    r13656 r13722  
    553553
    554554        case CAT_FILTER_TYPE_HOST: {
    555             int i;
     555            unsigned int i;
    556556            char tmp[1024];
    557557            for (i=0; i<inf->trackerCount; ++i) {
  • trunk/gtk/tr-core.c

    r13689 r13722  
    10121012build_torrent_trackers_hash (tr_torrent * tor)
    10131013{
    1014   int i;
     1014  unsigned int i;
    10151015  const char * pch;
    10161016  uint64_t hash = 0;
  • trunk/libtransmission/metainfo.c

    r13683 r13722  
    546546tr_metainfoFree (tr_info * inf)
    547547{
    548   int i;
     548  unsigned int i;
    549549  tr_file_index_t ff;
    550550
  • trunk/libtransmission/peer-mgr.c

    r13709 r13722  
    514514rebuildWebseedArray (Torrent * t, tr_torrent * tor)
    515515{
    516     int i;
     516    unsigned int i;
    517517    const tr_info * inf = &tor->info;
    518518
     
    26892689tr_peerMgrWebSpeeds_KBps (const tr_torrent * tor)
    26902690{
    2691   int i;
    2692   int webseedCount;
     2691  unsigned int i;
     2692  unsigned int webseedCount;
    26932693  const Torrent * t;
    26942694  const tr_webseed ** webseeds;
  • trunk/libtransmission/rpcimpl.c

    r13683 r13722  
    447447
    448448static void
    449 addWebseeds (const tr_info * info,
    450              tr_variant *      webseeds)
    451 {
    452     int i;
    453 
    454     for (i = 0; i < info->webseedCount; ++i)
    455         tr_variantListAddStr (webseeds, info->webseeds[i]);
     449addWebseeds (const tr_info  * info,
     450             tr_variant     * webseeds)
     451{
     452  unsigned int i;
     453
     454  for (i=0; i< info->webseedCount; ++i)
     455    tr_variantListAddStr (webseeds, info->webseeds[i]);
    456456}
    457457
    458458static void
    459 addTrackers (const tr_info * info,
    460              tr_variant *      trackers)
    461 {
    462     int i;
    463 
    464     for (i = 0; i < info->trackerCount; ++i)
    465     {
    466         const tr_tracker_info * t = &info->trackers[i];
    467         tr_variant *              d = tr_variantListAddDict (trackers, 4);
    468         tr_variantDictAddStr (d, TR_KEY_announce, t->announce);
    469         tr_variantDictAddInt (d, TR_KEY_id, t->id);
    470         tr_variantDictAddStr (d, TR_KEY_scrape, t->scrape);
    471         tr_variantDictAddInt (d, TR_KEY_tier, t->tier);
     459addTrackers (const tr_info  * info,
     460             tr_variant     * trackers)
     461{
     462  unsigned int i;
     463
     464  for (i=0; i<info->trackerCount; ++i)
     465    {
     466      const tr_tracker_info * t = &info->trackers[i];
     467      tr_variant * d = tr_variantListAddDict (trackers, 4);
     468      tr_variantDictAddStr (d, TR_KEY_announce, t->announce);
     469      tr_variantDictAddInt (d, TR_KEY_id, t->id);
     470      tr_variantDictAddStr (d, TR_KEY_scrape, t->scrape);
     471      tr_variantDictAddInt (d, TR_KEY_tier, t->tier);
    472472    }
    473473}
  • trunk/libtransmission/torrent-magnet.c

    r13683 r13722  
    374374tr_torrentInfoGetMagnetLink (const tr_info * inf)
    375375{
    376     int i;
     376    unsigned int i;
    377377    const char * name;
    378378    struct evbuffer * s = evbuffer_new ();
  • trunk/libtransmission/torrent.c

    r13688 r13722  
    12571257          }
    12581258
    1259         if ((s->leftUntilDone > s->desiredAvailable) && (tor->info.webseedCount < 0))
     1259        if ((s->leftUntilDone > s->desiredAvailable) && (tor->info.webseedCount < 1))
    12601260          s->eta = TR_ETA_NOT_AVAIL;
    12611261        else if (tor->etaDLSpeed_KBps < 1)
  • trunk/libtransmission/transmission.h

    r13703 r13722  
    17251725    time_t             dateCreated;
    17261726
    1727     int                trackerCount;
    1728     int                webseedCount;
     1727    unsigned int       trackerCount;
     1728    unsigned int       webseedCount;
    17291729    tr_file_index_t    fileCount;
    17301730    uint32_t           pieceSize;
  • trunk/qt/app.cc

    r13667 r13722  
    470470main( int argc, char * argv[] )
    471471{
     472std::cerr << "sizeof double " << sizeof(double) << std::endl;
     473std::cerr << "sizeof Speed " << sizeof(Speed) << std::endl;
     474std::cerr << "sizeof int " << sizeof(int) << std::endl;
     475std::cerr << "sizeof bool " << sizeof(bool) << std::endl;
     476std::cerr << "sizeof uint64_t " << sizeof(uint64_t) << std::endl;
     477std::cerr << "sizeof QString is " << sizeof(QString) << std::endl;
     478std::cerr << "sizeof TrFile is " << sizeof(struct TrFile) << std::endl;
     479std::cerr << "sizeof Peer is " << sizeof(Peer) << std::endl;
     480std::cerr << "sizeof TrackerStat is " << sizeof(TrackerStat) << std::endl;
     481
    472482    // find .torrents, URLs, magnet links, etc in the command-line args
    473483    int c;
  • trunk/qt/my-valgrind.sh

    r13687 r13722  
    11#/bin/sh
    2 valgrind --tool=cachegrind ./transmission-qt 2>&1 | tee runlog
     2#valgrind --tool=cachegrind ./transmission-qt 2>&1 | tee runlog
     3valgrind --tool=massif --threshold=0.2 ./transmission-qt 2>&1 | tee runlog
    34#valgrind --tool=memcheck --leak-check=full --leak-resolution=high --num-callers=48 --log-file=x-valgrind --show-reachable=no ./transmission-qt 2>&1 | tee runlog
  • trunk/qt/torrent.cc

    r13719 r13722  
    556556
    557557      myFiles.clear ();
     558      myFiles.reserve (tr_variantListSize (files));
    558559
    559560      while ((child = tr_variantListChild (files, i)))
  • trunk/utils/show.c

    r13683 r13722  
    123123showInfo (const tr_info * inf)
    124124{
    125   int i;
     125  unsigned int i;
    126126  char buf[128];
    127127  tr_file ** files;
     
    186186  printf ("\nFILES\n\n");
    187187  files = tr_new (tr_file*, inf->fileCount);
    188   for (i=0; i< (int)inf->fileCount; ++i)
     188  for (i=0; i<inf->fileCount; ++i)
    189189    files[i] = &inf->files[i];
    190190  qsort (files, inf->fileCount, sizeof (tr_file*), compare_files_by_name);
    191   for (i=0; i< (int)inf->fileCount; ++i)
     191  for (i=0; i<inf->fileCount; ++i)
    192192    printf ("  %s (%s)\n", files[i]->name, tr_formatter_size_B (buf, files[i]->length, sizeof (buf)));
    193193  tr_free (files);
     
    218218doScrape (const tr_info * inf)
    219219{
    220   int i;
     220  unsigned int i;
    221221
    222222  for (i=0; i<inf->trackerCount; ++i)
Note: See TracChangeset for help on using the changeset viewer.