Skip to content

Commit bd54b38

Browse files
committed
Fix #279
1 parent 5fdd8fa commit bd54b38

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/types/class_object.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use std::{
55
fmt::Debug,
66
mem,
77
ops::{Deref, DerefMut},
8-
ptr::{self, NonNull},
8+
ptr::{self, NonNull}, os::raw::c_char,
99
};
1010

1111
use crate::{
@@ -161,7 +161,7 @@ impl<T: RegisteredClass> ZendClassObject<T> {
161161
}
162162

163163
fn _from_zend_obj(std: &zend_object) -> Option<&mut Self> {
164-
let std = std as *const zend_object as *const i8;
164+
let std = std as *const zend_object as *const c_char;
165165
let ptr = unsafe {
166166
let ptr = std.offset(0 - Self::std_offset() as isize) as *const Self;
167167
(ptr as *mut Self).as_mut()?

src/types/object.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Represents an object in PHP. Allows for overriding the internal object used
22
//! by classes, allowing users to store Rust data inside a PHP object.
33
4-
use std::{convert::TryInto, fmt::Debug, ops::DerefMut};
4+
use std::{convert::TryInto, fmt::Debug, ops::DerefMut, os::raw::c_char};
55

66
use crate::{
77
boxed::{ZBox, ZBoxable},
@@ -146,7 +146,7 @@ impl ZendObject {
146146
unsafe {
147147
let res = zend_hash_str_find_ptr_lc(
148148
&(*self.ce).function_table,
149-
name.as_ptr() as *const i8,
149+
name.as_ptr() as *const c_char,
150150
name.len(),
151151
) as *mut zend_function;
152152
if res.is_null() {

src/zend/function.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ pub type Function = zend_function;
5252
impl Function {
5353
pub fn try_from_function(name: &str) -> Option<Self> {
5454
unsafe {
55-
let res = zend_fetch_function_str(name.as_ptr() as *const i8, name.len());
55+
let res = zend_fetch_function_str(name.as_ptr() as *const c_char, name.len());
5656
if res.is_null() {
5757
return None;
5858
}
@@ -65,7 +65,7 @@ impl Function {
6565
Some(ce) => unsafe {
6666
let res = zend_hash_str_find_ptr_lc(
6767
&ce.function_table,
68-
name.as_ptr() as *const i8,
68+
name.as_ptr() as *const c_char,
6969
name.len(),
7070
) as *mut zend_function;
7171
if res.is_null() {

0 commit comments

Comments
 (0)