Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
andresgutierrez committed Jul 27, 2015
1 parent 9a38455 commit 3bb4584
Show file tree
Hide file tree
Showing 10 changed files with 445 additions and 159 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# [2.0.7](https://github.com/phalcon/cphalcon/releases/tag/phalcon-v2.0.7) (2015-XX-XX)
- Image\Adapter\Gd::save() no longer fails if the method or the instance is created with a filename without an extension
- Fixed segfault in Image\Adapter\Imagick::text

# [2.0.6](https://github.com/phalcon/cphalcon/releases/tag/phalcon-v2.0.6) (2015-07-21)
- Builds in TravisCI now uses Docker to perform faster builds
Expand Down
2 changes: 1 addition & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"name": "phalcon",
"description": "Web framework delivered as a C-extension for PHP",
"author": "Phalcon Team and contributors",
"version": "2.0.6",
"version": "2.0.7",
"verbose": false,
"optimizer-dirs": [
"optimizers"
Expand Down
92 changes: 92 additions & 0 deletions ext/kernel/math.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,96 @@ double zephir_floor(zval *op1 TSRMLS_DC)
return floor(zephir_get_numberval(op1));
}

double zephir_sin(zval *op1 TSRMLS_DC)
{
switch (Z_TYPE_P(op1)) {
case IS_LONG:
return sin(Z_LVAL_P(op1));
case IS_ARRAY:
case IS_OBJECT:
case IS_RESOURCE:
zend_error(E_WARNING, "Unsupported operand types");
break;
}

return sin(zephir_get_numberval(op1));
}

double zephir_asin(zval *op1 TSRMLS_DC)
{
switch (Z_TYPE_P(op1)) {
case IS_LONG:
return asin(Z_LVAL_P(op1));
case IS_ARRAY:
case IS_OBJECT:
case IS_RESOURCE:
zend_error(E_WARNING, "Unsupported operand types");
break;
}

return asin(zephir_get_numberval(op1));
}

double zephir_cos(zval *op1 TSRMLS_DC)
{
switch (Z_TYPE_P(op1)) {
case IS_LONG:
return cos(Z_LVAL_P(op1));
case IS_ARRAY:
case IS_OBJECT:
case IS_RESOURCE:
zend_error(E_WARNING, "Unsupported operand types");
break;
}

return cos(zephir_get_numberval(op1));
}

double zephir_acos(zval *op1 TSRMLS_DC)
{
switch (Z_TYPE_P(op1)) {
case IS_LONG:
return acos(Z_LVAL_P(op1));
case IS_ARRAY:
case IS_OBJECT:
case IS_RESOURCE:
zend_error(E_WARNING, "Unsupported operand types");
break;
}

return acos(zephir_get_numberval(op1));
}

double zephir_sqrt(zval *op1 TSRMLS_DC)
{
switch (Z_TYPE_P(op1)) {
case IS_LONG:
return sqrt(Z_LVAL_P(op1));
case IS_ARRAY:
case IS_OBJECT:
case IS_RESOURCE:
zend_error(E_WARNING, "Unsupported operand types");
break;
}

return sqrt(zephir_get_numberval(op1));
}

double zephir_tan(zval *op1 TSRMLS_DC)
{
switch (Z_TYPE_P(op1)) {
case IS_LONG:
return tan(Z_LVAL_P(op1));
case IS_ARRAY:
case IS_OBJECT:
case IS_RESOURCE:
zend_error(E_WARNING, "Unsupported operand types");
break;
}

return tan(zephir_get_numberval(op1));
}


double zephir_ceil(zval *op1 TSRMLS_DC)
{
Expand Down Expand Up @@ -144,6 +234,8 @@ void zephir_pow_function_ex(zval *return_value, zval *zbase, zval *zexp TSRMLS_D
}
#endif



long zephir_mt_rand(long min, long max TSRMLS_DC) {

long number;
Expand Down
9 changes: 9 additions & 0 deletions ext/kernel/math.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,19 @@
#include <php.h>
#include <Zend/zend.h>

double zephir_sin(zval *op1 TSRMLS_DC);
double zephir_asin(zval *op1 TSRMLS_DC);
double zephir_tan(zval *op1 TSRMLS_DC);
double zephir_cos(zval *op1 TSRMLS_DC);
double zephir_acos(zval *op1 TSRMLS_DC);
double zephir_sqrt(zval *op1 TSRMLS_DC);

double zephir_floor(zval *op1 TSRMLS_DC);
double zephir_ceil(zval *op1 TSRMLS_DC);

void zephir_round(zval *return_value, zval *op1, zval *op2, zval *op3 TSRMLS_DC);
void zephir_pow(zval *return_value, zval *op1, zval *op2 TSRMLS_DC);

long zephir_mt_rand(long min, long max TSRMLS_DC);

#endif
46 changes: 20 additions & 26 deletions ext/phalcon/image/adapter.zep.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 3bb4584

Please sign in to comment.