Skip to content

Commit

Permalink
Remove some not-resolving make_pair() invocations.
Browse files Browse the repository at this point in the history
There's nothing wrong with make_pair(), but there is some type
resolution issue in these instances, at least with GCC 4.8.

Signed-off-by: Matt Benjamin <[email protected]>
  • Loading branch information
mattbenjamin authored and jdurgin committed Jul 10, 2014
1 parent ebbdb3c commit 79e3761
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/rgw/rgw_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1104,7 +1104,7 @@ int main(int argc, const char **argv)
configs.push_back(config);

string framework = config->get_framework();
fe_map.insert(make_pair<string, RGWFrontendConfig *>(framework, config));
fe_map.insert(pair<string, RGWFrontendConfig*>(framework, config));
}

list<RGWFrontend *> fes;
Expand Down
12 changes: 6 additions & 6 deletions src/rgw/rgw_rest_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ int RGWRESTSimpleRequest::execute(RGWAccessKey& key, const char *method, const c

string date_str;
get_new_date_str(cct, date_str);
headers.push_back(make_pair<string, string>("HTTP_DATE", date_str));
headers.push_back(pair<string, string>("HTTP_DATE", date_str));

string canonical_header;
map<string, string> meta_map;
Expand All @@ -108,7 +108,7 @@ int RGWRESTSimpleRequest::execute(RGWAccessKey& key, const char *method, const c

ldout(cct, 15) << "generated auth header: " << auth_hdr << dendl;

headers.push_back(make_pair<string, string>("AUTHORIZATION", auth_hdr));
headers.push_back(pair<string, string>("AUTHORIZATION", auth_hdr));
int r = process(method, new_url.c_str());
if (r < 0)
return r;
Expand Down Expand Up @@ -221,12 +221,12 @@ int RGWRESTSimpleRequest::forward_request(RGWAccessKey& key, req_info& info, siz
map<string, string, ltstr_nocase>& m = new_env.get_map();
map<string, string>::iterator iter;
for (iter = m.begin(); iter != m.end(); ++iter) {
headers.push_back(make_pair<string, string>(iter->first, iter->second));
headers.push_back(pair<string, string>(iter->first, iter->second));
}

map<string, string>& meta_map = new_info.x_meta_map;
for (iter = meta_map.begin(); iter != meta_map.end(); ++iter) {
headers.push_back(make_pair<string, string>(iter->first, iter->second));
headers.push_back(pair<string, string>(iter->first, iter->second));
}

string params_str;
Expand Down Expand Up @@ -446,7 +446,7 @@ int RGWRESTStreamWriteRequest::put_obj_init(RGWAccessKey& key, rgw_obj& obj, uin

map<string, string>::iterator iter;
for (iter = m.begin(); iter != m.end(); ++iter) {
headers.push_back(make_pair<string, string>(iter->first, iter->second));
headers.push_back(pair<string, string>(iter->first, iter->second));
}

cb = new RGWRESTStreamOutCB(this);
Expand Down Expand Up @@ -585,7 +585,7 @@ int RGWRESTStreamReadRequest::get_obj(RGWAccessKey& key, map<string, string>& ex
map<string, string, ltstr_nocase>& m = new_env.get_map();
map<string, string>::iterator iter;
for (iter = m.begin(); iter != m.end(); ++iter) {
headers.push_back(make_pair<string, string>(iter->first, iter->second));
headers.push_back(pair<string, string>(iter->first, iter->second));
}

int r = process(new_info.method, new_url.c_str());
Expand Down
18 changes: 9 additions & 9 deletions src/rgw/rgw_rest_conn.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ int RGWRESTConn::forward(const string& uid, req_info& info, obj_version *objv, s
if (ret < 0)
return ret;
list<pair<string, string> > params;
params.push_back(make_pair<string, string>(RGW_SYS_PARAM_PREFIX "uid", uid));
params.push_back(make_pair<string, string>(RGW_SYS_PARAM_PREFIX "region", region));
params.push_back(pair<string, string>(RGW_SYS_PARAM_PREFIX "uid", uid));
params.push_back(pair<string, string>(RGW_SYS_PARAM_PREFIX "region", region));
if (objv) {
params.push_back(make_pair<string, string>(RGW_SYS_PARAM_PREFIX "tag", objv->tag));
params.push_back(pair<string, string>(RGW_SYS_PARAM_PREFIX "tag", objv->tag));
char buf[16];
snprintf(buf, sizeof(buf), "%lld", (long long)objv->ver);
params.push_back(make_pair<string, string>(RGW_SYS_PARAM_PREFIX "ver", buf));
params.push_back(pair<string, string>(RGW_SYS_PARAM_PREFIX "ver", buf));
}
RGWRESTSimpleRequest req(cct, url, NULL, &params);
return req.forward_request(key, info, max_response, inbl, outbl);
Expand All @@ -61,8 +61,8 @@ int RGWRESTConn::put_obj_init(const string& uid, rgw_obj& obj, uint64_t obj_size
return ret;

list<pair<string, string> > params;
params.push_back(make_pair<string, string>(RGW_SYS_PARAM_PREFIX "uid", uid));
params.push_back(make_pair<string, string>(RGW_SYS_PARAM_PREFIX "region", region));
params.push_back(pair<string, string>(RGW_SYS_PARAM_PREFIX "uid", uid));
params.push_back(pair<string, string>(RGW_SYS_PARAM_PREFIX "region", region));
*req = new RGWRESTStreamWriteRequest(cct, url, NULL, &params);
return (*req)->put_obj_init(key, obj, obj_size, attrs);
}
Expand All @@ -84,10 +84,10 @@ int RGWRESTConn::get_obj(const string& uid, req_info *info /* optional */, rgw_o
return ret;

list<pair<string, string> > params;
params.push_back(make_pair<string, string>(RGW_SYS_PARAM_PREFIX "uid", uid));
params.push_back(make_pair<string, string>(RGW_SYS_PARAM_PREFIX "region", region));
params.push_back(pair<string, string>(RGW_SYS_PARAM_PREFIX "uid", uid));
params.push_back(pair<string, string>(RGW_SYS_PARAM_PREFIX "region", region));
if (prepend_metadata) {
params.push_back(make_pair<string, string>(RGW_SYS_PARAM_PREFIX "prepend-metadata", region));
params.push_back(pair<string, string>(RGW_SYS_PARAM_PREFIX "prepend-metadata", region));
}
*req = new RGWRESTStreamReadRequest(cct, url, cb, NULL, &params);
map<string, string> extra_headers;
Expand Down

0 comments on commit 79e3761

Please sign in to comment.