cvs: php4 /ext/standard uniqid.c
| From: | Sterling Hughes | Date: | Fri, 17 Aug 2001 09:10:49 +0000 |
| Subject: | cvs: php4 /ext/standard uniqid.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-6917@lists.php.net to get a copy of this message | ||
sterling Fri Aug 17 05:10:49 2001 EDT
Modified files:
/php4/ext/standard uniqid.c
Log:
Z_*_P{0,2} macro work.
Index: php4/ext/standard/uniqid.c
diff -u php4/ext/standard/uniqid.c:1.25 php4/ext/standard/uniqid.c:1.26
--- php4/ext/standard/uniqid.c:1.25 Sat Aug 11 13:03:37 2001
+++ php4/ext/standard/uniqid.c Fri Aug 17 05:10:49 2001
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: uniqid.c,v 1.25 2001/08/11 17:03:37 zeev Exp $ */
+/* $Id: uniqid.c,v 1.26 2001/08/17 09:10:49 sterling Exp $ */
#include "php.h"
@@ -38,7 +38,7 @@
#include "php_lcg.h"
#include "uniqid.h"
-#define MORE_ENTROPY (argc == 2 && (*flags)->value.lval)
+#define MORE_ENTROPY (argc == 2 && Z_LVAL_PP(flags))
/* {{{ proto string uniqid(string prefix, [bool more_entropy])
Generate a unique id */
@@ -60,7 +60,7 @@
}
/* Do some bounds checking since we are using a char array. */
- if ((*prefix)->value.str.len > 114) {
+ if (Z_STRLEN_PP(prefix) > 114) {
php_error(E_WARNING, "The prefix to uniqid should not be more than 114 characters.");
return;
}
@@ -77,9 +77,9 @@
* digits for usecs.
*/
if (MORE_ENTROPY) {
- sprintf(uniqid, "%s%08x%05x%.8f", (*prefix)->value.str.val, sec, usec,
php_combined_lcg(TSRMLS_C) * 10);
+ sprintf(uniqid, "%s%08x%05x%.8f", Z_STRVAL_PP(prefix), sec, usec,
php_combined_lcg(TSRMLS_C) * 10);
} else {
- sprintf(uniqid, "%s%08x%05x", (*prefix)->value.str.val, sec, usec);
+ sprintf(uniqid, "%s%08x%05x", Z_STRVAL_PP(prefix), sec, usec);
}
RETURN_STRING(uniqid, 1);