diff options
author | Andrew Neitsch <andrew@neitsch.ca> | 2016-06-04 14:11:30 -0600 |
---|---|---|
committer | Andrew Neitsch <andrew@neitsch.ca> | 2016-06-04 14:11:30 -0600 |
commit | 0f6f49500c091eda9c6b72172ca5fffd4c41abb7 (patch) | |
tree | 4d2f778cdafec1c0cbe76b77f31527b1235a6404 | |
parent | a00e9ce868deee260d210ca4cd9da193d13a3ff6 (diff) | |
download | ffi-0f6f49500c091eda9c6b72172ca5fffd4c41abb7.tar.gz |
Fix “char promoted to int when passed through ...”
-rw-r--r-- | spec/ffi/fixtures/FunctionTest.c | 6 | ||||
-rw-r--r-- | spec/ffi/variadic_spec.rb | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/spec/ffi/fixtures/FunctionTest.c b/spec/ffi/fixtures/FunctionTest.c index 6dfbeec..1dd9185 100644 --- a/spec/ffi/fixtures/FunctionTest.c +++ b/spec/ffi/fixtures/FunctionTest.c @@ -62,10 +62,10 @@ void testBlockingClose(struct testBlockingData *self) { free(self); } -static char sum_varargs(va_list args) { +static int sum_varargs(va_list args) { char sum = 0; - char arg; - while ((arg = va_arg(args, char)) != 0) { + int arg; + while ((arg = va_arg(args, int)) != 0) { sum += arg; } va_end(args); diff --git a/spec/ffi/variadic_spec.rb b/spec/ffi/variadic_spec.rb index 1b42266..0f1e077 100644 --- a/spec/ffi/variadic_spec.rb +++ b/spec/ffi/variadic_spec.rb @@ -36,8 +36,8 @@ describe "Function with variadic arguments" do handle = LibTest.testBlockingOpen expect(handle).not_to be_null begin - thWR = Thread.new { LibTest.testBlockingWRva(handle, 63, :char, 40, :char, 23, :char, 0) } - thRW = Thread.new { LibTest.testBlockingRWva(handle, 64, :char, 40, :char, 24, :char, 0) } + thWR = Thread.new { LibTest.testBlockingWRva(handle, 63, :int, 40, :int, 23, :int, 0) } + thRW = Thread.new { LibTest.testBlockingRWva(handle, 64, :int, 40, :int, 24, :int, 0) } expect(thWR.value).to eq(64) expect(thRW.value).to eq(63) ensure |