r17684 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r17683‎ | r17684 | r17685 >
Date:22:40, 14 November 2006
Author:river
Status:old
Tags:
Comment:
icc fixes
Modified paths:
  • /trunk/willow/src/include/confparse.h (modified) (history)
  • /trunk/willow/src/include/flalloc.h (modified) (history)
  • /trunk/willow/src/include/flowio.h (modified) (history)
  • /trunk/willow/src/include/format.h (modified) (history)
  • /trunk/willow/src/include/util.h (modified) (history)
  • /trunk/willow/src/include/wbackend.h (modified) (history)
  • /trunk/willow/src/include/willow.h (modified) (history)
  • /trunk/willow/src/include/wnet.h (modified) (history)
  • /trunk/willow/src/willow/confparse.cc (modified) (history)
  • /trunk/willow/src/willow/wconfig.cc (modified) (history)
  • /trunk/willow/src/willow/whttp.cc (modified) (history)
  • /trunk/willow/src/willow/willow.cc (modified) (history)
  • /trunk/willow/src/willow/wlog.cc (modified) (history)
  • /trunk/willow/src/willow/wnet.cc (modified) (history)

Diff [purge]

Index: trunk/willow/src/include/flowio.h
@@ -86,7 +86,7 @@
8787
8888 enum dio_source {
8989 dio_source_fd,
90 - dio_source_socket,
 90+ dio_source_socket
9191 };
9292
9393 /*
Index: trunk/willow/src/include/flalloc.h
@@ -49,6 +49,9 @@
5050 return pos;
5151 }
5252
 53+ void operator delete (void *, T *) {
 54+ }
 55+
5356 void operator delete (void *p) {
5457 T *o = (T *)p;
5558 o->_freelist_next = _freelist;
Index: trunk/willow/src/include/willow.h
@@ -32,10 +32,6 @@
3333 #include "radix.h"
3434 #include "ptalloc.h"
3535
36 -#ifdef __INTEL_COMPILER
37 -# pragma warning (disable: 869 981 304 383 1418 1469 810)
38 -#endif
39 -
4036 typedef unsigned long long w_size_t;
4137
4238 #include <stdlib.h>
Index: trunk/willow/src/include/util.h
@@ -15,6 +15,10 @@
1616 #include <iostream>
1717 #include <string>
1818
 19+#ifdef __INTEL_COMPILER
 20+# pragma warning (disable: 869 981 304 383 1418 1469 810 444)
 21+#endif
 22+
1923 struct noncopyable {
2024 noncopyable() {};
2125 private:
@@ -54,5 +58,4 @@
5559 return lexical_caster<From, To>::cast(f);
5660 }
5761
58 -
5962 #endif
Index: trunk/willow/src/include/wnet.h
@@ -173,7 +173,7 @@
174174
175175 enum socktype {
176176 st_stream = SOCK_STREAM,
177 - st_dgram = SOCK_DGRAM,
 177+ st_dgram = SOCK_DGRAM
178178 };
179179
180180 struct address : freelist_allocator<address> {
Index: trunk/willow/src/include/wbackend.h
@@ -28,7 +28,7 @@
2929 enum lb_type {
3030 lb_rr,
3131 lb_carp,
32 - lb_carp_hostonly,
 32+ lb_carp_hostonly
3333 };
3434
3535 struct backend_list;
Index: trunk/willow/src/include/confparse.h
@@ -26,6 +26,7 @@
2727 using std::pair;
2828
2929 #include "willow.h"
 30+#include "util.h"
3031
3132 /*
3233 * the config tree.
Index: trunk/willow/src/include/format.h
@@ -34,7 +34,9 @@
3535 format (string const &);
3636
3737 template<typename T>
38 - format& operator%(T const &);
 38+ format& operator% (T const &);
 39+ template<typename T, int i>
 40+ format& operator% (T (&)[i]);
3941
4042 string str(void) const;
4143 operator string(void) const;
@@ -47,7 +49,7 @@
4850 at_decint,
4951 at_hexint,
5052 at_octint,
51 - at_errno,
 53+ at_errno
5254 };
5355 vector<argtype> _argtypes;
5456 vector<string> _args;
@@ -83,4 +85,11 @@
8486 return *this;
8587 }
8688
 89+template<typename T, int i>
 90+format&
 91+format::operator% (T (&s)[i])
 92+{
 93+ return *this % (T *)s;
 94+}
 95+
8796 #endif
Index: trunk/willow/src/willow/wconfig.cc
@@ -123,6 +123,8 @@
124124 try {
125125 nl->sock = it->makesocket("HTTP listener", prio_accept);
126126 } catch (socket_error &ex) {
 127+ wlog(WLOG_DEBUG, format("creating listener %s: %s")
 128+ % e.item_key % ex.what());
127129 delete nl;
128130 delete res;
129131 return;
@@ -170,9 +172,8 @@
171173 static bool
172174 v_udp_log(tree_entry &e, value &v)
173175 {
174 -value *val;
175176 bool ret = true;
176 - if ((val = e/"udp-host") == NULL) {
 177+ if (e/"udp-host" == NULL) {
177178 v.report_error("udp-host must be specified for UDP logging");
178179 ret = false;
179180 }
@@ -253,7 +254,6 @@
254255 {
255256 vector<avalue>::iterator it = v.cv_values.begin(),
256257 end = v.cv_values.end();
257 -prefix p;
258258 for (; it != end; ++it) {
259259 if (it->av_type != cv_qstring) {
260260 v.report_error("access prefix must be a list of quoted strings");
@@ -339,9 +339,9 @@
340340 bpools.insert(make_pair(gn, backend_pool(e.item_key, lbtype, fogroup)));
341341
342342 if ((v = e/"hosts") != NULL) {
343 - vector<avalue>::iterator it = v->cv_values.begin(), end = v->cv_values.end();
344 - for (; it != end; ++it)
345 - host_to_bpool[imstring(it->av_strval)] = gn;
 343+ vector<avalue>::iterator hit = v->cv_values.begin(), hend = v->cv_values.end();
 344+ for (; hit != hend; ++hit)
 345+ host_to_bpool[imstring(hit->av_strval)] = gn;
346346 used_pools.insert(gn);
347347 }
348348 }
Index: trunk/willow/src/willow/whttp.cc
@@ -1012,13 +1012,13 @@
10131013 if (alf.is_open()) {
10141014 string line;
10151015 line = format("[%s] %s %s\"%s\" %d %d %s MISS")
1016 - % current_time_short
 1016+ % (char *)current_time_short
10171017 % _client_socket->straddr(false)
10181018 % request_string[_header_parser->_http_reqtype]
10191019 % _request_path
10201020 % size
10211021 % _response
1022 - % (_backend ? _backend->be_name : "-");
 1022+ % (_backend ? _backend->be_name : string("-"));
10231023
10241024 HOLDING(alf_lock);
10251025
@@ -1028,7 +1028,7 @@
10291029 }
10301030 }
10311031
1032 - if (config.udp_log) {
 1032+ if (do_udplog) {
10331033 char buf[65535];
10341034 char *bufp = buf, *endp = buf + sizeof(buf);
10351035 /*
Index: trunk/willow/src/willow/wlog.cc
@@ -70,7 +70,7 @@
7171 if (sev < logging.level)
7272 return;
7373
74 - r = format("%s| %s: %s") % current_time_short % sev_names[sev] % e;
 74+ r = format("%s| %s: %s") % (char *)current_time_short % sev_names[sev] % e;
7575
7676 HOLDING(log_lock);
7777 if (logging.syslog)
Index: trunk/willow/src/willow/wnet.cc
@@ -124,7 +124,6 @@
125125 void
126126 ioloop_t::_accept(wsocket *s, int)
127127 {
128 - int val;
129128 wsocket *newe;
130129 static atomic<time_t> last_nfile = 0;
131130 time_t now = time(NULL);
Index: trunk/willow/src/willow/willow.cc
@@ -351,7 +351,7 @@
352352 static struct event stats_ev;
353353 static struct timeval stats_tv;
354354 static void stats_sched(void);
355 -void add_stats_listener(pair<string,string> const &ip);
 355+static void add_stats_listener(pair<string,string> const &ip);
356356
357357 struct stats_handler_stru : noncopyable {
358358 void callback (wsocket *, int);
@@ -425,7 +425,7 @@
426426 stats_sched();
427427 }
428428
429 -void
 429+static void
430430 add_stats_listener(pair<string,string> const &ip)
431431 {
432432 addrlist *alist;
Index: trunk/willow/src/willow/confparse.cc
@@ -294,7 +294,6 @@
295295 if (*ap != '"' || ap[strlen(ap) - 1] != '"')
296296 report_parse_error("%%pragma include_path must be followed by a quoted string");
297297 else {
298 - const char *sp;
299298 ap++;
300299 ap[strlen(ap) - 1] = '\0';
301300 add_ipath(ap);