- Timestamp:
- 03/04/2007 08:26:02 (21 months ago)
- Files:
-
- 1 modified
-
trunk/ext/php/phpext.c (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ext/php/phpext.c
r246 r247 1 1 /** 2 2 * phpext.c 3 * 3 * 4 4 * $Author$ 5 5 * $Date$ 6 * 6 * 7 7 * Copyright (C) 2003 why the lucky stiff 8 8 * Copyright © 2007 Alexey Zakhlestin <indeyets@gmail.com> 9 * 9 * 10 10 **/ 11 11 #ifdef HAVE_CONFIG_H … … 51 51 52 52 53 static double zero(){ return 0.0; }54 static double one() { return 1.0; }55 static double in f() { return one() / zero(); }56 static double nanphp() { return zero() / zero(); }53 static double inline zero() { return 0.0; } 54 static double inline one() { return 1.0; } 55 static double inline inf() { return one() / zero(); } 56 static double inline nanphp() { return zero() / zero(); } 57 57 58 58 … … 99 99 * "Merge" class 100 100 **/ 101 static int le_mergekeyp;101 /*static int le_mergekeyp; 102 102 zend_class_entry *merge_key_entry; 103 103 … … 115 115 { 116 116 } 117 117 */ 118 118 119 119 /** … … 130 130 syck_exception_entry = zend_register_internal_class_ex(&ce, php_syck_get_exception_base(TSRMLS_CC), PHP_SYCK_EXCEPTION_PARENT TSRMLS_CC); 131 131 132 le_mergekeyp = zend_register_list_destructors_ex(destroy_MergeKey_resource, NULL, "MergeKey", module_number);132 /* le_mergekeyp = zend_register_list_destructors_ex(destroy_MergeKey_resource, NULL, "MergeKey", module_number); 133 133 INIT_CLASS_ENTRY(ce, "mergekey", mergekey_functions); 134 134 merge_key_entry = zend_register_internal_class(&ce TSRMLS_CC); 135 135 */ 136 136 return SUCCESS; 137 137 } … … 194 194 ZVAL_DOUBLE(o, -inf()); 195 195 } else if (strcmp(n->type_id, "merge") == 0) { 196 TSRMLS_FETCH(); 197 MAKE_STD_ZVAL(o);196 /* This thing doesn't work, anyway */ 197 /* TSRMLS_FETCH(); 198 198 object_init_ex(o, merge_key_entry); 199 } else {199 */ } else { 200 200 ZVAL_STRINGL(o, n->data.str->ptr, n->data.str->len, 1); 201 201 } … … 206 206 for (i = 0; i < n->data.list->idx; i++) { 207 207 oid = syck_seq_read(n, i); 208 syck_lookup_sym(p, oid, (char **) &o2); 208 syck_lookup_sym(p, oid, (char **) &o2); /* retrieving child-node */ 209 209 210 add_index_zval(o, i, o2); 210 211 } … … 215 216 for (i = 0; i < n->data.pairs->idx; i++) { 216 217 oid = syck_map_read(n, map_key, i); 217 syck_lookup_sym(p, oid, (char **) &o2); 218 syck_lookup_sym(p, oid, (char **) &o2); /* retrieving key-node */ 219 218 220 oid = syck_map_read(n, map_value, i); 219 syck_lookup_sym(p, oid, (char **) &o3); 221 syck_lookup_sym(p, oid, (char **) &o3); /* retrieving value-node */ 222 220 223 if (o2->type == IS_STRING) { 221 224 add_assoc_zval(o, o2->value.str.val, o3); … … 225 228 } 226 229 227 oid = syck_add_sym(p, (char *)o); 228 return oid; 230 return syck_add_sym(p, (char *)o); /* storing node */ 229 231 } 230 232 … … 268 270 *return_value = *obj; 269 271 zval_copy_ctor(return_value); 272 273 zval_dtor(obj); 274 efree(obj); 270 275 } 271 276