]> granicus.if.org Git - php/commitdiff
Simplify code
authorIlia Alshanetsky <iliaa@php.net>
Wed, 23 May 2007 15:01:00 +0000 (15:01 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Wed, 23 May 2007 15:01:00 +0000 (15:01 +0000)
ext/standard/math.c

index d14697eb40d595592c766def43f50b9ba99343b9..012889fca8ce99909941d1d4f2ae678c4f83b067 100644 (file)
@@ -880,9 +880,7 @@ PHP_FUNCTION(decbin)
        convert_to_long_ex(arg);
 
        result = _php_math_longtobase(*arg, 2);
-       Z_TYPE_P(return_value) = IS_STRING;
-       Z_STRLEN_P(return_value) = strlen(result);
-       Z_STRVAL_P(return_value) = result;
+       RETURN_STRING(result, 0);
 }
 /* }}} */
 
@@ -900,9 +898,7 @@ PHP_FUNCTION(decoct)
        convert_to_long_ex(arg);
 
        result = _php_math_longtobase(*arg, 8);
-       Z_TYPE_P(return_value) = IS_STRING;
-       Z_STRLEN_P(return_value) = strlen(result);
-       Z_STRVAL_P(return_value) = result;
+       RETURN_STRING(result, 0);
 }
 /* }}} */
 
@@ -920,9 +916,7 @@ PHP_FUNCTION(dechex)
        convert_to_long_ex(arg);
 
        result = _php_math_longtobase(*arg, 16);
-       Z_TYPE_P(return_value) = IS_STRING;
-       Z_STRLEN_P(return_value) = strlen(result);
-       Z_STRVAL_P(return_value) = result;
+       RETURN_STRING(result, 0);
 }
 /* }}} */