Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix several compile warnings

  • Loading branch information...
commit 5f495c2e4dfcd336375d2356cca95b2a12adea53 1 parent 3d6d07f
@chobie chobie authored
Showing with 13 additions and 12 deletions.
  1. +7 −8 backend.c
  2. +2 −2 commit.c
  3. +2 −1  config.c
  4. +1 −0  php_git2.h
  5. +1 −1  tree.c
View
15 backend.c
@@ -55,10 +55,9 @@ static int php_git2_backend_exists(git_odb_backend *_backend, const git_oid *oid
static int php_git2_backend_write(git_oid *id, git_odb_backend *_backend, const void *buffer, size_t size, git_otype type)
{
- zval *z_id, *z_buffer, *z_size, *z_type, *retval, **value;
+ zval *z_id, *z_buffer, *z_size, *z_type, *retval;
int error = GIT_ERROR;
char t_id[GIT_OID_HEXSZ] = {0};
- TSRMLS_FETCH();
php_git2_backend_internal *backend;
MAKE_STD_ZVAL(z_id);
@@ -101,7 +100,7 @@ static int php_git2_backend_read(void **buffer,size_t *size, git_otype *type, gi
git_oid_fmt(out, id);
ZVAL_STRING(z_oid, out, 1);
- ZVAL_LONG(z_type, type);
+ ZVAL_LONG(z_type, (long)type);
m_backend = (php_git2_backend_internal*)_backend;
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
}
if (zend_hash_find(hash,"size",sizeof("size"),(void **)&value_pp) != FAILURE) {
- size = *value_pp;
+ z_size = *value_pp;
}
*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
TSRMLS_FETCH();
zval *retval, *z_oid, *z_type;
php_git2_backend_internal *m_backend;
- const char out[GIT_OID_HEXSZ] = {0};
+ char out[GIT_OID_HEXSZ] = {0};
int result = GIT_ERROR;
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
return result;
}
-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)
+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)
{
TSRMLS_FETCH();
zval *retval, *z_oid, *z_type;
php_git2_backend_internal *m_backend;
- const char out[GIT_OID_HEXSZ+1] = {0};
+ char out[GIT_OID_HEXSZ+1] = {0};
int result = GIT_ERROR;
MAKE_STD_ZVAL(z_oid);
@@ -196,7 +195,7 @@ static int php_git2_backend_read_prefix(git_oid *id,void ** buffer, size_t * siz
}
if (zend_hash_find(hash,"size",sizeof("size"),(void **)&value_pp) != FAILURE) {
- size = *value_pp;
+ z_size = *value_pp;
}
if (zend_hash_find(hash,"oid",sizeof("oid"),(void **)&value_pp) != FAILURE) {
View
4 commit.c
@@ -386,7 +386,7 @@ PHP_METHOD(git2_commit, getParents)
error = git_commit_parent(&parent, m_commit->commit, i);
if (error == GIT_OK) {
- tmp = php_git2_object_new(git_object_owner((git_object *)m_commit->commit), parent TSRMLS_CC);
+ tmp = php_git2_object_new(git_object_owner((git_object *)m_commit->commit), (git_object*)parent TSRMLS_CC);
add_next_index_zval(result, tmp);
}
}
@@ -432,7 +432,7 @@ PHP_METHOD(git2_commit, getParent)
error = git_commit_parent(&parent, m_commit->commit, (unsigned int)index);
if (error == GIT_OK) {
- result = php_git2_object_new(git_object_owner((git_object *)m_commit->commit), parent TSRMLS_CC);
+ result = php_git2_object_new(git_object_owner((git_object *)m_commit->commit), (git_object*)parent TSRMLS_CC);
RETVAL_ZVAL(result,0,1);
}
} else {
View
3  config.c
@@ -92,7 +92,6 @@ static zval* php_git2_config_read_dimension(zval *object, zval *offset, int type
{
zval *entry, *tmp_result, **target_offset;
char *current_key, *tmp_value, *savedptr, *k;
- int error = 0;
entry = zend_read_property(git2_config_class_entry, object,"configs",sizeof("configs")-1, 0 TSRMLS_CC);
@@ -279,6 +278,8 @@ static int php_git2_config_reload(zval *object, unsigned short dtor TSRMLS_DC)
if (dtor == 1) {
zval_ptr_dtor(&entry);
}
+
+ return 0;
}
static void php_git2_config_write_dimension(zval *object, zval *offset, zval *value TSRMLS_DC)
View
1  php_git2.h
@@ -36,6 +36,7 @@
# include "Zend/zend_interfaces.h"
# include "Zend/zend_exceptions.h"
# include "ext/spl/spl_exceptions.h"
+# include "ext/standard/php_string.h"
# include <date/php_date.h>
# include <git2.h>
# include <git2/errors.h>
View
2  tree.c
@@ -135,7 +135,7 @@ PHP_METHOD(git2_tree, valid)
static int get_subtree(git_tree **result, git_tree *root, char *path)
{
char *p, *k, *current_key, *tmp_value, *savedptr = NULL;
- git_tree_entry *entry;
+ const git_tree_entry *entry;
git_tree *target,*tmp_result;
int error = 0;
Please sign in to comment.
Something went wrong with that request. Please try again.