From 076f1474faa95cb70277d96000c2803ea1f8852b Mon Sep 17 00:00:00 2001 From: Vo Van Nghia Date: Thu, 18 Jun 2020 00:24:43 +0700 Subject: [PATCH] Return instead of using out parameter --- tensorflow/c/env.cc | 4 ++-- tensorflow/c/env.h | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/tensorflow/c/env.cc b/tensorflow/c/env.cc index 6d8528bc42f..ce715c43acb 100644 --- a/tensorflow/c/env.cc +++ b/tensorflow/c/env.cc @@ -147,8 +147,8 @@ TF_StringStream* TF_GetLocalTempDirectories() { return list; } -void TF_GetTempFileName(const char* extension, char** name) { - *name = strdup(::tensorflow::io::GetTempFilename(extension).c_str()); +char* TF_GetTempFileName(const char* extension) { + return strdup(::tensorflow::io::GetTempFilename(extension).c_str()); } TF_CAPI_EXPORT extern uint64_t TF_NowNanos(void) { diff --git a/tensorflow/c/env.h b/tensorflow/c/env.h index 29ec417a75e..7dc7ac32f08 100644 --- a/tensorflow/c/env.h +++ b/tensorflow/c/env.h @@ -154,8 +154,7 @@ TF_CAPI_EXPORT extern TF_StringStream* TF_GetLocalTempDirectories(void); // Creates a temporary file name with an extension. // The caller is responsible for freeing the returned pointer. -TF_CAPI_EXPORT extern void TF_GetTempFileName(const char* extension, - char** name); +TF_CAPI_EXPORT extern char* TF_GetTempFileName(const char* extension); // Returns the number of nanoseconds since the Unix epoch. TF_CAPI_EXPORT extern uint64_t TF_NowNanos(void);