Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit 81211a4

Browse files
fix: all leftover warnings on Linux (#2111)
Co-authored-by: vansangpfiev <[email protected]>
1 parent d80ddc8 commit 81211a4

File tree

10 files changed

+23
-10
lines changed

10 files changed

+23
-10
lines changed

engine/common/assistant_code_interpreter_tool.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ struct AssistantCodeInterpreterTool : public AssistantTool {
2020

2121
static cpp::result<AssistantCodeInterpreterTool, std::string> FromJson() {
2222
AssistantCodeInterpreterTool tool;
23-
return std::move(tool);
23+
return tool;
2424
}
2525

2626
cpp::result<Json::Value, std::string> ToJson() override {

engine/common/thread.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,11 @@ struct Thread : JsonSerializable {
150150
if (auto code_interpreter =
151151
dynamic_cast<CodeInterpreter*>(tool_resources.get())) {
152152
tool_json["code_interpreter"] = tool_result.value();
153+
(void) code_interpreter;
153154
} else if (auto file_search =
154155
dynamic_cast<FileSearch*>(tool_resources.get())) {
155156
tool_json["file_search"] = tool_result.value();
157+
(void) file_search;
156158
}
157159
json["tool_resources"] = tool_json;
158160
}

engine/extensions/python-engine/python_engine.cc

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ size_t StreamWriteCallback(char* ptr, size_t size, size_t nmemb,
5656
return size * nmemb;
5757
}
5858

59-
static size_t WriteCallback(char* ptr, size_t size, size_t nmemb,
59+
[[maybe_unused]] static size_t WriteCallback(char* ptr, size_t size, size_t nmemb,
6060
std::string* data) {
6161
data->append(ptr, size * nmemb);
6262
return size * nmemb;
@@ -185,6 +185,7 @@ void PythonEngine::GetModels(
185185
status["status_code"] = k200OK;
186186

187187
callback(std::move(status), std::move(response_json));
188+
(void) json_body;
188189
}
189190

190191
void PythonEngine::LoadModel(
@@ -386,6 +387,8 @@ void PythonEngine::HandleChatCompletion(
386387
std::shared_ptr<Json::Value> json_body,
387388
std::function<void(Json::Value&&, Json::Value&&)>&& callback) {
388389
LOG_WARN << "Does not support yet!";
390+
(void) json_body;
391+
(void) callback;
389392
}
390393

391394
CurlResponse PythonEngine::MakeStreamPostRequest(
@@ -623,7 +626,9 @@ Json::Value PythonEngine::GetRemoteModels() {
623626
return Json::Value();
624627
}
625628

626-
void PythonEngine::StopInferencing(const std::string& model_id) {}
629+
void PythonEngine::StopInferencing(const std::string& model_id) {
630+
(void)model_id;
631+
}
627632

628633
void PythonEngine::HandleRouteRequest(
629634
std::shared_ptr<Json::Value> json_body,
@@ -893,12 +898,14 @@ void PythonEngine::SetLogLevel(trantor::Logger::LogLevel log_level) {
893898

894899
void PythonEngine::Load(EngineLoadOption opts) {
895900
// Develop register model here on loading engine
901+
(void) opts;
896902
};
897903

898904
void PythonEngine::Unload(EngineUnloadOption opts) {
899905
for (const auto& pair : models_) {
900906
TerminateModelProcess(pair.first);
901907
}
908+
(void) opts;
902909
};
903910

904-
} // namespace python_engine
911+
} // namespace python_engine

engine/main.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ void RunServer(std::optional<std::string> host, std::optional<int> port,
6363
bool ignore_cout) {
6464
#if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
6565
auto signal_handler = +[](int sig) -> void {
66-
std::cout << "\rCaught interrupt signal, shutting down\n";
66+
std::cout << "\rCaught interrupt signal:" << sig << ", shutting down\n";;
6767
shutdown_signal = true;
6868
};
6969
signal(SIGINT, signal_handler);
@@ -145,7 +145,7 @@ void RunServer(std::optional<std::string> host, std::optional<int> port,
145145
return;
146146
}
147147

148-
using Event = cortex::event::Event;
148+
// using Event = cortex::event::Event; //unused
149149
using EventQueue =
150150
eventpp::EventQueue<EventType,
151151
void(const eventpp::AnyData<eventMaxSize>&)>;

engine/services/download_service.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,8 @@ class DownloadService {
234234
break;
235235
}
236236
}
237+
(void) ultotal;
238+
(void) ulnow;
237239

238240
return 0;
239241
}

engine/utils/cortex_utils.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ inline std::string logs_cli_base_name = "./logs/cortex-cli.log";
3030
// example: Mon, 25 Nov 2024 09:57:03 GMT
3131
inline std::string GetDateRFC1123() {
3232
std::time_t now = std::time(nullptr);
33-
std::tm gmt_time = {};
3433
#ifdef _MSC_VER
34+
std::tm gmt_time = {};
3535
gmtime_s(&gmt_time, &now);
3636
std::ostringstream oss;
3737
oss << std::put_time(&gmt_time, "%a, %d %b %Y %H:%M:%S GMT");
@@ -133,7 +133,7 @@ inline std::string GetCurrentPath() {
133133
#else
134134
std::vector<char> buf(PATH_MAX);
135135
ssize_t len = readlink("/proc/self/exe", &buf[0], buf.size());
136-
if (len == -1 || len == buf.size()) {
136+
if (len == -1 || len == (ssize_t) buf.size()) {
137137
std::cerr << "Error reading symlink /proc/self/exe." << std::endl;
138138
return "";
139139
}

engine/utils/file_logger.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ void FileLogger::CircularLogFile::writeLog(const char* logLine,
5454
lineBuffer_.push_back(line);
5555
AppendToFile(line + "\n");
5656
++linesWrittenSinceLastTruncate_;
57-
if (linesWrittenSinceLastTruncate_.load() >= TRUNCATE_CHECK_INTERVAL) {
57+
if (static_cast<uint64_t>(linesWrittenSinceLastTruncate_.load()) >= TRUNCATE_CHECK_INTERVAL) {
5858

5959
TruncateFileIfNeeded();
6060
}

engine/utils/github_release_utils.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ inline cpp::result<std::vector<GitHubRelease>, std::string> GetReleases(
168168
for (const auto& release : result.value()) {
169169
releases.push_back(GitHubRelease::FromJson(release));
170170
}
171+
(void) allow_prerelease;
171172
return releases;
172173
}
173174

engine/utils/hardware/gguf/gguf_file.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,7 @@ inline std::optional<GGUFFile> ParseGgufFile(const std::string& path) {
539539
}
540540
gf.tensor_infos = tis;
541541
}
542+
(void) version;
542543
return gf;
543544
}
544545
} // namespace hardware

engine/utils/url_parser.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ inline cpp::result<Url, std::string> FromUrlString(
9393
.host = "",
9494
.pathParams = {},
9595
};
96-
unsigned counter = 0;
96+
int counter = 0;
9797

9898
std::smatch url_match_result;
9999

0 commit comments

Comments
 (0)