mirror of
https://gitee.com/zyjblog/oatpp.git
synced 2024-12-22 22:16:37 +08:00
Merge pull request #3 from nuvo-legrand/dmc-fix-android-ios-compile-errors
Cherry pick fixes into master in preparation to push upstream
This commit is contained in:
commit
3203d5ffee
@ -174,7 +174,7 @@ Action CoroutineStarter::next(Action&& action) {
|
||||
Action result = m_first;
|
||||
m_first = nullptr;
|
||||
m_last = nullptr;
|
||||
return std::move(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
CoroutineStarter& CoroutineStarter::next(CoroutineStarter&& starter) {
|
||||
|
@ -690,7 +690,7 @@ public:
|
||||
m_coroutine->m_callback = (FunctionPtr)(callback);
|
||||
Action result = m_coroutine;
|
||||
m_coroutine = nullptr;
|
||||
return std::move(result);
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
|
@ -181,7 +181,6 @@ v_int32 Executor::getTasksCount() {
|
||||
void Executor::waitTasksFinished(const std::chrono::duration<v_int64, std::micro>& timeout) {
|
||||
|
||||
auto startTime = std::chrono::system_clock::now();
|
||||
auto end = startTime + timeout;
|
||||
|
||||
while(getTasksCount() != 0) {
|
||||
auto elapsed = std::chrono::system_clock::now() - startTime;
|
||||
|
@ -170,7 +170,7 @@ void IOEventWorker::waitEvents() {
|
||||
auto coroutine = (AbstractCoroutine*) event->udata;
|
||||
|
||||
if((event->flags & EV_ERROR) > 0) {
|
||||
OATPP_LOGD("Error", "data='%s'", strerror(event->data));
|
||||
OATPP_LOGD("Error", "data='%s'", strerror((int)event->data));
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -235,4 +235,4 @@ void IOEventWorker::waitEvents() {
|
||||
|
||||
}}}
|
||||
|
||||
#endif // #ifdef OATPP_IO_EVENT_INTERFACE_KQUEUE
|
||||
#endif // #ifdef OATPP_IO_EVENT_INTERFACE_KQUEUE
|
||||
|
@ -44,7 +44,13 @@ v_int32 setThreadAffinityToCpuRange(std::thread::native_handle_type nativeHandle
|
||||
CPU_SET(i, &cpuset);
|
||||
}
|
||||
|
||||
v_int32 result = pthread_setaffinity_np(nativeHandle, sizeof(cpu_set_t), &cpuset);
|
||||
v_int32 result = 0;
|
||||
|
||||
// The below line doesn't compile on Android.
|
||||
//result = pthread_setaffinity_np(nativeHandle, sizeof(cpu_set_t), &cpuset);
|
||||
|
||||
// The below line compiles on Android but has not been tested.
|
||||
//result = sched_setaffinity(nativeHandle, sizeof(cpu_set_t), &cpuset);
|
||||
|
||||
if (result != 0) {
|
||||
OATPP_LOGD("[oatpp::concurrency::Thread::assignThreadToCpu(...)]", "error code - %d", result);
|
||||
|
@ -272,7 +272,7 @@ data::v_io_size FIFOBuffer::flushToStream(data::stream::OutputStream& stream) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
data::v_io_size result;
|
||||
data::v_io_size result = 0;
|
||||
|
||||
if(m_readPosition < m_writePosition) {
|
||||
result = data::stream::writeExactSizeData(&stream, &m_buffer[m_readPosition], m_writePosition - m_readPosition);
|
||||
|
@ -122,7 +122,7 @@ Deserializer::AbstractObjectWrapper Deserializer::readInt32Value(oatpp::parser::
|
||||
if(caret.isAtText("null", true)){
|
||||
return AbstractObjectWrapper(Int32::ObjectWrapper::Class::getType());
|
||||
} else {
|
||||
return AbstractObjectWrapper(Int32::ObjectType::createAbstract(caret.parseInt()), Int32::ObjectWrapper::Class::getType());
|
||||
return AbstractObjectWrapper(Int32::ObjectType::createAbstract((const int)caret.parseInt()), Int32::ObjectWrapper::Class::getType());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -298,8 +298,8 @@ void Parser::parseResponseStartingLine(ResponseStartingLine& line,
|
||||
error = Status::CODE_400;
|
||||
return;
|
||||
}
|
||||
|
||||
line.statusCode = caret.parseInt();
|
||||
|
||||
line.statusCode = (v_int32)caret.parseInt();
|
||||
|
||||
auto descriptionLabel = caret.putLabel();
|
||||
if(caret.findRN()){
|
||||
|
@ -71,7 +71,7 @@ void SimpleBodyDecoder::doChunkedDecoding(const std::shared_ptr<oatpp::data::str
|
||||
return; // error reading stream
|
||||
}
|
||||
lineBuffer[lineSize] = 0;
|
||||
countToRead = std::strtol((const char*)lineBuffer, nullptr, 16);
|
||||
countToRead = strtol((const char*)lineBuffer, nullptr, 16);
|
||||
|
||||
if(countToRead > 0) {
|
||||
oatpp::data::stream::transfer(fromStream, toStream, countToRead, buffer->getData(), buffer->getSize());
|
||||
@ -185,7 +185,7 @@ oatpp::async::CoroutineStarter SimpleBodyDecoder::doChunkedDecodingAsync(const s
|
||||
}
|
||||
|
||||
Action onLineRead() {
|
||||
data::v_io_size countToRead = std::strtol((const char*) m_lineBuffer, nullptr, 16);
|
||||
data::v_io_size countToRead = strtol((const char*) m_lineBuffer, nullptr, 16);
|
||||
if(countToRead > 0) {
|
||||
prepareSkipRN();
|
||||
return oatpp::data::stream::transferAsync(m_fromStream, m_toStream, countToRead, m_buffer).next(yieldTo(&ChunkedDecoder::skipRN));
|
||||
|
@ -52,4 +52,4 @@ void DtoBody::declareHeaders(Headers& headers) noexcept {
|
||||
}
|
||||
}
|
||||
|
||||
}}}}}
|
||||
}}}}}
|
||||
|
@ -116,7 +116,7 @@ void ChunkedBufferTest::onRun() {
|
||||
OATPP_ASSERT(oatpp::String((const char*)&wholeText->getData()[i], substringSize, false) == stream.getSubstring(i, substringSize));
|
||||
}
|
||||
|
||||
substringSize = ChunkedBuffer::CHUNK_ENTRY_SIZE * 2;
|
||||
substringSize = (v_int32) ChunkedBuffer::CHUNK_ENTRY_SIZE * 2;
|
||||
for(v_int32 i = 0; i < wholeText->getSize() - substringSize; i ++) {
|
||||
OATPP_ASSERT(oatpp::String((const char*)&wholeText->getData()[i], substringSize, false) == stream.getSubstring(i, substringSize));
|
||||
}
|
||||
@ -126,4 +126,4 @@ void ChunkedBufferTest::onRun() {
|
||||
|
||||
}
|
||||
|
||||
}}}}}
|
||||
}}}}}
|
||||
|
Loading…
Reference in New Issue
Block a user