From fa395d7205a9d157c072493a1849ac1e7ac087eb Mon Sep 17 00:00:00 2001 From: Jonathan Hui Date: Mon, 20 May 2019 08:50:43 -0700 Subject: [PATCH] [time-sync] remove reference operator in C API (#3833) --- include/openthread/network_time.h | 2 +- src/cli/cli.cpp | 2 +- src/core/api/network_time_api.cpp | 4 ++-- src/ncp/ncp_base_mtd.cpp | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/openthread/network_time.h b/include/openthread/network_time.h index 53309249e..23ab7e207 100644 --- a/include/openthread/network_time.h +++ b/include/openthread/network_time.h @@ -84,7 +84,7 @@ typedef void (*otNetworkTimeSyncCallbackFn)(void *aCallbackContext); * @returns The time synchronization status. * */ -otNetworkTimeStatus otNetworkTimeGet(otInstance *aInstance, uint64_t &aNetworkTime); +otNetworkTimeStatus otNetworkTimeGet(otInstance *aInstance, uint64_t *aNetworkTime); /** * Set the time synchronization period. diff --git a/src/cli/cli.cpp b/src/cli/cli.cpp index c86bacdff..7b350b73a 100644 --- a/src/cli/cli.cpp +++ b/src/cli/cli.cpp @@ -1865,7 +1865,7 @@ void Interpreter::ProcessNetworkTime(int argc, char *argv[]) uint64_t time; otNetworkTimeStatus networkTimeStatus; - networkTimeStatus = otNetworkTimeGet(mInstance, time); + networkTimeStatus = otNetworkTimeGet(mInstance, &time); mServer->OutputFormat("Network Time: %luus", time); diff --git a/src/core/api/network_time_api.cpp b/src/core/api/network_time_api.cpp index dd4d5f99e..5d4d23ab6 100644 --- a/src/core/api/network_time_api.cpp +++ b/src/core/api/network_time_api.cpp @@ -42,11 +42,11 @@ using namespace ot; -otNetworkTimeStatus otNetworkTimeGet(otInstance *aInstance, uint64_t &aNetworkTime) +otNetworkTimeStatus otNetworkTimeGet(otInstance *aInstance, uint64_t *aNetworkTime) { Instance &instance = *static_cast(aInstance); - return instance.Get().GetTime(aNetworkTime); + return instance.Get().GetTime(*aNetworkTime); } otError otNetworkTimeSetSyncPeriod(otInstance *aInstance, uint16_t aTimeSyncPeriod) diff --git a/src/ncp/ncp_base_mtd.cpp b/src/ncp/ncp_base_mtd.cpp index 5f2708fe4..6ba02bd33 100644 --- a/src/ncp/ncp_base_mtd.cpp +++ b/src/ncp/ncp_base_mtd.cpp @@ -3182,7 +3182,7 @@ template <> otError NcpBase::HandlePropertyGet( otNetworkTimeStatus networkTimeStatus; uint64_t time; - networkTimeStatus = otNetworkTimeGet(mInstance, time); + networkTimeStatus = otNetworkTimeGet(mInstance, &time); SuccessOrExit(error = mEncoder.WriteUint64(time)); SuccessOrExit(error = mEncoder.WriteInt8((int8_t)networkTimeStatus));