Skip to content

Commit 56f675a

Browse files
committed
rename harcoded value to macro
1 parent 6fa2207 commit 56f675a

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

note.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ PHP_FUNCTION(git_note_create)
151151
char *notes_ref = NULL, *oid = NULL, *note = NULL;
152152
int notes_ref_len = 0, oid_len = 0, note_len = 0, error = 0;
153153
long force = 0;
154-
char buf[41] = {0};
154+
char buf[GIT2_OID_HEXSIZE] = {0};
155155

156156
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
157157
"raasssl", &repo, &author, &committer, &notes_ref, &notes_ref_len, &oid, &oid_len, &note, &note_len, &force) == FAILURE) {

odb.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ PHP_FUNCTION(git_odb_write)
258258
zval *data = NULL;
259259
long type = 0;
260260
int error = 0, data_len = 0;
261-
char buf[41] = {0};
261+
char buf[GIT2_OID_HEXSIZE] = {0};
262262

263263
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
264264
"rsl", &odb, &data, &data_len, &type) == FAILURE) {
@@ -330,7 +330,7 @@ PHP_FUNCTION(git_odb_stream_finalize_write)
330330
git_oid out = {0};
331331
zval *stream = NULL;
332332
int error = 0;
333-
char buf[41] = {0};
333+
char buf[GIT2_OID_HEXSIZE] = {0};
334334

335335
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
336336
"r", &stream) == FAILURE) {
@@ -461,7 +461,7 @@ PHP_FUNCTION(git_odb_hash)
461461
zval *data = NULL;
462462
int error = 0, data_len = 0;
463463
long type = 0;
464-
char buf[41] = {0};
464+
char buf[GIT2_OID_HEXSIZE] = {0};
465465

466466
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
467467
"sl", &data, &data_len, &type) == FAILURE) {
@@ -484,7 +484,7 @@ PHP_FUNCTION(git_odb_hashfile)
484484
git_oid out = {0};
485485
char *path = NULL;
486486
int path_len = 0, error = 0;
487-
char buf[41] = {0};
487+
char buf[GIT2_OID_HEXSIZE] = {0};
488488
long type = 0;
489489

490490
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,

repository.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ static int php_git2_repository_fetchhead_foreach_cb(const char *ref_name,
1313
php_git2_cb_t *p = (php_git2_cb_t*)payload;
1414
int i = 0;
1515
long retval = 0;
16-
char _oid[41] = {0};
16+
char _oid[GIT2_OID_HEXSIZE] = {0};
1717
GIT2_TSRMLS_SET(p->tsrm_ls)
1818

1919
git_oid_fmt(_oid, oid);
@@ -50,7 +50,7 @@ static int php_git2_repository_mergehead_foreach_cb(const git_oid *oid,
5050
php_git2_cb_t *p = (php_git2_cb_t*)payload;
5151
int i = 0;
5252
long retval = 0;
53-
char _oid[41] = {0};
53+
char _oid[GIT2_OID_HEXSIZE] = {0};
5454
GIT2_TSRMLS_SET(p->tsrm_ls)
5555

5656
git_oid_fmt(_oid, oid);

stash.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ static int php_git2_stash_cb(size_t index,
1212
php_git2_cb_t *p = (php_git2_cb_t*)payload;
1313
int i = 0;
1414
long retval = 0;
15-
char _oid[41] = {0};
15+
char _oid[GIT2_OID_HEXSIZE] = {0};
1616
GIT2_TSRMLS_SET(p->tsrm_ls)
1717

1818
git_oid_fmt(_oid, stash_id);
@@ -44,7 +44,7 @@ PHP_FUNCTION(git_stash_save)
4444
char *message = NULL;
4545
int message_len = 0, error = 0;
4646
long flags = 0;
47-
char buf[41] = {0};
47+
char buf[GIT2_OID_HEXSIZE] = {0};
4848

4949
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
5050
"rasl", &repo, &stasher, &message, &message_len, &flags) == FAILURE) {

tag.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ static int php_git2_tag_foreach_cb(const char *name, git_oid *oid, void *payload
99
php_git2_cb_t *p = (php_git2_cb_t*)payload;
1010
int i = 0;
1111
long retval = 0;
12-
char buffer[41] = {0};
12+
char buffer[GIT2_OID_HEXSIZE] = {0};
1313
GIT2_TSRMLS_SET(p->tsrm_ls)
1414

1515
git_oid_fmt(buffer, oid);

0 commit comments

Comments
 (0)