Browse Source

refactor: improve build, kill warning

git-svn-id: svn://svn.lighttpd.net/xcache/trunk@1027 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
3.0
Xuefer 9 years ago
parent
commit
43c2392a8e
  1. 1
      mod_coverager/xc_coverager.c
  2. 1
      mod_disassembler/xc_disassembler.c
  3. 8
      processor/processor.m4
  4. 8
      xcache.c
  5. 5
      xcache.h
  6. 6
      xcache/xc_compatibility.h
  7. 3
      xcache/xc_lock.c
  8. 9
      xcache/xc_lock.h

1
mod_coverager/xc_coverager.c

@ -22,6 +22,7 @@
#include "xcache_globals.h"
#include "ext/standard/info.h"
#include "zend_compile.h"
typedef HashTable *coverager_t;
#define PCOV_HEADER_MAGIC 0x564f4350

1
mod_disassembler/xc_disassembler.c

@ -1,5 +1,6 @@
#include "xc_disassembler.h"
#include "xcache.h"
#include "xcache/xc_ini.h"
#include "xcache/xc_utils.h"
#include "xcache/xc_sandbox.h"
#include "xcache/xc_compatibility.h"

8
processor/processor.m4

@ -653,9 +653,11 @@ DEF_STRUCT_P_FUNC(`zend_op', , `dnl {{{
case ZEND_GOTO:
#endif
case ZEND_JMP:
#ifdef ZEND_ENGINE_2
assert(Z_OP(src->op1).jmp_addr >= processor->active_op_array_src->opcodes && Z_OP(src->op1).jmp_addr - processor->active_op_array_src->opcodes < processor->active_op_array_src->last);
Z_OP(dst->op1).jmp_addr = processor->active_op_array_dst->opcodes + (Z_OP(src->op1).jmp_addr - processor->active_op_array_src->opcodes);
assert(Z_OP(dst->op1).jmp_addr >= processor->active_op_array_dst->opcodes && Z_OP(dst->op1).jmp_addr - processor->active_op_array_dst->opcodes < processor->active_op_array_dst->last);
#endif
break;
case ZEND_JMPZ:
@ -668,9 +670,11 @@ DEF_STRUCT_P_FUNC(`zend_op', , `dnl {{{
#ifdef ZEND_JMP_SET_VAR
case ZEND_JMP_SET_VAR:
#endif
#ifdef ZEND_ENGINE_2
assert(Z_OP(src->op2).jmp_addr >= processor->active_op_array_src->opcodes && Z_OP(src->op2).jmp_addr - processor->active_op_array_src->opcodes < processor->active_op_array_src->last);
Z_OP(dst->op2).jmp_addr = processor->active_op_array_dst->opcodes + (Z_OP(src->op2).jmp_addr - processor->active_op_array_src->opcodes);
assert(Z_OP(dst->op2).jmp_addr >= processor->active_op_array_dst->opcodes && Z_OP(dst->op2).jmp_addr - processor->active_op_array_dst->opcodes < processor->active_op_array_dst->last);
#endif
break;
default:
@ -752,7 +756,9 @@ DEF_STRUCT_P_FUNC(`zend_op_array', , `dnl {{{
case ZEND_GOTO:
#endif
case ZEND_JMP:
#ifdef ZEND_ENGINE_2
Z_OP(opline->op1).jmp_addr = &dst->opcodes[Z_OP(opline->op1).jmp_addr - src->opcodes];
#endif
break;
case ZEND_JMPZ:
@ -765,7 +771,9 @@ DEF_STRUCT_P_FUNC(`zend_op_array', , `dnl {{{
#ifdef ZEND_JMP_SET_VAR
case ZEND_JMP_SET_VAR:
#endif
#ifdef ZEND_ENGINE_2
Z_OP(opline->op2).jmp_addr = &dst->opcodes[Z_OP(opline->op2).jmp_addr - src->opcodes];
#endif
break;
default:

8
xcache.c

@ -3131,9 +3131,13 @@ PHP_FUNCTION(xcache_get_refcount)
/* }}} */
/* {{{ proto bool xcache_get_isref(mixed variable)
XCache internal uses only: Check if variable data is marked referenced */
#ifdef ZEND_BEGIN_ARG_INFO_EX
ZEND_BEGIN_ARG_INFO_EX(arginfo_xcache_get_isref, 0, 0, 1)
ZEND_ARG_INFO(1, variable)
ZEND_END_ARG_INFO()
#else
static unsigned char arginfo_xcache_get_isref[] = { 1, BYREF_FORCE };
#endif
PHP_FUNCTION(xcache_get_isref)
{
@ -3656,7 +3660,7 @@ static PHP_MINFO_FUNCTION(xcache) /* {{{ */
if (xc_php_size) {
ptr = _php_math_number_format(xc_php_size, 0, '.', ',');
snprintf(buf, sizeof(buf), "enabled, %s bytes, %d split(s), with %d slots each", ptr, xc_php_hcache.size, xc_php_hentry.size);
snprintf(buf, sizeof(buf), "enabled, %s bytes, %lu split(s), with %lu slots each", ptr, xc_php_hcache.size, xc_php_hentry.size);
php_info_print_table_row(2, "Opcode Cache", buf);
efree(ptr);
}
@ -3665,7 +3669,7 @@ static PHP_MINFO_FUNCTION(xcache) /* {{{ */
}
if (xc_var_size) {
ptr = _php_math_number_format(xc_var_size, 0, '.', ',');
snprintf(buf, sizeof(buf), "enabled, %s bytes, %d split(s), with %d slots each", ptr, xc_var_hcache.size, xc_var_hentry.size);
snprintf(buf, sizeof(buf), "enabled, %s bytes, %lu split(s), with %lu slots each", ptr, xc_var_hcache.size, xc_var_hentry.size);
php_info_print_table_row(2, "Variable Cache", buf);
efree(ptr);
}

5
xcache.h

@ -10,11 +10,6 @@
#define XCACHE_WIKI_URL XCACHE_URL "/wiki"
#include <php.h>
#include <zend_compile.h>
#include <zend_API.h>
#include <zend.h>
#include "php_ini.h"
#include "zend_hash.h"
#ifdef HAVE_CONFIG_H
#include <config.h>

6
xcache/xc_compatibility.h

@ -232,7 +232,11 @@ long xc_atol(const char *str, int len);
#endif
#ifndef PHP_FE_END
# define PHP_FE_END {NULL, NULL, NULL}
# ifdef ZEND_ENGINE_2
# define PHP_FE_END {NULL, NULL, NULL, 0, 0}
# else
# define PHP_FE_END {NULL, NULL, NULL}
# endif
#endif
#endif /* XC_COMPATIBILITY_H_54F26ED90198353558718191D5EE244C */

3
xcache/xc_lock.c

@ -1,8 +1,9 @@
#include "xc_lock.h"
#include "xcache.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <php.h>
#ifndef ZEND_WIN32
typedef int HANDLE;
# ifndef INVALID_HANDLE_VALUE

9
xcache/xc_lock.h

@ -1,3 +1,10 @@
#ifndef XC_LOCK_H_1913F3DED68715D7CDA5A055E79FE0FF
#define XC_LOCK_H_1913F3DED68715D7CDA5A055E79FE0FF
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
typedef struct _xc_lock_t xc_lock_t;
xc_lock_t *xc_fcntl_init(const char *pathname);
@ -9,3 +16,5 @@ void xc_fcntl_unlock(xc_lock_t *lck);
#define xc_lock_destroy(fd) xc_fcntl_destroy(fd)
#define xc_lock(fd) xc_fcntl_lock(fd)
#define xc_unlock(fd) xc_fcntl_unlock(fd)
#endif /* XC_LOCK_H_1913F3DED68715D7CDA5A055E79FE0FF */
Loading…
Cancel
Save