From 9cefde3391cea239af417e06c353e9dd0acf3346 Mon Sep 17 00:00:00 2001 From: Ori Levari Date: Wed, 8 Jan 2020 15:04:59 -0800 Subject: [PATCH] User/orilevari/32bit comparison warning (#2800) * use correct type for for loop * explicitly specify void for parameters of OrtGetApiBase because the function is defined in c, so when the function is just (), it is interpreted as having an unknown number of parameters. This was causing compiler warning C4276. --- include/onnxruntime/core/session/onnxruntime_c_api.h | 2 +- onnxruntime/core/session/onnxruntime_c_api.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/onnxruntime/core/session/onnxruntime_c_api.h b/include/onnxruntime/core/session/onnxruntime_c_api.h index c5a42d66cf..a9193c2fbf 100644 --- a/include/onnxruntime/core/session/onnxruntime_c_api.h +++ b/include/onnxruntime/core/session/onnxruntime_c_api.h @@ -217,7 +217,7 @@ struct OrtApiBase { }; typedef struct OrtApiBase OrtApiBase; -ORT_EXPORT const OrtApiBase* ORT_API_CALL OrtGetApiBase() NO_EXCEPTION; +ORT_EXPORT const OrtApiBase* ORT_API_CALL OrtGetApiBase(void) NO_EXCEPTION; struct OrtApi { /** diff --git a/onnxruntime/core/session/onnxruntime_c_api.cc b/onnxruntime/core/session/onnxruntime_c_api.cc index 983889f93a..0bc47b77bb 100644 --- a/onnxruntime/core/session/onnxruntime_c_api.cc +++ b/onnxruntime/core/session/onnxruntime_c_api.cc @@ -1463,7 +1463,7 @@ ORT_API(const char*, OrtApis::GetVersionString) { return ORT_VERSION; } -const OrtApiBase* ORT_API_CALL OrtGetApiBase() NO_EXCEPTION { +const OrtApiBase* ORT_API_CALL OrtGetApiBase(void) NO_EXCEPTION { return &ort_api_base; }