Skip to content

Commit 4fee32f

Browse files
author
David Eriksson
committed
adjusted Satellite for Zend 2
1 parent 2246007 commit 4fee32f

File tree

4 files changed

+7
-33
lines changed

4 files changed

+7
-33
lines changed

ext/satellite/class.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ void orbit_save_data(zval * php_object, int type, void * data)
138138
INIT_PZVAL(orbit_data_handle); /* set reference count */
139139

140140
zend_hash_index_update(
141-
php_object->value.obj.properties, /* hashtable */
141+
Z_OBJPROP_P(php_object), /* hashtable */
142142
0, /* hash??? */
143143
&orbit_data_handle, /* data */
144144
sizeof(pval *), /* data size */
@@ -160,7 +160,7 @@ void * orbit_retrieve_data(const zval * php_object, int wanted_type)
160160

161161
/* get handle to corba data */
162162
zend_hash_index_find(
163-
php_object->value.obj.properties, /* hash table */
163+
Z_OBJPROP_P(php_object), /* hash table */
164164
0, /* hash??? */
165165
(void **)&orbit_data_handle /* data */
166166
);

ext/satellite/object.c

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ static void OrbitObject_Wakeup(INTERNAL_FUNCTION_PARAMETERS)
179179

180180
/* find IOR property */
181181
if (zend_hash_find(
182-
this_ptr->value.obj.properties,
182+
Z_OBJPROP_P(this_ptr),
183183
IOR_PROPERTY_KEY,
184184
sizeof(IOR_PROPERTY_KEY),
185185
(void**)&pp_ior) != SUCCESS)
@@ -242,20 +242,7 @@ zend_bool OrbitObject_Create(CORBA_Object source, zval * pDestination)
242242
goto error;
243243
}
244244

245-
/* set zval members */
246-
pDestination->type = IS_OBJECT;
247-
pDestination->is_ref = 1;
248-
pDestination->refcount = 1;
249-
250-
pDestination->value.obj.ce = &OrbitObject_class_entry;
251-
pDestination->value.obj.properties = orbit_new(HashTable);
252-
253-
zend_hash_init(
254-
pDestination->value.obj.properties, /* hash table */
255-
0, /* size */
256-
NULL, /* hash function */
257-
ZVAL_PTR_DTOR, /* destructor */
258-
0); /* persistent */
245+
object_init_ex(pDestination, &OrbitObject_class_entry);
259246

260247
/* save orbit data */
261248
OrbitObject_SaveData(pDestination, p_object);

ext/satellite/struct.c

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -209,20 +209,7 @@ zend_bool OrbitStruct_Create(const char * pId, zval * pDestination)
209209
if (!OrbitStruct_Initialize(pId, p_struct))
210210
goto error;
211211

212-
/* set zval members */
213-
pDestination->type = IS_OBJECT;
214-
pDestination->is_ref = 1;
215-
pDestination->refcount = 1;
216-
217-
pDestination->value.obj.ce = &OrbitStruct_class_entry;
218-
pDestination->value.obj.properties = orbit_new(HashTable);
219-
220-
zend_hash_init(
221-
pDestination->value.obj.properties, /* hash table */
222-
0, /* size */
223-
NULL, /* hash function */
224-
ZVAL_PTR_DTOR, /* destructor */
225-
0); /* persistent */
212+
object_init_ex(pDestination, &OrbitStruct_class_entry);
226213

227214
/* save orbit data */
228215
OrbitStruct_SaveData(pDestination, p_struct);

ext/satellite/zval_to_namedvalue.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ static zend_bool satellite_zval_to_namedvalue_objref(const zval * pSource,
145145
goto error;
146146

147147
/* see that it's a corba object */
148-
if (strcmp(pSource->value.obj.ce->name, "OrbitObject") != 0)
148+
if (strcmp(Z_OBJCE_P(pSource)->name, "OrbitObject") != 0)
149149
goto error; /* bad class type */
150150

151151
pObject = OrbitObject_RetrieveData(pSource);
@@ -308,7 +308,7 @@ static zend_bool satellite_zval_to_namedvalue_struct(const zval * pSource,
308308
goto error; /* bad source type */
309309

310310
/* see that it's a structure object */
311-
if (strcmp(pSource->value.obj.ce->name, "OrbitStruct") != 0)
311+
if (strcmp(Z_OBJCE_P(pSource)->name, "OrbitStruct") != 0)
312312
goto error; /* bad class type */
313313

314314
/* get struct info */

0 commit comments

Comments
 (0)