From e8aded2135fe0aee339d2a644bb0d2b4b1e08fcd Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 20 Apr 2007 18:49:40 +0000 Subject: [PATCH] David 20 Apr 2007 - str_util: don't use std::transform, since it causes problems with VC++ express edition clientgui/ sg_SGUIListControl.h html/ops/ db_update.php lib/ str_util.C,h svn path=/trunk/boinc/; revision=12433 --- COPYRIGHT | 2 +- checkin_notes | 11 +++++++++++ clientgui/sg_SGUIListControl.h | 2 +- html/ops/db_update.php | 7 ++++++- lib/str_util.C | 2 +- lib/str_util.h | 15 +++++++-------- 6 files changed, 27 insertions(+), 12 deletions(-) diff --git a/COPYRIGHT b/COPYRIGHT index 910d148100..bd77db0dad 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -1,7 +1,7 @@ // Berkeley Open Infrastructure for Network Computing // http://boinc.berkeley.edu // Source: http://boinc.berkeley.edu/source_code.php -// Copyright(C) 2002-2006 University of California +// Copyright(C) 2002-2007 University of California // // This is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff --git a/checkin_notes b/checkin_notes index 7b679e9a7b..8b5a4c02d6 100755 --- a/checkin_notes +++ b/checkin_notes @@ -3852,3 +3852,14 @@ David 20 Apr 2007 tools/ backend_lib.C make_project + +David 20 Apr 2007 + - str_util: don't use std::transform, since it causes problems + with VC++ express edition + + clientgui/ + sg_SGUIListControl.h + html/ops/ + db_update.php + lib/ + str_util.C,h diff --git a/clientgui/sg_SGUIListControl.h b/clientgui/sg_SGUIListControl.h index bb25124314..0f285f65be 100644 --- a/clientgui/sg_SGUIListControl.h +++ b/clientgui/sg_SGUIListControl.h @@ -46,4 +46,4 @@ private: CPanelMessages* m_pParentView; }; -#endif \ No newline at end of file +#endif diff --git a/html/ops/db_update.php b/html/ops/db_update.php index 41e57005ce..e8f536955e 100644 --- a/html/ops/db_update.php +++ b/html/ops/db_update.php @@ -346,7 +346,7 @@ function update_11_10_2006() { do_query("ALTER TABLE thread ADD locked TINYINT NOT NULL DEFAULT 0"); } -function update_12_22_2007() { +function update_12_22_2006() { do_query("ALTER TABLE forum ADD is_dev_blog TINYINT NOT NULL DEFAULT 0"); } @@ -360,6 +360,11 @@ function update_4_07_2007() { ); } +// modify the following to call the function you want. +// Make sure you do all needed functions, in order. +// (Look at your DB structure using "explain" queries to see +// which ones you need). + //update_4_07_2007(); ?> diff --git a/lib/str_util.C b/lib/str_util.C index 0902feaf32..03e5877ca1 100755 --- a/lib/str_util.C +++ b/lib/str_util.C @@ -433,7 +433,7 @@ void canonicalize_master_url(char* url) { if (buf[n-1] != '/') { strcat(buf, "/"); } - sprintf(url, "http%s://%s", (bSSL ? "s" : ""), buf); // CMC Here -- add SSL if needed + sprintf(url, "http%s://%s", (bSSL ? "s" : ""), buf); } void canonicalize_master_url(string& url) { diff --git a/lib/str_util.h b/lib/str_util.h index 36cee83a7b..ebb7c36656 100755 --- a/lib/str_util.h +++ b/lib/str_util.h @@ -70,15 +70,14 @@ inline bool starts_with(std::string const& s, std::string const& prefix) { return s.substr(0, prefix.size()) == prefix; } -// http://lists.debian.org/debian-gcc/2002/debian-gcc-200204/msg00092.html -inline void downcase_string( - std::string::iterator begin, std::string::iterator end, std::string::iterator src -) { - transform(begin, end, src, (int(*)(int))tolower); -} - inline void downcase_string(std::string& w) { - downcase_string(w.begin(), w.end(), w.begin()); + char buf[1024]; + strlcpy(buf, w.c_str(), sizeof(buf)); + int n = strlen(buf); + for (int i=0; i