summaryrefslogtreecommitdiffstats
path: root/searchlib
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@oath.com>2018-07-26 14:03:08 +0200
committerGitHub <noreply@github.com>2018-07-26 14:03:08 +0200
commit8039d52c40c5860ab14030975c728c9a7f458cb4 (patch)
tree12343d0c12a76084f321a7609d4c79fa461c7ad8 /searchlib
parentdf6f72fb34b6d28d6ee27e42ebfba24a4d3545ef (diff)
parent5037bb7c8c9de94337c0d5bc1b831145f69ec9a3 (diff)
Merge pull request #6469 from vespa-engine/vekterli/remove-dangerous-stringref-c_str-function
Remove dangerous stringref::c_str()
Diffstat (limited to 'searchlib')
-rw-r--r--searchlib/src/tests/attribute/benchmark/attributesearcher.h4
-rw-r--r--searchlib/src/tests/stackdumpiterator/stackdumpiteratortest.cpp4
-rw-r--r--searchlib/src/vespa/searchlib/common/packets.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/diskindex/dictionarywordreader.cpp4
-rw-r--r--searchlib/src/vespa/searchlib/diskindex/dictionarywordreader.h4
-rw-r--r--searchlib/src/vespa/searchlib/diskindex/indexbuilder.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/docstore/chunkformat.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/docstore/chunkformat.h2
-rw-r--r--searchlib/src/vespa/searchlib/docstore/logdatastore.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/docstore/summaryexceptions.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/engine/transportserver.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/expression/catserializer.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/expression/documentfieldnode.cpp9
-rw-r--r--searchlib/src/vespa/searchlib/features/array_parser.hpp6
-rw-r--r--searchlib/src/vespa/searchlib/features/attributefeature.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/features/dotproductfeature.h2
-rw-r--r--searchlib/src/vespa/searchlib/features/weighted_set_parser.hpp4
-rw-r--r--searchlib/src/vespa/searchlib/memoryindex/fieldinverter.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/memoryindex/memoryfieldindex.h2
-rw-r--r--searchlib/src/vespa/searchlib/memoryindex/urlfieldinverter.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/parsequery/parse.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/query/queryterm.cpp8
-rw-r--r--searchlib/src/vespa/searchlib/query/tree/stackdumpquerycreator.h2
-rw-r--r--searchlib/src/vespa/searchlib/uca/ucaconverter.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/util/filekit.cpp8
-rw-r--r--searchlib/src/vespa/searchlib/util/filekit.h8
26 files changed, 47 insertions, 44 deletions
diff --git a/searchlib/src/tests/attribute/benchmark/attributesearcher.h b/searchlib/src/tests/attribute/benchmark/attributesearcher.h
index f8cd614c48c..37f33803d27 100644
--- a/searchlib/src/tests/attribute/benchmark/attributesearcher.h
+++ b/searchlib/src/tests/attribute/benchmark/attributesearcher.h
@@ -126,7 +126,7 @@ AttributeFindSearcher<T>::doRun()
// build simple term query
vespalib::asciistream ss;
ss << _values[i % _values.size()].getValue();
- this->buildTermQuery(_query, _attrPtr->getName(), ss.str().c_str());
+ this->buildTermQuery(_query, _attrPtr->getName(), ss.str().data());
AttributeGuard guard(_attrPtr);
std::unique_ptr<AttributeVector::SearchContext> searchContext =
@@ -204,7 +204,7 @@ AttributeRangeSearcher::doRun()
// build simple range term query
vespalib::asciistream ss;
ss << "[" << iter.a() << ";" << iter.b() << "]";
- buildTermQuery(_query, _attrPtr->getName(), ss.str().c_str());
+ buildTermQuery(_query, _attrPtr->getName(), ss.str().data());
AttributeGuard guard(_attrPtr);
std::unique_ptr<AttributeVector::SearchContext> searchContext =
diff --git a/searchlib/src/tests/stackdumpiterator/stackdumpiteratortest.cpp b/searchlib/src/tests/stackdumpiterator/stackdumpiteratortest.cpp
index 8ad4578b6c1..37a63828667 100644
--- a/searchlib/src/tests/stackdumpiterator/stackdumpiteratortest.cpp
+++ b/searchlib/src/tests/stackdumpiterator/stackdumpiteratortest.cpp
@@ -172,12 +172,12 @@ StackDumpIteratorTest::ShowResult(int testNo,
delete item;
break;
}
- if (strncmp(item->_indexName.c_str(), idx.c_str(), idx.size()) != 0) {
+ if (strncmp(item->_indexName.c_str(), idx.data(), idx.size()) != 0) {
results |= ITERATOR_ERROR_WRONG_INDEX;
delete item;
break;
}
- if (strncmp(item->_term.c_str(), term.c_str(), term.size()) != 0) {
+ if (strncmp(item->_term.c_str(), term.data(), term.size()) != 0) {
results |= ITERATOR_ERROR_WRONG_TERM;
delete item;
break;
diff --git a/searchlib/src/vespa/searchlib/common/packets.cpp b/searchlib/src/vespa/searchlib/common/packets.cpp
index b6b0baea92a..90157e318e9 100644
--- a/searchlib/src/vespa/searchlib/common/packets.cpp
+++ b/searchlib/src/vespa/searchlib/common/packets.cpp
@@ -243,7 +243,7 @@ void FS4Properties::set(StringRef & e, const vespalib::stringref & s)
{
e.first = _backing.size();
e.second = s.size();
- _backing.append(s.c_str(), s.size());
+ _backing.append(s.data(), s.size());
}
void
diff --git a/searchlib/src/vespa/searchlib/diskindex/dictionarywordreader.cpp b/searchlib/src/vespa/searchlib/diskindex/dictionarywordreader.cpp
index e3c5853d74e..b820a77724b 100644
--- a/searchlib/src/vespa/searchlib/diskindex/dictionarywordreader.cpp
+++ b/searchlib/src/vespa/searchlib/diskindex/dictionarywordreader.cpp
@@ -28,8 +28,8 @@ DictionaryWordReader::~DictionaryWordReader()
bool
-DictionaryWordReader::open(const vespalib::stringref &dictionaryName,
- const vespalib::stringref & wordMapName,
+DictionaryWordReader::open(const vespalib::string & dictionaryName,
+ const vespalib::string & wordMapName,
const TuneFileSeqRead &tuneFileRead)
{
_old2newwordfile.reset(new Fast_BufferedFile(new FastOS_File));
diff --git a/searchlib/src/vespa/searchlib/diskindex/dictionarywordreader.h b/searchlib/src/vespa/searchlib/diskindex/dictionarywordreader.h
index 7204ba14d25..9436c17cdbc 100644
--- a/searchlib/src/vespa/searchlib/diskindex/dictionarywordreader.h
+++ b/searchlib/src/vespa/searchlib/diskindex/dictionarywordreader.h
@@ -106,8 +106,8 @@ public:
}
bool
- open(const vespalib::stringref & dictionaryName,
- const vespalib::stringref & wordMapName,
+ open(const vespalib::string & dictionaryName,
+ const vespalib::string & wordMapName,
const TuneFileSeqRead &tuneFileRead);
void
diff --git a/searchlib/src/vespa/searchlib/diskindex/indexbuilder.cpp b/searchlib/src/vespa/searchlib/diskindex/indexbuilder.cpp
index 99eced5f97b..b879e1f65a6 100644
--- a/searchlib/src/vespa/searchlib/diskindex/indexbuilder.cpp
+++ b/searchlib/src/vespa/searchlib/diskindex/indexbuilder.cpp
@@ -296,7 +296,7 @@ FileHandle::open(const vespalib::stringref &dir,
index.getSchema(), index.getIndex(),
tuneFileWrite, fileHeaderContext)) {
LOG(error, "Could not open term writer %s for write (%s)",
- dir.c_str(), getLastErrorString().c_str());
+ vespalib::string(dir).c_str(), getLastErrorString().c_str());
LOG_ABORT("should not be reached");
}
}
diff --git a/searchlib/src/vespa/searchlib/docstore/chunkformat.cpp b/searchlib/src/vespa/searchlib/docstore/chunkformat.cpp
index 37381cfa3f6..93f1d9c0d51 100644
--- a/searchlib/src/vespa/searchlib/docstore/chunkformat.cpp
+++ b/searchlib/src/vespa/searchlib/docstore/chunkformat.cpp
@@ -13,7 +13,7 @@ using vespalib::compression::decompress;
using vespalib::compression::computeMaxCompressedsize;
using vespalib::compression::CompressionConfig;
-ChunkException::ChunkException(const vespalib::stringref & msg, const vespalib::stringref & location) :
+ChunkException::ChunkException(const vespalib::string & msg, const vespalib::stringref & location) :
Exception(make_string("Illegal chunk: %s", msg.c_str()), location)
{
}
diff --git a/searchlib/src/vespa/searchlib/docstore/chunkformat.h b/searchlib/src/vespa/searchlib/docstore/chunkformat.h
index 9f9580f1f1d..81feaf2a27f 100644
--- a/searchlib/src/vespa/searchlib/docstore/chunkformat.h
+++ b/searchlib/src/vespa/searchlib/docstore/chunkformat.h
@@ -12,7 +12,7 @@ namespace search {
class ChunkException : public vespalib::Exception
{
public:
- ChunkException(const vespalib::stringref & msg, const vespalib::stringref & location);
+ ChunkException(const vespalib::string & msg, const vespalib::stringref & location);
};
// This is an interface for implementing a chunk format
diff --git a/searchlib/src/vespa/searchlib/docstore/logdatastore.cpp b/searchlib/src/vespa/searchlib/docstore/logdatastore.cpp
index 1f5a904a514..148d77738f9 100644
--- a/searchlib/src/vespa/searchlib/docstore/logdatastore.cpp
+++ b/searchlib/src/vespa/searchlib/docstore/logdatastore.cpp
@@ -934,7 +934,7 @@ LogDataStore::scanDir(const vespalib::string &dir, const vespalib::string &suffi
base.c_str(), err, getLastErrorString().c_str()));
}
} else {
- LOG(debug, "Skipping '%s' since it does not end with '%s'", file.c_str(), suffix.c_str());
+ LOG(debug, "Skipping '%s' since it does not end with '%s'", file.data(), suffix.c_str());
}
}
}
diff --git a/searchlib/src/vespa/searchlib/docstore/summaryexceptions.cpp b/searchlib/src/vespa/searchlib/docstore/summaryexceptions.cpp
index 30c825bca65..2cfa023e7ed 100644
--- a/searchlib/src/vespa/searchlib/docstore/summaryexceptions.cpp
+++ b/searchlib/src/vespa/searchlib/docstore/summaryexceptions.cpp
@@ -12,7 +12,7 @@ SummaryException::SummaryException(const vespalib::stringref &msg,
FastOS_FileInterface &file,
const vespalib::stringref &location)
: IoException(make_string("%s : Failing file = '%s'. Reason given by OS = '%s'",
- msg.c_str(), file.GetFileName(), file.getLastErrorString().c_str()),
+ vespalib::string(msg).c_str(), file.GetFileName(), file.getLastErrorString().c_str()),
getErrorType(file.GetLastError()), location)
{ }
diff --git a/searchlib/src/vespa/searchlib/engine/transportserver.cpp b/searchlib/src/vespa/searchlib/engine/transportserver.cpp
index 005ef473817..c94e36202a1 100644
--- a/searchlib/src/vespa/searchlib/engine/transportserver.cpp
+++ b/searchlib/src/vespa/searchlib/engine/transportserver.cpp
@@ -322,7 +322,7 @@ TransportServer::logPacket(const vespalib::stringref &msg, FNET_Packet *p, FNET_
} else {
str = vespalib::make_string("packet { pcode=%u }", p->GetPCODE());
}
- LOG(debug, "%s (chid=%u, conn=%u):\n%s", msg.c_str(), chid, conntag, str.c_str());
+ LOG(debug, "%s (chid=%u, conn=%u):\n%s", msg.data(), chid, conntag, str.c_str());
}
void
diff --git a/searchlib/src/vespa/searchlib/expression/catserializer.cpp b/searchlib/src/vespa/searchlib/expression/catserializer.cpp
index a01f68de1a4..f613bd16a54 100644
--- a/searchlib/src/vespa/searchlib/expression/catserializer.cpp
+++ b/searchlib/src/vespa/searchlib/expression/catserializer.cpp
@@ -17,7 +17,7 @@ using vespalib::stringref;
CatSerializer & CatSerializer::put(const IFieldBase & field, const stringref & value)
{
(void) field;
- getStream().write(value.c_str(), value.size());
+ getStream().write(value.data(), value.size());
return *this;
}
diff --git a/searchlib/src/vespa/searchlib/expression/documentfieldnode.cpp b/searchlib/src/vespa/searchlib/expression/documentfieldnode.cpp
index 2055cf9c18c..c7ce9528520 100644
--- a/searchlib/src/vespa/searchlib/expression/documentfieldnode.cpp
+++ b/searchlib/src/vespa/searchlib/expression/documentfieldnode.cpp
@@ -77,7 +77,8 @@ deduceResultNode(const vespalib::stringref & fieldName, const FieldValue & fv, b
} else if (cInfo.inherits(MapFieldValue::classId)) {
value = deduceResultNode(fieldName, *static_cast<const MapFieldValue &>(fv).createValue(), preserveAccurateTypes, nestedMultiValue);
} else {
- throw std::runtime_error(make_string("Can not deduce correct resultclass for documentfield '%s' in based on class '%s'", fieldName.c_str(), cInfo.name()));
+ throw std::runtime_error(make_string("Can not deduce correct resultclass for documentfield '%s' in based on class '%s'",
+ vespalib::string(fieldName).c_str(), cInfo.name()));
}
const Identifiable::RuntimeClass & rInfo = value->getClass();
if (rInfo.inherits(ResultNodeVector::classId)) {
@@ -97,10 +98,12 @@ deduceResultNode(const vespalib::stringref & fieldName, const FieldValue & fv, b
} else if (rInfo.inherits(RawResultNode::classId)) {
value.reset(new RawResultNodeVector());
} else {
- throw std::runtime_error(make_string("Can not deduce correct resultclass for documentfield '%s' in based on class '%s'. It nests down to %s which is not expected", fieldName.c_str(), cInfo.name(), rInfo.name()));
+ throw std::runtime_error(make_string("Can not deduce correct resultclass for documentfield '%s' in based on class '%s'. It nests down to %s which is not expected",
+ vespalib::string(fieldName).c_str(), cInfo.name(), rInfo.name()));
}
} else {
- throw std::runtime_error(make_string("Can not deduce correct resultclass for documentfield '%s' in based on class '%s'", fieldName.c_str(), cInfo.name()));
+ throw std::runtime_error(make_string("Can not deduce correct resultclass for documentfield '%s' in based on class '%s'",
+ vespalib::string(fieldName).c_str(), cInfo.name()));
}
return value;
}
diff --git a/searchlib/src/vespa/searchlib/features/array_parser.hpp b/searchlib/src/vespa/searchlib/features/array_parser.hpp
index 613fa9ec13e..92abec3aab9 100644
--- a/searchlib/src/vespa/searchlib/features/array_parser.hpp
+++ b/searchlib/src/vespa/searchlib/features/array_parser.hpp
@@ -52,13 +52,13 @@ ArrayParser::parsePartial(const vespalib::string &input, OutputType &output)
logWarning(vespalib::make_string(
"Could not parse item '%s' in query vector '%s', skipping. "
"Expected ':' between dimension and component.",
- item.c_str(), input.c_str()));
+ vespalib::string(item).c_str(), input.c_str()));
return;
}
} catch (vespalib::IllegalArgumentException & e) {
logWarning(vespalib::make_string(
"Could not parse item '%s' in query vector '%s', skipping. "
- "Incorrect type of operands", item.c_str(), input.c_str()));
+ "Incorrect type of operands", vespalib::string(item).c_str(), input.c_str()));
return;
}
if (commaPos != vespalib::string::npos) {
@@ -77,7 +77,7 @@ ArrayParser::parsePartial(const vespalib::string &input, OutputType &output)
} catch (vespalib::IllegalArgumentException & e) {
logWarning(vespalib::make_string(
"Could not parse item[%ld] = '%s' in query vector '%s', skipping. "
- "Incorrect type of operands", output.size(), is.c_str(), s.c_str()));
+ "Incorrect type of operands", output.size(), is.c_str(), vespalib::string(s).c_str()));
return;
}
}
diff --git a/searchlib/src/vespa/searchlib/features/attributefeature.cpp b/searchlib/src/vespa/searchlib/features/attributefeature.cpp
index b400233bd99..7e913f96b7f 100644
--- a/searchlib/src/vespa/searchlib/features/attributefeature.cpp
+++ b/searchlib/src/vespa/searchlib/features/attributefeature.cpp
@@ -43,7 +43,7 @@ bool equals(const X & lhs, const Y & rhs) {
template <>
bool equals<ConstCharPtr, vespalib::stringref>(const ConstCharPtr & lhs, const vespalib::stringref & rhs) {
- return strcmp(lhs, rhs.c_str()) == 0;
+ return strcmp(lhs, rhs.data()) == 0;
}
template <typename T>
diff --git a/searchlib/src/vespa/searchlib/features/dotproductfeature.h b/searchlib/src/vespa/searchlib/features/dotproductfeature.h
index 27e96c26538..e3cd662cdd8 100644
--- a/searchlib/src/vespa/searchlib/features/dotproductfeature.h
+++ b/searchlib/src/vespa/searchlib/features/dotproductfeature.h
@@ -100,7 +100,7 @@ public:
EnumVector(const search::attribute::IAttributeVector * attribute) : _attribute(attribute) {}
void insert(const vespalib::stringref & label, const vespalib::stringref & value) {
search::attribute::EnumHandle e;
- if (_attribute->findEnum(label.c_str(), e)) {
+ if (_attribute->findEnum(label.data(), e)) {
_vector.push_back(std::make_pair(e, util::strToNum<feature_t>(value)));
}
}
diff --git a/searchlib/src/vespa/searchlib/features/weighted_set_parser.hpp b/searchlib/src/vespa/searchlib/features/weighted_set_parser.hpp
index 3199d54bf03..d67b089f5fe 100644
--- a/searchlib/src/vespa/searchlib/features/weighted_set_parser.hpp
+++ b/searchlib/src/vespa/searchlib/features/weighted_set_parser.hpp
@@ -24,13 +24,13 @@ WeightedSetParser::parse(const vespalib::string &input, OutputType &output)
if (colonPos != vespalib::string::npos) {
vespalib::string tmpKey(item.substr(0, colonPos));
vespalib::string::size_type start(tmpKey.find_first_not_of(' '));
- vespalib::stringref key(tmpKey.c_str() + start, colonPos - start);
+ vespalib::stringref key(tmpKey.data() + start, colonPos - start);
vespalib::stringref value(item.substr(colonPos+1));
output.insert(key, value);
} else {
logWarning(vespalib::make_string(
"Could not parse item '%s' in input string '%s', skipping. "
- "Expected ':' between key and weight.", item.c_str(), input.c_str()));
+ "Expected ':' between key and weight.", vespalib::string(item).c_str(), input.c_str()));
}
if (commaPos != vespalib::string::npos) {
s = s.substr(commaPos+1);
diff --git a/searchlib/src/vespa/searchlib/memoryindex/fieldinverter.cpp b/searchlib/src/vespa/searchlib/memoryindex/fieldinverter.cpp
index 3238243ff0b..957573d0ad7 100644
--- a/searchlib/src/vespa/searchlib/memoryindex/fieldinverter.cpp
+++ b/searchlib/src/vespa/searchlib/memoryindex/fieldinverter.cpp
@@ -256,7 +256,7 @@ FieldInverter::saveWord(const vespalib::stringref word)
char * buf = &_words[0] + wordsSize;
memset(buf, 0, 4);
- memcpy(buf + 4, word.c_str(), len);
+ memcpy(buf + 4, word.data(), len);
uint32_t *lastWord = reinterpret_cast<uint32_t *>(buf + 4 + (len & ~0x3));
*lastWord &= (0xffffff >> ((3 - (len & 3)) << 3)); //only on little endian machiness !!
diff --git a/searchlib/src/vespa/searchlib/memoryindex/memoryfieldindex.h b/searchlib/src/vespa/searchlib/memoryindex/memoryfieldindex.h
index 92a69277b76..c4583d7f49f 100644
--- a/searchlib/src/vespa/searchlib/memoryindex/memoryfieldindex.h
+++ b/searchlib/src/vespa/searchlib/memoryindex/memoryfieldindex.h
@@ -52,7 +52,7 @@ public:
if (wordRef.valid()) {
return _wordStore.getWord(wordRef);
}
- return _word.c_str();
+ return _word.data();
}
public:
diff --git a/searchlib/src/vespa/searchlib/memoryindex/urlfieldinverter.cpp b/searchlib/src/vespa/searchlib/memoryindex/urlfieldinverter.cpp
index 527de32b956..0f8c05a44b9 100644
--- a/searchlib/src/vespa/searchlib/memoryindex/urlfieldinverter.cpp
+++ b/searchlib/src/vespa/searchlib/memoryindex/urlfieldinverter.cpp
@@ -130,7 +130,7 @@ UrlFieldInverter::processUrlSubField(FieldInverter *inverter,
LOG(error,
"Illegal field type %s for URL subfield %s, expected string",
sfv->getDataType()->getName().c_str(),
- subField.c_str());
+ vespalib::string(subField).data());
return;
}
const StringFieldValue &value = static_cast<const StringFieldValue &>(*sfv);
diff --git a/searchlib/src/vespa/searchlib/parsequery/parse.cpp b/searchlib/src/vespa/searchlib/parsequery/parse.cpp
index cba69ea474a..60236275f76 100644
--- a/searchlib/src/vespa/searchlib/parsequery/parse.cpp
+++ b/searchlib/src/vespa/searchlib/parsequery/parse.cpp
@@ -63,7 +63,7 @@ ParseItem::ParseItem(ItemType type, const vespalib::stringref & idx, const char
{
assert_type(type);
SetType(type);
- SetIndex(idx.c_str());
+ SetIndex(idx.data());
SetTerm(term);
}
diff --git a/searchlib/src/vespa/searchlib/query/queryterm.cpp b/searchlib/src/vespa/searchlib/query/queryterm.cpp
index ee2e72b41a8..5eabaf35378 100644
--- a/searchlib/src/vespa/searchlib/query/queryterm.cpp
+++ b/searchlib/src/vespa/searchlib/query/queryterm.cpp
@@ -386,16 +386,16 @@ QueryTermSimple::QueryTermSimple(const string & term_, SearchTerm type) :
}
_valid = (numParts >= 2) && (numParts < NELEMS(parts));
if (_valid && numParts > 2) {
- _rangeLimit = strtol(parts[2].c_str(), NULL, 0);
+ _rangeLimit = strtol(parts[2].data(), nullptr, 0);
if (numParts > 3) {
_valid = (numParts >= 5);
if (_valid) {
_diversityAttribute = parts[3];
- _maxPerGroup = strtoul(parts[4].c_str(), NULL, 0);
+ _maxPerGroup = strtoul(parts[4].data(), nullptr, 0);
if ((_maxPerGroup > 0) && (numParts > 5)) {
char *err = nullptr;
- size_t cutoffGroups = strtoul(parts[5].c_str(), &err, 0);
- if ((err == nullptr) || (size_t(err - parts[5].c_str()) == parts[5].size())) {
+ size_t cutoffGroups = strtoul(parts[5].data(), &err, 0);
+ if ((err == nullptr) || (size_t(err - parts[5].data()) == parts[5].size())) {
_diversityCutoffGroups = cutoffGroups;
}
if (numParts > 6) {
diff --git a/searchlib/src/vespa/searchlib/query/tree/stackdumpquerycreator.h b/searchlib/src/vespa/searchlib/query/tree/stackdumpquerycreator.h
index fa42cdac1c0..a208ae357fa 100644
--- a/searchlib/src/vespa/searchlib/query/tree/stackdumpquerycreator.h
+++ b/searchlib/src/vespa/searchlib/query/tree/stackdumpquerycreator.h
@@ -41,7 +41,7 @@ public:
vespalib::stringref stack = queryStack.getStack();
LOG(error, "Unable to create query tree from stack dump. Failed at position %ld out of %ld bytes %s",
queryStack.getPosition(), stack.size(), builder.error().c_str());
- LOG(error, "Raw QueryStack = %s", vespalib::HexDump(stack.c_str(), stack.size()).toString().c_str());
+ LOG(error, "Raw QueryStack = %s", vespalib::HexDump(stack.data(), stack.size()).toString().c_str());
if (LOG_WOULD_LOG(debug)) {
vespalib::string query = SimpleQueryStack::StackbufToString(stack);
LOG(error, "Error = %s, QueryStack = %s", builder.error().c_str(), query.c_str());
diff --git a/searchlib/src/vespa/searchlib/uca/ucaconverter.cpp b/searchlib/src/vespa/searchlib/uca/ucaconverter.cpp
index fffcc782298..b36e9d13cdb 100644
--- a/searchlib/src/vespa/searchlib/uca/ucaconverter.cpp
+++ b/searchlib/src/vespa/searchlib/uca/ucaconverter.cpp
@@ -32,7 +32,7 @@ UcaConverter::UcaConverter(vespalib::stringref locale, vespalib::stringref stren
Collator *coll(NULL);
{
std::lock_guard<std::mutex> guard(_GlobalDirtyICUThreadSafeLock);
- coll = Collator::createInstance(icu::Locale(locale.c_str()), status);
+ coll = Collator::createInstance(icu::Locale(locale.data()), status);
}
if(U_SUCCESS(status)) {
_collator.reset(coll);
diff --git a/searchlib/src/vespa/searchlib/util/filekit.cpp b/searchlib/src/vespa/searchlib/util/filekit.cpp
index 210a9c30134..7fc4ca8e7bb 100644
--- a/searchlib/src/vespa/searchlib/util/filekit.cpp
+++ b/searchlib/src/vespa/searchlib/util/filekit.cpp
@@ -12,7 +12,7 @@ namespace search {
using vespalib::getLastErrorString;
bool
-FileKit::createStamp(const vespalib::stringref &name)
+FileKit::createStamp(const vespalib::string &name)
{
FastOS_File stamp;
FastOS_StatInfo statInfo;
@@ -40,7 +40,7 @@ FileKit::createStamp(const vespalib::stringref &name)
bool
-FileKit::hasStamp(const vespalib::stringref &name)
+FileKit::hasStamp(const vespalib::string &name)
{
FastOS_StatInfo statInfo;
bool statres;
@@ -57,7 +57,7 @@ FileKit::hasStamp(const vespalib::stringref &name)
bool
-FileKit::removeStamp(const vespalib::stringref &name)
+FileKit::removeStamp(const vespalib::string &name)
{
FastOS_StatInfo statInfo;
bool deleteres;
@@ -91,7 +91,7 @@ FileKit::removeStamp(const vespalib::stringref &name)
fastos::TimeStamp
-FileKit::getModificationTime(const vespalib::stringref &name)
+FileKit::getModificationTime(const vespalib::string &name)
{
FastOS_StatInfo statInfo;
if (FastOS_File::Stat(name.c_str(), &statInfo)) {
diff --git a/searchlib/src/vespa/searchlib/util/filekit.h b/searchlib/src/vespa/searchlib/util/filekit.h
index 70acf19c70c..929412ee6d8 100644
--- a/searchlib/src/vespa/searchlib/util/filekit.h
+++ b/searchlib/src/vespa/searchlib/util/filekit.h
@@ -12,15 +12,15 @@ class FileKit
private:
static bool _syncFiles;
public:
- static bool createStamp(const vespalib::stringref &name);
- static bool hasStamp(const vespalib::stringref &name);
- static bool removeStamp(const vespalib::stringref &name);
+ static bool createStamp(const vespalib::string &name);
+ static bool hasStamp(const vespalib::string &name);
+ static bool removeStamp(const vespalib::string &name);
/**
* Returns the modification time of the given file/directory,
* or time stamp 0 if stating of file/directory fails.
**/
- static fastos::TimeStamp getModificationTime(const vespalib::stringref &name);
+ static fastos::TimeStamp getModificationTime(const vespalib::string &name);
};
}