[qt6] Fix narrowing warnings due to int->size_t type change

This commit is contained in:
Nyall Dawson 2022-08-18 10:12:29 +10:00
parent 0a45c064bd
commit a63e2cf4af
2 changed files with 5 additions and 5 deletions

View File

@ -198,7 +198,7 @@ class TcpServerWorker: public QObject
try try
{ {
// Parse protocol and URL GET /path HTTP/1.1 // Parse protocol and URL GET /path HTTP/1.1
const int firstLinePos { incomingData->indexOf( "\r\n" ) }; const auto firstLinePos { incomingData->indexOf( "\r\n" ) };
if ( firstLinePos == -1 ) if ( firstLinePos == -1 )
{ {
throw HttpException( QStringLiteral( "HTTP error finding protocol header" ) ); throw HttpException( QStringLiteral( "HTTP error finding protocol header" ) );
@ -251,7 +251,7 @@ class TcpServerWorker: public QObject
// Headers // Headers
QgsBufferServerRequest::Headers headers; QgsBufferServerRequest::Headers headers;
const int endHeadersPos { incomingData->indexOf( "\r\n\r\n" ) }; const auto endHeadersPos { incomingData->indexOf( "\r\n\r\n" ) };
if ( endHeadersPos == -1 ) if ( endHeadersPos == -1 )
{ {
@ -262,7 +262,7 @@ class TcpServerWorker: public QObject
for ( const auto &headerLine : httpHeaders ) for ( const auto &headerLine : httpHeaders )
{ {
const int headerColonPos { headerLine.indexOf( ':' ) }; const auto headerColonPos { headerLine.indexOf( ':' ) };
if ( headerColonPos > 0 ) if ( headerColonPos > 0 )
{ {
headers.insert( headerLine.left( headerColonPos ), headerLine.mid( headerColonPos + 2 ) ); headers.insert( headerLine.left( headerColonPos ), headerLine.mid( headerColonPos + 2 ) );

View File

@ -59,8 +59,8 @@ QgsServerInterface *QgsServerApiContext::serverInterface() const
const QString QgsServerApiContext::matchedPath() const const QString QgsServerApiContext::matchedPath() const
{ {
auto path { mRequest->url().path( )}; QString path { mRequest->url().path( )};
const int idx { path.indexOf( mApiRootPath )}; const auto idx { path.indexOf( mApiRootPath )};
if ( idx != -1 ) if ( idx != -1 )
{ {
path.truncate( idx + mApiRootPath.length() ); path.truncate( idx + mApiRootPath.length() );