From: robertc <> Date: Mon, 29 Sep 2003 16:24:00 +0000 (+0000) Subject: Summary: Merge Gerard's AIX signed and datatype size patches. X-Git-Tag: SQUID_3_0_PRE4~1194 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e40497560cb00f30ce91a4771a5c23ff39418fc8;p=thirdparty%2Fsquid.git Summary: Merge Gerard's AIX signed and datatype size patches. Keywords: Patches applied: * gerard@eviston.net--squid/squid--aix-fixes--3.0--patch-5 typecast ntohl() in wccp.cc * ports@eviston.net--aix/squid--aix-fixes--3.0--patch-3 debug() ==> debugs() round 1 * ports@eviston.net--aix/squid--aix-fixes--3.0--patch-4 casts and format strings * ports@eviston.net--aix/squid--aix-fixes--3.0--patch-5 debug() => debugs() round 2: peer_digest.cc * ports@eviston.net--aix/squid--aix-fixes--3.0--patch-6 casts in stat.cc * ports@eviston.net--aix/squid--aix-fixes--3.0--patch-7 debug() => debugs() round 3 * ports@eviston.net--aix/squid--aix-fixes--3.0--patch-8 cast for ntohl() in wccp.cc * ports@eviston.net--aix/squid--aix-fixes--3.0--patch-9 casts in tools.cc --- diff --git a/src/HttpHdrRange.cc b/src/HttpHdrRange.cc index 1d0fe8fbd7..1e8d849a2a 100644 --- a/src/HttpHdrRange.cc +++ b/src/HttpHdrRange.cc @@ -1,6 +1,6 @@ /* - * $Id: HttpHdrRange.cc,v 1.37 2003/08/04 22:14:40 robertc Exp $ + * $Id: HttpHdrRange.cc,v 1.38 2003/09/29 10:24:00 robertc Exp $ * * DEBUG: section 64 HTTP Range Header * AUTHOR: Alex Rousskov @@ -313,7 +313,8 @@ HttpHdrRange::parseInit(const String * range_spec) ++count; } - debug(64, 8) ("parsed range range count: %d, kept %d\n", count, specs.size()); + debugs(64, 8, "parsed range range count: " << count << ", kept " << + specs.size()); return specs.count != 0; } @@ -394,8 +395,8 @@ HttpHdrRange::merge (Vector &basis) ++i; /* progress */ } - debug(64, 3) ("HttpHdrRange::merge: had %d specs, merged %d specs\n", - basis.size(), basis.size() - specs.size()); + debugs(64, 3, "HttpHdrRange::merge: had " << basis.size() << + " specs, merged " << basis.size() - specs.size() << " specs"); } @@ -411,8 +412,8 @@ HttpHdrRange::getCanonizedSpecs (Vector ©) delete (*pos); } - debug(64, 3) ("HttpHdrRange::getCanonizedSpecs: found %d bad specs\n", - specs.size() - copy.size()); + debugs(64, 3, "HttpHdrRange::getCanonizedSpecs: found " << + specs.size() - copy.size() << " bad specs"); } #include "HttpHdrContRange.h" @@ -441,12 +442,13 @@ int HttpHdrRange::canonize (size_t newClen) { clen = newClen; - debug(64, 3) ("HttpHdrRange::canonize: started with %d specs, clen: %ld\n", specs.count, (long int) clen); + debugs(64, 3, "HttpHdrRange::canonize: started with " << specs.count << + " specs, clen: " << clen); Vector goods; getCanonizedSpecs(goods); merge (goods); - debug(64, 3) ("HttpHdrRange::canonize: finished with %d specs\n", - specs.count); + debugs(64, 3, "HttpHdrRange::canonize: finished with " << specs.count << + " specs"); return specs.count > 0; } diff --git a/src/HttpHeader.cc b/src/HttpHeader.cc index c4ef40a102..91f573806c 100644 --- a/src/HttpHeader.cc +++ b/src/HttpHeader.cc @@ -1,6 +1,6 @@ /* - * $Id: HttpHeader.cc,v 1.94 2003/07/17 22:08:15 wessels Exp $ + * $Id: HttpHeader.cc,v 1.95 2003/09/29 10:24:00 robertc Exp $ * * DEBUG: section 55 HTTP Header * AUTHOR: Alex Rousskov @@ -680,8 +680,8 @@ httpHeaderAddEntry(HttpHeader * hdr, HttpHeaderEntry * e) assert(hdr && e); assert_eid(e->id); - debug(55, 7) ("%p adding entry: %d at %d\n", - hdr, e->id, hdr->entries.count); + debugs(55, 7, hdr << " adding entry: " << e->id << " at " << + hdr->entries.count); if (CBIT_TEST(hdr->mask, e->id)) Headers[e->id].stat.repCount++; diff --git a/src/HttpReply.cc b/src/HttpReply.cc index 33b8d285e2..104631f3c0 100644 --- a/src/HttpReply.cc +++ b/src/HttpReply.cc @@ -1,6 +1,6 @@ /* - * $Id: HttpReply.cc,v 1.63 2003/09/01 03:49:37 robertc Exp $ + * $Id: HttpReply.cc,v 1.64 2003/09/29 10:24:00 robertc Exp $ * * DEBUG: section 58 HTTP Reply (Response) * AUTHOR: Alex Rousskov @@ -153,7 +153,7 @@ httpReplyParse(HttpReply * rep, const char *buf, ssize_t end) */ char *headers = (char *)memAllocate(MEM_4K_BUF); int success; - size_t s = XMIN(end + 1, 4096); + size_t s = XMIN(end + 1, (ssize_t)4096); /* reset current state, because we are not used in incremental fashion */ httpReplyReset(rep); /* put a string terminator. s is how many bytes to touch in diff --git a/src/client_side.cc b/src/client_side.cc index a499fcb52f..6758a5e96e 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -1,6 +1,6 @@ /* - * $Id: client_side.cc,v 1.661 2003/09/27 23:17:46 robertc Exp $ + * $Id: client_side.cc,v 1.662 2003/09/29 10:24:00 robertc Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -1479,8 +1479,9 @@ ClientSocketContext::writeComplete(int fd, char *bufnotused, size_t size, comm_e StoreEntry *entry = http->storeEntry(); http->out.size += size; assert(fd > -1); - debug(33, 5) ("clientWriteComplete: FD %d, sz %ld, err %d, off %ld, len %d\n", - fd, (long int) size, errflag, (long int) http->out.size, entry ? objectLen(entry) : 0); + debugs(33, 5, "clientWriteComplete: FD " << fd << ", sz " << size << + ", err " << errflag << ", off " << http->out.size << ", len " << + entry ? objectLen(entry) : 0); clientUpdateSocketStats(http->logType, size); assert (this->fd() == fd); diff --git a/src/mem.cc b/src/mem.cc index 6315ceb45d..1ba8ece1f0 100644 --- a/src/mem.cc +++ b/src/mem.cc @@ -1,6 +1,6 @@ /* - * $Id: mem.cc,v 1.83 2003/09/14 22:41:24 robertc Exp $ + * $Id: mem.cc,v 1.84 2003/09/29 10:24:01 robertc Exp $ * * DEBUG: section 13 High Level Memory Pool Management * AUTHOR: Harvest Derived @@ -120,9 +120,9 @@ memStringStats(StoreEntry * sentry) static void memBufStats(StoreEntry * sentry) { - storeAppendPrintf(sentry, "Large buffers: %d (%d KB)\n", - HugeBufCountMeter.level, - HugeBufVolumeMeter.level / 1024); + storeAppendPrintf(sentry, "Large buffers: %ld (%ld KB)\n", + (long int) HugeBufCountMeter.level, + (long int) HugeBufVolumeMeter.level / 1024); } void @@ -418,7 +418,9 @@ Mem::Init(void) StrPools[i].pool = memPoolCreate(StrPoolsAttrs[i].name, StrPoolsAttrs[i].obj_size); if (StrPools[i].pool->obj_size != StrPoolsAttrs[i].obj_size) - debug(13, 1) ("Notice: %s is %d bytes instead of requested %d bytes\n", StrPoolsAttrs[i].name, StrPoolsAttrs[i].obj_size, StrPoolsAttrs[i].obj_size); + debugs(13, 1, "Notice: " << StrPoolsAttrs[i].name << " is " << + StrPools[i].pool->obj_size << " bytes instead of requested " + << StrPoolsAttrs[i].obj_size << " bytes"); } cachemgrRegister("mem", @@ -592,25 +594,25 @@ Mem::PoolReport(const MemPoolStats * mp_st, const MemPoolMeter * AllMeter, Store */ storeAppendPrintf(e, - "%d\t %d\t %d\t %.2f\t %.1f\t" /* alloc */ - "%d\t %d\t %d\t %.1f\t" /* in use */ - "%d\t %d\t %d\t" /* idle */ + "%d\t %ld\t %ld\t %.2f\t %.1f\t" /* alloc */ + "%d\t %ld\t %ld\t %.1f\t" /* in use */ + "%d\t %ld\t %ld\t" /* idle */ "%.0f\t %.1f\t %.1f\t %.1f\n", /* saved */ /* alloc */ mp_st->items_alloc, - toKB(mp_st->obj_size * pm->alloc.level), - toKB(mp_st->obj_size * pm->alloc.hwater_level), + (long) toKB(mp_st->obj_size * pm->alloc.level), + (long) toKB(mp_st->obj_size * pm->alloc.hwater_level), (double) ((squid_curtime - pm->alloc.hwater_stamp) / 3600.), xpercent(mp_st->obj_size * pm->alloc.level, AllMeter->alloc.level), /* in use */ mp_st->items_inuse, - toKB(mp_st->obj_size * pm->inuse.level), - toKB(mp_st->obj_size * pm->inuse.hwater_level), + (long) toKB(mp_st->obj_size * pm->inuse.level), + (long) toKB(mp_st->obj_size * pm->inuse.hwater_level), xpercent(pm->inuse.level, pm->alloc.level), /* idle */ mp_st->items_idle, - toKB(mp_st->obj_size * pm->idle.level), - toKB(mp_st->obj_size * pm->idle.hwater_level), + (long) toKB(mp_st->obj_size * pm->idle.level), + (long) toKB(mp_st->obj_size * pm->idle.hwater_level), /* saved */ pm->gb_saved.count, xpercent(pm->gb_saved.count, AllMeter->gb_saved.count), diff --git a/src/peer_digest.cc b/src/peer_digest.cc index ca9bc14997..fb5a0296c4 100644 --- a/src/peer_digest.cc +++ b/src/peer_digest.cc @@ -1,6 +1,6 @@ /* - * $Id: peer_digest.cc,v 1.100 2003/09/06 12:47:35 robertc Exp $ + * $Id: peer_digest.cc,v 1.101 2003/09/29 10:24:01 robertc Exp $ * * DEBUG: section 72 Peer Digest Routines * AUTHOR: Alex Rousskov @@ -699,8 +699,8 @@ peerDigestSwapInMask(void *data, char *buf, ssize_t size) fetch->mask_offset += size; if (fetch->mask_offset >= (off_t)pd->cd->mask_size) { - debug(72, 2) ("peerDigestSwapInMask: Done! Got %d, expected %d\n", - fetch->mask_offset, pd->cd->mask_size); + debugs(72, 2, "peerDigestSwapInMask: Done! Got " << + fetch->mask_offset << ", expected " << pd->cd->mask_size); assert(fetch->mask_offset == (off_t)pd->cd->mask_size); assert(peerDigestFetchedEnough(fetch, NULL, 0, "peerDigestSwapInMask")); return -1; /* XXX! */ @@ -740,9 +740,8 @@ peerDigestFetchedEnough(DigestFetchState * fetch, char *buf, ssize_t size, const host = pd->host.buf(); } - debug(72, 6) ("%s: peer %s, offset: %d size: %d.\n", - step_name, host, - fetch->offset, size); + debugs(72, 6, step_name << ": peer " << host << ", offset: " << + fetch->offset << " size: " << size << "."); /* continue checking (with pd and host known and valid) */ @@ -1003,8 +1002,10 @@ peerDigestSetCBlock(PeerDigest * pd, const char *buf) /* check consistency further */ if ((size_t)cblock.mask_size != cacheDigestCalcMaskSize(cblock.capacity, cblock.bits_per_entry)) { - debug(72, 0) ("%s digest cblock is corrupted (mask size mismatch: %d ? %d).\n", - host, cblock.mask_size, cacheDigestCalcMaskSize(cblock.capacity, cblock.bits_per_entry)); + debugs(72, 0, host << " digest cblock is corrupted " << + "(mask size mismatch: " << cblock.mask_size << " ? " << + cacheDigestCalcMaskSize(cblock.capacity, cblock.bits_per_entry) + << ")."); return 0; } @@ -1020,8 +1021,8 @@ peerDigestSetCBlock(PeerDigest * pd, const char *buf) */ /* check size changes */ if (pd->cd && cblock.mask_size != (ssize_t)pd->cd->mask_size) { - debug(72, 2) ("%s digest changed size: %d -> %d\n", - host, cblock.mask_size, pd->cd->mask_size); + debugs(72, 2, host << " digest changed size: " << cblock.mask_size << + " -> " << pd->cd->mask_size); freed_size = pd->cd->mask_size; cacheDigestDestroy(pd->cd); pd->cd = NULL; diff --git a/src/repl/heap/store_heap_replacement.cc b/src/repl/heap/store_heap_replacement.cc index ebb9012cde..3bf01d3468 100644 --- a/src/repl/heap/store_heap_replacement.cc +++ b/src/repl/heap/store_heap_replacement.cc @@ -1,6 +1,6 @@ /* - * $Id: store_heap_replacement.cc,v 1.12 2003/02/21 22:50:50 robertc Exp $ + * $Id: store_heap_replacement.cc,v 1.13 2003/09/29 10:24:00 robertc Exp $ * * DEBUG: section 20 Storage Manager Heap-based replacement * AUTHOR: John Dilley @@ -83,8 +83,9 @@ HeapKeyGen_StoreEntry_LFUDA(void *entry, double heap_age) key = heap_age + (double) e->refcount - tie; - debug(81, 3) ("HeapKeyGen_StoreEntry_LFUDA: %s refcnt=%d lastref=%ld heap_age=%f tie=%f -> %f\n", - e->getMD5Text(), (int)e->refcount, e->lastref, heap_age, tie, key); + debugs(81, 3, "HeapKeyGen_StoreEntry_LFUDA: " << e->getMD5Text() << + " refcnt=" << e->refcount << " lastref=" << e->lastref << + " heap_age=" << heap_age << " tie=" << tie << " -> " << key); if (e->mem_obj && e->mem_obj->url) debug(81, 3) ("HeapKeyGen_StoreEntry_LFUDA: url=%s\n", @@ -121,8 +122,10 @@ HeapKeyGen_StoreEntry_GDSF(void *entry, double heap_age) double size = e->swap_file_sz ? (double) e->swap_file_sz : 1.0; double tie = (e->lastref > 1) ? (1.0 / e->lastref) : 1.0; key = heap_age + ((double) e->refcount / size) - tie; - debug(81, 3) ("HeapKeyGen_StoreEntry_GDSF: %s size=%f refcnt=%d lastref=%ld heap_age=%f tie=%f -> %f\n", - e->getMD5Text(), size, (int)e->refcount, e->lastref, heap_age, tie, key); + debugs(81, 3, "HeapKeyGen_StoreEntry_GDSF: " << e->getMD5Text() << + " size=" << size << " refcnt=" << e->refcount << " lastref=" << + e->lastref << " heap_age=" << heap_age << " tie=" << tie << + " -> " << key); if (e->mem_obj && e->mem_obj->url) debug(81, 3) ("HeapKeyGen_StoreEntry_GDSF: url=%s\n", diff --git a/src/stat.cc b/src/stat.cc index baa5c20897..d623440507 100644 --- a/src/stat.cc +++ b/src/stat.cc @@ -1,5 +1,5 @@ /* - * $Id: stat.cc,v 1.380 2003/08/27 22:45:37 hno Exp $ + * $Id: stat.cc,v 1.381 2003/09/29 10:24:01 robertc Exp $ * * DEBUG: section 18 Cache Manager Statistics * AUTHOR: Harvest Derived @@ -624,23 +624,23 @@ info_get(StoreEntry * sentry) storeAppendPrintf(sentry, "Memory usage for %s via mallinfo():\n", appname); - storeAppendPrintf(sentry, "\tTotal space in arena: %6d KB\n", - mp.arena >> 10); + storeAppendPrintf(sentry, "\tTotal space in arena: %6ld KB\n", + (long)mp.arena >> 10); - storeAppendPrintf(sentry, "\tOrdinary blocks: %6d KB %6d blks\n", - mp.uordblks >> 10, mp.ordblks); + storeAppendPrintf(sentry, "\tOrdinary blocks: %6ld KB %6ld blks\n", + (long)mp.uordblks >> 10, (long)mp.ordblks); - storeAppendPrintf(sentry, "\tSmall blocks: %6d KB %6d blks\n", - mp.usmblks >> 10, mp.smblks); + storeAppendPrintf(sentry, "\tSmall blocks: %6ld KB %6ld blks\n", + (long)mp.usmblks >> 10, (long)mp.smblks); - storeAppendPrintf(sentry, "\tHolding blocks: %6d KB %6d blks\n", - mp.hblkhd >> 10, mp.hblks); + storeAppendPrintf(sentry, "\tHolding blocks: %6ld KB %6ld blks\n", + (long)mp.hblkhd >> 10, (long)mp.hblks); - storeAppendPrintf(sentry, "\tFree Small blocks: %6d KB\n", - mp.fsmblks >> 10); + storeAppendPrintf(sentry, "\tFree Small blocks: %6ld KB\n", + (long)mp.fsmblks >> 10); - storeAppendPrintf(sentry, "\tFree Ordinary blocks: %6d KB\n", - mp.fordblks >> 10); + storeAppendPrintf(sentry, "\tFree Ordinary blocks: %6ld KB\n", + (long)mp.fordblks >> 10); t = mp.uordblks + mp.usmblks + mp.hblkhd; @@ -697,9 +697,11 @@ info_get(StoreEntry * sentry) #if !(HAVE_MSTATS && HAVE_GNUMALLOC_H) && HAVE_MALLINFO && HAVE_STRUCT_MALLINFO storeAppendPrintf(sentry, "\tmemPool accounted: %6d KB %3d%%\n", - mp_stats.TheMeter->alloc.level >> 10, percent(mp_stats.TheMeter->alloc.level, t)); + (int) mp_stats.TheMeter->alloc.level >> 10, + percent(mp_stats.TheMeter->alloc.level, t)); storeAppendPrintf(sentry, "\tmemPool unaccounted: %6d KB %3d%%\n", - (t - mp_stats.TheMeter->alloc.level) >> 10, percent((t - mp_stats.TheMeter->alloc.level), t)); + (t - (int) mp_stats.TheMeter->alloc.level) >> 10, + percent((t - mp_stats.TheMeter->alloc.level), t)); #endif storeAppendPrintf(sentry, "\tmemPoolAlloc calls: %9.0f\n", @@ -1567,7 +1569,7 @@ extern double cd = CountHist[0].cd.kbytes_recv.kb - CountHist[minutes].cd.kbytes_recv.kb; if (s < cd) - debug(18, 1) ("STRANGE: srv_kbytes=%d, cd_kbytes=%d\n", s, cd); + debugs(18, 1, "STRANGE: srv_kbytes=" << s << ", cd_kbytes=" << cd); s -= cd; diff --git a/src/stmem.cc b/src/stmem.cc index 0ad1a12cfa..be16f6e933 100644 --- a/src/stmem.cc +++ b/src/stmem.cc @@ -1,6 +1,6 @@ /* - * $Id: stmem.cc,v 1.82 2003/09/22 08:50:50 robertc Exp $ + * $Id: stmem.cc,v 1.83 2003/09/29 10:24:01 robertc Exp $ * * DEBUG: section 19 Store Memory Primitives * AUTHOR: Harvest Derived @@ -219,7 +219,7 @@ ssize_t mem_hdr::copy(off_t offset, char *buf, size_t size) const { - debug(19, 6) ("memCopy: offset %ld: size %u\n", (long int) offset, size); + debugs(19, 6, "memCopy: offset " << offset << ": size " << size); /* we shouldn't ever ask for absent offsets */ @@ -237,7 +237,8 @@ mem_hdr::copy(off_t offset, char *buf, size_t size) const mem_node *p = getBlockContainingLocation((size_t)offset); if (!p) { - debug(19, 1) ("memCopy: could not find offset %u in memory.\n", (size_t) offset); + debugs(19, 1, "memCopy: could not find offset " << offset << + " in memory."); debugDump(); /* we shouldn't ever ask for absent offsets */ assert (0); diff --git a/src/store.cc b/src/store.cc index dbe5b09462..621bde64a8 100644 --- a/src/store.cc +++ b/src/store.cc @@ -1,6 +1,6 @@ /* - * $Id: store.cc,v 1.575 2003/09/25 00:06:56 wessels Exp $ + * $Id: store.cc,v 1.576 2003/09/29 10:24:01 robertc Exp $ * * DEBUG: section 20 Storage Manager * AUTHOR: Harvest Derived @@ -790,8 +790,8 @@ StoreEntry::write (StoreIOBuffer writeBuffer) PROF_start(StoreEntry_write); - debug(20, 5) ("storeWrite: writing %u bytes for '%s'\n", - writeBuffer.length, getMD5Text()); + debugs(20, 5, "storeWrite: writing " << writeBuffer.length << + " bytes for '" << getMD5Text() << "'"); storeGetMemSpace(writeBuffer.length); @@ -1126,7 +1126,8 @@ storeGetMemSpace(int size) return; } - debug(20, 2) ("storeGetMemSpace: Starting, need %d pages\n", pages_needed); + debugs(20, 2, "storeGetMemSpace: Starting, need " << pages_needed << + " pages"); /* XXX what to set as max_scan here? */ walker = mem_policy->PurgeInit(mem_policy, 100000); @@ -1312,8 +1313,8 @@ StoreEntry::validLength() const assert(mem_obj != NULL); reply = getReply(); debug(20, 3) ("storeEntryValidLength: Checking '%s'\n", getMD5Text()); - debug(20, 5) ("storeEntryValidLength: object_len = %d\n", - objectLen(this)); + debugs(20, 5, "storeEntryValidLength: object_len = " << + objectLen(this)); debug(20, 5) ("storeEntryValidLength: hdr_sz = %d\n", reply->hdr_sz); debug(20, 5) ("storeEntryValidLength: content_length = %d\n", diff --git a/src/store_digest.cc b/src/store_digest.cc index 2b65b1fe10..532cfa0fd6 100644 --- a/src/store_digest.cc +++ b/src/store_digest.cc @@ -1,6 +1,6 @@ /* - * $Id: store_digest.cc,v 1.57 2003/09/01 03:49:40 robertc Exp $ + * $Id: store_digest.cc,v 1.58 2003/09/29 10:24:02 robertc Exp $ * * DEBUG: section 71 Store Digest Manager * AUTHOR: Alex Rousskov @@ -482,8 +482,9 @@ storeDigestSwapOutStep(void *data) storeAppend(e, store_digest->mask + sd_state.rewrite_offset, chunk_size); - debug(71, 3) ("storeDigestSwapOutStep: size: %d offset: %d chunk: %d bytes\n", - store_digest->mask_size, sd_state.rewrite_offset, chunk_size); + debugs(71, 3, "storeDigestSwapOutStep: size: " << store_digest->mask_size << + " offset: " << sd_state.rewrite_offset << " chunk: " << + chunk_size << " bytes"); sd_state.rewrite_offset += chunk_size; diff --git a/src/tools.cc b/src/tools.cc index 9f0c988b69..037ff43e22 100644 --- a/src/tools.cc +++ b/src/tools.cc @@ -1,6 +1,6 @@ /* - * $Id: tools.cc,v 1.239 2003/08/03 10:05:12 robertc Exp $ + * $Id: tools.cc,v 1.240 2003/09/29 10:24:02 robertc Exp $ * * DEBUG: section 21 Misc Functions * AUTHOR: Harvest Derived @@ -157,23 +157,23 @@ dumpMallocStats(void) fprintf(debug_log, "Memory usage for %s via mallinfo():\n", appname); - fprintf(debug_log, "\ttotal space in arena: %6d KB\n", - mp.arena >> 10); + fprintf(debug_log, "\ttotal space in arena: %6ld KB\n", + (long)mp.arena >> 10); - fprintf(debug_log, "\tOrdinary blocks: %6d KB %6d blks\n", - mp.uordblks >> 10, mp.ordblks); + fprintf(debug_log, "\tOrdinary blocks: %6ld KB %6ld blks\n", + (long)mp.uordblks >> 10, (long)mp.ordblks); - fprintf(debug_log, "\tSmall blocks: %6d KB %6d blks\n", - mp.usmblks >> 10, mp.smblks); + fprintf(debug_log, "\tSmall blocks: %6ld KB %6ld blks\n", + (long)mp.usmblks >> 10, (long)mp.smblks); - fprintf(debug_log, "\tHolding blocks: %6d KB %6d blks\n", - mp.hblkhd >> 10, mp.hblks); + fprintf(debug_log, "\tHolding blocks: %6ld KB %6ld blks\n", + (long)mp.hblkhd >> 10, (long)mp.hblks); - fprintf(debug_log, "\tFree Small blocks: %6d KB\n", - mp.fsmblks >> 10); + fprintf(debug_log, "\tFree Small blocks: %6ld KB\n", + (long)mp.fsmblks >> 10); - fprintf(debug_log, "\tFree Ordinary blocks: %6d KB\n", - mp.fordblks >> 10); + fprintf(debug_log, "\tFree Ordinary blocks: %6ld KB\n", + (long)mp.fordblks >> 10); t = mp.uordblks + mp.usmblks + mp.hblkhd; diff --git a/src/wccp.cc b/src/wccp.cc index f5c99f5825..970c8370fa 100644 --- a/src/wccp.cc +++ b/src/wccp.cc @@ -1,6 +1,6 @@ /* - * $Id: wccp.cc,v 1.34 2003/02/23 00:08:04 robertc Exp $ + * $Id: wccp.cc,v 1.35 2003/09/29 10:24:02 robertc Exp $ * * DEBUG: section 80 WCCP Support * AUTHOR: Glenn Chisholm @@ -277,13 +277,13 @@ wccpHandleUdp(int sock, void *not_used) if (Config.Wccp.router.s_addr != from.sin_addr.s_addr) return; - if (ntohl(wccp_i_see_you.version) != (unsigned)Config.Wccp.version) + if ((unsigned) ntohl(wccp_i_see_you.version) != (unsigned) Config.Wccp.version) return; if (ntohl(wccp_i_see_you.type) != WCCP_I_SEE_YOU) return; - if ((0 == change) && (number_caches == ntohl(wccp_i_see_you.number))) { + if ((0 == change) && (number_caches == (unsigned) ntohl(wccp_i_see_you.number))) { if (last_assign_buckets_change == wccp_i_see_you.change) { /* * After a WCCP_ASSIGN_BUCKET message, the router should @@ -315,7 +315,7 @@ wccpLowestIP(void) { unsigned int loop; - for (loop = 0; loop < ntohl(wccp_i_see_you.number); loop++) { + for (loop = 0; loop < (unsigned) ntohl(wccp_i_see_you.number); loop++) { if (wccp_i_see_you.wccp_cache_entry[loop].ip_addr.s_addr < local_ip.s_addr) return 0; }