From: wessels <> Date: Thu, 5 Mar 1998 07:42:42 +0000 (+0000) Subject: gindent X-Git-Tag: SQUID_3_0_PRE1~3919 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=399e85eaaf04e7a7bc4c5f15aa2d1f136544f526;p=thirdparty%2Fsquid.git gindent --- diff --git a/src/HttpHeader.cc b/src/HttpHeader.cc index 90b3545cc2..fab05d38b7 100644 --- a/src/HttpHeader.cc +++ b/src/HttpHeader.cc @@ -1,5 +1,5 @@ /* - * $Id: HttpHeader.cc,v 1.14 1998/03/05 00:01:07 rousskov Exp $ + * $Id: HttpHeader.cc,v 1.15 1998/03/05 00:42:42 wessels Exp $ * * DEBUG: section 55 HTTP Header * AUTHOR: Alex Rousskov @@ -263,9 +263,27 @@ static const char *getStringPrefix(const char *str); * some compilers do not want to convert a type into a union which that type * belongs to */ -field_store intField(int n) { field_store f; f.v_int = n; return f; } -field_store timeField(time_t t) { field_store f; f.v_time = t; return f; } -field_store ptrField(void *p) { field_store f; f.v_pchar = (char*)p; return f; } +field_store +intField(int n) +{ + field_store f; + f.v_int = n; + return f; +} +field_store +timeField(time_t t) +{ + field_store f; + f.v_time = t; + return f; +} +field_store +ptrField(void *p) +{ + field_store f; + f.v_pchar = (char *) p; + return f; +} /* * Module initialization routines @@ -467,7 +485,7 @@ httpHeaderGetEntry(const HttpHeader * hdr, HttpHeaderPos * pos) { assert(hdr && pos); assert(*pos >= HttpHeaderInitPos && *pos < hdr->capacity); - debug(55,8) ("searching next e in hdr %p from %d\n", hdr, *pos); + debug(55, 8) ("searching next e in hdr %p from %d\n", hdr, *pos); for ((*pos)++; *pos < hdr->ucount; (*pos)++) { HttpHeaderEntry *e = hdr->entries + *pos; if (httpHeaderEntryIsValid(e)) { @@ -764,7 +782,7 @@ int httpHeaderGetInt(const HttpHeader * hdr, http_hdr_type id) { assert_eid(id); - assert(Headers[id].type == ftInt); /* must be of an apropriate type */ + assert(Headers[id].type == ftInt); /* must be of an apropriate type */ return httpHeaderGet(hdr, id).v_int; } @@ -772,7 +790,7 @@ const char * httpHeaderGetStr(const HttpHeader * hdr, http_hdr_type id) { assert_eid(id); - assert(Headers[id].type == ftPChar); /* must be of an apropriate type */ + assert(Headers[id].type == ftPChar); /* must be of an apropriate type */ return httpHeaderGet(hdr, id).v_pchar; } @@ -1185,7 +1203,7 @@ httpHeaderFieldBadValue(field_type type) return ptrField(NULL); /* not reached */ } -#if 0 /* moved to HttpHdrCC.c */ +#if 0 /* moved to HttpHdrCC.c */ /* * HttpScc (server cache control) @@ -1437,7 +1455,7 @@ static void shortStringStatDump(StoreEntry * e) { storeAppendPrintf(e, "

Short String Stats

\n

"); - memPoolReport(shortStrings, e); + memPoolReport(shortStrings, e); storeAppendPrintf(e, "\n

\n"); storeAppendPrintf(e, "

Long String Stats

