Skip to content

Commit

Permalink
Merge pull request #18 from pierrejoye/master
Browse files Browse the repository at this point in the history
clean unused variable, add include/libxl check
  • Loading branch information
iliaal committed Dec 2, 2011
2 parents 777f87a + c06d22a commit 3cf858c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
2 changes: 1 addition & 1 deletion config.w32
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG_WITH("excel", "Excel", "no");

if (PHP_EXCEL != "no") {
if (CHECK_LIB("libxl.lib", "excel", PHP_EXCEL) && CHECK_HEADER_ADD_INCLUDE("libxl.h", "CFLAGS_EXCEL")) {
if (CHECK_LIB("libxl.lib", "excel", PHP_EXCEL) && CHECK_HEADER_ADD_INCLUDE("libxl.h", "CFLAGS_EXCEL", PHP_EXCEL+ ";" + PHP_PHP_BUILD + "\\include\\libxl")) {
EXTENSION("excel", "excel.c");
AC_DEFINE('HAVE_EXCELLIB', 1, 'Have LibXL library');
AC_DEFINE('HAVE_LIBXL_243_PLUS', 1, 'Have LibXL version 2.4.3 or later');
Expand Down
23 changes: 15 additions & 8 deletions excel.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ static zend_object_value excel_object_new_book(zend_class_entry *class_type TSRM
{
excel_book_object *intern;
zend_object_value retval;
zval *tmp;

intern = emalloc(sizeof(excel_book_object));
memset(intern, 0, sizeof(excel_book_object));
Expand All @@ -195,7 +194,10 @@ static zend_object_value excel_object_new_book(zend_class_entry *class_type TSRM
#ifdef ZEND_ENGINE_2_4
object_properties_init(&intern->std, class_type);
#else
{
zval *tmp;
zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
}
#endif
intern->book = xlCreateBook();

Expand All @@ -218,16 +220,17 @@ static zend_object_value excel_object_new_sheet(zend_class_entry *class_type TSR
{
excel_sheet_object *intern;
zend_object_value retval;
zval *tmp;

intern = emalloc(sizeof(excel_sheet_object));
memset(intern, 0, sizeof(excel_sheet_object));

zend_object_std_init(&intern->std, class_type TSRMLS_CC);
#ifdef ZEND_ENGINE_2_4
object_properties_init(&intern->std, class_type);
#else
zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
{
zval *tmp;
zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
}
#endif
(&retval)->handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t) excel_sheet_object_free_storage, NULL TSRMLS_CC);
(&retval)->handlers = &excel_object_handlers_sheet;
Expand All @@ -251,7 +254,6 @@ static zend_object_value excel_object_new_font_ex(zend_class_entry *class_type,
{
excel_font_object *intern;
zend_object_value retval;
zval *tmp;

intern = emalloc(sizeof(excel_font_object));
memset(intern, 0, sizeof(excel_font_object));
Expand All @@ -263,7 +265,10 @@ static zend_object_value excel_object_new_font_ex(zend_class_entry *class_type,
#ifdef ZEND_ENGINE_2_4
object_properties_init(&intern->std, class_type);
#else
zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
{
zval *tmp;
zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
}
#endif
(&retval)->handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t) excel_font_object_free_storage, NULL TSRMLS_CC);
(&retval)->handlers = &excel_object_handlers_font;
Expand Down Expand Up @@ -309,7 +314,6 @@ static zend_object_value excel_object_new_format_ex(zend_class_entry *class_type
{
excel_format_object *intern;
zend_object_value retval;
zval *tmp;

intern = emalloc(sizeof(excel_format_object));
memset(intern, 0, sizeof(excel_format_object));
Expand All @@ -321,7 +325,10 @@ static zend_object_value excel_object_new_format_ex(zend_class_entry *class_type
#ifdef ZEND_ENGINE_2_4
object_properties_init(&intern->std, class_type);
#else
zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
{
zval *tmp;
zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
}
#endif
(&retval)->handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t) excel_format_object_free_storage, NULL TSRMLS_CC);
(&retval)->handlers = &excel_object_handlers_format;
Expand Down

0 comments on commit 3cf858c

Please sign in to comment.