Skip to content

Commit 43f366c

Browse files
committed
[repository] remove unused variables
1 parent fdeedda commit 43f366c

File tree

1 file changed

+5
-16
lines changed

1 file changed

+5
-16
lines changed

repository.c

+5-16
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,8 @@ static int php_git2_repository_fetchhead_foreach_cb(const char *ref_name,
6969
unsigned int is_merge,
7070
void *payload)
7171
{
72-
php_git2_t *result;
7372
zval *param_ref_name, *param_remote_url, *param_oid, *param_is_merge, *retval_ptr = NULL;
7473
php_git2_cb_t *p = (php_git2_cb_t*)payload;
75-
int i = 0;
7674
long retval = 0;
7775
char _oid[GIT2_OID_HEXSIZE] = {0};
7876
GIT2_TSRMLS_SET(p->tsrm_ls)
@@ -106,10 +104,8 @@ static int php_git2_repository_fetchhead_foreach_cb(const char *ref_name,
106104
static int php_git2_repository_mergehead_foreach_cb(const git_oid *oid,
107105
void *payload)
108106
{
109-
php_git2_t *result;
110107
zval *param_oid, *retval_ptr = NULL;
111108
php_git2_cb_t *p = (php_git2_cb_t*)payload;
112-
int i = 0;
113109
long retval = 0;
114110
char _oid[GIT2_OID_HEXSIZE] = {0};
115111
GIT2_TSRMLS_SET(p->tsrm_ls)
@@ -435,7 +431,6 @@ PHP_FUNCTION(git_repository_head_detached)
435431
int result = 0;
436432
zval *repo = NULL;
437433
php_git2_t *_repo = NULL;
438-
int error = 0;
439434

440435
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
441436
"r", &repo) == FAILURE) {
@@ -455,7 +450,6 @@ PHP_FUNCTION(git_repository_head_unborn)
455450
int result = 0;
456451
zval *repo = NULL;
457452
php_git2_t *_repo = NULL;
458-
int error = 0;
459453

460454
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
461455
"r", &repo) == FAILURE) {
@@ -476,7 +470,6 @@ PHP_FUNCTION(git_repository_is_empty)
476470
int result = 0;
477471
zval *repo = NULL;
478472
php_git2_t *_repo = NULL;
479-
int error = 0;
480473

481474
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
482475
"r", &repo) == FAILURE) {
@@ -520,7 +513,6 @@ PHP_FUNCTION(git_repository_set_workdir)
520513
char *workdir = NULL;
521514
int workdir_len = 0;
522515
long update_gitlink = 0;
523-
int error = 0;
524516

525517
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
526518
"rsl", &repo, &workdir, &workdir_len, &update_gitlink) == FAILURE) {
@@ -540,7 +532,6 @@ PHP_FUNCTION(git_repository_is_bare)
540532
int result = 0;
541533
zval *repo = NULL;
542534
php_git2_t *_repo = NULL;
543-
int error = 0;
544535

545536
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
546537
"r", &repo) == FAILURE) {
@@ -694,7 +685,6 @@ PHP_FUNCTION(git_repository_message_remove)
694685
int result = 0;
695686
zval *repo = NULL;
696687
php_git2_t *_repo = NULL;
697-
int error = 0;
698688

699689
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
700690
"r", &repo) == FAILURE) {
@@ -714,7 +704,6 @@ PHP_FUNCTION(git_repository_merge_cleanup)
714704
int result = 0;
715705
zval *repo = NULL;
716706
php_git2_t *_repo = NULL;
717-
int error = 0;
718707

719708
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
720709
"r", &repo) == FAILURE) {
@@ -731,8 +720,8 @@ PHP_FUNCTION(git_repository_merge_cleanup)
731720
*/
732721
PHP_FUNCTION(git_repository_fetchhead_foreach)
733722
{
734-
int result = 0, error = 0;
735-
zval *repo = NULL, *callback = NULL, *payload = NULL;
723+
int result = 0;
724+
zval *repo = NULL, *payload = NULL;
736725
php_git2_t *_repo = NULL;
737726
zend_fcall_info fci = empty_fcall_info;
738727
zend_fcall_info_cache fcc = empty_fcall_info_cache;
@@ -757,8 +746,8 @@ PHP_FUNCTION(git_repository_fetchhead_foreach)
757746
*/
758747
PHP_FUNCTION(git_repository_mergehead_foreach)
759748
{
760-
int result = 0, error = 0;
761-
zval *repo = NULL, *callback = NULL, *payload = NULL;
749+
int result = 0;
750+
zval *repo = NULL, *payload = NULL;
762751
php_git2_t *_repo = NULL;
763752
zend_fcall_info fci = empty_fcall_info;
764753
zend_fcall_info_cache fcc = empty_fcall_info_cache;
@@ -784,7 +773,7 @@ PHP_FUNCTION(git_repository_mergehead_foreach)
784773
*/
785774
PHP_FUNCTION(git_repository_hashfile)
786775
{
787-
php_git2_t *result = NULL, *_repo = NULL;
776+
php_git2_t *_repo = NULL;
788777
git_oid out = {0};
789778
zval *repo = NULL;
790779
char *path = NULL, *as_path = NULL, buf[41] = {0};

0 commit comments

Comments
 (0)