Skip to content

Commit

Permalink
Merge pull request #34 from cdoco/master
Browse files Browse the repository at this point in the history
Fixd segmentation fault for in the case gcc 4.8 and php7
  • Loading branch information
CatKang authored Jun 28, 2016
2 parents 5ba30b5 + 7d9c9ed commit 6dff8b8
Showing 1 changed file with 24 additions and 48 deletions.
72 changes: 24 additions & 48 deletions driver/php/php_qconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,9 @@ static PHP_METHOD(Qconf, __construct)
*/
static PHP_METHOD(Qconf, getConf)
{
char *path;
int path_len;
char *path, *idc;
size_t path_len, idc_len;
long get_flags = QCONF_WAIT;
char *idc = NULL;
int idc_len = 0;

if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|sl", &path, &path_len, &idc, &idc_len, &get_flags) == FAILURE)
{
Expand Down Expand Up @@ -113,11 +111,9 @@ static PHP_METHOD(Qconf, getConf)
*/
static PHP_METHOD(Qconf, getHost)
{
char *path;
int path_len;
char *path, *idc;
size_t path_len, idc_len;
long get_flags = QCONF_WAIT;
char *idc = NULL;
int idc_len = 0;

if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|sl", &path, &path_len, &idc, &idc_len, &get_flags) == FAILURE)
{
Expand Down Expand Up @@ -158,13 +154,11 @@ static PHP_METHOD(Qconf, getHost)
*/
static PHP_METHOD(Qconf, getAllHost)
{
char *path;
int path_len;
char *path, *idc;
size_t path_len, idc_len;
int i;
long get_flags = QCONF_WAIT;
int ret = 0;
char *idc = NULL;
int idc_len = 0;
string_vector_t nodes;

if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|sl", &path, &path_len, &idc, &idc_len, &get_flags) == FAILURE)
Expand Down Expand Up @@ -214,13 +208,11 @@ static PHP_METHOD(Qconf, getAllHost)
*/
static PHP_METHOD(Qconf, getBatchConf)
{
char *path;
int path_len;
char *path, *idc;
size_t path_len, idc_len;
int i;
qconf_batch_nodes bnodes;
long get_flags = QCONF_WAIT;
char *idc = NULL;
int idc_len = 0;
int ret = 0;

if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|sl", &path, &path_len, &idc, &idc_len, &get_flags) == FAILURE)
Expand Down Expand Up @@ -270,12 +262,10 @@ static PHP_METHOD(Qconf, getBatchConf)
*/
static PHP_METHOD(Qconf, getBatchKeys)
{
char *path;
int path_len;
char *path, *idc;
size_t path_len, idc_len;
int i;
long get_flags = QCONF_WAIT;
char *idc = NULL;
int idc_len = 0;
string_vector_t nodes;
int ret = 0;

Expand Down Expand Up @@ -327,12 +317,10 @@ static PHP_METHOD(Qconf, getBatchKeys)
*/
static PHP_METHOD(Qconf, getHostNative)
{
char *path;
int path_len;
char *path, *idc;
size_t path_len, idc_len;
int i;
long get_flags = QCONF_WAIT;
char *idc = NULL;
int idc_len = 0;
int ret = 0;
string_vector_t nodes;

Expand Down Expand Up @@ -384,12 +372,10 @@ static PHP_METHOD(Qconf, getHostNative)
*/
static PHP_METHOD(Qconf, getAllHostNative)
{
char *path;
int path_len;
char *path, *idc;
size_t path_len, idc_len;
int i;
long get_flags = QCONF_WAIT;
char *idc = NULL;
int idc_len = 0;
int ret = 0;
string_vector_t nodes;

Expand Down Expand Up @@ -446,11 +432,9 @@ static PHP_METHOD(QConfig, __construct)
*/
static PHP_METHOD(QConfig, Get)
{
char *path;
int path_len;
char *path, *idc;
size_t path_len, idc_len;
long get_flags = QCONF_WAIT;
char *idc = NULL;
int idc_len = 0;

if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|sl", &path, &path_len, &idc, &idc_len, &get_flags) == FAILURE)
{
Expand Down Expand Up @@ -491,13 +475,11 @@ static PHP_METHOD(QConfig, Get)
*/
static PHP_METHOD(QConfig, GetChild)
{
char *path;
int path_len;
char *path, *idc;
size_t path_len, idc_len;
int i;
long get_flags = QCONF_WAIT;
int ret = 0;
char *idc = NULL;
int idc_len = 0;
string_vector_t nodes;

if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|sl", &path, &path_len, &idc, &idc_len, &get_flags) == FAILURE)
Expand Down Expand Up @@ -547,13 +529,11 @@ static PHP_METHOD(QConfig, GetChild)
*/
static PHP_METHOD(QConfig, GetBatchConf)
{
char *path;
int path_len;
char *path, *idc;
size_t path_len, idc_len;
int i;
qconf_batch_nodes bnodes;
long get_flags = QCONF_WAIT;
char *idc = NULL;
int idc_len = 0;
int ret = 0;

if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|sl", &path, &path_len, &idc, &idc_len, &get_flags) == FAILURE)
Expand Down Expand Up @@ -603,12 +583,10 @@ static PHP_METHOD(QConfig, GetBatchConf)
*/
static PHP_METHOD(QConfig, GetBatchKeys)
{
char *path;
int path_len;
char *path, *idc;
size_t path_len, idc_len;
int i;
long get_flags = QCONF_WAIT;
char *idc = NULL;
int idc_len = 0;
string_vector_t nodes;
int ret = 0;

Expand Down Expand Up @@ -660,12 +638,10 @@ static PHP_METHOD(QConfig, GetBatchKeys)
*/
static PHP_METHOD(QConfig, GetBatchKeysNative)
{
char *path;
int path_len;
char *path, *idc;
size_t path_len, idc_len;
int i;
long get_flags = QCONF_WAIT;
char *idc = NULL;
int idc_len = 0;
int ret = 0;
string_vector_t nodes;

Expand Down

0 comments on commit 6dff8b8

Please sign in to comment.