- take advantage of constified ZEND_API
[m6w6/ext-http] / http_api.c
index aa48e65d520ddc2535dfc0b33a96515971220cbf..4ab7d7edbd1862d4eb6b2ab41ef7eb0666907717 100644 (file)
@@ -17,6 +17,7 @@
 
 #include "php_output.h"
 #include "ext/standard/url.h"
+#include "ext/standard/php_lcg.h"
 
 #include "php_http_api.h"
 #include "php_http_send_api.h"
@@ -191,7 +192,7 @@ STATUS _http_object_new(zend_object_value *ov, const char *cname_str, uint cname
        zend_class_entry *ce = parent_ce;
        
        if (cname_str && cname_len) {
-               if (!(ce = zend_fetch_class((char *) cname_str, cname_len, ZEND_FETCH_CLASS_DEFAULT TSRMLS_CC))) {
+               if (!(ce = zend_fetch_class(HTTP_ZAPI_CONST_CAST(char *) cname_str, cname_len, ZEND_FETCH_CLASS_DEFAULT TSRMLS_CC))) {
                        return FAILURE;
                }
                if (!instanceof_function(ce, parent_ce TSRMLS_CC)) {
@@ -321,7 +322,7 @@ PHP_HTTP_API zval *_http_get_server_var_ex(const char *key, size_t key_len, zend
        if ((SUCCESS != zend_hash_find(&EG(symbol_table), "_SERVER", sizeof("_SERVER"), (void *) &hsv)) || (Z_TYPE_PP(hsv) != IS_ARRAY)) {
                return NULL;
        }
-       if ((SUCCESS != zend_hash_find(Z_ARRVAL_PP(hsv), (char *) key, key_len + 1, (void *) &var))) {
+       if ((SUCCESS != zend_hash_find(Z_ARRVAL_PP(hsv), HTTP_ZAPI_CONST_CAST(char *) key, key_len + 1, (void *) &var))) {
                return NULL;
        }
        if (check && !((Z_TYPE_PP(var) == IS_STRING) && Z_STRVAL_PP(var) && Z_STRLEN_PP(var))) {