[ 
https://issues.apache.org/jira/browse/ORC-428?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16670838#comment-16670838
 ] 

ASF GitHub Bot commented on ORC-428:
------------------------------------

fangzheng closed pull request #331: ORC-428: Use ORC_UNIQUE_PTR consistently in 
OrcFile, OrcHdfsFile and …
URL: https://github.com/apache/orc/pull/331
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/c++/src/OrcFile.cc b/c++/src/OrcFile.cc
index 009a8ce971..96640159a6 100644
--- a/c++/src/OrcFile.cc
+++ b/c++/src/OrcFile.cc
@@ -104,8 +104,8 @@ namespace orc {
 #endif
   }
 
-  std::unique_ptr<InputStream> readLocalFile(const std::string& path) {
-      return std::unique_ptr<InputStream>(new FileInputStream(path));
+  ORC_UNIQUE_PTR<InputStream> readLocalFile(const std::string& path) {
+      return ORC_UNIQUE_PTR<InputStream>(new FileInputStream(path));
   }
 
   OutputStream::~OutputStream() {
@@ -176,7 +176,7 @@ namespace orc {
     }
   }
 
-  std::unique_ptr<OutputStream> writeLocalFile(const std::string& path) {
-    return std::unique_ptr<OutputStream>(new FileOutputStream(path));
+  ORC_UNIQUE_PTR<OutputStream> writeLocalFile(const std::string& path) {
+    return ORC_UNIQUE_PTR<OutputStream>(new FileOutputStream(path));
   }
 }
diff --git a/c++/src/OrcHdfsFile.cc b/c++/src/OrcHdfsFile.cc
index 58027c7a4b..ba093460f0 100644
--- a/c++/src/OrcHdfsFile.cc
+++ b/c++/src/OrcHdfsFile.cc
@@ -167,7 +167,7 @@ namespace orc {
   HdfsFileInputStream::~HdfsFileInputStream() {
   }
 
-  std::unique_ptr<InputStream> readHdfsFile(const std::string& path) {
-    return std::unique_ptr<InputStream>(new HdfsFileInputStream(path));
+  ORC_UNIQUE_PTR<InputStream> readHdfsFile(const std::string& path) {
+    return ORC_UNIQUE_PTR<InputStream>(new HdfsFileInputStream(path));
   }
 }
diff --git a/c++/src/Writer.cc b/c++/src/Writer.cc
index 621876927b..7b9af6f28e 100644
--- a/c++/src/Writer.cc
+++ b/c++/src/Writer.cc
@@ -584,11 +584,11 @@ namespace orc {
     return static_cast<proto::CompressionKind>(kind);
   }
 
-  std::unique_ptr<Writer> createWriter(
+    ORC_UNIQUE_PTR<Writer> createWriter(
                                        const Type& type,
                                        OutputStream* stream,
                                        const WriterOptions& options) {
-    return std::unique_ptr<Writer>(
+    return ORC_UNIQUE_PTR<Writer>(
                                    new WriterImpl(
                                             type,
                                             stream,


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Use ORC_UNIQUE_PTR consistently in OrcFile, OrcHdfsFile, and Writer
> -------------------------------------------------------------------
>
>                 Key: ORC-428
>                 URL: https://issues.apache.org/jira/browse/ORC-428
>             Project: ORC
>          Issue Type: Bug
>          Components: C++
>            Reporter: Fang Zheng
>            Priority: Minor
>
> In OrcFile.hh, the declarations of  readLocalFile() and other four functions 
> return  ORC_UNIQUE_PTR:
> ORC_UNIQUE_PTR<InputStream> readLocalFile(const std::string& path);
> ORC_UNIQUE_PTR<InputStream> readHdfsFile(const std::string& path);
> ORC_UNIQUE_PTR<Reader> createReader(ORC_UNIQUE_PTR<InputStream> stream,
>  const ReaderOptions& options);
> ORC_UNIQUE_PTR<Writer> createWriter(const Type& type, OutputStream* stream, 
> const WriterOptions& options);
> However, these functions' definitions all return std::unique_ptr. On a system 
> where ORC_UNIQUE_PTR is not defined as std::unique_ptr but std::auto_ptr, 
> there is inconsistency.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to