Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix zend_get_constant() usage #1235

Merged
merged 3 commits into from Sep 17, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ext/image/adapter.c
Original file line number Diff line number Diff line change
Expand Up @@ -1063,7 +1063,7 @@ PHP_METHOD(Phalcon_Image_Adapter, save){
}
} else {
PHALCON_INIT_VAR(constant);
if (zend_get_constant(SL("PATHINFO_DIRNAME"), constant TSRMLS_CC) == FAILURE) {
if (!zend_get_constant(SL("PATHINFO_DIRNAME"), constant TSRMLS_CC)) {
RETURN_MM();
}

Expand Down Expand Up @@ -1118,7 +1118,7 @@ PHP_METHOD(Phalcon_Image_Adapter, render){
file = phalcon_fetch_nproperty_this(this_ptr, SL("_file"), PH_NOISY_CC);

PHALCON_INIT_VAR(constant);
if (zend_get_constant(SL("PATHINFO_EXTENSION"), constant TSRMLS_CC) == FAILURE) {
if (!zend_get_constant(SL("PATHINFO_EXTENSION"), constant TSRMLS_CC)) {
RETURN_MM();
}

Expand Down
14 changes: 7 additions & 7 deletions ext/image/adapter/gd.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ PHP_METHOD(Phalcon_Image_Adapter_GD, check){
}

PHALCON_INIT_VAR(gd_version);
if (zend_get_constant(SL("GD_VERSION"), gd_version TSRMLS_CC) == FAILURE) {
if (!zend_get_constant(SL("GD_VERSION"), gd_version TSRMLS_CC)) {
PHALCON_OBS_VAR(gd_info);
phalcon_call_func_p0_ex(gd_info, &gd_info, "gd_info");

Expand Down Expand Up @@ -609,11 +609,11 @@ PHP_METHOD(Phalcon_Image_Adapter_GD, _flip) {
#else
PHALCON_INIT_VAR(mode);
if (Z_LVAL_P(direction) == PHALCON_IMAGE_HORIZONTAL) {
if (zend_get_constant(SL("IMG_FLIP_HORIZONTAL"), mode TSRMLS_CC) == FAILURE) {
if (!zend_get_constant(SL("IMG_FLIP_HORIZONTAL"), mode TSRMLS_CC)) {
RETURN_MM();
}
} else {
if (zend_get_constant(SL("IMG_FLIP_VERTICAL"), mode TSRMLS_CC) == FAILURE) {
if (!zend_get_constant(SL("IMG_FLIP_VERTICAL"), mode TSRMLS_CC)) {
RETURN_MM();
}
}
Expand Down Expand Up @@ -743,7 +743,7 @@ PHP_METHOD(Phalcon_Image_Adapter_GD, _reflection) {
image_height = phalcon_fetch_nproperty_this(this_ptr, SL("_height"), PH_NOISY_CC);

PHALCON_INIT_VAR(filtertype);
if (zend_get_constant(SL("IMG_FILTER_COLORIZE"), filtertype TSRMLS_CC) == FAILURE) {
if (!zend_get_constant(SL("IMG_FILTER_COLORIZE"), filtertype TSRMLS_CC)) {
RETURN_MM();
}

Expand Down Expand Up @@ -881,7 +881,7 @@ PHP_METHOD(Phalcon_Image_Adapter_GD, _watermark) {
phalcon_call_func_p5_ex(color, &color, "imagecolorallocatealpha", overlay, tmp, tmp, tmp, op);

PHALCON_INIT_VAR(effect);
if (zend_get_constant(SL("IMG_EFFECT_OVERLAY"), effect TSRMLS_CC) == FAILURE) {
if (!zend_get_constant(SL("IMG_EFFECT_OVERLAY"), effect TSRMLS_CC)) {
RETURN_MM();
}

Expand Down Expand Up @@ -1297,7 +1297,7 @@ PHP_METHOD(Phalcon_Image_Adapter_GD, _blur){
image = phalcon_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC);

PHALCON_INIT_VAR(constant);
if (zend_get_constant(SL("IMG_FILTER_GAUSSIAN_BLUR"), constant TSRMLS_CC) == FAILURE) {
if (!zend_get_constant(SL("IMG_FILTER_GAUSSIAN_BLUR"), constant TSRMLS_CC)) {
RETURN_MM();
}

Expand Down Expand Up @@ -1388,7 +1388,7 @@ PHP_METHOD(Phalcon_Image_Adapter_GD, _save) {
phalcon_fetch_params(1, 2, 0, &file, &quality);

PHALCON_INIT_VAR(constant);
if (zend_get_constant(SL("PATHINFO_EXTENSION"), constant TSRMLS_CC) == FAILURE) {
if (!zend_get_constant(SL("PATHINFO_EXTENSION"), constant TSRMLS_CC)) {
RETURN_MM();
}

Expand Down
2 changes: 1 addition & 1 deletion ext/image/adapter/imagick.c
Original file line number Diff line number Diff line change
Expand Up @@ -1562,7 +1562,7 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, _save) {
ce0 = zend_fetch_class(SL("Imagick"), ZEND_FETCH_CLASS_AUTO TSRMLS_CC);

PHALCON_INIT_VAR(constant);
if (zend_get_constant(SL("PATHINFO_EXTENSION"), constant TSRMLS_CC) == FAILURE) {
if (!zend_get_constant(SL("PATHINFO_EXTENSION"), constant TSRMLS_CC)) {
RETURN_MM();
}

Expand Down