diff --git a/checkin_notes b/checkin_notes index 9604b8f2d2..739c54147a 100644 --- a/checkin_notes +++ b/checkin_notes @@ -1930,3 +1930,20 @@ David 12 Mar 2010 db/ db_base.cpp + +David 12 Mar 2010 + - GUI RPC: more replacement of std::string + + clientgui/ + sg_ViewTagPage.cpp + DlgItemProperties.cpp + ViewWork.cpp + db/ + schema.sql + schema_locality.sql + sched/ + credit_test.cpp + lib/ + gui_rpc_client_print.cpp + gui_rpc_client_ops.cpp + gui_rpc_client.h diff --git a/clientgui/DlgItemProperties.cpp b/clientgui/DlgItemProperties.cpp index c5e0a9a43d..0030128d64 100755 --- a/clientgui/DlgItemProperties.cpp +++ b/clientgui/DlgItemProperties.cpp @@ -356,16 +356,16 @@ wxString CDlgItemProperties::FormatApplicationName(RESULT* result ) { APP_VERSION* avp = state_result->avp; if (!avp) return strBuffer; - if (app->user_friendly_name.size()) { - strAppBuffer = wxString(state_result->app->user_friendly_name.c_str(), wxConvUTF8); + if (strlen(app->user_friendly_name)) { + strAppBuffer = wxString(state_result->app->user_friendly_name, wxConvUTF8); } else { - strAppBuffer = wxString(state_result->avp->app_name.c_str(), wxConvUTF8); + strAppBuffer = wxString(state_result->avp->app_name, wxConvUTF8); } - if (avp->plan_class.size()) { + if (strlen(avp->plan_class)) { strClassBuffer.Printf( wxT(" (%s)"), - wxString(avp->plan_class.c_str(), wxConvUTF8).c_str() + wxString(avp->plan_class, wxConvUTF8).c_str() ); } diff --git a/clientgui/ViewWork.cpp b/clientgui/ViewWork.cpp index b8cfb75d74..42e101dee5 100644 --- a/clientgui/ViewWork.cpp +++ b/clientgui/ViewWork.cpp @@ -937,16 +937,16 @@ void CViewWork::GetDocApplicationName(wxInt32 item, wxString& strBuffer) const { APP_VERSION* avp = state_result->avp; if (!avp) return; - if (app->user_friendly_name.size()) { - strAppBuffer = HtmlEntityDecode(wxString(state_result->app->user_friendly_name.c_str(), wxConvUTF8)); + if (strlen(app->user_friendly_name)) { + strAppBuffer = HtmlEntityDecode(wxString(state_result->app->user_friendly_name, wxConvUTF8)); } else { - strAppBuffer = HtmlEntityDecode(wxString(state_result->avp->app_name.c_str(), wxConvUTF8)); + strAppBuffer = HtmlEntityDecode(wxString(state_result->avp->app_name, wxConvUTF8)); } - if (avp->plan_class.size()) { + if (strlen(avp->plan_class)) { strClassBuffer.Printf( wxT(" (%s)"), - wxString(avp->plan_class.c_str(), wxConvUTF8).c_str() + wxString(avp->plan_class, wxConvUTF8).c_str() ); } diff --git a/clientgui/sg_ViewTabPage.cpp b/clientgui/sg_ViewTabPage.cpp index c844222c6d..9b9d7f0c21 100644 --- a/clientgui/sg_ViewTabPage.cpp +++ b/clientgui/sg_ViewTabPage.cpp @@ -114,10 +114,10 @@ void CViewTabPage::CreatePage() resState = pDoc->state.lookup_result(resultWU->project_url, resultWU->name); if(resState){ projName = wxString(resState->project->project_name.c_str(), wxConvUTF8 ); - if (resState->app->user_friendly_name.size()) { - projectFrName = wxString(resState->app->user_friendly_name.c_str(), wxConvUTF8); + if (strlen(resState->app->user_friendly_name)) { + projectFrName = wxString(resState->app->user_friendly_name, wxConvUTF8); } else { - projectFrName = wxString(resState->avp->app_name.c_str(), wxConvUTF8); + projectFrName = wxString(resState->avp->app_name, wxConvUTF8); } } else { projName = wxString("Not Available", wxConvUTF8 ); @@ -198,7 +198,7 @@ void CViewTabPage::LoadSlideShow(std::vector *vSlideShow) { char resolvedFile[512]; wxBitmap* btmpSlideShow; for(int i=0; i<99; i++) { - sprintf(file, "%s/slideshow_%s_%02d", urlDirectory, result->app->name.c_str(), i); + sprintf(file, "%s/slideshow_%s_%02d", urlDirectory, result->app->name, i); if(boinc_resolve_filename(file, resolvedFile, sizeof(resolvedFile)) == 0){ btmpSlideShow = new wxBitmap(); if ( btmpSlideShow->LoadFile(wxString(resolvedFile,wxConvUTF8), wxBITMAP_TYPE_ANY) ) { @@ -723,7 +723,7 @@ void WorkunitNotebook::AddTab(RESULT* result) { pDoc->ForceCacheUpdate(); return; } - wxString appShortName = wxString(resState->app->name.c_str(), wxConvUTF8 ); + wxString appShortName = wxString(resState->app->name, wxConvUTF8 ); // Do not update screen at this point Freeze(); std::string index = " "; diff --git a/db/schema.sql b/db/schema.sql index e633f700b7..15e2085388 100644 --- a/db/schema.sql +++ b/db/schema.sql @@ -626,14 +626,12 @@ create table state_counts ( create table host_app_version ( host_id; integer not null, app_version_id integer not null, - vnpfc_n double not null, - vnpfc_sum double not null, - vnpfc_avg double not null, + pfc_n double not null, + pfc_avg double not null, et_n double not null, - et_sum double not null, et_avg double not null, et_var double not null, - et_sum_sq double not null, + et_q double not null, host_scale_time double not null, scale_probation tinyint not null, error_rate double not null, diff --git a/db/schema_locality.sql b/db/schema_locality.sql index d2ae4b6b60..209b89671d 100644 --- a/db/schema_locality.sql +++ b/db/schema_locality.sql @@ -41,3 +41,6 @@ alter table sched_trigger add index(work_available), add index(no_work_available), add index(working_set_removal); + +alter table workunit + add index (fileset_id); diff --git a/lib/gui_rpc_client.h b/lib/gui_rpc_client.h index 64a4208893..37e931fa39 100644 --- a/lib/gui_rpc_client.h +++ b/lib/gui_rpc_client.h @@ -171,8 +171,8 @@ public: class APP { public: - std::string name; - std::string user_friendly_name; + char name[256]; + char user_friendly_name[256]; PROJECT* project; APP(); @@ -185,9 +185,9 @@ public: class APP_VERSION { public: - std::string app_name; + char app_name[256]; int version_num; - std::string plan_class; + char plan_class[64]; APP* app; PROJECT* project; @@ -201,8 +201,8 @@ public: class WORKUNIT { public: - std::string name; - std::string app_name; + char name[256]; + char app_name[256]; int version_num; // backwards compat double rsc_fpops_est; double rsc_fpops_bound; @@ -369,7 +369,7 @@ public: ~CC_STATE(); PROJECT* lookup_project(char* url); - APP* lookup_app(PROJECT*, std::string&); + APP* lookup_app(PROJECT*, char* name); APP_VERSION* lookup_app_version(PROJECT*, APP*, int, char* plan_class); APP_VERSION* lookup_app_version_old(PROJECT*, APP*, int); WORKUNIT* lookup_wu(PROJECT*, char* name); diff --git a/lib/gui_rpc_client_ops.cpp b/lib/gui_rpc_client_ops.cpp index 42848c5d29..5f3adb2feb 100644 --- a/lib/gui_rpc_client_ops.cpp +++ b/lib/gui_rpc_client_ops.cpp @@ -339,14 +339,15 @@ int APP::parse(MIOFILE& in) { char buf[256]; while (in.fgets(buf, 256)) { if (match_tag(buf, "")) return 0; - if (parse_str(buf, "", name)) continue; - if (parse_str(buf, "", user_friendly_name)) continue; + if (parse_str(buf, "", name, sizeof(name))) continue; + if (parse_str(buf, "", user_friendly_name, sizeof(user_friendly_name))) continue; } return ERR_XML_PARSE; } void APP::clear() { - name.clear(); + strcpy(name, ""); + strcpy(user_friendly_name, ""); project = NULL; } @@ -362,15 +363,16 @@ int APP_VERSION::parse(MIOFILE& in) { char buf[256]; while (in.fgets(buf, 256)) { if (match_tag(buf, "")) return 0; - if (parse_str(buf, "", app_name)) continue; - if (parse_str(buf, "", plan_class)) continue; + if (parse_str(buf, "", app_name, sizeof(app_name))) continue; + if (parse_str(buf, "", plan_class, sizeof(plan_class))) continue; if (parse_int(buf, "", version_num)) continue; } return ERR_XML_PARSE; } void APP_VERSION::clear() { - app_name.clear(); + strcpy(app_name, ""); + strcpy(plan_class, ""); version_num = 0; app = NULL; project = NULL; @@ -388,8 +390,8 @@ int WORKUNIT::parse(MIOFILE& in) { char buf[256]; while (in.fgets(buf, 256)) { if (match_tag(buf, "")) return 0; - if (parse_str(buf, "", name)) continue; - if (parse_str(buf, "", app_name)) continue; + if (parse_str(buf, "", name, sizeof(name))) continue; + if (parse_str(buf, "", app_name, sizeof(app_name))) continue; if (parse_int(buf, "", version_num)) continue; if (parse_double(buf, "", rsc_fpops_est)) continue; if (parse_double(buf, "", rsc_fpops_bound)) continue; @@ -400,8 +402,8 @@ int WORKUNIT::parse(MIOFILE& in) { } void WORKUNIT::clear() { - name.clear(); - app_name.clear(); + strcpy(name, ""); + strcpy(app_name, ""); version_num = 0; rsc_fpops_est = 0; rsc_fpops_bound = 0; @@ -725,11 +727,11 @@ PROJECT* CC_STATE::lookup_project(char* url) { return 0; } -APP* CC_STATE::lookup_app(PROJECT* project, string& str) { +APP* CC_STATE::lookup_app(PROJECT* project, char* name) { unsigned int i; for (i=0; iproject != project) continue; - if (apps[i]->name == str) return apps[i]; + if (!strcmp(apps[i]->name, name)) return apps[i]; } return 0; } diff --git a/lib/gui_rpc_client_print.cpp b/lib/gui_rpc_client_print.cpp index 0233589b15..19c4df694f 100644 --- a/lib/gui_rpc_client_print.cpp +++ b/lib/gui_rpc_client_print.cpp @@ -92,18 +92,18 @@ void PROJECT::print() { } void APP::print() { - printf(" name: %s\n", name.c_str()); + printf(" name: %s\n", name); printf(" Project: %s\n", project->project_name.c_str()); } void APP_VERSION::print() { - printf(" application: %s\n", app->name.c_str()); + printf(" application: %s\n", app->name); printf(" version: %.2f\n", version_num/100.0); printf(" project: %s\n", project->project_name.c_str()); } void WORKUNIT::print() { - printf(" name: %s\n", name.c_str()); + printf(" name: %s\n", name); printf(" FP estimate: %f\n", rsc_fpops_est); printf(" FP bound: %f\n", rsc_fpops_bound); printf(" memory bound: %f\n", rsc_memory_bound); diff --git a/sched/credit_test.cpp b/sched/credit_test.cpp index 6e6476a5c9..3100b58eb1 100644 --- a/sched/credit_test.cpp +++ b/sched/credit_test.cpp @@ -27,7 +27,7 @@ struct HOST_APP_VERSION { int host_id; - int app_version_id; // 0 unknown, -1 anon platform + int app_version_id; // 0 unknown, -1/-2/-3 anon platform int app_id; // if unknown or anon platform AVERAGE pfc; AVERAGE et;