Skip to content

Commit

Permalink
Merge pull request #203 from viest/dev
Browse files Browse the repository at this point in the history
code style
  • Loading branch information
viest authored Nov 21, 2019
2 parents 0270e80 + 6d417eb commit 3ac6f8c
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion include/xlswriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,9 @@ void format_copy(lxw_format *new_format, lxw_format *other_format);
void xls_file_path(zend_string *file_name, zval *dir_path, zval *file_path);
void freeze_panes(xls_resource_write_t *res, zend_long row, zend_long column);
void merge_cells(zend_string *range, zend_string *value, xls_resource_write_t *res);
void formula_writer(zval *value, zend_long row, zend_long columns, xls_resource_write_t *res);
void set_row(zend_string *range, double height, xls_resource_write_t *res, lxw_format *format);
void set_column(zend_string *range, double width, xls_resource_write_t *res, lxw_format *format);
void formula_writer(zend_string *value, zend_long row, zend_long columns, xls_resource_write_t *res);
void url_writer(zend_long row, zend_long columns, xls_resource_write_t *res, zend_string *url, lxw_format *format);
void chart_writer(zend_long row, zend_long columns, xls_resource_chart_t *chart_resource, xls_resource_write_t *res);
void worksheet_set_rows(lxw_row_t start, lxw_row_t end, double height, xls_resource_write_t *res, lxw_format *format);
Expand Down
46 changes: 23 additions & 23 deletions kernel/excel.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ ZEND_END_ARG_INFO()
*/
PHP_METHOD(vtiful_xls, __construct)
{
zval *config, *c_path;
zval *config = NULL, *c_path = NULL;

ZEND_PARSE_PARAMETERS_START(1, 1)
Z_PARAM_ARRAY(config)
Expand All @@ -228,9 +228,9 @@ PHP_METHOD(vtiful_xls, __construct)
*/
PHP_METHOD(vtiful_xls, fileName)
{
char *sheet_name = NULL;
zval file_path, *dir_path = NULL;
zend_string *zs_file_name = NULL, *zs_sheet_name = NULL;
char *sheet_name = NULL;

ZEND_PARSE_PARAMETERS_START(1, 2)
Z_PARAM_STR(zs_file_name)
Expand Down Expand Up @@ -265,8 +265,8 @@ PHP_METHOD(vtiful_xls, fileName)
*/
PHP_METHOD(vtiful_xls, addSheet)
{
zend_string *zs_sheet_name = NULL;
char *sheet_name = NULL;
zend_string *zs_sheet_name = NULL;

ZEND_PARSE_PARAMETERS_START(0, 1)
Z_PARAM_OPTIONAL
Expand Down Expand Up @@ -323,9 +323,9 @@ PHP_METHOD(vtiful_xls, checkoutSheet)
*/
PHP_METHOD(vtiful_xls, constMemory)
{
char *sheet_name = NULL;
zval file_path, *dir_path = NULL;
zend_string *zs_file_name = NULL, *zs_sheet_name = NULL;
char *sheet_name = NULL;

ZEND_PARSE_PARAMETERS_START(1, 2)
Z_PARAM_STR(zs_file_name)
Expand Down Expand Up @@ -363,8 +363,8 @@ PHP_METHOD(vtiful_xls, constMemory)
*/
PHP_METHOD(vtiful_xls, header)
{
zval *header, *header_value;
zend_long header_l_key;
zval *header = NULL, *header_value = NULL;

ZEND_PARSE_PARAMETERS_START(1, 1)
Z_PARAM_ARRAY(header)
Expand Down Expand Up @@ -418,7 +418,7 @@ PHP_METHOD(vtiful_xls, data)
*/
PHP_METHOD(vtiful_xls, output)
{
zval rv, *file_path;
zval rv, *file_path = NULL;

file_path = zend_read_property(vtiful_xls_ce, getThis(), ZEND_STRL(V_XLS_FIL), 0, &rv TSRMLS_DC);

Expand Down Expand Up @@ -446,9 +446,9 @@ PHP_METHOD(vtiful_xls, getHandle)
*/
PHP_METHOD(vtiful_xls, insertText)
{
zval *data, *format_handle = NULL;
zend_long row, column;
zend_long row = 0, column = 0;
zend_string *format = NULL;
zval *data = NULL, *format_handle = NULL;

ZEND_PARSE_PARAMETERS_START(3, 5)
Z_PARAM_LONG(row)
Expand Down Expand Up @@ -480,7 +480,7 @@ PHP_METHOD(vtiful_xls, insertText)
PHP_METHOD(vtiful_xls, insertDate)
{
zval *data = NULL, *format_handle = NULL;
zend_long row, column;
zend_long row = 0, column = 0;
zend_string *format = NULL;

ZEND_PARSE_PARAMETERS_START(3, 5)
Expand Down Expand Up @@ -527,8 +527,8 @@ PHP_METHOD(vtiful_xls, insertDate)
*/
PHP_METHOD(vtiful_xls, insertChart)
{
zval *chart_resource;
zend_long row, column;
zval *chart_resource = NULL;
zend_long row = 0, column = 0;

ZEND_PARSE_PARAMETERS_START(3, 3)
Z_PARAM_LONG(row)
Expand All @@ -550,7 +550,7 @@ PHP_METHOD(vtiful_xls, insertChart)
*/
PHP_METHOD(vtiful_xls, insertUrl)
{
zend_long row, column;
zend_long row = 0, column = 0;
zend_string *url = NULL;
zval *format_handle = NULL;

Expand Down Expand Up @@ -584,8 +584,8 @@ PHP_METHOD(vtiful_xls, insertUrl)
*/
PHP_METHOD(vtiful_xls, insertImage)
{
zval *image;
zend_long row, column;
zval *image = NULL;
zend_long row = 0, column = 0;
double width = 1, height = 1;

ZEND_PARSE_PARAMETERS_START(3, 5)
Expand All @@ -611,13 +611,13 @@ PHP_METHOD(vtiful_xls, insertImage)
*/
PHP_METHOD(vtiful_xls, insertFormula)
{
zval *formula;
zend_long row, column;
zend_string *formula = NULL;
zend_long row = 0, column = 0;

ZEND_PARSE_PARAMETERS_START(3, 3)
Z_PARAM_LONG(row)
Z_PARAM_LONG(column)
Z_PARAM_ZVAL(formula)
Z_PARAM_STR(formula)
ZEND_PARSE_PARAMETERS_END();

ZVAL_COPY(return_value, getThis());
Expand All @@ -634,7 +634,7 @@ PHP_METHOD(vtiful_xls, insertFormula)
*/
PHP_METHOD(vtiful_xls, autoFilter)
{
zend_string *range;
zend_string *range = NULL;

ZEND_PARSE_PARAMETERS_START(1, 1)
Z_PARAM_STR(range)
Expand All @@ -654,7 +654,7 @@ PHP_METHOD(vtiful_xls, autoFilter)
*/
PHP_METHOD(vtiful_xls, mergeCells)
{
zend_string *range, *data;
zend_string *range = NULL, *data = NULL;

ZEND_PARSE_PARAMETERS_START(2, 2)
Z_PARAM_STR(range)
Expand All @@ -675,8 +675,8 @@ PHP_METHOD(vtiful_xls, mergeCells)
*/
PHP_METHOD(vtiful_xls, setColumn)
{
zval *format_handle;
zend_string *range;
zval *format_handle = NULL;
zend_string *range = NULL;

double width = 0;
int argc = ZEND_NUM_ARGS();
Expand Down Expand Up @@ -708,8 +708,8 @@ PHP_METHOD(vtiful_xls, setColumn)
*/
PHP_METHOD(vtiful_xls, setRow)
{
zval *format_handle;
zend_string *range;
zval *format_handle = NULL;
zend_string *range = NULL;

double height = 0;
int argc = ZEND_NUM_ARGS();
Expand Down
4 changes: 2 additions & 2 deletions kernel/write.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,9 @@ void image_writer(zval *value, zend_long row, zend_long columns, double width, d
/*
* Write the image to the file
*/
void formula_writer(zval *value, zend_long row, zend_long columns, xls_resource_write_t *res)
void formula_writer(zend_string *value, zend_long row, zend_long columns, xls_resource_write_t *res)
{
worksheet_write_formula(res->worksheet, (lxw_row_t)row, (lxw_col_t)columns, ZSTR_VAL(zval_get_string(value)), NULL);
worksheet_write_formula(res->worksheet, (lxw_row_t)row, (lxw_col_t)columns, ZSTR_VAL(value), NULL);
}

void chart_writer(zend_long row, zend_long columns, xls_resource_chart_t *chart_resource, xls_resource_write_t *res)
Expand Down

0 comments on commit 3ac6f8c

Please sign in to comment.