@@ -55,10 +55,9 @@ static int php_git2_backend_exists(git_odb_backend *_backend, const git_oid *oid
5555
5656static int php_git2_backend_write (git_oid * id , git_odb_backend * _backend , const void * buffer , size_t size , git_otype type )
5757{
58- zval * z_id , * z_buffer , * z_size , * z_type , * retval , * * value ;
58+ zval * z_id , * z_buffer , * z_size , * z_type , * retval ;
5959 int error = GIT_ERROR ;
6060 char t_id [GIT_OID_HEXSZ ] = {0 };
61- TSRMLS_FETCH ();
6261 php_git2_backend_internal * backend ;
6362
6463 MAKE_STD_ZVAL (z_id );
@@ -101,7 +100,7 @@ static int php_git2_backend_read(void **buffer,size_t *size, git_otype *type, gi
101100 git_oid_fmt (out , id );
102101
103102 ZVAL_STRING (z_oid , out , 1 );
104- ZVAL_LONG (z_type , type );
103+ ZVAL_LONG (z_type , ( long ) type );
105104 m_backend = (php_git2_backend_internal * )_backend ;
106105
107106 zend_call_method_with_2_params (& m_backend -> self , Z_OBJCE_P (m_backend -> self ), NULL , "read" , & retval , z_oid , z_type );
@@ -116,7 +115,7 @@ static int php_git2_backend_read(void **buffer,size_t *size, git_otype *type, gi
116115 }
117116
118117 if (zend_hash_find (hash ,"size" ,sizeof ("size" ),(void * * )& value_pp ) != FAILURE ) {
119- size = * value_pp ;
118+ z_size = * value_pp ;
120119 }
121120
122121 * buffer = estrndup (Z_STRVAL_P (data ),Z_STRLEN_P (data ));
@@ -136,7 +135,7 @@ static int php_git2_backend_read_header(size_t *size, git_otype *type, git_odb_b
136135 TSRMLS_FETCH ();
137136 zval * retval , * z_oid , * z_type ;
138137 php_git2_backend_internal * m_backend ;
139- const char out [GIT_OID_HEXSZ ] = {0 };
138+ char out [GIT_OID_HEXSZ ] = {0 };
140139 int result = GIT_ERROR ;
141140
142141 MAKE_STD_ZVAL (z_oid );
@@ -170,12 +169,12 @@ static int php_git2_backend_read_header(size_t *size, git_otype *type, git_odb_b
170169 return result ;
171170}
172171
173- static int php_git2_backend_read_prefix (git_oid * id ,void * * buffer , size_t * size , git_otype * type ,struct git_odb_backend * _backend ,const git_oid * oid ,unsigned int length )
172+ static int php_git2_backend_read_prefix (git_oid * id , void * * buffer , size_t * size , git_otype * type , struct git_odb_backend * _backend , const git_oid * oid , size_t length )
174173{
175174 TSRMLS_FETCH ();
176175 zval * retval , * z_oid , * z_type ;
177176 php_git2_backend_internal * m_backend ;
178- const char out [GIT_OID_HEXSZ + 1 ] = {0 };
177+ char out [GIT_OID_HEXSZ + 1 ] = {0 };
179178 int result = GIT_ERROR ;
180179
181180 MAKE_STD_ZVAL (z_oid );
@@ -196,7 +195,7 @@ static int php_git2_backend_read_prefix(git_oid *id,void ** buffer, size_t * siz
196195 }
197196
198197 if (zend_hash_find (hash ,"size" ,sizeof ("size" ),(void * * )& value_pp ) != FAILURE ) {
199- size = * value_pp ;
198+ z_size = * value_pp ;
200199 }
201200
202201 if (zend_hash_find (hash ,"oid" ,sizeof ("oid" ),(void * * )& value_pp ) != FAILURE ) {
0 commit comments