Fix CS for some setters and few more

This commit is contained in:
Jakub Zelenka 2016-09-19 19:53:41 +01:00
parent 4d14a5736c
commit 8eabb499cf

34
gnupg.c
View file

@ -666,11 +666,13 @@ PHP_FUNCTION(gnupg_setarmor)
GNUPG_GETOBJ(); GNUPG_GETOBJ();
if (this) { if (this) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &armor) == FAILURE) { if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l",
&armor) == FAILURE) {
return; return;
} }
} else { } else {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &res, &armor) == FAILURE) { if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl",
&res, &armor) == FAILURE) {
return; return;
} }
GNUPG_RES_FETCH(); GNUPG_RES_FETCH();
@ -693,11 +695,13 @@ PHP_FUNCTION(gnupg_seterrormode)
GNUPG_GETOBJ(); GNUPG_GETOBJ();
if (this) { if (this) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &errormode) == FAILURE) { if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l",
&errormode) == FAILURE) {
return; return;
} }
} else { } else {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &res, &errormode) == FAILURE) { if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl",
&res, &errormode) == FAILURE) {
return; return;
} }
GNUPG_RES_FETCH(); GNUPG_RES_FETCH();
@ -728,11 +732,13 @@ PHP_FUNCTION(gnupg_setsignmode)
GNUPG_GETOBJ(); GNUPG_GETOBJ();
if (this) { if (this) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &signmode) == FAILURE) { if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l",
&signmode) == FAILURE) {
return; return;
} }
} else { } else {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &res, &signmode) == FAILURE) { if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl",
&res, &signmode) == FAILURE) {
return; return;
} }
GNUPG_RES_FETCH(); GNUPG_RES_FETCH();
@ -761,7 +767,8 @@ PHP_FUNCTION(gnupg_geterror)
GNUPG_GETOBJ(); GNUPG_GETOBJ();
if (!this) { if (!this) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &res) == FAILURE) { if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r",
&res) == FAILURE) {
return; return;
} }
GNUPG_RES_FETCH(); GNUPG_RES_FETCH();
@ -785,7 +792,8 @@ PHP_FUNCTION(gnupg_getprotocol) {
/* }}} */ /* }}} */
/* {{{ proto array gnupg_keyinfo(string pattern) /* {{{ proto array gnupg_keyinfo(string pattern)
* returns an array with informations about all keys, that matches the given pattern * returns an array with informations about all keys, that matches
* the given pattern
*/ */
PHP_FUNCTION(gnupg_keyinfo) PHP_FUNCTION(gnupg_keyinfo)
{ {
@ -799,16 +807,20 @@ PHP_FUNCTION(gnupg_keyinfo)
GNUPG_GETOBJ(); GNUPG_GETOBJ();
if (this) { if (this) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &searchkey, &searchkey_len) == FAILURE) { if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s",
&searchkey, &searchkey_len) == FAILURE) {
return; return;
} }
} else { } else {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &res, &searchkey, &searchkey_len) == FAILURE) { if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs",
&res, &searchkey, &searchkey_len) == FAILURE) {
return; return;
} }
GNUPG_RES_FETCH(); GNUPG_RES_FETCH();
} }
if ((PHPC_THIS->err = gpgme_op_keylist_start(PHPC_THIS->ctx, searchkey, 0)) != GPG_ERR_NO_ERROR) {
PHPC_THIS->err = gpgme_op_keylist_start(PHPC_THIS->ctx, searchkey, 0);
if (PHPC_THIS->err != GPG_ERR_NO_ERROR) {
GNUPG_ERR("could not init keylist"); GNUPG_ERR("could not init keylist");
return; return;
} }