Skip to content
Browse files

Merge pull request #18 from pierrejoye/master

clean unused variable, add include/libxl check
  • Loading branch information...
2 parents 777f87a + c06d22a commit 3cf858c9ae3a6c032722ed2d6ee39b86a36ee050 @iliaal committed Dec 2, 2011
Showing with 16 additions and 9 deletions.
  1. +1 −1 config.w32
  2. +15 −8 excel.c
View
2 config.w32
@@ -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');
View
23 excel.c
@@ -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));
@@ -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();
@@ -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;
@@ -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));
@@ -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;
@@ -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));
@@ -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;

0 comments on commit 3cf858c

Please sign in to comment.
Something went wrong with that request. Please try again.