summaryrefslogtreecommitdiff
path: root/test_napi/src
diff options
context:
space:
mode:
Diffstat (limited to 'test_napi/src')
-rw-r--r--test_napi/src/async.rs4
-rw-r--r--test_napi/src/lib.rs2
-rw-r--r--test_napi/src/object_wrap.rs4
-rw-r--r--test_napi/src/properties.rs9
4 files changed, 10 insertions, 9 deletions
diff --git a/test_napi/src/async.rs b/test_napi/src/async.rs
index d14871a7c..53432de7c 100644
--- a/test_napi/src/async.rs
+++ b/test_napi/src/async.rs
@@ -3,7 +3,7 @@
use napi_sys::Status::napi_ok;
use napi_sys::ValueType::napi_function;
use napi_sys::*;
-use std::os::raw::c_void;
+use std::os::raw::{c_char, c_void};
use std::ptr;
pub struct Baton {
@@ -62,7 +62,7 @@ extern "C" fn test_async_work(
unsafe {
napi_create_string_utf8(
env,
- "test_async_resource\0".as_ptr() as *const i8,
+ "test_async_resource\0".as_ptr() as *const c_char,
usize::MAX,
&mut resource_name,
)
diff --git a/test_napi/src/lib.rs b/test_napi/src/lib.rs
index dd0c7cbed..569256a0b 100644
--- a/test_napi/src/lib.rs
+++ b/test_napi/src/lib.rs
@@ -42,7 +42,7 @@ macro_rules! get_callback_info {
macro_rules! new_property {
($env: expr, $name: expr, $value: expr) => {
napi_property_descriptor {
- utf8name: $name.as_ptr() as *const i8,
+ utf8name: $name.as_ptr() as *const std::os::raw::c_char,
name: ptr::null_mut(),
method: Some($value),
getter: None,
diff --git a/test_napi/src/object_wrap.rs b/test_napi/src/object_wrap.rs
index 3b849b2dc..a38f97c9c 100644
--- a/test_napi/src/object_wrap.rs
+++ b/test_napi/src/object_wrap.rs
@@ -3,7 +3,7 @@
use napi_sys::Status::napi_ok;
use napi_sys::ValueType::napi_number;
use napi_sys::*;
-use std::os::raw::c_void;
+use std::os::raw::{c_char, c_void};
use std::ptr;
pub struct NapiObject {
@@ -146,7 +146,7 @@ pub fn init(env: napi_env, exports: napi_value) {
napi_set_named_property(
env,
exports,
- "NapiObject\0".as_ptr() as *const i8,
+ "NapiObject\0".as_ptr() as *const c_char,
cons,
)
} == napi_ok
diff --git a/test_napi/src/properties.rs b/test_napi/src/properties.rs
index 89d95d6c6..b245fd61d 100644
--- a/test_napi/src/properties.rs
+++ b/test_napi/src/properties.rs
@@ -3,6 +3,7 @@
use napi_sys::PropertyAttributes::*;
use napi_sys::Status::napi_ok;
use napi_sys::*;
+use std::os::raw::c_char;
use std::ptr;
pub fn init(env: napi_env, exports: napi_value) {
@@ -15,7 +16,7 @@ pub fn init(env: napi_env, exports: napi_value) {
unsafe {
napi_create_string_utf8(
env,
- "key_v8_string".as_ptr() as *const i8,
+ "key_v8_string".as_ptr() as *const c_char,
usize::MAX,
&mut name_value,
)
@@ -29,7 +30,7 @@ pub fn init(env: napi_env, exports: napi_value) {
unsafe {
napi_create_string_utf8(
env,
- "key_v8_symbol".as_ptr() as *const i8,
+ "key_v8_symbol".as_ptr() as *const c_char,
usize::MAX,
&mut symbol_description,
)
@@ -42,7 +43,7 @@ pub fn init(env: napi_env, exports: napi_value) {
let properties = &[
napi_property_descriptor {
- utf8name: "test_property_rw\0".as_ptr() as *const i8,
+ utf8name: "test_property_rw\0".as_ptr() as *const c_char,
name: ptr::null_mut(),
method: None,
getter: None,
@@ -52,7 +53,7 @@ pub fn init(env: napi_env, exports: napi_value) {
value: number,
},
napi_property_descriptor {
- utf8name: "test_property_r\0".as_ptr() as *const i8,
+ utf8name: "test_property_r\0".as_ptr() as *const c_char,
name: ptr::null_mut(),
method: None,
getter: None,