Skip to content

Commit

Permalink
master renames phase 1
Browse files Browse the repository at this point in the history
  • Loading branch information
weltling committed Aug 25, 2014
1 parent 0cf2dbd commit c3e3c98
Show file tree
Hide file tree
Showing 486 changed files with 11,534 additions and 11,616 deletions.
2 changes: 1 addition & 1 deletion Zend/Zend.m4
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ int main()
exit(1);
}
], [
AC_DEFINE([ZEND_DVAL_TO_IVAL_CAST_OK], 1, [Define if double cast to long preserves least significant bits])
AC_DEFINE([ZEND_DVAL_TO_LVAL_CAST_OK], 1, [Define if double cast to long preserves least significant bits])
AC_MSG_RESULT(yes)
], [
AC_MSG_RESULT(no)
Expand Down
42 changes: 21 additions & 21 deletions Zend/zend.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,22 @@

/* true multithread-shared globals */
ZEND_API zend_class_entry *zend_standard_class_def = NULL;
ZEND_API zend_size_t (*zend_printf)(const char *format, ...);
ZEND_API size_t (*zend_printf)(const char *format, ...);
ZEND_API zend_write_func_t zend_write;
ZEND_API FILE *(*zend_fopen)(const char *filename, char **opened_path TSRMLS_DC);
ZEND_API int (*zend_stream_open_function)(const char *filename, zend_file_handle *handle TSRMLS_DC);
ZEND_API void (*zend_block_interruptions)(void);
ZEND_API void (*zend_unblock_interruptions)(void);
ZEND_API void (*zend_ticks_function)(int ticks TSRMLS_DC);
ZEND_API void (*zend_error_cb)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args);
zend_size_t (*zend_vspprintf)(char **pbuf, zend_size_t max_len, const char *format, va_list ap);
size_t (*zend_vspprintf)(char **pbuf, size_t max_len, const char *format, va_list ap);
zend_string *(*zend_vstrpprintf)(size_t max_len, const char *format, va_list ap);
ZEND_API char *(*zend_getenv)(char *name, size_t name_len TSRMLS_DC);
ZEND_API char *(*zend_resolve_path)(const char *filename, int filename_len TSRMLS_DC);

void (*zend_on_timeout)(int seconds TSRMLS_DC);

static void (*zend_message_dispatcher_p)(zend_int_t message, const void *data TSRMLS_DC);
static void (*zend_message_dispatcher_p)(zend_long message, const void *data TSRMLS_DC);
static int (*zend_get_configuration_directive_p)(const char *name, uint name_length, zval *contents);

