From db05436fc02a8b07b9bfc5e72e9ea5273a484f5b 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 247d204f9b..176b988ad0 100644 --- a/include/onnxruntime/core/session/onnxruntime_c_api.h +++ b/include/onnxruntime/core/session/onnxruntime_c_api.h @@ -218,7 +218,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 99ff0212ad..de18d1fe64 100644 --- a/onnxruntime/core/session/onnxruntime_c_api.cc +++ b/onnxruntime/core/session/onnxruntime_c_api.cc @@ -1460,7 +1460,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; }