com php-src: Remove excessive macros: ext/session/mod_user. c
| From: | Yasuo Ohgaki | Date: | Thu, 29 Jan 2015 10:48:50 +0000 |
| Subject: | com php-src: Remove excessive macros: ext/session/mod_user. c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-84444@lists.php.net to get a copy of this message | ||
Commit: 7f52978c6727f5bd3452df3b1d684e3708c43833
Author: Yasuo Ohgaki <yohgaki@php.net> Thu, 29 Jan 2015 19:48:50 +0900
Parents: 07a5dfca5bf33ef287b14da8218d9a72cc7cb929
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=7f52978c6727f5bd3452df3b1d684e3708c43833
Log:
Remove excessive macros
Changed paths:
M ext/session/mod_user.c
Diff:
diff --git a/ext/session/mod_user.c b/ext/session/mod_user.c
index bb32a95..89a3eca 100644
--- a/ext/session/mod_user.c
+++ b/ext/session/mod_user.c
@@ -26,26 +26,6 @@ ps_module ps_mod_user = {
PS_MOD_UPDATE_TIMESTAMP(user)
};
-#define SESS_ZVAL_LONG(val, a) \
-{ \
- ZVAL_LONG(a, val); \
-}
-
-#define SESS_ZVAL_STRING(vl, a) \
-{ \
- char *__vl = vl; \
- SESS_ZVAL_STRINGN(__vl, strlen(__vl), a); \
-}
-
-#define SESS_ZVAL_STRINGN(vl, ln, a) \
-{ \
- ZVAL_STRINGL(a, vl, ln); \
-}
-
-#define SESS_ZVAL_STR(vl, a) \
-{ \
- ZVAL_STR_COPY(a, vl); \
-}
static void ps_call_handler(zval *func, int argc, zval *argv, zval *retval)
{
@@ -102,8 +82,8 @@ PS_OPEN_FUNC(user)
return FAILURE;
}
- SESS_ZVAL_STRING((char*)save_path, &args[0]);
- SESS_ZVAL_STRING((char*)session_name, &args[1]);
+ ZVAL_STRING(&args[0], (char*)save_path);
+ ZVAL_STRING(&args[1], (char*)session_name);
ps_call_handler(&PSF(open), 2, args, &retval);
PS(mod_user_implemented) = 1;
@@ -144,7 +124,7 @@ PS_READ_FUNC(user)
zval args[1];
STDVARS;
- SESS_ZVAL_STR(key, &args[0]);
+ ZVAL_STR_COPY(&args[0], key);
ps_call_handler(&PSF(read), 1, args, &retval);
@@ -164,8 +144,8 @@ PS_WRITE_FUNC(user)
zval args[2];
STDVARS;
- SESS_ZVAL_STR(key, &args[0]);
- SESS_ZVAL_STR(val, &args[1]);
+ ZVAL_STR_COPY(&args[0], key);
+ ZVAL_STR_COPY(&args[1], val);
ps_call_handler(&PSF(write), 2, args, &retval);
@@ -177,7 +157,7 @@ PS_DESTROY_FUNC(user)
zval args[1];
STDVARS;
- SESS_ZVAL_STR(key, &args[0]);
+ ZVAL_STR_COPY(&args[0], key);
ps_call_handler(&PSF(destroy), 1, args, &retval);
@@ -189,7 +169,7 @@ PS_GC_FUNC(user)
zval args[1];
STDVARS;
- SESS_ZVAL_LONG(maxlifetime, &args[0]);
+ ZVAL_LONG(&args[0], maxlifetime);
ps_call_handler(&PSF(gc), 1, args, &retval);
@@ -234,7 +214,7 @@ PS_VALIDATE_SID_FUNC(user)
zval args[1];
STDVARS;
- SESS_ZVAL_STR(key, &args[0]);
+ ZVAL_STR_COPY(&args[0], key);
ps_call_handler(&PSF(validate_sid), 1, args, &retval);
@@ -250,8 +230,8 @@ PS_UPDATE_TIMESTAMP_FUNC(user)
zval args[2];
STDVARS;
- SESS_ZVAL_STR(key, &args[0]);
- SESS_ZVAL_STR(val, &args[1]);
+ ZVAL_STR_COPY(&args[0], key);
+ ZVAL_STR_COPY(&args[1], val);
/* maintain backwards compatibility */
if (!Z_ISUNDEF(PSF(update_timestamp))) {