Skip to content

Commit fdeedda

Browse files
committed
remove unused variables
1 parent e5aeb5b commit fdeedda

37 files changed

+165
-288
lines changed

attr.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ PHP_FUNCTION(git_attr_value)
2424
*/
2525
PHP_FUNCTION(git_attr_get)
2626
{
27-
php_git2_t *result = NULL, *_repo = NULL;
27+
php_git2_t *_repo = NULL;
2828
char *value_out = NULL, *path = NULL, *name = NULL;
2929
zval *repo = NULL;
3030
long flags = 0;
@@ -48,7 +48,7 @@ PHP_FUNCTION(git_attr_get)
4848
*/
4949
PHP_FUNCTION(git_attr_get_many)
5050
{
51-
php_git2_t *result = NULL, *_repo = NULL;
51+
php_git2_t *_repo = NULL;
5252
char *values_out = NULL, *path = NULL;
5353
zval *repo = NULL, *names = NULL;
5454
long flags = 0, num_attr = 0;
@@ -74,8 +74,8 @@ PHP_FUNCTION(git_attr_get_many)
7474
*/
7575
PHP_FUNCTION(git_attr_foreach)
7676
{
77-
int result = 0, path_len = 0, error = 0;
78-
zval *repo = NULL, *callback = NULL, *payload = NULL;
77+
int result = 0, path_len = 0;
78+
zval *repo = NULL, *payload = NULL;
7979
php_git2_t *_repo = NULL;
8080
long flags = 0;
8181
char *path = NULL;
@@ -120,7 +120,7 @@ PHP_FUNCTION(git_attr_cache_flush)
120120
*/
121121
PHP_FUNCTION(git_attr_add_macro)
122122
{
123-
int result = 0, name_len = 0, values_len = 0, error = 0;
123+
int result = 0, name_len = 0, values_len = 0;
124124
zval *repo = NULL;
125125
php_git2_t *_repo = NULL;
126126
char *name = NULL, *values = NULL;

blob.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ PHP_FUNCTION(git_blob_create_frombuffer)
3434
*/
3535
PHP_FUNCTION(git_blob_create_fromchunks)
3636
{
37-
int result = 0, id_len = 0, hintpath_len = 0, error = 0;
37+
int result = 0, id_len = 0, hintpath_len = 0;
3838
char *id = NULL, *hintpath = NULL;
3939
git_oid __id = {0};
40-
zval *repo = NULL, *callback = NULL, *payload = NULL;
40+
zval *repo = NULL, *payload = NULL;
4141
php_git2_t *_repo = NULL;
4242
zend_fcall_info fci = empty_fcall_info;
4343
zend_fcall_info_cache fcc = empty_fcall_info_cache;
@@ -215,7 +215,7 @@ PHP_FUNCTION(git_blob_is_binary)
215215
*/
216216
PHP_FUNCTION(git_blob_lookup)
217217
{
218-
int result = 0, id_len = 0, error = 0;
218+
int result = 0, id_len = 0;
219219
git_blob *blob = NULL;
220220
zval *repo = NULL;
221221
php_git2_t *_repo = NULL, *_result = NULL;
@@ -244,7 +244,7 @@ PHP_FUNCTION(git_blob_lookup)
244244
*/
245245
PHP_FUNCTION(git_blob_lookup_prefix)
246246
{
247-
int result = 0, id_len = 0, error = 0;
247+
int result = 0, id_len = 0;
248248
git_blob *blob = NULL;
249249
zval *repo = NULL;
250250
php_git2_t *_repo = NULL, *_result = NULL;

branch.c

-5
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ PHP_FUNCTION(git_branch_delete)
3939
int result = 0;
4040
zval *branch = NULL;
4141
php_git2_t *_branch = NULL;
42-
int error = 0;
4342

4443
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
4544
"r", &branch) == FAILURE) {
@@ -190,7 +189,6 @@ PHP_FUNCTION(git_branch_lookup)
190189
*/
191190
PHP_FUNCTION(git_branch_name)
192191
{
193-
php_git2_t *result = NULL;
194192
char out[GIT2_BUFFER_SIZE] = {0};
195193
zval *ref = NULL;
196194
php_git2_t *_ref = NULL;
@@ -241,7 +239,6 @@ PHP_FUNCTION(git_branch_upstream)
241239
*/
242240
PHP_FUNCTION(git_branch_upstream_name)
243241
{
244-
php_git2_t *result = NULL;
245242
char tracking_branch_name_out[GIT2_BUFFER_SIZE] = {0};
246243
long buffer_size = GIT2_BUFFER_SIZE;
247244
zval *repo = NULL;
@@ -271,7 +268,6 @@ PHP_FUNCTION(git_branch_is_head)
271268
int result = 0;
272269
zval *branch = NULL;
273270
php_git2_t *_branch = NULL;
274-
int error = 0;
275271

276272
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
277273
"r", &branch) == FAILURE) {
@@ -288,7 +284,6 @@ PHP_FUNCTION(git_branch_is_head)
288284
*/
289285
PHP_FUNCTION(git_branch_remote_name)
290286
{
291-
php_git2_t *result = NULL;
292287
char remote_name_out[GIT2_BUFFER_SIZE] = {0};
293288
long buffer_size = GIT2_BUFFER_SIZE;
294289
zval *repo = NULL;

checkout.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ PHP_FUNCTION(git_checkout_head)
88
{
99
zval *opts = NULL, *repo = NULL;
1010
php_git2_t *_repo = NULL;
11-
int result = 0, error = 0, shoud_free = 0;
11+
int result = 0, shoud_free = 0;
1212
git_checkout_opts *options;
1313

1414
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
@@ -39,7 +39,7 @@ PHP_FUNCTION(git_checkout_head)
3939
*/
4040
PHP_FUNCTION(git_checkout_index)
4141
{
42-
int result = 0, error = 0;
42+
int result = 0;
4343
zval *repo = NULL, *index = NULL, *opts = NULL;
4444
php_git2_t *_repo = NULL, *_index = NULL;
4545

@@ -60,7 +60,7 @@ PHP_FUNCTION(git_checkout_index)
6060
*/
6161
PHP_FUNCTION(git_checkout_tree)
6262
{
63-
int result = 0, error = 0;
63+
int result = 0;
6464
zval *repo = NULL, *treeish = NULL, *opts = NULL;
6565
php_git2_t *_repo = NULL, *_treeish = NULL;
6666
git_checkout_opts options = {0};

commit.c

+3-5
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
PHP_FUNCTION(git_commit_lookup)
88
{
9-
int result = 0, id_len = 0, error = 0;
9+
int result = 0, id_len = 0;
1010
git_commit *commit = NULL;
1111
zval *repo = NULL;
1212
php_git2_t *_repo = NULL, *_result = NULL;
@@ -34,7 +34,6 @@ PHP_FUNCTION(git_commit_lookup)
3434
*/
3535
PHP_FUNCTION(git_commit_author)
3636
{
37-
zval *repository;
3837
php_git2_t *git2;
3938
zval *commit;
4039
git_signature *author;
@@ -83,7 +82,7 @@ PHP_FUNCTION(git_commit_tree)
8382
*/
8483
PHP_FUNCTION(git_commit_lookup_prefix)
8584
{
86-
int result = 0, id_len = 0, error = 0;
85+
int result = 0, id_len = 0;
8786
git_commit *commit = NULL;
8887
zval *repo = NULL;
8988
php_git2_t *_repo = NULL, *_result = NULL;
@@ -418,7 +417,7 @@ PHP_FUNCTION(git_commit_create)
418417
zval *repo, *tree, *parents, *committer, *author, **element;
419418
char *update_ref = {0}, *message_encoding = {0}, *message = {0};
420419
int update_ref_len, message_encoding_len, message_len, parent_count = 0, error = 0, i;
421-
php_git2_t *_repo, *_author, *_committer, *_tree;
420+
php_git2_t *_repo, *_tree;
422421
git_signature __author, __committer;
423422
char out[GIT2_OID_HEXSIZE] = {0};
424423
git_oid oid;
@@ -452,7 +451,6 @@ PHP_FUNCTION(git_commit_create)
452451
zend_hash_move_forward_ex(Z_ARRVAL_P(parents), &pos)
453452
) {
454453
git_commit *p = NULL;
455-
git_oid parent_oid;
456454

457455
if (Z_TYPE_PP(element) == IS_STRING) {
458456
error = git_oid_fromstr(&oid, Z_STRVAL_PP(element));

cred.c

-12
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ PHP_FUNCTION(git_cred_has_username)
99
int result = 0;
1010
zval *cred = NULL;
1111
php_git2_t *_cred = NULL;
12-
int error = 0;
1312

1413
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
1514
"r", &cred) == FAILURE) {
@@ -79,12 +78,6 @@ PHP_FUNCTION(git_cred_ssh_key_new)
7978
*/
8079
PHP_FUNCTION(git_cred_ssh_custom_new)
8180
{
82-
char *username = {0};
83-
int username_len;
84-
char *publickey = {0};
85-
int publickey_len;
86-
zval *sign_fn;
87-
php_git2_t *_sign_fn;
8881

8982
/* TODO(chobie): implement this */
9083
php_error_docref(NULL TSRMLS_CC, E_WARNING, "git_cred_ssh_custom_new not implemented yet");
@@ -122,11 +115,6 @@ PHP_FUNCTION(git_cred_default_new)
122115
*/
123116
PHP_FUNCTION(git_cred_userpass)
124117
{
125-
char *url = {0};
126-
int url_len;
127-
char *user_from_url = {0};
128-
int user_from_url_len;
129-
long allowed_types;
130118

131119
/* TODO(chobie): implement this */
132120
php_error_docref(NULL TSRMLS_CC, E_WARNING, "git_cred_userpass not implemented yet");

diff.c

+13-17
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ PHP_FUNCTION(git_diff_tree_to_tree)
3636
zval *new_tree = NULL;
3737
php_git2_t *_new_tree = NULL;
3838
zval *opts = NULL;
39-
int error = 0;
4039
git_diff_options options = {0};
4140

4241
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
@@ -59,7 +58,7 @@ PHP_FUNCTION(git_diff_tree_to_tree)
5958
*/
6059
PHP_FUNCTION(git_diff_tree_to_index)
6160
{
62-
int result = 0, error = 0;
61+
int result = 0;
6362
git_diff *diff = NULL;
6463
zval *repo = NULL, *old_tree = NULL, *index = NULL, *opts = NULL;
6564
php_git2_t *_repo = NULL, *_old_tree = NULL, *_index = NULL, *_diff = NULL;
@@ -88,7 +87,7 @@ PHP_FUNCTION(git_diff_tree_to_index)
8887
*/
8988
PHP_FUNCTION(git_diff_index_to_workdir)
9089
{
91-
int result = 0, error = 0;
90+
int result = 0;
9291
git_diff *diff = NULL;
9392
zval *repo = NULL, *index = NULL, *opts = NULL;
9493
php_git2_t *_repo = NULL, *_index = NULL, *_diff = NULL;
@@ -115,7 +114,7 @@ PHP_FUNCTION(git_diff_index_to_workdir)
115114
*/
116115
PHP_FUNCTION(git_diff_tree_to_workdir)
117116
{
118-
int result = 0, error = 0;
117+
int result = 0;
119118
git_diff *diff = NULL;
120119
zval *repo = NULL, *old_tree = NULL, *opts = NULL;
121120
php_git2_t *_repo = NULL, *_old_tree = NULL, *_result;
@@ -148,7 +147,7 @@ PHP_FUNCTION(git_diff_tree_to_workdir)
148147
*/
149148
PHP_FUNCTION(git_diff_tree_to_workdir_with_index)
150149
{
151-
int result = 0, error = 0;
150+
int result = 0;
152151
git_diff *diff = NULL;
153152
zval *repo = NULL, *old_tree = NULL, *opts = NULL;
154153
php_git2_t *_repo = NULL, *_old_tree = NULL, *_diff = NULL;
@@ -175,7 +174,7 @@ PHP_FUNCTION(git_diff_tree_to_workdir_with_index)
175174
*/
176175
PHP_FUNCTION(git_diff_merge)
177176
{
178-
int result = 0, error = 0;
177+
int result = 0;
179178
zval *onto = NULL, *from = NULL;
180179
php_git2_t *_onto = NULL, *_from = NULL;
181180

@@ -199,7 +198,6 @@ PHP_FUNCTION(git_diff_find_similar)
199198
zval *diff = NULL;
200199
php_git2_t *_diff = NULL;
201200
zval *options = NULL;
202-
int error = 0;
203201
git_diff_options _options = {0};
204202

205203
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
@@ -223,7 +221,6 @@ PHP_FUNCTION(git_diff_options_init)
223221
git_diff_options options = {0};
224222
long version = GIT_DIFF_OPTIONS_VERSION;
225223
zval *out;
226-
int error = 0;
227224

228225
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
229226
"|l", &version) == FAILURE) {
@@ -303,7 +300,6 @@ PHP_FUNCTION(git_diff_is_sorted_icase)
303300
int result = 0;
304301
zval *diff = NULL;
305302
php_git2_t *_diff = NULL;
306-
int error = 0;
307303

308304
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
309305
"r", &diff) == FAILURE) {
@@ -321,8 +317,8 @@ PHP_FUNCTION(git_diff_is_sorted_icase)
321317
*/
322318
PHP_FUNCTION(git_diff_foreach)
323319
{
324-
int result = 0, error = 0;
325-
zval *diff = NULL, *file_cb = NULL, *hunk_cb = NULL, *line_cb = NULL, *payload = NULL;
320+
int result = 0;
321+
zval *diff = NULL, *payload = NULL;
326322
php_git2_t *_diff = NULL;
327323
zend_fcall_info file_fci = empty_fcall_info;
328324
zend_fcall_info_cache file_fcc = empty_fcall_info_cache;
@@ -371,8 +367,8 @@ PHP_FUNCTION(git_diff_status_char)
371367
*/
372368
PHP_FUNCTION(git_diff_print)
373369
{
374-
int result = 0, error = 0;
375-
zval *diff = NULL, *print_cb = NULL, *payload = NULL;
370+
int result = 0;
371+
zval *diff = NULL, *payload = NULL;
376372
php_git2_t *_diff = NULL;
377373
zend_fcall_info fci = empty_fcall_info;
378374
zend_fcall_info_cache fcc = empty_fcall_info_cache;
@@ -398,8 +394,8 @@ PHP_FUNCTION(git_diff_print)
398394
*/
399395
PHP_FUNCTION(git_diff_blobs)
400396
{
401-
int result = 0, old_as_path_len = 0, new_as_path_len = 0, error = 0;
402-
zval *old_blob = NULL, *new_blob = NULL, *options = NULL, *file_cb = NULL, *hunk_cb = NULL, *line_cb = NULL, *payload = NULL;
397+
int result = 0, old_as_path_len = 0, new_as_path_len = 0;
398+
zval *old_blob = NULL, *new_blob = NULL, *options = NULL, *payload = NULL;
403399
php_git2_t *_old_blob = NULL, *_new_blob = NULL;
404400
char *old_as_path = NULL, *new_as_path = NULL;
405401
zend_fcall_info file_fci = empty_fcall_info;
@@ -436,8 +432,8 @@ PHP_FUNCTION(git_diff_blobs)
436432
*/
437433
PHP_FUNCTION(git_diff_blob_to_buffer)
438434
{
439-
int result = 0, old_as_path_len = 0, buffer_len = 0, buffer_as_path_len = 0, error = 0;
440-
zval *old_blob = NULL, *options = NULL, *file_cb = NULL, *hunk_cb = NULL, *line_cb = NULL, *payload = NULL;
435+
int result = 0, old_as_path_len = 0, buffer_len = 0, buffer_as_path_len = 0;
436+
zval *old_blob = NULL, *options = NULL, *payload = NULL;
441437
php_git2_t *_old_blob = NULL;
442438
char *old_as_path = NULL, *buffer = NULL, *buffer_as_path = NULL;
443439
zend_fcall_info file_fci = empty_fcall_info;

0 commit comments

Comments
 (0)