static ZEND_INI_MH(OnUpdateErrorReporting) /* {{{ */
Expand Down Expand Up @@ -134,7 +134,7 @@ static void print_hash(zend_write_func_t write_func, HashTable *ht, int indent,
{
zval *tmp;
zend_string *string_key;
zend_uint_t num_key;
zend_ulong num_key;
int i;

for (i = 0; i < indent; i++) {
Expand Down Expand Up @@ -193,7 +193,7 @@ static void print_flat_hash(HashTable *ht TSRMLS_DC) /* {{{ */
{
zval *tmp;
zend_string *string_key;
zend_uint_t num_key;
zend_ulong num_key;
int i = 0;

ZEND_HASH_FOREACH_KEY_VAL_IND(ht, num_key, string_key, tmp) {
Expand Down Expand Up @@ -226,23 +226,23 @@ ZEND_API int zend_make_printable_zval(zval *expr, zval *expr_copy TSRMLS_DC) /*
break;
case IS_TRUE:
if (CG(one_char_string)['1']) {
ZVAL_INT_STR(expr_copy, CG(one_char_string)['1']);
ZVAL_LONG_STR(expr_copy, CG(one_char_string)['1']);
} else {
ZVAL_NEW_STR(expr_copy, STR_INIT("1", 1, 0));
ZVAL_NEW_STR(expr_copy, zend_string_init("1", 1, 0));
}
break;
case IS_RESOURCE: {
char buf[sizeof("Resource id #") + MAX_LENGTH_OF_ZEND_INT];
char buf[sizeof("Resource id #") + MAX_LENGTH_OF_LONG];
int len;

len = snprintf(buf, sizeof(buf), "Resource id #" ZEND_INT_FMT, Z_RES_HANDLE_P(expr));
ZVAL_NEW_STR(expr_copy, STR_INIT(buf, len, 0));
ZVAL_NEW_STR(expr_copy, zend_string_init(buf, len, 0));
}
break;
case IS_ARRAY:
zend_error(E_NOTICE, "Array to string conversion");
// TODO: use interned string ???
ZVAL_NEW_STR(expr_copy, STR_INIT("Array", sizeof("Array") - 1, 0));
ZVAL_NEW_STR(expr_copy, zend_string_init("Array", sizeof("Array") - 1, 0));
break;
case IS_OBJECT:
if (Z_OBJ_HANDLER_P(expr, cast_object)) {
Expand Down Expand Up @@ -278,7 +278,7 @@ ZEND_API int zend_make_printable_zval(zval *expr, zval *expr_copy TSRMLS_DC) /*
case IS_REFERENCE:
expr = Z_REFVAL_P(expr);
if (Z_TYPE_P(expr) == IS_STRING) {
ZVAL_STR(expr_copy, STR_COPY(Z_STR_P(expr)));
ZVAL_STR(expr_copy, zend_string_copy(Z_STR_P(expr)));
return 1;
}
goto again;
Expand Down Expand Up @@ -307,7 +307,7 @@ ZEND_API int zend_print_zval_ex(zend_write_func_t write_func, zval *expr, int in
write_func(str->val, len);
}

STR_RELEASE(str);
zend_string_release(str);
return len;
}
/* }}} */
Expand Down Expand Up @@ -343,7 +343,7 @@ ZEND_API void zend_print_flat_zval_r(zval *expr TSRMLS_DC) /* {{{ */
zend_printf("%s Object (", "Unknown Class");
}
if (class_name) {
STR_RELEASE(class_name);
zend_string_release(class_name);
}
if (Z_OBJ_HANDLER_P(expr, get_properties)) {
properties = Z_OBJPROP_P(expr);
Expand Down Expand Up @@ -406,7 +406,7 @@ ZEND_API void zend_print_zval_r_ex(zend_write_func_t write_func, zval *expr, int
}
ZEND_PUTS_EX(" Object\n");
if (class_name) {
STR_RELEASE(class_name);
zend_string_release(class_name);
}
if ((properties = Z_OBJDEBUG_P(expr, is_temp)) == NULL) {
break;
Expand Down Expand Up @@ -739,7 +739,7 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions TS
zend_interned_strings_init(TSRMLS_C);
zend_startup_builtin_functions(TSRMLS_C);
zend_register_standard_constants(TSRMLS_C);
zend_register_auto_global(STR_INIT("GLOBALS", sizeof("GLOBALS") - 1, 1), 1, php_auto_globals_create_globals TSRMLS_CC);
zend_register_auto_global(zend_string_init("GLOBALS", sizeof("GLOBALS") - 1, 1), 1, php_auto_globals_create_globals TSRMLS_CC);

#ifndef ZTS
zend_init_rsrc_plist(TSRMLS_C);
Expand Down Expand Up @@ -972,7 +972,7 @@ ZEND_API void zend_deactivate(TSRMLS_D) /* {{{ */
/* }}} */

BEGIN_EXTERN_C()
ZEND_API void zend_message_dispatcher(zend_int_t message, const void *data TSRMLS_DC) /* {{{ */
ZEND_API void zend_message_dispatcher(zend_long message, const void *data TSRMLS_DC) /* {{{ */
{
if (zend_message_dispatcher_p) {
zend_message_dispatcher_p(message, data TSRMLS_CC);
Expand Down Expand Up @@ -1152,21 +1152,21 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
#endif
va_copy(usr_copy, args);
len = zend_vspprintf(&str, 0, format, usr_copy);
ZVAL_NEW_STR(&params[1], STR_INIT(str, len, 0));
ZVAL_NEW_STR(&params[1], zend_string_init(str, len, 0));
efree(str);
#ifdef va_copy
va_end(usr_copy);
#endif

ZVAL_INT(&params[0], type);
ZVAL_LONG(&params[0], type);

if (error_filename) {
ZVAL_STRING(&params[2], error_filename);
} else {
ZVAL_NULL(&params[2]);
}

ZVAL_INT(&params[3], error_lineno);
ZVAL_LONG(&params[3], error_lineno);

symbol_table = zend_rebuild_symbol_table(TSRMLS_C);

Expand Down Expand Up @@ -1293,7 +1293,7 @@ ZEND_API int zend_execute_scripts(int type TSRMLS_DC, zval *retval, int file_cou
int i;
zend_file_handle *file_handle;
zend_op_array *op_array;
zend_int_t orig_interactive = CG(interactive);
zend_long orig_interactive = CG(interactive);

va_start(files, file_count);
for (i = 0; i < file_count; i++) {
Expand Down Expand Up @@ -1390,7 +1390,7 @@ void free_estring(char **str_p) /* {{{ */
void free_string_zval(zval *zv) /* {{{ */
{
zend_string *str = Z_PTR_P(zv);
STR_RELEASE(str);
zend_string_release(str);
}
/* }}} */

Expand Down
24 changes: 12 additions & 12 deletions Zend/zend.h
Original file line number Diff line number Diff line change
Expand Up @@ -274,11 +274,11 @@ char *alloca ();
#endif

#if SIZEOF_ZEND_INT == 4
#define MAX_LENGTH_OF_ZEND_INT 11
static const char int_min_digits[] = "2147483648";
#define MAX_LENGTH_OF_LONG 11
static const char long_min_digits[] = "2147483648";
#elif SIZEOF_ZEND_INT == 8
#define MAX_LENGTH_OF_ZEND_INT 20
static const char int_min_digits[] = "9223372036854775808";
#define MAX_LENGTH_OF_LONG 20
static const char long_min_digits[] = "9223372036854775808";
#else
#error "Unknown SIZEOF_ZEND_INT"
#endif
Expand Down Expand Up @@ -388,7 +388,7 @@ void zend_error_noreturn(int type, const char *format, ...) __attribute__ ((nore
# else /* ! (CRAY || __arm) */

# define XtOffset(p_type, field) \
((zend_int_t) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL)))
((zend_long) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL)))

# endif /* !CRAY */

Expand Down Expand Up @@ -534,8 +534,8 @@ struct _zend_class_entry {
#include "zend_stream.h"
typedef struct _zend_utility_functions {
void (*error_function)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 4, 0);
zend_size_t (*printf_function)(const char *format, ...) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 1, 2);
zend_size_t (*write_function)(const char *str, zend_size_t str_length);
size_t (*printf_function)(const char *format, ...) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 1, 2);
size_t (*write_function)(const char *str, size_t str_length);
FILE *(*fopen_function)(const char *filename, char **opened_path TSRMLS_DC);
void (*message_handler)(long message, const void *data TSRMLS_DC);
void (*block_interruptions)(void);
Expand All @@ -544,7 +544,7 @@ typedef struct _zend_utility_functions {
void (*ticks_function)(int ticks TSRMLS_DC);
void (*on_timeout)(int seconds TSRMLS_DC);
int (*stream_open_function)(const char *filename, zend_file_handle *handle TSRMLS_DC);
zend_size_t (*vspprintf_function)(char **pbuf, size_t max_len, const char *format, va_list ap);
size_t (*vspprintf_function)(char **pbuf, size_t max_len, const char *format, va_list ap);
zend_string *(*vstrpprintf_function)(size_t max_len, const char *format, va_list ap);
char *(*getenv_function)(char *name, size_t name_len TSRMLS_DC);
char *(*resolve_path_function)(const char *filename, int filename_len TSRMLS_DC);
Expand Down Expand Up @@ -646,7 +646,7 @@ END_EXTERN_C()
#define ZEND_PUTC(c) zend_write(&(c), 1)

BEGIN_EXTERN_C()
extern ZEND_API zend_size_t (*zend_printf)(const char *format, ...) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 1, 2);
extern ZEND_API size_t (*zend_printf)(const char *format, ...) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 1, 2);
extern ZEND_API zend_write_func_t zend_write;
extern ZEND_API FILE *(*zend_fopen)(const char *filename, char **opened_path TSRMLS_DC);
extern ZEND_API void (*zend_block_interruptions)(void);
Expand All @@ -655,8 +655,8 @@ extern ZEND_API void (*zend_ticks_function)(int ticks TSRMLS_DC);
extern ZEND_API void (*zend_error_cb)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 4, 0);
extern ZEND_API void (*zend_on_timeout)(int seconds TSRMLS_DC);
extern ZEND_API int (*zend_stream_open_function)(const char *filename, zend_file_handle *handle TSRMLS_DC);
extern zend_size_t (*zend_vspprintf)(char **pbuf, zend_size_t max_len, const char *format, va_list ap);
extern zend_string *(*zend_vstrpprintf)(zend_size_t max_len, const char *format, va_list ap);
extern size_t (*zend_vspprintf)(char **pbuf, size_t max_len, const char *format, va_list ap);
extern zend_string *(*zend_vstrpprintf)(size_t max_len, const char *format, va_list ap);
extern ZEND_API char *(*zend_getenv)(char *name, size_t name_len TSRMLS_DC);
extern ZEND_API char *(*zend_resolve_path)(const char *filename, int filename_len TSRMLS_DC);

Expand Down Expand Up @@ -685,7 +685,7 @@ END_EXTERN_C()
#endif

BEGIN_EXTERN_C()
ZEND_API void zend_message_dispatcher(zend_int_t message, const void *data TSRMLS_DC);
ZEND_API void zend_message_dispatcher(zend_long message, const void *data TSRMLS_DC);

ZEND_API int zend_get_configuration_directive(const char *name, uint name_length, zval *contents);
END_EXTERN_C()
Expand Down
Loading

0 comments on commit c3e3c98

Please sign in to comment.