1
0
Fork 0

get* proto changes

git-svn-id: svn://svn.lighttpd.net/xcache/trunk@20 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
This commit is contained in:
Xuefer 2006-05-25 02:38:27 +00:00
parent d7d686435c
commit a2d3c2ceee
5 changed files with 14 additions and 13 deletions

View File

@ -24,7 +24,7 @@ static const char *const op_type_names[] = {
#endif
};
int xc_get_op_type_count()
zend_uchar xc_get_op_type_count()
{
return sizeof(op_type_names) / sizeof(op_type_names[0]);
}
@ -70,7 +70,7 @@ static const char *const data_type_names[] = {
#endif
};
int xc_get_data_type_count()
zend_uchar xc_get_data_type_count()
{
return sizeof(data_type_names) / sizeof(data_type_names[0]);
}
@ -101,7 +101,7 @@ const char *xc_get_data_type(zend_uchar data_type)
# endif
#endif
int xc_get_opcode_count()
zend_uchar xc_get_opcode_count()
{
return sizeof(xc_opcode_names) / sizeof(xc_opcode_names[0]);
}

View File

@ -1,8 +1,8 @@
#include "php.h"
int xc_get_op_type_count();
zend_uchar xc_get_op_type_count();
const char *xc_get_op_type(zend_uchar op_type);
int xc_get_data_type_count();
zend_uchar xc_get_data_type_count();
const char *xc_get_data_type(zend_uchar data_type);
int xc_get_opcode_count();
zend_uchar xc_get_opcode_count();
const char *xc_get_opcode(zend_uchar opcode);

View File

@ -12,7 +12,7 @@
#endif
#include "opcode_spec_def.h"
int xc_get_opcode_spec_count()
zend_uchar xc_get_opcode_spec_count()
{
return sizeof(xc_opcode_spec) / sizeof(xc_opcode_spec[0]);
}
@ -30,7 +30,7 @@ const xc_opcode_spec_t *xc_get_opcode_spec(zend_uchar opcode)
#define OPSPECS_DEF_NAME(name) #name,
static const char *xc_op_spec[] = { OPSPECS(OPSPECS_DEF_NAME) };
int xc_get_op_spec_count()
zend_uchar xc_get_op_spec_count()
{
return sizeof(xc_op_spec) / sizeof(xc_op_spec[0]);
}

View File

@ -38,6 +38,6 @@ typedef struct {
} xc_opcode_spec_t;
const xc_opcode_spec_t *xc_get_opcode_spec(zend_uchar opcode);
int xc_get_opcode_spec_count();
int xc_get_op_spec_count();
zend_uchar xc_get_opcode_spec_count();
zend_uchar xc_get_op_spec_count();
const char *xc_get_op_spec(zend_uchar spec);

View File

@ -829,7 +829,7 @@ static int xc_init_constant(int module_number TSRMLS_DC) /* {{{ */
{
typedef struct {
const char *prefix;
int (*getsize)();
zend_uchar (*getsize)();
const char *(*get)(zend_uchar i);
} xc_meminfo_t;
xc_meminfo_t nameinfos[] = {
@ -840,13 +840,14 @@ static int xc_init_constant(int module_number TSRMLS_DC) /* {{{ */
{ NULL, NULL, NULL }
};
xc_meminfo_t* p;
int i;
zend_uchar i, count;
char const_name[96];
int const_name_len;
int undefdone = 0;
for (p = nameinfos; p->getsize; p ++) {
for (i = p->getsize() - 1; i >= 0; i --) {
count = p->getsize();
for (i = 0; i < count; i ++) {
const char *name = p->get(i);
if (!name) continue;
if (strcmp(name, "UNDEF") == 0) {