This is an automated email from the ASF dual-hosted git repository.
eldenmoon pushed a commit to branch clucene
in repository https://gitbox.apache.org/repos/asf/doris-thirdparty.git
The following commit(s) were added to refs/heads/clucene by this push:
new 021666f9 [fix](reader) fix overloaded-virtual compiler error (#119)
021666f9 is described below
commit 021666f9a8a7dc57570730c6ac873e5fd1c18e41
Author: zzzxl <[email protected]>
AuthorDate: Mon Sep 11 13:16:55 2023 +0800
[fix](reader) fix overloaded-virtual compiler error (#119)
---
src/core/CLucene/util/CLStreams.h | 16 ++++++++++++++--
src/core/CLucene/util/Reader.cpp | 8 ++++----
2 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/src/core/CLucene/util/CLStreams.h
b/src/core/CLucene/util/CLStreams.h
index 82bb1274..18d9a72e 100644
--- a/src/core/CLucene/util/CLStreams.h
+++ b/src/core/CLucene/util/CLStreams.h
@@ -270,7 +270,11 @@ class CLUCENE_EXPORT FilteredBufferedReader: public
BufferedReader{
public:
FilteredBufferedReader(Reader* reader, bool deleteReader);
virtual ~FilteredBufferedReader();
-
+
+ void init(const void *_value, int32_t _length, bool copyData) override {
+ _CLTHROWA(CL_ERR_UnsupportedOperation, "UnsupportedOperationException:
CLStream::init");
+ }
+
int32_t read(const void** start, int32_t min, int32_t max);
int64_t position();
int64_t reset(int64_t);
@@ -304,7 +308,7 @@ protected:
size_t buffer_size;
public:
StringReader ( const TCHAR* value, const int32_t length = -1, bool copyData
= true );
- void init ( const TCHAR* value, const int32_t length, bool copyData = true );
+ void init ( const void* value, const int32_t length, bool copyData = true )
override;
virtual ~StringReader();
int32_t read(const void** start, int32_t min, int32_t max);
@@ -345,6 +349,10 @@ class CLUCENE_EXPORT FileInputStream: public
BufferedInputStream {
Internal* _internal;
protected:
void init(InputStream *i, int encoding);
+
+ void init(const void *_value, int32_t _length, bool copyData) override {
+ _CLTHROWA(CL_ERR_UnsupportedOperation, "UnsupportedOperationException:
CLStream::init");
+ }
public:
LUCENE_STATIC_CONSTANT(int32_t, DEFAULT_BUFFER_SIZE=4096);
FileInputStream ( const char* path, int32_t buflen = -1 );
@@ -363,6 +371,10 @@ class CLUCENE_EXPORT SimpleInputStreamReader: public
BufferedReader{
Internal* _internal;
protected:
void init(InputStream *i, int encoding);
+
+ void init(const void *_value, int32_t _length, bool copyData) override {
+ _CLTHROWA(CL_ERR_UnsupportedOperation, "UnsupportedOperationException:
CLStream::init");
+ }
public:
enum{
ASCII=1,
diff --git a/src/core/CLucene/util/Reader.cpp b/src/core/CLucene/util/Reader.cpp
index 0bbe498f..f302bc3d 100644
--- a/src/core/CLucene/util/Reader.cpp
+++ b/src/core/CLucene/util/Reader.cpp
@@ -62,8 +62,8 @@ StringReader::StringReader ( const TCHAR* _value, const
int32_t _length, bool co
this->init(_value,_length,copyData);
}
-void StringReader::init(const TCHAR *_value, const int32_t _length, bool
copyData) {
- const size_t length = (_length < 0 ? _tcslen(_value) : _length);
+void StringReader::init(const void *_value, const int32_t _length, bool
copyData) {
+ const size_t length = (_length < 0 ? _tcslen((TCHAR *)_value) : _length);
this->pos = 0;
if (copyData) {
TCHAR *tmp = (TCHAR *) this->value;
@@ -74,13 +74,13 @@ void StringReader::init(const TCHAR *_value, const int32_t
_length, bool copyDat
tmp = (TCHAR *) realloc(tmp, sizeof(TCHAR) * (length + 1));
this->buffer_size = length;
}
- _tcsncpy(tmp, _value, length + 1);
+ _tcsncpy(tmp, (TCHAR *)_value, length + 1);
this->value = tmp;
} else {
if (ownValue && this->value != NULL) {
_CLDELETE_LARRAY((TCHAR *) this->value);
}
- this->value = _value;
+ this->value = (TCHAR *)_value;
this->buffer_size = 0;
}
this->m_size = length;
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]