From f8e88f0a63a64afe87b8c9d348aa1d226de21b29 Mon Sep 17 00:00:00 2001 From: sfc-gh-ext-simba-hx Date: Thu, 19 Dec 2024 16:14:18 -0800 Subject: [PATCH] debug: remove changes for unused --- cpp/lib/ResultSet.hpp | 1 - cpp/lib/ResultSetPutGet.cpp | 4 ---- include/snowflake/BindUploader.hpp | 3 --- lib/client_int.h | 7 ------- lib/result_set.h | 1 - tests/test_bind_params.c | 3 --- tests/test_multiple_statements.c | 7 ------- tests/utils/test_setup.h | 7 ------- 8 files changed, 33 deletions(-) diff --git a/cpp/lib/ResultSet.hpp b/cpp/lib/ResultSet.hpp index 8b6a0e2692..5e583c7848 100644 --- a/cpp/lib/ResultSet.hpp +++ b/cpp/lib/ResultSet.hpp @@ -78,7 +78,6 @@ class ResultSet */ virtual SF_STATUS STDCALL appendChunk(void* chunkPtr) { - UNUSED(chunkPtr); return SF_STATUS_ERROR_GENERAL; } diff --git a/cpp/lib/ResultSetPutGet.cpp b/cpp/lib/ResultSetPutGet.cpp index 1fe6e2934d..173ea18a70 100644 --- a/cpp/lib/ResultSetPutGet.cpp +++ b/cpp/lib/ResultSetPutGet.cpp @@ -138,8 +138,6 @@ SF_STATUS STDCALL ResultSetPutGet::next() SF_STATUS STDCALL ResultSetPutGet::getCellAsBool(size_t idx, sf_bool * out_data) { - UNUSED(idx); - UNUSED(out_data); setError(SF_STATUS_ERROR_CONVERSION_FAILURE, "Value cannot be converted to boolean."); return SF_STATUS_ERROR_CONVERSION_FAILURE; @@ -306,8 +304,6 @@ SF_STATUS STDCALL ResultSetPutGet::getCellAsConstString(size_t idx, const char * SF_STATUS STDCALL ResultSetPutGet::getCellAsTimestamp(size_t idx, SF_TIMESTAMP * out_data) { - UNUSED(idx); - UNUSED(out_data); setError(SF_STATUS_ERROR_CONVERSION_FAILURE, "Value cannot be converted to timestamp."); return SF_STATUS_ERROR_CONVERSION_FAILURE; diff --git a/include/snowflake/BindUploader.hpp b/include/snowflake/BindUploader.hpp index c3489b7876..e32668f569 100644 --- a/include/snowflake/BindUploader.hpp +++ b/include/snowflake/BindUploader.hpp @@ -14,7 +14,6 @@ #include #include #include "client.h" -#include "client_int.h" namespace Snowflake { @@ -115,7 +114,6 @@ class BindUploader virtual std::string convertTimestampFormat(const std::string& timestampInNano, SF_DB_TYPE type) { - UNUSED(type); return timestampInNano; } @@ -145,7 +143,6 @@ class BindUploader virtual std::string revertTimestampFormat(const std::string& Formatedtimestamp, SF_DB_TYPE type) { - UNUSED(type); return Formatedtimestamp; } diff --git a/lib/client_int.h b/lib/client_int.h index cb0ea04d1c..38a633fc06 100644 --- a/lib/client_int.h +++ b/lib/client_int.h @@ -76,13 +76,6 @@ #define DATE_STRING_MAX_SIZE 12 #define SECONDS_IN_AN_HOUR 86400L -// Defined for unused function parameters. -#ifdef _MSC_VER -#define UNUSED(...) (__VA_ARGS__) -#else -#define UNUSED(...) -#endif - /** * Maximum one-directional range of offset-based timezones (24 hours) */ diff --git a/lib/result_set.h b/lib/result_set.h index bd0ee599fe..c5faac33ff 100644 --- a/lib/result_set.h +++ b/lib/result_set.h @@ -7,7 +7,6 @@ #include "snowflake/client.h" #include "connection.h" -#include "client_int.h" #ifdef __cplusplus extern "C" { diff --git a/tests/test_bind_params.c b/tests/test_bind_params.c index d0816f84e9..0f65f57a3a 100644 --- a/tests/test_bind_params.c +++ b/tests/test_bind_params.c @@ -9,7 +9,6 @@ #define INPUT_ARRAY_SIZE 3 void test_bind_parameters(void **unused) { - UNUSED(unused); /* init */ SF_STATUS status; SF_BIND_INPUT input_array[INPUT_ARRAY_SIZE]; @@ -292,12 +291,10 @@ void test_array_binding_core(unsigned int array_size) { } void test_array_binding_normal(void** unused) { - UNUSED(unused); test_array_binding_core(1000); } void test_array_binding_stage(void** unused) { - UNUSED(unused); test_array_binding_core(100000); } diff --git a/tests/test_multiple_statements.c b/tests/test_multiple_statements.c index 3d471e5498..f4a2cf37e3 100644 --- a/tests/test_multiple_statements.c +++ b/tests/test_multiple_statements.c @@ -6,7 +6,6 @@ void test_multi_stmt_transaction(void **unused) { - UNUSED(unused); SF_CONNECT *sf = setup_snowflake_connection(); SF_STATUS status = snowflake_connect(sf); if (status != SF_STATUS_SUCCESS) { @@ -77,7 +76,6 @@ void test_multi_stmt_transaction(void **unused) void test_multi_stmt_transaction_rollback(void **unused) { - UNUSED(unused); SF_CONNECT *sf = setup_snowflake_connection(); SF_STATUS status = snowflake_connect(sf); if (status != SF_STATUS_SUCCESS) { @@ -148,7 +146,6 @@ void test_multi_stmt_transaction_rollback(void **unused) void test_multi_stmt_with_large_result(void **unused) { - UNUSED(unused); const int rownum = 100000; SF_CONNECT *sf = setup_snowflake_connection(); @@ -267,7 +264,6 @@ sf_bool test_multi_stmt_core(sf_bool use_session_param, int count) void test_multi_stmt_count_session_param_off(void** unused) { - UNUSED(unused); // disable multiple statements by setting session parameter to 1 // the query is expected to fail assert_int_equal(test_multi_stmt_core(SF_BOOLEAN_TRUE, 1), SF_BOOLEAN_FALSE); @@ -275,7 +271,6 @@ void test_multi_stmt_count_session_param_off(void** unused) void test_multi_stmt_count_session_param_on(void** unused) { - UNUSED(unused); // enable multiple statements by setting session parameter to 0 // the query should work assert_int_equal(test_multi_stmt_core(SF_BOOLEAN_TRUE, 0), SF_BOOLEAN_TRUE); @@ -283,7 +278,6 @@ void test_multi_stmt_count_session_param_on(void** unused) void test_multi_stmt_count_stmt_attr_match(void** unused) { - UNUSED(unused); // set statement attribute with match number // the query should work assert_int_equal(test_multi_stmt_core(SF_BOOLEAN_FALSE, 3), SF_BOOLEAN_TRUE); @@ -291,7 +285,6 @@ void test_multi_stmt_count_stmt_attr_match(void** unused) void test_multi_stmt_count_stmt_attr_mismatch(void** unused) { - UNUSED(unused); // set statement attribute with mismatch number // the query is expected to fail assert_int_equal(test_multi_stmt_core(SF_BOOLEAN_FALSE, 2), SF_BOOLEAN_FALSE); diff --git a/tests/utils/test_setup.h b/tests/utils/test_setup.h index 56b2a17a34..99d8d9db39 100644 --- a/tests/utils/test_setup.h +++ b/tests/utils/test_setup.h @@ -29,13 +29,6 @@ extern "C" { } \ } -// Defined for unused function parameters. -#ifdef _MSC_VER -#define UNUSED(...) (__VA_ARGS__) -#else -#define UNUSED(...) -#endif - void initialize_test(sf_bool debug); SF_STATUS STDCALL enable_arrow_force(SF_CONNECT *sf);