Commit f211d38d authored by atraczyk's avatar atraczyk Committed by gerrit2

build: remove C99 designated initializers for Microsoft's compiler

- Microsoft's compiler doesn't support C99 designated initializers.
  Hopefully this we be added in the future, but for now we can
  comment the '.fieldname =' to achieve the same initialization,
  as long as all the elements are initialized in the fixed order
  that they were declared.

Change-Id: I38af2eb66d583ef8f280ff8b4c7065c7d8229c02
Tuleap: #790
parent 44cd6110
......@@ -184,8 +184,8 @@ PluginManager::createObject(const std::string& type)
return {nullptr, nullptr};
RING_PluginObjectParams op = {
.pluginApi = &pluginApi_,
.type = type.c_str(),
/*.pluginApi = */&pluginApi_,
/*.type = */type.c_str(),
};
// Try to find an exact match
......
......@@ -1478,12 +1478,12 @@ RingAccount::handlePendingCall(PendingCall& pc, bool incoming)
std::weak_ptr<RingAccount> w = std::static_pointer_cast<RingAccount>(shared_from_this());
tls::TlsParams tlsParams {
.ca_list = "",
.cert = identity_.second,
.cert_key = identity_.first,
.dh_params = dhParams_,
.timeout = std::chrono::duration_cast<decltype(tls::TlsParams::timeout)>(TLS_TIMEOUT),
.cert_check = [w,call,remote_h,incoming](unsigned status, const gnutls_datum_t* cert_list, unsigned cert_num) -> pj_status_t {
/*.ca_list = */"",
/*.cert = */identity_.second,
/*.cert_key = */identity_.first,
/*.dh_params = */dhParams_,
/*.timeout = */std::chrono::duration_cast<decltype(tls::TlsParams::timeout)>(TLS_TIMEOUT),
/*.cert_check = */[w,call,remote_h,incoming](unsigned status, const gnutls_datum_t* cert_list, unsigned cert_num) -> pj_status_t {
try {
if (auto sthis = w.lock()) {
auto& this_ = *sthis;
......@@ -1799,9 +1799,9 @@ RingAccount::doRegister_()
}
if (req == this_.trustRequests_.end()) {
this_.trustRequests_.emplace_back(TrustRequest{
.from = v.from,
.received = std::chrono::system_clock::now(),
.payload = v.payload
/*.from = */v.from,
/*.received = */std::chrono::system_clock::now(),
/*.payload = */v.payload
});
req = std::prev(this_.trustRequests_.end());
}
......@@ -2017,13 +2017,13 @@ RingAccount::replyToIncomingIceMsg(std::shared_ptr<SIPCall> call,
{
std::lock_guard<std::mutex> lock(callsMutex_);
pendingCalls_.emplace_back(PendingCall {
.start = started_time,
.ice_sp = ice,
.call = wcall,
.listen_key = {},
.call_key = {},
.from = peer_ice_msg.from,
.from_cert = peer_cert });
/*.start = */started_time,
/*.ice_sp = */ice,
/*.call = */wcall,
/*.listen_key = */{},
/*.call_key = */{},
/*.from = */peer_ice_msg.from,
/*.from_cert = */peer_cert });
}
}
......
......@@ -243,11 +243,11 @@ SipsIceTransport::SipsIceTransport(pjsip_endpoint* endpt,
std::memset(&remoteCertInfo_, 0, sizeof(pj_ssl_cert_info));
TlsSession::TlsSessionCallbacks cbs = {
.onStateChange = [this](TlsSessionState state){ onTlsStateChange(state); },
.onRxData = [this](std::vector<uint8_t>&& buf){ onRxData(std::move(buf)); },
.onCertificatesUpdate = [this](const gnutls_datum_t* l, const gnutls_datum_t* r,
/*.onStateChange = */[this](TlsSessionState state){ onTlsStateChange(state); },
/*.onRxData = */[this](std::vector<uint8_t>&& buf){ onRxData(std::move(buf)); },
/*.onCertificatesUpdate = */[this](const gnutls_datum_t* l, const gnutls_datum_t* r,
unsigned int n){ onCertificatesUpdate(l, r, n); },
.verifyCertificate = [this](gnutls_session_t session){ return verifyCertificate(session); }
/*.verifyCertificate = */[this](gnutls_session_t session){ return verifyCertificate(session); }
};
tls_.reset(new TlsSession(ice, comp_id, param, cbs));
......
......@@ -1605,16 +1605,16 @@ void SIPAccount::setCredentials(const std::vector<std::map<std::string, std::str
c.computePasswordHash();
cred_.emplace_back(pjsip_cred_info {
.realm = pj_str((char*) c.realm.c_str()),
.scheme = pj_str((char*) "digest"),
.username = pj_str((char*) c.username.c_str()),
.data_type = (c.password_h.empty()
/*.realm = */pj_str((char*) c.realm.c_str()),
/*.scheme = */pj_str((char*) "digest"),
/*.username = */pj_str((char*) c.username.c_str()),
/*.data_type = */(c.password_h.empty()
? PJSIP_CRED_DATA_PLAIN_PASSWD
: PJSIP_CRED_DATA_DIGEST),
.data = pj_str((char*) (c.password_h.empty()
/*.data = */pj_str((char*) (c.password_h.empty()
? c.password.c_str()
: c.password_h.c_str())),
.ext = {}
/*.ext = */{}
});
}
}
......
......@@ -1228,9 +1228,9 @@ SIPVoIPLink::resolveSrvName(const std::string &name, pjsip_transport_type_e type
RING_DBG("try to resolve '%s' (port: %u)", name.c_str(), port);
pjsip_host_info host_info {
.flag = 0,
.type = type,
.addr = {{(char*)name.c_str(), name_size}, port},
/*.flag = */0,
/*.type = */type,
/*.addr = */{{(char*)name.c_str(), name_size}, port},
};
const auto token = std::hash<std::string>()(name + to_string(type));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment