pivotal-jbarrett commented on code in PR #962: URL: https://github.com/apache/geode-native/pull/962#discussion_r861178697
########## cppcache/src/ClientProxyMembershipID.cpp: ########## @@ -185,31 +182,31 @@ void ClientProxyMembershipID::toData(DataOutput&) const { void ClientProxyMembershipID::fromData(DataInput& input) { // deserialization for PR FX HA - auto length = input.readArrayLength(); - auto hostAddress = new uint8_t[length]; - input.readBytesOnly(hostAddress, length); - auto hostPort = input.readInt32(); - auto hostname = + const auto length = input.readArrayLength(); + auto hostAddress = std::vector<uint8_t>(length); + input.readBytesOnly(hostAddress.data(), length); + const auto hostPort = input.readInt32(); + const auto hostname = std::dynamic_pointer_cast<CacheableString>(input.readObject()); - auto splitbrain = input.read(); - auto dcport = input.readInt32(); - auto vPID = input.readInt32(); - auto vmKind = input.read(); - auto aStringArray = CacheableStringArray::create(); + const auto splitbrain = input.read(); + const auto dcport = input.readInt32(); + const auto vPID = input.readInt32(); + const auto vmKind = input.read(); + const auto aStringArray = CacheableStringArray::create(); aStringArray->fromData(input); - auto dsName = std::dynamic_pointer_cast<CacheableString>(input.readObject()); - auto uniqueTag = + const auto dsName = std::dynamic_pointer_cast<CacheableString>(input.readObject()); - auto durableClientId = + const auto uniqueTag = std::dynamic_pointer_cast<CacheableString>(input.readObject()); - auto durableClientTimeOut = std::chrono::seconds(input.readInt32()); - int32_t vmViewId = 0; + const auto durableClientId = + std::dynamic_pointer_cast<CacheableString>(input.readObject()); + const auto durableClientTimeOut = std::chrono::seconds(input.readInt32()); readVersion(splitbrain, input); - initHostAddressVector(hostAddress, length); + initHostAddressVector(hostAddress.data(), length); - if (vmKind != ClientProxyMembershipID::LONER_DM_TYPE) { - vmViewId = std::stoi(uniqueTag->value()); + if (vmKind != kVmKindLoaner) { + auto vmViewId = std::stoi(uniqueTag->value()); initObjectVars(hostname->value().c_str(), hostPort, durableClientId->value().c_str(), durableClientTimeOut, dcport, vPID, vmKind, splitbrain, dsName->value().c_str(), Review Comment: Oh god, there is a book you could write on poorly named symbols in here... If I get bored while making other changes maybe I will address this one. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@geode.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org