Changeset 14644


Ignore:
Timestamp:
Dec 29, 2015, 7:37:31 PM (5 years ago)
Author:
mikedld
Message:

Remove useless checks and definitions (C99)

Now that MSVC support for C99 is quite good, remove previously needed but
now unused checks and definitions, like PRI* format macros (including
PRIdMAX and TR_PRIuSIZE, replaced with %jd and %zu) and inline macro.
Also, remove ssize_t typedef and replace few occurences with ev_ssize_t.
Also, remove check for stdbool.h availability (guaranteed by C99) and
include it unconditionally (except when in C++ mode).

Location:
trunk
Files:
25 edited

Legend:

Unmodified
Added
Removed
  • trunk/CMakeLists.txt

    r14625 r14644  
    454454
    455455set(NEEDED_HEADERS
    456     stdbool.h
    457456    sys/statvfs.h
    458457    xfs/xfs.h
  • trunk/configure.ac

    r14575 r14644  
    107107AC_HEADER_TIME
    108108
    109 AC_CHECK_HEADERS([stdbool.h xlocale.h])
     109AC_CHECK_HEADERS([xlocale.h])
    110110AC_CHECK_FUNCS([iconv_open pread pwrite lrintf strlcpy daemon dirname basename canonicalize_file_name strcasecmp localtime_r fallocate64 posix_fallocate memmem strsep strtold syslog valloc getpagesize posix_memalign statvfs htonll ntohll mkdtemp uselocale _configthreadlocale])
    111111AC_PROG_INSTALL
  • trunk/libtransmission/announcer-http.c

    r14634 r14644  
    259259
    260260            if (tr_variantDictFindRaw (&benc, TR_KEY_peers6, &raw, &len)) {
    261                 dbgmsg (data->log_name, "got a peers6 length of %"TR_PRIuSIZE, len);
     261                dbgmsg (data->log_name, "got a peers6 length of %zu", len);
    262262                response->pex6 = tr_peerMgrCompact6ToPex (raw, len,
    263263                                              NULL, 0, &response->pex6_count);
     
    265265
    266266            if (tr_variantDictFindRaw (&benc, TR_KEY_peers, &raw, &len)) {
    267                 dbgmsg (data->log_name, "got a compact peers length of %"TR_PRIuSIZE, len);
     267                dbgmsg (data->log_name, "got a compact peers length of %zu", len);
    268268                response->pex = tr_peerMgrCompactToPex (raw, len,
    269269                                               NULL, 0, &response->pex_count);
    270270            } else if (tr_variantDictFindList (&benc, TR_KEY_peers, &tmp)) {
    271271                response->pex = listToPex (tmp, &response->pex_count);
    272                 dbgmsg (data->log_name, "got a peers list with %"TR_PRIuSIZE" entries",
     272                dbgmsg (data->log_name, "got a peers list with %zu entries",
    273273                        response->pex_count);
    274274            }
  • trunk/libtransmission/announcer-udp.c

    r14633 r14644  
    689689    }
    690690
    691     dbgmsg (tracker->key, "addr %p -- connected %d (%"TR_PRIuSIZE" %"TR_PRIuSIZE") -- connecting_at %"TR_PRIuSIZE,
     691    dbgmsg (tracker->key, "addr %p -- connected %d (%zu %zu) -- connecting_at %zu",
    692692            (void*)tracker->addr,
    693693            (int)(tracker->connection_expiration_time > now),
     
    872872    struct evbuffer * buf;
    873873
    874     /*fprintf (stderr, "got an incoming udp message w/len %"TR_PRIuSIZE"\n", msglen);*/
     874    /*fprintf (stderr, "got an incoming udp message w/len %zu\n", msglen);*/
    875875
    876876    if (!session || !session->announcer_udp)
  • trunk/libtransmission/announcer.c

    r14633 r14644  
    10331033                      "min_interval:%d "
    10341034                      "tracker_id_str:%s "
    1035                       "pex:%"TR_PRIuSIZE" "
    1036                       "pex6:%"TR_PRIuSIZE" "
     1035                      "pex:%zu "
     1036                      "pex6:%zu "
    10371037                      "err:%s "
    10381038                      "warn:%s",
     
    12851285    /* schedule a rescrape */
    12861286    interval = getRetryInterval (tier->currentTracker);
    1287     dbgmsg (tier, "Retrying scrape in %"TR_PRIuSIZE" seconds.", (size_t)interval);
    1288     tr_logAddTorInfo (tier->tor, "Retrying scrape in %"TR_PRIuSIZE" seconds.", (size_t)interval);
     1287    dbgmsg (tier, "Retrying scrape in %zu seconds.", (size_t)interval);
     1288    tr_logAddTorInfo (tier->tor, "Retrying scrape in %zu seconds.", (size_t)interval);
    12891289    tier->lastScrapeSucceeded = false;
    12901290    tier->scrapeAt = get_next_scrape_time (session, tier, interval);
  • trunk/libtransmission/bandwidth.c

    r14532 r14644  
    394394#ifdef DEBUG_DIRECTION
    395395if ((dir == DEBUG_DIRECTION) && (band->isLimited))
    396 fprintf (stderr, "%p consumed %5"TR_PRIuSIZE" bytes of %5s data... was %6"TR_PRIuSIZE", now %6"TR_PRIuSIZE" left\n",
     396fprintf (stderr, "%p consumed %5zu bytes of %5s data... was %6zu, now %6zu left\n",
    397397         b, byteCount, (isPieceData?"piece":"raw"), oldBytesLeft, band->bytesLeft);
    398398#endif
  • trunk/libtransmission/blocklist.c

    r14334 r14644  
    9898
    9999  base = tr_sys_path_basename (b->filename, NULL);
    100   tr_logAddInfo (_("Blocklist \"%s\" contains %"TR_PRIuSIZE" entries"), base, b->ruleCount);
     100  tr_logAddInfo (_("Blocklist \"%s\" contains %zu entries"), base, b->ruleCount);
    101101  tr_free (base);
    102102}
     
    406406    {
    407407      char * base = tr_sys_path_basename (b->filename, NULL);
    408       tr_logAddInfo (_("Blocklist \"%s\" updated with %"TR_PRIuSIZE" entries"), base, ranges_count);
     408      tr_logAddInfo (_("Blocklist \"%s\" updated with %zu entries"), base, ranges_count);
    409409      tr_free (base);
    410410    }
  • trunk/libtransmission/cache.c

    r14613 r14644  
    9494      if (b->tor != ref->tor)
    9595        break;
    96       //fprintf (stderr, "pos %d tor %d block %"TR_PRIuSIZE" time %"TR_PRIuSIZE"\n", i, b->tor->uniqueId, (size_t)b->block, (size_t)b->time);
     96      //fprintf (stderr, "pos %d tor %d block %zu time %zu\n", i, b->tor->uniqueId, (size_t)b->block, (size_t)b->time);
    9797    }
    9898
     
    439439  tr_torGetFileBlockRange (torrent, i, &first, &last);
    440440  pos = findBlockPos (cache, torrent, first);
    441   dbgmsg ("flushing file %d from cache to disk: blocks [%"TR_PRIuSIZE"...%"TR_PRIuSIZE"]", (int)i, (size_t)first, (size_t)last);
     441  dbgmsg ("flushing file %d from cache to disk: blocks [%zu...%zu]", (int)i, (size_t)first, (size_t)last);
    442442
    443443  /* flush out all the blocks in that file */
  • trunk/libtransmission/handshake.c

    r14476 r14644  
    251251  uint8_t peer_id[PEER_ID_LEN];
    252252
    253   dbgmsg (handshake, "payload: need %d, got %"TR_PRIuSIZE,
     253  dbgmsg (handshake, "payload: need %d, got %zu",
    254254          HANDSHAKE_SIZE, evbuffer_get_length (inbuf));
    255255
     
    568568  const size_t needlen = handshake->pad_d_len;
    569569
    570   dbgmsg (handshake, "pad d: need %"TR_PRIuSIZE", got %"TR_PRIuSIZE,
     570  dbgmsg (handshake, "pad d: need %zu, got %zu",
    571571          needlen, evbuffer_get_length (inbuf));
    572572  if (evbuffer_get_length (inbuf) < needlen)
     
    596596  uint8_t hash[SHA_DIGEST_LENGTH];
    597597
    598   dbgmsg (handshake, "payload: need %d, got %"TR_PRIuSIZE,
     598  dbgmsg (handshake, "payload: need %d, got %zu",
    599599          INCOMING_HANDSHAKE_LEN, evbuffer_get_length (inbuf));
    600600
     
    736736  int len;
    737737
    738   dbgmsg (handshake, "in readYa... need %d, have %"TR_PRIuSIZE,
     738  dbgmsg (handshake, "in readYa... need %d, have %zu",
    739739          KEY_LEN, evbuffer_get_length (inbuf));
    740740  if (evbuffer_get_length (inbuf) < KEY_LEN)
     
    885885  uint32_t crypto_select;
    886886
    887   dbgmsg (handshake, "reading IA... have %"TR_PRIuSIZE", need %"TR_PRIuSIZE,
     887  dbgmsg (handshake, "reading IA... have %zu, need %zu",
    888888          evbuffer_get_length (inbuf), needlen);
    889889  if (evbuffer_get_length (inbuf) < needlen)
     
    962962  const size_t needlen = HANDSHAKE_SIZE;
    963963
    964   dbgmsg (handshake, "reading payload stream... have %"TR_PRIuSIZE", need %"TR_PRIuSIZE,
     964  dbgmsg (handshake, "reading payload stream... have %zu, need %zu",
    965965          evbuffer_get_length (inbuf), needlen);
    966966  if (evbuffer_get_length (inbuf) < needlen)
  • trunk/libtransmission/peer-io.c

    r14548 r14644  
    412412
    413413    rc = evbuffer_add (io->inbuf, buf, buflen);
    414     dbgmsg (io, "utp_on_read got %"TR_PRIuSIZE" bytes", buflen);
     414    dbgmsg (io, "utp_on_read got %zu bytes", buflen);
    415415
    416416    if (rc < 0) {
     
    431431
    432432    rc = evbuffer_remove (io->outbuf, buf, buflen);
    433     dbgmsg (io, "utp_on_write sending %"TR_PRIuSIZE" bytes... evbuffer_remove returned %d", buflen, rc);
     433    dbgmsg (io, "utp_on_write sending %zu bytes... evbuffer_remove returned %d", buflen, rc);
    434434    assert (rc == (int)buflen); /* if this fails, we've corrupted our bookkeeping somewhere */
    435435    if (rc < (long)buflen) {
     
    449449    bytes = tr_bandwidthClamp (&io->bandwidth, TR_DOWN, UTP_READ_BUFFER_SIZE);
    450450
    451     dbgmsg (io, "utp_get_rb_size is saying it's ready to read %"TR_PRIuSIZE" bytes", bytes);
     451    dbgmsg (io, "utp_get_rb_size is saying it's ready to read %zu bytes", bytes);
    452452    return UTP_READ_BUFFER_SIZE - bytes;
    453453}
     
    510510    assert (tr_isPeerIo (io));
    511511
    512     dbgmsg (io, "utp_on_overhead -- count is %"TR_PRIuSIZE, count);
     512    dbgmsg (io, "utp_on_overhead -- count is %zu", count);
    513513
    514514    tr_bandwidthUsed (&io->bandwidth, send ? TR_UP : TR_DOWN,
     
    12881288    int n = 0;
    12891289    const size_t old_len = evbuffer_get_length (io->outbuf);
    1290     dbgmsg (io, "in tr_peerIoTryWrite %"TR_PRIuSIZE, howmuch);
     1290    dbgmsg (io, "in tr_peerIoTryWrite %zu", howmuch);
    12911291
    12921292    if (howmuch > old_len)
     
    13411341        bytesUsed = tr_peerIoTryWrite (io, limit);
    13421342
    1343     dbgmsg (io, "flushing peer-io, direction %d, limit %"TR_PRIuSIZE", bytesUsed %d", (int)dir, limit, bytesUsed);
     1343    dbgmsg (io, "flushing peer-io, direction %d, limit %zu, bytesUsed %d", (int)dir, limit, bytesUsed);
    13441344    return bytesUsed;
    13451345}
  • trunk/libtransmission/peer-mgr.c

    r14640 r14644  
    29032903        const int inc = maxIncrease * mult;
    29042904        maxPeers = s->maxPeers + inc;
    2905         tordbg (s, "time since last cancel is %"PRIdMAX" -- increasing the "
     2905        tordbg (s, "time since last cancel is %jd -- increasing the "
    29062906                   "number of peers we're interested in by %d",
    29072907                   (intmax_t)timeSinceCancel, inc);
  • trunk/libtransmission/peer-msgs.c

    r14634 r14644  
    335335dbgOutMessageLen (tr_peerMsgs * msgs)
    336336{
    337   dbgmsg (msgs, "outMessage size is now %"TR_PRIuSIZE, evbuffer_get_length (msgs->outMessages));
     337  dbgmsg (msgs, "outMessage size is now %zu", evbuffer_get_length (msgs->outMessages));
    338338}
    339339
     
    907907{
    908908    struct peer_request req;
    909 /*fprintf (stderr, "SENDING CANCEL MESSAGE FOR BLOCK %"TR_PRIuSIZE"\n\t\tFROM PEER %p ------------------------------------\n", (size_t)block, msgs->peer);*/
     909/*fprintf (stderr, "SENDING CANCEL MESSAGE FOR BLOCK %zu\n\t\tFROM PEER %p ------------------------------------\n", (size_t)block, msgs->peer);*/
    910910    blockToReq (msgs->torrent, block, &req);
    911911    protocolSendCancel (msgs, &req);
     
    13011301    tr_peerIoReadUint8 (msgs->io, inbuf, &id);
    13021302    msgs->incoming.id = id;
    1303     dbgmsg (msgs, "msgs->incoming.id is now %d; msgs->incoming.length is %"TR_PRIuSIZE, id, (size_t)msgs->incoming.length);
     1303    dbgmsg (msgs, "msgs->incoming.id is now %d; msgs->incoming.length is %zu", id, (size_t)msgs->incoming.length);
    13041304
    13051305    if (id == BT_PIECE)
     
    14641464        fireClientGotPieceData (msgs, n);
    14651465        *setme_piece_bytes_read += n;
    1466         dbgmsg (msgs, "got %"TR_PRIuSIZE" bytes for block %u:%u->%u ... %d remain",
     1466        dbgmsg (msgs, "got %zu bytes for block %u:%u->%u ... %d remain",
    14671467               n, req->index, req->offset, req->length,
    14681468             (int)(req->length - evbuffer_get_length (block_buffer)));
     
    14981498    --msglen; /* id length */
    14991499
    1500     dbgmsg (msgs, "got BT id %d, len %d, buffer size is %"TR_PRIuSIZE, (int)id, (int)msglen, inlen);
     1500    dbgmsg (msgs, "got BT id %d, len %d, buffer size is %zu", (int)id, (int)msglen, inlen);
    15011501
    15021502    if (inlen < msglen)
     
    17651765    const size_t      inlen = evbuffer_get_length (in);
    17661766
    1767     dbgmsg (msgs, "canRead: inlen is %"TR_PRIuSIZE", msgs->state is %d", inlen, msgs->state);
     1767    dbgmsg (msgs, "canRead: inlen is %zu, msgs->state is %d", inlen, msgs->state);
    17681768
    17691769    if (!inlen)
     
    19331933    if (haveMessages && !msgs->outMessagesBatchedAt) /* fresh batch */
    19341934    {
    1935         dbgmsg (msgs, "started an outMessages batch (length is %"TR_PRIuSIZE")", evbuffer_get_length (msgs->outMessages));
     1935        dbgmsg (msgs, "started an outMessages batch (length is %zu)", evbuffer_get_length (msgs->outMessages));
    19361936        msgs->outMessagesBatchedAt = now;
    19371937    }
     
    19401940        const size_t len = evbuffer_get_length (msgs->outMessages);
    19411941        /* flush the protocol messages */
    1942         dbgmsg (msgs, "flushing outMessages... to %p (length is %"TR_PRIuSIZE")", (void*)msgs->io, len);
     1942        dbgmsg (msgs, "flushing outMessages... to %p (length is %zu)", (void*)msgs->io, len);
    19431943        tr_peerIoWriteBuf (msgs->io, msgs->outMessages, false);
    19441944        msgs->clientSentAnythingAt = now;
     
    20472047            if (!err && tr_torrentPieceNeedsCheck (msgs->torrent, req.index))
    20482048                if ((err = !tr_torrentCheckPiece (msgs->torrent, req.index)))
    2049                     tr_torrentSetLocalError (msgs->torrent, _("Please Verify Local Data! Piece #%"TR_PRIuSIZE" is corrupt."), (size_t)req.index);
     2049                    tr_torrentSetLocalError (msgs->torrent, _("Please Verify Local Data! Piece #%zu is corrupt."), (size_t)req.index);
    20502050
    20512051            if (err)
     
    21482148    evbuffer_add_uint8 (out, BT_BITFIELD);
    21492149    evbuffer_add     (out, bytes, byte_count);
    2150     dbgmsg (msgs, "sending bitfield... outMessage size is now %"TR_PRIuSIZE, evbuffer_get_length (out));
     2150    dbgmsg (msgs, "sending bitfield... outMessage size is now %zu", evbuffer_get_length (out));
    21512151    pokeBatchPeriod (msgs, IMMEDIATE_PRIORITY_INTERVAL_SECS);
    21522152
     
    24432443            evbuffer_add_buffer (out, payload);
    24442444            pokeBatchPeriod (msgs, HIGH_PRIORITY_INTERVAL_SECS);
    2445             dbgmsg (msgs, "sending a pex message; outMessage size is now %"TR_PRIuSIZE, evbuffer_get_length (out));
     2445            dbgmsg (msgs, "sending a pex message; outMessage size is now %zu", evbuffer_get_length (out));
    24462446            dbgOutMessageLen (msgs);
    24472447
  • trunk/libtransmission/resume.c

    r14532 r14644  
    164164  else
    165165    {
    166       tr_logAddTorDbg (tor, "Couldn't load DND flags. DND list (%p) has %"TR_PRIuSIZE" children; torrent has %d files",
     166      tr_logAddTorDbg (tor, "Couldn't load DND flags. DND list (%p) has %zu"" children; torrent has %d files",
    167167                       (void*)list, tr_variantListSize (list), (int)n);
    168168    }
  • trunk/libtransmission/rpc-server.c

    r14633 r14644  
    371371
    372372#if 0
    373           fprintf (stderr, "compressed response is %.2f of original (raw==%"TR_PRIuSIZE" bytes; compressed==%"TR_PRIuSIZE")\n",
     373          fprintf (stderr, "compressed response is %.2f of original (raw==%zu bytes; compressed==%zu)\n",
    374374                   (double)evbuffer_get_length (out)/content_len,
    375375                   content_len, evbuffer_get_length (out));
  • trunk/libtransmission/rpcimpl.c

    r14636 r14644  
    16501650  struct add_torrent_idle_data * data = user_data;
    16511651
    1652   dbgmsg ("torrentAdd: HTTP response code was %ld (%s); response length was %"TR_PRIuSIZE" bytes",
     1652  dbgmsg ("torrentAdd: HTTP response code was %ld (%s); response length was %zu bytes",
    16531653          response_code, tr_webGetResponseStr (response_code), response_byte_count);
    16541654
  • trunk/libtransmission/session.c

    r14613 r14644  
    676676    usec = min;
    677677  tr_timerAdd (session->nowTimer, 0, usec);
    678   /* fprintf (stderr, "time %"TR_PRIuSIZE" sec, %"TR_PRIuSIZE" microsec\n", (size_t)tr_time (), (size_t)tv.tv_usec); */
     678  /* fprintf (stderr, "time %zu sec, %zu microsec\n", (size_t)tr_time (), (size_t)tv.tv_usec); */
    679679}
    680680
     
    18701870  assert (tr_isSession (session));
    18711871
    1872   dbgmsg ("shutting down transmission session %p... now is %"TR_PRIuSIZE", deadline is %"TR_PRIuSIZE, (void*)session, (size_t)time (NULL), (size_t)deadline);
     1872  dbgmsg ("shutting down transmission session %p... now is %zu, deadline is %zu", (void*)session, (size_t)time (NULL), (size_t)deadline);
    18731873
    18741874  /* close the session */
     
    18871887           && !deadlineReached (deadline))
    18881888    {
    1889       dbgmsg ("waiting on port unmap (%p) or announcer (%p)... now %"TR_PRIuSIZE" deadline %"TR_PRIuSIZE,
     1889      dbgmsg ("waiting on port unmap (%p) or announcer (%p)... now %zu deadline %zu",
    18901890              (void*)session->shared, (void*)session->announcer, (size_t)time (NULL), (size_t)deadline);
    18911891      tr_wait_msec (50);
     
    18991899    {
    19001900      static bool forced = false;
    1901       dbgmsg ("waiting for libtransmission thread to finish... now %"TR_PRIuSIZE" deadline %"TR_PRIuSIZE, (size_t)time (NULL), (size_t)deadline);
     1901      dbgmsg ("waiting for libtransmission thread to finish... now %zu deadline %zu", (size_t)time (NULL), (size_t)deadline);
    19021902      tr_wait_msec (100);
    19031903
  • trunk/libtransmission/torrent.c

    r14642 r14644  
    561561
    562562          if (allAreSeeds)
    563             tr_logAddTorDbg (tor, "Got %"TR_PRIuSIZE" seeds from tracker", event->pexCount);
     563            tr_logAddTorDbg (tor, "Got %zu seeds from tracker", event->pexCount);
    564564          else
    565             tr_logAddTorDbg (tor, "Got %"TR_PRIuSIZE" peers from tracker", event->pexCount);
     565            tr_logAddTorDbg (tor, "Got %zu peers from tracker", event->pexCount);
    566566
    567567          for (i = 0; i < event->pexCount; ++i)
     
    26372637  const bool pass = tr_ioTestPiece (tor, pieceIndex);
    26382638
    2639   tr_deeplog_tor (tor, "[LAZY] tr_torrentCheckPiece tested piece %"TR_PRIuSIZE", pass==%d", (size_t)pieceIndex, (int)pass);
     2639  tr_deeplog_tor (tor, "[LAZY] tr_torrentCheckPiece tested piece %zu, pass==%d", (size_t)pieceIndex, (int)pass);
    26402640  tr_torrentSetHasPiece (tor, pieceIndex, pass);
    26412641  tr_torrentSetPieceChecked (tor, pieceIndex);
     
    33163316      if (tr_torrentPieceIsComplete (tor, p))
    33173317        {
    3318           tr_logAddTorDbg (tor, "[LAZY] checking just-completed piece %"TR_PRIuSIZE, (size_t)p);
     3318          tr_logAddTorDbg (tor, "[LAZY] checking just-completed piece %zu", (size_t)p);
    33193319
    33203320          if (tr_torrentCheckPiece (tor, p))
  • trunk/libtransmission/tr-utp.c

    r14479 r14644  
    6666UTP_Write (struct UTPSocket *socket, size_t count)
    6767{
    68     tr_logAddNamedError (MY_NAME, "UTP_RBDrained (%p, %"TR_PRIuSIZE") was called.", socket, count);
    69     dbgmsg ("UTP_RBDrained (%p, %"TR_PRIuSIZE") was called.", socket, count);
     68    tr_logAddNamedError (MY_NAME, "UTP_RBDrained (%p, %zu) was called.", socket, count);
     69    dbgmsg ("UTP_RBDrained (%p, %zu) was called.", socket, count);
    7070    assert (0); /* FIXME: this is too much for the long term, but probably needed in the short term */
    7171    return false;
  • trunk/libtransmission/transmission.h

    r14633 r14644  
    3030#include <time.h> /* time_t */
    3131
    32 #ifdef _MSC_VER
    33  typedef intptr_t ssize_t;
    34 #endif
    35 
    36 #if !defined (__cplusplus)
    37  #ifdef HAVE_STDBOOL_H
    38   #include <stdbool.h>
    39  #elif !defined (__bool_true_false_are_defined)
    40   #define bool uint8_t
    41   #define true 1
    42   #define false 0
    43  #endif
    44 #endif
    45 
    46 #ifndef PRId64
    47  #ifdef _WIN32
    48   #define PRId64 "I64"
    49  #else
    50   #define PRId64 "lld"
    51  #endif
    52 #endif
    53 
    54 #ifndef PRIu64
    55  #ifdef _WIN32
    56   #define PRIu64 "I64u"
    57  #else
    58   #define PRIu64 "llu"
    59  #endif
    60 #endif
    61 
    62 #ifndef PRIu32
    63  #ifdef _WIN32
    64   #define PRIu32 "u"
    65  #else
    66   #define PRIu32 "lu"
    67  #endif
    68 #endif
    69 
    70 #ifndef PRIdMAX
    71  #ifdef _WIN32
    72   #define PRIdMAX "I64"
    73  #else
    74   #define PRIdMAX "jd"
    75  #endif
    76 #endif
    77 
    78 #ifndef TR_PRIuSIZE
    79  #ifdef _WIN32
    80   #define TR_PRIuSIZE "Iu"
    81  #else
    82   #define TR_PRIuSIZE "zu"
    83  #endif
    84 #endif
    85 
    86 #if defined (_MSC_VER) && !defined (__cplusplus)
    87  #define inline __inline
     32#ifndef __cplusplus
     33 #include <stdbool.h>
    8834#endif
    8935
  • trunk/libtransmission/trevent.c

    r14525 r14644  
    191191            struct tr_run_data data;
    192192            const size_t       nwant = sizeof (data);
    193             const ssize_t      ngot = piperead (fd, &data, nwant);
    194             if (!eh->die && (ngot == (ssize_t)nwant))
     193            const ev_ssize_t   ngot = piperead (fd, &data, nwant);
     194            if (!eh->die && (ngot == (ev_ssize_t) nwant))
    195195            {
    196196                dbgmsg ("invoking function in libevent thread");
     
    325325      tr_pipe_end_t fd;
    326326      char ch;
    327       ssize_t res_1;
    328       ssize_t res_2;
     327      ev_ssize_t res_1;
     328      ev_ssize_t res_2;
    329329      tr_event_handle * e = session->events;
    330330      struct tr_run_data data;
  • trunk/libtransmission/variant-benc.c

    r14521 r14644  
    305305  const char * str;
    306306  tr_variantGetStr (v, &str, &len);
    307   evbuffer_add_printf (evbuf, "%"TR_PRIuSIZE":", len);
     307  evbuffer_add_printf (evbuf, "%zu:", len);
    308308  evbuffer_add (evbuf, str, len);
    309309}
  • trunk/libtransmission/variant-json.c

    r14535 r14644  
    8989  if (data->source)
    9090    {
    91       tr_logAddError ("JSON parse failed in %s at pos %"TR_PRIuSIZE": %s -- remaining text \"%.16s\"",
     91      tr_logAddError ("JSON parse failed in %s at pos %zu: %s -- remaining text \"%.16s\"",
    9292              data->source,
    9393              jsn->pos,
     
    9797  else
    9898    {
    99       tr_logAddError ("JSON parse failed at pos %"TR_PRIuSIZE": %s -- remaining text \"%.16s\"",
     99      tr_logAddError ("JSON parse failed at pos %zu: %s -- remaining text \"%.16s\"",
    100100              jsn->pos,
    101101              jsonsl_strerror (error),
  • trunk/libtransmission/variant-test.c

    r14634 r14644  
    101101
    102102  /* string len is designed to overflow */
    103   n = tr_snprintf ((char*)buf, sizeof (buf), "%"TR_PRIuSIZE":boat", (size_t)(SIZE_MAX-2));
     103  n = tr_snprintf ((char*)buf, sizeof (buf), "%zu:boat", (size_t)(SIZE_MAX-2));
    104104  err = tr_bencParseStr (buf, buf+n, &end, &str, &len);
    105105  check_int_eq (EILSEQ, err);
  • trunk/libtransmission/web.c

    r14634 r14644  
    131131
    132132  evbuffer_add (task->response, ptr, byteCount);
    133   dbgmsg ("wrote %"TR_PRIuSIZE" bytes to task %p's buffer", byteCount, (void*)task);
     133  dbgmsg ("wrote %zu bytes to task %p's buffer", byteCount, (void*)task);
    134134  return byteCount;
    135135}
  • trunk/utils/edit.c

    r14633 r14644  
    278278          tr_variant * tier = tr_variantListAddList (announce_list, 1);
    279279          tr_variantListAddStr (tier, url);
    280           printf ("\tAdded \"%s\" to \"announce-list\" tier %"TR_PRIuSIZE"\n", url, tr_variantListSize (announce_list));
     280          printf ("\tAdded \"%s\" to \"announce-list\" tier %zu\n", url, tr_variantListSize (announce_list));
    281281          changed = true;
    282282        }
Note: See TracChangeset for help on using the changeset viewer.