cvs: php-src /ext/calendar calendar.c
| From: | Andrey Hristov | Date: | Sun, 10 Apr 2005 20:57:32 +0000 |
| Subject: | cvs: php-src /ext/calendar calendar.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-31337@lists.php.net to get a copy of this message | ||
andrey Sun Apr 10 16:57:32 2005 EDT
Modified files:
/php-src/ext/calendar calendar.c
Log:
simplify code (no need of local variable - return directly)
http://cvs.php.net/diff.php/php-src/ext/calendar/calendar.c?r1=1.43&r2=1.44&ty=u
Index: php-src/ext/calendar/calendar.c
diff -u php-src/ext/calendar/calendar.c:1.43 php-src/ext/calendar/calendar.c:1.44
--- php-src/ext/calendar/calendar.c:1.43 Thu Apr 7 12:17:08 2005
+++ php-src/ext/calendar/calendar.c Sun Apr 10 16:57:31 2005
@@ -18,7 +18,7 @@
| Wez Furlong <wez@thebrainroom.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: calendar.c,v 1.43 2005/04/07 16:17:08 dmitry Exp $ */
+/* $Id: calendar.c,v 1.44 2005/04/10 20:57:31 andrey Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -266,7 +266,7 @@
Converts from a supported calendar to Julian Day Count */
PHP_FUNCTION(cal_to_jd)
{
- long cal, month, day, year, jdate;
+ long cal, month, day, year;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "llll", &cal, &month,
&day, &year) != SUCCESS) {
RETURN_FALSE;
@@ -277,8 +277,7 @@
RETURN_FALSE;
}
- jdate = cal_conversion_table[cal].to_jd(year, month, day);
- RETURN_LONG(jdate);
+ RETURN_LONG(cal_conversion_table[cal].to_jd(year, month, day));
}
/* }}} */
@@ -347,15 +346,12 @@
PHP_FUNCTION(gregoriantojd)
{
long year, month, day;
- int jdate;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll", &month, &day,
&year) == FAILURE) {
RETURN_FALSE;
}
- jdate = GregorianToSdn(year, month, day);
-
- RETURN_LONG(jdate);
+ RETURN_LONG(GregorianToSdn(year, month, day));
}
/* }}} */
@@ -389,9 +385,7 @@
RETURN_FALSE;
}
- jdate = JulianToSdn(year, month, day);
-
- RETURN_LONG(jdate);
+ RETURN_LONG(JulianToSdn(year, month, day));
}
/* }}} */
@@ -534,15 +528,12 @@
PHP_FUNCTION(jewishtojd)
{
long year, month, day;
- int jdate;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll", &month, &day,
&year) == FAILURE) {
RETURN_FALSE;
}
- jdate = JewishToSdn(year, month, day);
-
- RETURN_LONG(jdate);
+ RETURN_LONG(JewishToSdn(year, month, day));
}
/* }}} */
@@ -576,9 +567,7 @@
RETURN_FALSE;
}
- jdate = FrenchToSdn(year, month, day);
-
- RETURN_LONG(jdate);
+ RETURN_LONG(FrenchToSdn(year, month, day));
}
/* }}} */