\n"); storeAppendPrintf(e, "alive: %3d (%5.1f KB) high-water: %3d (%5.1f KB)\n", diff --git a/src/HttpReply.cc b/src/HttpReply.cc index 5a0d9b87e7..8aa23ce586 100644 --- a/src/HttpReply.cc +++ b/src/HttpReply.cc @@ -1,6 +1,6 @@ /* - * $Id: HttpReply.cc,v 1.10 1998/03/05 00:01:08 rousskov Exp $ + * $Id: HttpReply.cc,v 1.11 1998/03/05 00:42:43 wessels Exp $ * * DEBUG: section 58 HTTP Reply (Response) * AUTHOR: Alex Rousskov @@ -49,7 +49,7 @@ HttpReply * httpReplyCreate() { HttpReply *rep = memAllocate(MEM_HTTPREPLY); - debug(58,7) ("creating rep: %p\n", rep); + debug(58, 7) ("creating rep: %p\n", rep); httpReplyInit(rep); return rep; } @@ -78,7 +78,7 @@ void httpReplyDestroy(HttpReply * rep) { assert(rep); - debug(58,7) ("destroying rep: %p\n", rep); + debug(58, 7) ("destroying rep: %p\n", rep); httpReplyClean(rep); httpReplyDoDestroy(rep); } diff --git a/src/HttpStatusLine.cc b/src/HttpStatusLine.cc index a290230363..41719b51a2 100644 --- a/src/HttpStatusLine.cc +++ b/src/HttpStatusLine.cc @@ -1,5 +1,5 @@ /* - * $Id: HttpStatusLine.cc,v 1.6 1998/03/03 22:17:51 rousskov Exp $ + * $Id: HttpStatusLine.cc,v 1.7 1998/03/05 00:42:44 wessels Exp $ * * DEBUG: section 57 HTTP Status-line * AUTHOR: Alex Rousskov @@ -67,8 +67,8 @@ void httpStatusLinePackInto(const HttpStatusLine * sline, Packer * p) { assert(sline && p); - debug(57,9) ("packing sline %p using %p:\n", sline, p); - debug(57,9) (HttpStatusLineFormat, sline->version, sline->status, + debug(57, 9) ("packing sline %p using %p:\n", sline, p); + debug(57, 9) (HttpStatusLineFormat, sline->version, sline->status, sline->reason ? sline->reason : httpStatusString(sline->status)); packerPrintf(p, HttpStatusLineFormat, sline->version, sline->status, diff --git a/src/StatHist.cc b/src/StatHist.cc index da99cff2bc..8a3e8fb305 100644 --- a/src/StatHist.cc +++ b/src/StatHist.cc @@ -1,6 +1,6 @@ /* - * $Id: StatHist.cc,v 1.4 1998/03/04 06:23:28 rousskov Exp $ + * $Id: StatHist.cc,v 1.5 1998/03/05 00:42:45 wessels Exp $ * * DEBUG: section 62 Generic Histogram * AUTHOR: Duane Wessels @@ -73,7 +73,7 @@ statHistInit(StatHist * H, int capacity, hbase_f val_in, hbase_f val_out, double /* a max value should go into the last bin */ assert(statHistBin(H, max) == H->capacity - 1); /* it is hard to test val_out, here is a crude test */ - assert(((int)(0.99+statHistVal(H, 0)-min)) == 0); + assert(((int) (0.99 + statHistVal(H, 0) - min)) == 0); } void diff --git a/src/cachemgr.cc b/src/cachemgr.cc index c6f767093b..dbca39741e 100644 --- a/src/cachemgr.cc +++ b/src/cachemgr.cc @@ -1,6 +1,6 @@ /* - * $Id: cachemgr.cc,v 1.74 1998/03/03 21:58:49 rousskov Exp $ + * $Id: cachemgr.cc,v 1.75 1998/03/05 00:42:47 wessels Exp $ * * DEBUG: section 0 CGI Cache Manager * AUTHOR: Duane Wessels @@ -301,7 +301,7 @@ munge_menu_line(const char *buf, cachemgr_request * req) const char *p; char *a_url; char *buf_copy; - static char html[2*1024]; + static char html[2 * 1024]; if (strlen(buf) < 1) return buf; if (*buf != ' ') @@ -339,7 +339,8 @@ munge_menu_line(const char *buf, cachemgr_request * req) static const char * munge_other_line(const char *buf, cachemgr_request * req) { - static const char* ttags[] = { "td", "th" }; + static const char *ttags[] = + {"td", "th"}; static char html[4096]; static table_line_num = 0; static next_is_header = 0; @@ -358,29 +359,33 @@ munge_other_line(const char *buf, cachemgr_request * req) } /* start html table */ if (!table_line_num) { - l += snprintf(html+l, sizeof(html)-l, "\n"); + l += snprintf(html + l, sizeof(html) - l, "
\n"); next_is_header = 0; } /* remove '\n' */ is_header = (!table_line_num || next_is_header) && !strchr(buf, ':') && !is_number(buf); ttag = ttags[is_header]; /* record starts */ - l += snprintf(html+l, sizeof(html)-l, ""); + l += snprintf(html + l, sizeof(html) - l, ""); /* substitute '\t' */ buf_copy = x = xstrdup(buf); - if ((p = strchr(x, '\n'))) *p = '\0'; + if ((p = strchr(x, '\n'))) + *p = '\0'; while (x && strlen(x)) { int column_span = 1; const char *cell = xstrtok(&x, '\t'); - while (x && *x == '\t') { column_span++; x++; } - l += snprintf(html+l, sizeof(html)-l, "<%s colspan=%d align=\"%s\">%s", + while (x && *x == '\t') { + column_span++; + x++; + } + l += snprintf(html + l, sizeof(html) - l, "<%s colspan=%d align=\"%s\">%s", ttag, column_span, is_header ? "center" : is_number(cell) ? "right" : "left", cell, ttag); } xfree(buf_copy); /* record ends */ - l += snprintf(html+l, sizeof(html)-l, "\n"); + l += snprintf(html + l, sizeof(html) - l, "\n"); next_is_header = is_header && strstr(buf, "\t\t"); table_line_num++; return html; diff --git a/src/client.cc b/src/client.cc index 7aa52fa836..87fdec9094 100644 --- a/src/client.cc +++ b/src/client.cc @@ -1,8 +1,9 @@ + /* - * $Id: client.cc,v 1.57 1998/02/26 18:00:39 wessels Exp $ + * $Id: client.cc,v 1.58 1998/03/05 00:42:48 wessels Exp $ * * DEBUG: section 0 WWW Client * AUTHOR: Harvest Derived diff --git a/src/defines.h b/src/defines.h index 9595fe3f69..5cfbddcca3 100644 --- a/src/defines.h +++ b/src/defines.h @@ -204,7 +204,7 @@ #define N_COUNT_HIST (3600 / COUNT_INTERVAL) + 1 /* * keep 3 days' (72 hours) worth of hourly readings -*/ + */ #define N_COUNT_HOUR_HIST (86400 * 3) / (60 * COUNT_INTERVAL) /* were to look for errors if config path fails */ diff --git a/src/enums.h b/src/enums.h index e94974b4e3..e27d379d3b 100644 --- a/src/enums.h +++ b/src/enums.h @@ -207,7 +207,7 @@ typedef enum { /* possible types for http header fields */ typedef enum { - ftInvalid = HDR_ENUM_END, /* to catch nasty errors with hdr_id<->fld_type clashes */ + ftInvalid = HDR_ENUM_END, /* to catch nasty errors with hdr_id<->fld_type clashes */ ftInt, ftPChar, ftDate_1123, diff --git a/src/fqdncache.cc b/src/fqdncache.cc index c739b68e5f..31a8ce94d5 100644 --- a/src/fqdncache.cc +++ b/src/fqdncache.cc @@ -1,6 +1,6 @@ /* - * $Id: fqdncache.cc,v 1.89 1998/03/03 22:17:52 rousskov Exp $ + * $Id: fqdncache.cc,v 1.90 1998/03/05 00:42:51 wessels Exp $ * * DEBUG: section 35 FQDN Cache * AUTHOR: Harvest Derived @@ -943,7 +943,7 @@ snmp_fqdncacheFn(variable_list * Var, long *ErrP) case NET_FQDN_NAME: Answer->type = SMI_STRING; Answer->val_len = strlen(fq->names[0]); - Answer->val.string = (u_char *)xstrdup(fq->names[0]); + Answer->val.string = (u_char *) xstrdup(fq->names[0]); break; case NET_FQDN_IP: Answer->type = SMI_IPADDRESS; diff --git a/src/ftp.cc b/src/ftp.cc index c67fee94c2..5327d1bbd2 100644 --- a/src/ftp.cc +++ b/src/ftp.cc @@ -1,6 +1,6 @@ /* - * $Id: ftp.cc,v 1.200 1998/03/04 23:52:39 wessels Exp $ + * $Id: ftp.cc,v 1.201 1998/03/05 00:42:52 wessels Exp $ * * DEBUG: section 9 File Transfer Protocol (FTP) * AUTHOR: Harvest Derived @@ -1032,7 +1032,7 @@ ftpWriteCommandCallback(int fd, char *bufnotused, size_t size, int errflag, void if (size > 0) { fd_bytes(fd, size, FD_WRITE); kb_incr(&Counter.server.all.kbytes_out, size); - kb_incr(&Counter.server.ftp.kbytes_out, size); + kb_incr(&Counter.server.ftp.kbytes_out, size); } if (errflag == COMM_ERR_CLOSING) return; @@ -1105,7 +1105,7 @@ ftpReadControlReply(int fd, void *data) if (len > 0) { fd_bytes(fd, len, FD_READ); kb_incr(&Counter.server.all.kbytes_in, len); - kb_incr(&Counter.server.ftp.kbytes_in,len); + kb_incr(&Counter.server.ftp.kbytes_in, len); } debug(9, 5) ("ftpReadControlReply: FD %d, Read %d bytes\n", fd, len); if (len < 0) { diff --git a/src/gopher.cc b/src/gopher.cc index 881be4b12e..f8dffc7866 100644 --- a/src/gopher.cc +++ b/src/gopher.cc @@ -1,6 +1,6 @@ /* - * $Id: gopher.cc,v 1.121 1998/03/04 23:52:41 wessels Exp $ + * $Id: gopher.cc,v 1.122 1998/03/05 00:42:53 wessels Exp $ * * DEBUG: section 10 Gopher * AUTHOR: Harvest Derived @@ -755,7 +755,7 @@ gopherSendComplete(int fd, char *buf, size_t size, int errflag, void *data) if (size > 0) { fd_bytes(fd, size, FD_WRITE); kb_incr(&Counter.server.all.kbytes_out, size); - kb_incr(&Counter.server.other.kbytes_out, size); + kb_incr(&Counter.server.other.kbytes_out, size); } if (errflag) { ErrorState *err; diff --git a/src/http.cc b/src/http.cc index cb2f07655a..b0b444e63e 100644 --- a/src/http.cc +++ b/src/http.cc @@ -1,6 +1,6 @@ /* - * $Id: http.cc,v 1.245 1998/03/05 00:01:11 rousskov Exp $ + * $Id: http.cc,v 1.246 1998/03/05 00:42:55 wessels Exp $ * * DEBUG: section 11 Hypertext Transfer Protocol (HTTP) * AUTHOR: Harvest Derived @@ -742,7 +742,7 @@ httpSendComplete(int fd, char *bufnotused, size_t size, int errflag, void *data) if (size > 0) { fd_bytes(fd, size, FD_WRITE); kb_incr(&Counter.server.all.kbytes_out, size); - kb_incr(&Counter.server.http.kbytes_out, size); + kb_incr(&Counter.server.http.kbytes_out, size); } if (errflag == COMM_ERR_CLOSING) return; diff --git a/src/ipcache.cc b/src/ipcache.cc index fb75632dbd..266fdb6ee3 100644 --- a/src/ipcache.cc +++ b/src/ipcache.cc @@ -1,6 +1,6 @@ /* - * $Id: ipcache.cc,v 1.164 1998/03/03 22:17:53 rousskov Exp $ + * $Id: ipcache.cc,v 1.165 1998/03/05 00:42:57 wessels Exp $ * * DEBUG: section 14 IP Cache * AUTHOR: Harvest Derived @@ -1099,7 +1099,7 @@ snmp_ipcacheFn(variable_list * Var, long *ErrP) xfree(Answer->val.integer); Answer->type = SMI_STRING; Answer->val_len = strlen(IPc->name); - Answer->val.string = (u_char *)xstrdup(IPc->name); + Answer->val.string = (u_char *) xstrdup(IPc->name); break; case NET_IPC_IP: Answer->type = SMI_IPADDRESS; diff --git a/src/main.cc b/src/main.cc index afd7b995eb..5fa959536d 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1,6 +1,6 @@ /* - * $Id: main.cc,v 1.231 1998/03/03 00:31:08 rousskov Exp $ + * $Id: main.cc,v 1.232 1998/03/05 00:42:58 wessels Exp $ * * DEBUG: section 1 Startup and Main Loop * AUTHOR: Harvest Derived @@ -519,7 +519,7 @@ main(int argc, char **argv) debug_log = stderr; if (FD_SETSIZE < Squid_MaxFD) Squid_MaxFD = FD_SETSIZE; - + /* call mallopt() before anything else */ #if HAVE_MALLOPT #ifdef M_GRAIN @@ -764,7 +764,7 @@ normal_shutdown(void) } #endif #if MEM_GEN_TRACE - log_trace_done(); + log_trace_done(); #endif debug(1, 0) ("Squid Cache (Version %s): Exiting normally.\n", diff --git a/src/mem.cc b/src/mem.cc index 4c7fee3866..d985df89eb 100644 --- a/src/mem.cc +++ b/src/mem.cc @@ -1,6 +1,6 @@ /* - * $Id: mem.cc,v 1.10 1998/03/05 00:01:11 rousskov Exp $ + * $Id: mem.cc,v 1.11 1998/03/05 00:42:59 wessels Exp $ * * DEBUG: section 13 High Level Memory Pool Management * AUTHOR: Harvest Derived @@ -193,7 +193,7 @@ memClean() if (dirty_count) debug(13, 2) ("memClean: %d pools are left dirty\n", dirty_count); else - memCleanModule(); /* will free chunks and stuff */ + memCleanModule(); /* will free chunks and stuff */ } diff --git a/src/protos.h b/src/protos.h index 19fb42a262..5c5ead0476 100644 --- a/src/protos.h +++ b/src/protos.h @@ -530,7 +530,7 @@ extern void memClean(); extern void memInitModule(); extern void memCleanModule(); extern void memConfigure(); -#if 0 /* not used */ +#if 0 /* not used */ extern void memFreeMemory(void); #endif extern void *memAllocate(mem_type); @@ -541,20 +541,20 @@ extern void memFreeDISK(void *); extern int memInUse(mem_type); extern DynPool *dynPoolCreate(); -extern void dynPoolDestroy(DynPool *pool); -extern void *dynPoolAlloc(DynPool *pool, size_t size); -extern void dynPoolFree(DynPool *pool, void *obj, size_t size); +extern void dynPoolDestroy(DynPool * pool); +extern void *dynPoolAlloc(DynPool * pool, size_t size); +extern void dynPoolFree(DynPool * pool, void *obj, size_t size); extern MemPool *memPoolCreate(const char *label, size_t obj_size); -extern void memPoolDestroy(MemPool *pool); -extern void *memPoolAlloc(MemPool *pool); -extern void memPoolFree(MemPool *pool, void *obj); -extern int memPoolWasUsed(const MemPool *pool); -extern int memPoolInUseCount(const MemPool *pool); -extern size_t memPoolInUseSize(const MemPool *pool); -extern int memPoolUsedCount(const MemPool *pool); -extern void memPoolDescribe(const MemPool *pool); -extern void memPoolReport(const MemPool *pool, StoreEntry *e); -extern void memReport(StoreEntry *e); +extern void memPoolDestroy(MemPool * pool); +extern void *memPoolAlloc(MemPool * pool); +extern void memPoolFree(MemPool * pool, void *obj); +extern int memPoolWasUsed(const MemPool * pool); +extern int memPoolInUseCount(const MemPool * pool); +extern size_t memPoolInUseSize(const MemPool * pool); +extern int memPoolUsedCount(const MemPool * pool); +extern void memPoolDescribe(const MemPool * pool); +extern void memPoolReport(const MemPool * pool, StoreEntry * e); +extern void memReport(StoreEntry * e); extern int stmemFreeDataUpto(mem_hdr *, int); extern void stmemAppend(mem_hdr *, const char *, int); @@ -808,7 +808,7 @@ extern void dlinkDelete(dlink_node * m, dlink_list * list); extern void kb_incr(kb_t *, size_t); extern double gb_to_double(const gb_t *); extern const char *gb_to_str(const gb_t *); -extern void gb_flush(gb_t *); /* internal, do not use this */ +extern void gb_flush(gb_t *); /* internal, do not use this */ /* * prototypes for system functions missing from system includes diff --git a/src/snmp_agent.cc b/src/snmp_agent.cc index 62135ba836..f28e549b85 100644 --- a/src/snmp_agent.cc +++ b/src/snmp_agent.cc @@ -45,12 +45,12 @@ snmp_agent_parse(snmp_request_t * rq) cbdataAdd(rq, MEM_NONE); PDU = snmp_pdu_create(0); Community = snmp_parse(Session, PDU, buf, len); - - if (!snmp_coexist_V2toV1(PDU)) { /* incompatibility */ - debug(49, 3) ("snmp_agent_parse: Incompatible V2 packet.\n"); - snmp_free_pdu(PDU); - snmp_agent_parse_done(0, rq); - return; + + if (!snmp_coexist_V2toV1(PDU)) { /* incompatibility */ + debug(49, 3) ("snmp_agent_parse: Incompatible V2 packet.\n"); + snmp_free_pdu(PDU); + snmp_agent_parse_done(0, rq); + return; } rq->community = Community; rq->PDU = PDU; diff --git a/src/stat.cc b/src/stat.cc index 132c709236..1818fc076c 100644 --- a/src/stat.cc +++ b/src/stat.cc @@ -1,6 +1,6 @@ /* - * $Id: stat.cc,v 1.213 1998/03/05 00:40:54 wessels Exp $ + * $Id: stat.cc,v 1.214 1998/03/05 00:43:06 wessels Exp $ * * DEBUG: section 18 Cache Manager Statistics * AUTHOR: Harvest Derived @@ -634,19 +634,19 @@ statAvgDump(StoreEntry * sentry, int minutes, int hours) hours = N_COUNT_HOUR_HIST - 1; l = &CountHourHist[hours]; } else { - debug(18,1)("statAvgDump: Invalid args, minutes=%d, hours=%d\n", - minutes, hours); + debug(18, 1) ("statAvgDump: Invalid args, minutes=%d, hours=%d\n", + minutes, hours); return; } dt = tvSubDsec(l->timestamp, f->timestamp); ct = f->cputime - l->cputime; - storeAppendPrintf(sentry, "sample_start_time = %d.%d (%s)\n", - f->timestamp.tv_sec, + storeAppendPrintf(sentry, "sample_start_time = %d.%d (%s)\n", + f->timestamp.tv_sec, f->timestamp.tv_usec, mkrfc1123(f->timestamp.tv_sec)); - storeAppendPrintf(sentry, "sample_end_time = %d.%d (%s)\n", - l->timestamp.tv_sec, + storeAppendPrintf(sentry, "sample_end_time = %d.%d (%s)\n", + l->timestamp.tv_sec, l->timestamp.tv_usec, mkrfc1123(l->timestamp.tv_sec)); @@ -886,7 +886,7 @@ statCountersDump(StoreEntry * sentry) f->cputime = rusage_cputime(&rusage); storeAppendPrintf(sentry, "sample_time = %d.%d (%s)\n", - f->timestamp.tv_sec, + f->timestamp.tv_sec, f->timestamp.tv_usec, mkrfc1123(f->timestamp.tv_sec)); storeAppendPrintf(sentry, "client_http.requests = %d\n", diff --git a/src/structs.h b/src/structs.h index 23cfc73755..f4b2b55f7e 100644 --- a/src/structs.h +++ b/src/structs.h @@ -1,4 +1,5 @@ + struct _acl_ip_data { struct in_addr addr1; /* if addr2 non-zero then its a range */ struct in_addr addr2; @@ -465,7 +466,7 @@ struct _HttpBody { }; -/* http cache control header field*/ +/* http cache control header field */ struct _HttpHdrCc { int mask; time_t max_age; @@ -484,10 +485,10 @@ union _field_store { /* per field statistics */ struct _HttpHeaderFieldStat { - int aliveCount; /* created but not destroyed (count) */ - int parsCount; /* #parsing attempts */ - int errCount; /* #pasring errors */ - int repCount; /* #repetitons */ + int aliveCount; /* created but not destroyed (count) */ + int parsCount; /* #parsing attempts */ + int errCount; /* #pasring errors */ + int repCount; /* #repetitons */ }; @@ -1068,7 +1069,7 @@ struct _StatCounters { int errors; kb_t kbytes_in; kb_t kbytes_out; - } all,http,ftp,other; + } all , http, ftp, other; } server; struct { int pkts_sent; diff --git a/src/tools.cc b/src/tools.cc index 6cdadd1cc4..aaf7af1a63 100644 --- a/src/tools.cc +++ b/src/tools.cc @@ -1,6 +1,6 @@ /* - * $Id: tools.cc,v 1.150 1998/03/04 23:48:14 rousskov Exp $ + * $Id: tools.cc,v 1.151 1998/03/05 00:43:09 wessels Exp $ * * DEBUG: section 21 Misc Functions * AUTHOR: Harvest Derived @@ -123,9 +123,9 @@ static void shutdownTimeoutHandler(int fd, void *data); static void safeunlinkComplete(void *data, int retcode, int errcode); #endif #if MEM_GEN_TRACE -extern void log_trace_done(); +extern void log_trace_done(); extern void log_trace_init(char *); -#endif +#endif void releaseServerSockets(void) @@ -822,25 +822,25 @@ kb_incr(kb_t * k, size_t v) } void -gb_flush(gb_t *g) +gb_flush(gb_t * g) { g->gb += (g->bytes >> 30); - g->bytes &= (1<<30)-1; + g->bytes &= (1 << 30) - 1; } double -gb_to_double(const gb_t *g) +gb_to_double(const gb_t * g) { - return ((double)g->gb)*((double)(1<<30)) + ((double)g->bytes); + return ((double) g->gb) * ((double) (1 << 30)) + ((double) g->bytes); } const char * -gb_to_str(const gb_t *g) +gb_to_str(const gb_t * g) { /* * it is often convenient to call gb_to_str several times for _one_ printf */ - #define max_cc_calls 5 +#define max_cc_calls 5 typedef char GbBuf[32]; static GbBuf bufs[max_cc_calls]; static int call_id = 0; @@ -848,11 +848,10 @@ gb_to_str(const gb_t *g) char *buf = bufs[call_id++]; /* select format */ if (value < 1e9) - snprintf(buf, sizeof(GbBuf), "%.2f MB", value/1e6); - else - if (value < 1e12) - snprintf(buf, sizeof(GbBuf), "%.2f GB", value/1e9); + snprintf(buf, sizeof(GbBuf), "%.2f MB", value / 1e6); + else if (value < 1e12) + snprintf(buf, sizeof(GbBuf), "%.2f GB", value / 1e9); else - snprintf(buf, sizeof(GbBuf), "%.2f TB", value/1e12); + snprintf(buf, sizeof(GbBuf), "%.2f TB", value / 1e12); return buf; } diff --git a/src/typedefs.h b/src/typedefs.h index e4db68fb88..7be1c8e1cc 100644 --- a/src/typedefs.h +++ b/src/typedefs.h @@ -56,7 +56,7 @@ typedef struct _HttpHdrCc HttpHdrCc; typedef struct _HttpHeaderExtField HttpHeaderExtField; typedef struct _HttpHeaderEntry HttpHeaderEntry; typedef struct _HttpHeaderFieldStat HttpHeaderFieldStat; -typedef union _field_store field_store; +typedef union _field_store field_store; typedef struct _HttpBody HttpBody; typedef struct _HttpReply HttpReply; typedef struct _HttpStateData HttpStateData; diff --git a/src/wais.cc b/src/wais.cc index 7218b81aa8..33638d7ed1 100644 --- a/src/wais.cc +++ b/src/wais.cc @@ -1,6 +1,6 @@ /* - * $Id: wais.cc,v 1.102 1998/03/04 23:52:41 wessels Exp $ + * $Id: wais.cc,v 1.103 1998/03/05 00:43:11 wessels Exp $ * * DEBUG: section 24 WAIS Relay * AUTHOR: Harvest Derived @@ -236,7 +236,7 @@ waisSendComplete(int fd, char *bufnotused, size_t size, int errflag, void *data) if (size > 0) { fd_bytes(fd, size, FD_WRITE); kb_incr(&Counter.server.all.kbytes_out, size); - kb_incr(&Counter.server.other.kbytes_out, size); + kb_incr(&Counter.server.other.kbytes_out, size); } if (errflag == COMM_ERR_CLOSING) return;