Warning fixes
This commit is contained in:
@@ -2,8 +2,11 @@
|
||||
// Created by kj16609 on 6/11/25.
|
||||
//
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Weffc++"
|
||||
#include <spdlog/spdlog.h>
|
||||
#include <vips/vips.h>
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
#include <format>
|
||||
#include <functional>
|
||||
|
||||
@@ -198,7 +198,7 @@ void ServerContext::run()
|
||||
{
|
||||
log::server::info( "Starting runtime" );
|
||||
|
||||
trantor::Logger::setOutputFunction( trantorHook, []() {} );
|
||||
trantor::Logger::setOutputFunction( trantorHook, []() noexcept {} );
|
||||
|
||||
log::info( "Server available at http://localhost:{}", IDHAN_DEFAULT_PORT );
|
||||
log::info( "Swagger docs available at http://localhost:{}/api", IDHAN_DEFAULT_PORT );
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
#pragma GCC diagnostic ignored "-Wnoexcept"
|
||||
#pragma GCC diagnostic ignored "-Wswitch-enum"
|
||||
#pragma GCC diagnostic ignored "-Wshadow"
|
||||
#include "drogon/HttpController.h"
|
||||
#include "drogon/utils/coroutine.h"
|
||||
#include <drogon/HttpController.h>
|
||||
#include <drogon/utils/coroutine.h>
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
namespace idhan::api
|
||||
|
||||
@@ -3,13 +3,18 @@
|
||||
//
|
||||
|
||||
#include "api/ClusterAPI.hpp"
|
||||
#include "fixme.hpp"
|
||||
|
||||
namespace idhan::api
|
||||
{
|
||||
|
||||
ClusterAPI::ResponseTask ClusterAPI::remove( drogon::HttpRequestPtr request, const ClusterID cluster_id )
|
||||
ClusterAPI::ResponseTask ClusterAPI::
|
||||
remove( [[maybe_unused]] drogon::HttpRequestPtr request, [[maybe_unused]] const ClusterID cluster_id )
|
||||
{
|
||||
//TODO: Implement removal logic
|
||||
idhan::fixme();
|
||||
|
||||
co_return drogon::HttpResponse::newHttpJsonResponse( Json::Value() );
|
||||
}
|
||||
|
||||
} // namespace idhan::api
|
||||
@@ -24,12 +24,12 @@ void IDHANApi::api( const drogon::HttpRequestPtr& request, ResponseFunction&& ca
|
||||
{
|
||||
if ( auto ifs = std::ifstream( "./pages/apidocs.html", std::ios::ate ); ifs )
|
||||
{
|
||||
const std::size_t size { ifs.tellg() };
|
||||
const std::streamoff size { ifs.tellg() };
|
||||
ifs.seekg( 0, std::ios::beg );
|
||||
|
||||
std::string str {};
|
||||
str.resize( size );
|
||||
ifs.read( str.data(), str.size() );
|
||||
str.resize( static_cast< std::size_t >( size ) );
|
||||
ifs.read( str.data(), size );
|
||||
|
||||
// create http response
|
||||
const auto response { drogon::HttpResponse::newHttpResponse() };
|
||||
|
||||
@@ -2,12 +2,24 @@
|
||||
// Created by kj16609 on 7/24/25.
|
||||
//
|
||||
#pragma once
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Weffc++"
|
||||
#pragma GCC diagnostic ignored "-Wredundant-tags"
|
||||
#pragma GCC diagnostic ignored "-Wold-style-cast"
|
||||
#pragma GCC diagnostic ignored "-Wcast-qual"
|
||||
#pragma GCC diagnostic ignored "-Wswitch-enum"
|
||||
#pragma GCC diagnostic ignored "-Wnoexcept"
|
||||
#pragma GCC diagnostic ignored "-Wuseless-cast"
|
||||
#pragma GCC diagnostic ignored "-Wshadow"
|
||||
#include <drogon/HttpResponse.h>
|
||||
#include <drogon/orm/DbClient.h>
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
#include <expected>
|
||||
#include <string>
|
||||
|
||||
#include "IDHANTypes.hpp"
|
||||
#include "drogon/HttpResponse.h"
|
||||
#include "drogon/orm/DbClient.h"
|
||||
|
||||
namespace idhan::helpers
|
||||
{
|
||||
@@ -15,6 +27,6 @@ namespace idhan::helpers
|
||||
constexpr UrlID INVALID_URL_ID { 0 };
|
||||
|
||||
drogon::Task< std::expected< UrlID, drogon::HttpResponsePtr > >
|
||||
findOrCreateUrl( const std::string url, drogon::orm::DbClientPtr db );
|
||||
findOrCreateUrl( std::string url, drogon::orm::DbClientPtr db );
|
||||
|
||||
} // namespace idhan::helpers
|
||||
@@ -9,6 +9,13 @@ namespace idhan::api
|
||||
|
||||
drogon::Task< drogon::HttpResponsePtr > IDHANRecordAPI::
|
||||
removeTags( const drogon::HttpRequestPtr request, const RecordID record_id )
|
||||
{}
|
||||
{
|
||||
auto db { drogon::app().getDbClient() };
|
||||
|
||||
Json::Value ok {};
|
||||
ok[ "status" ] = 200;
|
||||
|
||||
co_return drogon::HttpResponse::newHttpJsonResponse( ok );
|
||||
}
|
||||
|
||||
} // namespace idhan::api
|
||||
@@ -24,7 +24,7 @@ drogon::Task< std::optional< Json::Value > >
|
||||
|
||||
Json::Value out_json {};
|
||||
|
||||
out_json[ "domain_id" ] = search[ 0 ][ 0 ].as< TagDomainID >();
|
||||
out_json[ "domain_id" ] = static_cast< Json::UInt64 >( search[ 0 ][ 0 ].as< TagDomainID >() );
|
||||
out_json[ "domain_name" ] = search[ 0 ][ 1 ].as< std::string >();
|
||||
|
||||
co_return out_json;
|
||||
@@ -88,7 +88,7 @@ drogon::Task< drogon::HttpResponsePtr > IDHANTagAPI::createTagDomain( drogon::Ht
|
||||
FGL_UNREACHABLE();
|
||||
}
|
||||
|
||||
drogon::Task< drogon::HttpResponsePtr > IDHANTagAPI::getTagDomains( drogon::HttpRequestPtr request )
|
||||
drogon::Task< drogon::HttpResponsePtr > IDHANTagAPI::getTagDomains( [[maybe_unused]] drogon::HttpRequestPtr request )
|
||||
{
|
||||
auto db { drogon::app().getDbClient() };
|
||||
|
||||
@@ -115,7 +115,7 @@ drogon::Task< drogon::HttpResponsePtr > IDHANTagAPI::getTagDomains( drogon::Http
|
||||
}
|
||||
|
||||
drogon::Task< drogon::HttpResponsePtr > IDHANTagAPI::
|
||||
getTagDomainInfo( drogon::HttpRequestPtr request, const TagDomainID domain_id )
|
||||
getTagDomainInfo( [[maybe_unused]] drogon::HttpRequestPtr request, const TagDomainID domain_id )
|
||||
{
|
||||
auto db { drogon::app().getDbClient() };
|
||||
|
||||
|
||||
@@ -9,8 +9,7 @@
|
||||
namespace idhan
|
||||
{
|
||||
|
||||
std::string
|
||||
createFilter( std::uint32_t index, const std::vector< TagID >& tag_ids, const HydrusDisplayType display_mode )
|
||||
std::string createFilter( std::size_t index, const std::vector< TagID >& tag_ids, const HydrusDisplayType display_mode )
|
||||
{
|
||||
std::string str {};
|
||||
str += format_ns::format( " filter_{}", index );
|
||||
|
||||
@@ -6,30 +6,16 @@
|
||||
|
||||
#include <QStorageInfo>
|
||||
|
||||
#include <drogon/HttpAppFramework.h>
|
||||
#include <drogon/orm/DbClient.h>
|
||||
#include <drogon/utils/FunctionTraits.h>
|
||||
|
||||
#include <expected>
|
||||
#include <filesystem>
|
||||
#include <future>
|
||||
|
||||
#include "IDHANTypes.hpp"
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Weffc++"
|
||||
#pragma GCC diagnostic ignored "-Wredundant-tags"
|
||||
#pragma GCC diagnostic ignored "-Wcast-qual"
|
||||
#pragma GCC diagnostic ignored "-Wold-style-cast"
|
||||
#pragma GCC diagnostic ignored "-Wnoexcept"
|
||||
#pragma GCC diagnostic ignored "-Wredundant-decls"
|
||||
#pragma GCC diagnostic ignored "-Wuseless-cast"
|
||||
#pragma GCC diagnostic ignored "-Wnoexcept"
|
||||
#pragma GCC diagnostic ignored "-Wswitch-enum"
|
||||
#pragma GCC diagnostic ignored "-Wshadow"
|
||||
#include "drogon/HttpAppFramework.h"
|
||||
#include "drogon/HttpController.h"
|
||||
#include "drogon/HttpResponse.h"
|
||||
#include "drogon/orm/DbClient.h"
|
||||
#include "drogon/utils/FunctionTraits.h"
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
namespace idhan
|
||||
{
|
||||
class SHA256;
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
#include <iostream>
|
||||
#include <source_location>
|
||||
|
||||
#include "logging/format_ns.hpp"
|
||||
|
||||
namespace idhan
|
||||
{
|
||||
inline void fixme( const std::source_location location = std::source_location::current() )
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
#include "api/helpers/createBadRequest.hpp"
|
||||
#include "api/helpers/records.hpp"
|
||||
#include "api/helpers/tags/tags.hpp"
|
||||
#include "constants/SearchOrder.hpp"
|
||||
#include "constants/hydrus_version.hpp"
|
||||
#include "core/search/SearchBuilder.hpp"
|
||||
#include "crypto/SHA256.hpp"
|
||||
@@ -25,7 +24,7 @@
|
||||
namespace idhan::hyapi
|
||||
{
|
||||
|
||||
drogon::Task< drogon::HttpResponsePtr > HydrusAPI::unsupported( drogon::HttpRequestPtr request )
|
||||
drogon::Task< drogon::HttpResponsePtr > HydrusAPI::unsupported( [[maybe_unused]] drogon::HttpRequestPtr request )
|
||||
{
|
||||
Json::Value root;
|
||||
root[ "status" ] = 410;
|
||||
|
||||
Reference in New Issue
Block a user