diff options
author | Stanislav Malyshev <stas@php.net> | 2015-01-03 01:22:58 -0800 |
---|---|---|
committer | Stanislav Malyshev <stas@php.net> | 2015-01-10 15:07:38 -0800 |
commit | b7a7b1a624c97945c0aaa49d46ae996fc0bdb6bc (patch) | |
tree | 0e09490075ee4f9a75a77ef4168d8ee254c52e5b /ext/pdo_sqlite | |
parent | 773c8b0c092a0e9ad5c5548815bcb9991d54d5c1 (diff) | |
download | php-git-b7a7b1a624c97945c0aaa49d46ae996fc0bdb6bc.tar.gz |
trailing whitespace removal
Diffstat (limited to 'ext/pdo_sqlite')
-rw-r--r-- | ext/pdo_sqlite/php_pdo_sqlite.h | 10 | ||||
-rw-r--r-- | ext/pdo_sqlite/php_pdo_sqlite_int.h | 2 | ||||
-rw-r--r-- | ext/pdo_sqlite/sqlite_driver.c | 48 | ||||
-rw-r--r-- | ext/pdo_sqlite/sqlite_statement.c | 22 |
4 files changed, 41 insertions, 41 deletions
diff --git a/ext/pdo_sqlite/php_pdo_sqlite.h b/ext/pdo_sqlite/php_pdo_sqlite.h index 21977d7f2b..c9f7c6b2ba 100644 --- a/ext/pdo_sqlite/php_pdo_sqlite.h +++ b/ext/pdo_sqlite/php_pdo_sqlite.h @@ -35,9 +35,9 @@ PHP_RINIT_FUNCTION(pdo_sqlite); PHP_RSHUTDOWN_FUNCTION(pdo_sqlite); PHP_MINFO_FUNCTION(pdo_sqlite); -/* +/* Declare any global variables you may need between the BEGIN - and END macros here: + and END macros here: ZEND_BEGIN_MODULE_GLOBALS(pdo_sqlite) long global_value; @@ -45,12 +45,12 @@ ZEND_BEGIN_MODULE_GLOBALS(pdo_sqlite) ZEND_END_MODULE_GLOBALS(pdo_sqlite) */ -/* In every utility function you add that needs to use variables - in php_pdo_sqlite_globals, call TSRMLS_FETCH(); after declaring other +/* In every utility function you add that needs to use variables + in php_pdo_sqlite_globals, call TSRMLS_FETCH(); after declaring other variables used by that function, or better yet, pass in after the last function argument and declare your utility function with after the last declared argument. Always refer to - the globals in your function as PDO_SQLITE_G(variable). You are + the globals in your function as PDO_SQLITE_G(variable). You are encouraged to rename these macros something shorter, see examples in any other php module directory. */ diff --git a/ext/pdo_sqlite/php_pdo_sqlite_int.h b/ext/pdo_sqlite/php_pdo_sqlite_int.h index 6fbef66269..577f24730f 100644 --- a/ext/pdo_sqlite/php_pdo_sqlite_int.h +++ b/ext/pdo_sqlite/php_pdo_sqlite_int.h @@ -41,7 +41,7 @@ struct pdo_sqlite_func { zval func, step, fini; int argc; const char *funcname; - + /* accelerated callback references */ struct pdo_sqlite_fci afunc, astep, afini; }; diff --git a/ext/pdo_sqlite/sqlite_driver.c b/ext/pdo_sqlite/sqlite_driver.c index 8e1de906a5..7c1667bb5e 100644 --- a/ext/pdo_sqlite/sqlite_driver.c +++ b/ext/pdo_sqlite/sqlite_driver.c @@ -53,7 +53,7 @@ int _pdo_sqlite_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *file, int li switch (einfo->errcode) { case SQLITE_NOTFOUND: strncpy(*pdo_err, "42S02", sizeof("42S02")); - break; + break; case SQLITE_INTERRUPT: strncpy(*pdo_err, "01002", sizeof("01002")); @@ -66,7 +66,7 @@ int _pdo_sqlite_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *file, int li case SQLITE_TOOBIG: strncpy(*pdo_err, "22001", sizeof("22001")); break; - + case SQLITE_CONSTRAINT: strncpy(*pdo_err, "23000", sizeof("23000")); break; @@ -81,7 +81,7 @@ int _pdo_sqlite_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *file, int li zend_throw_exception_ex(php_pdo_get_exception(), einfo->errcode, "SQLSTATE[%s] [%d] %s", *pdo_err, einfo->errcode, einfo->errmsg); } - + return einfo->errcode; } /* }}} */ @@ -155,7 +155,7 @@ static void pdo_sqlite_cleanup_callbacks(pdo_sqlite_db_handle *H) static int sqlite_handle_closer(pdo_dbh_t *dbh) /* {{{ */ { pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data; - + if (H) { pdo_sqlite_error_info *einfo = &H->einfo; @@ -223,7 +223,7 @@ static char *pdo_sqlite_last_insert_id(pdo_dbh_t *dbh, const char *name, unsigne { pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data; char *id; - + id = php_pdo_int64_to_str(sqlite3_last_insert_rowid(H->db)); *len = strlen(id); return id; @@ -287,9 +287,9 @@ static int pdo_sqlite_get_attribute(pdo_dbh_t *dbh, zend_long attr, zval *return case PDO_ATTR_SERVER_VERSION: ZVAL_STRING(return_value, (char *)sqlite3_libversion()); break; - + default: - return 0; + return 0; } return 1; @@ -318,13 +318,13 @@ static int do_callback(struct pdo_sqlite_fci *fc, zval *cb, int ret; int fake_argc; zend_reference *agg_context = NULL; - + if (is_agg) { is_agg = 2; } - + fake_argc = argc + is_agg; - + fc->fci.size = sizeof(fc->fci); fc->fci.function_table = EG(function_table); ZVAL_COPY_VALUE(&fc->fci.function_name, cb); @@ -332,7 +332,7 @@ static int do_callback(struct pdo_sqlite_fci *fc, zval *cb, fc->fci.object = NULL; fc->fci.retval = &retval; fc->fci.param_count = fake_argc; - + /* build up the params */ if (fake_argc) { @@ -353,7 +353,7 @@ static int do_callback(struct pdo_sqlite_fci *fc, zval *cb, } ZVAL_LONG(&zargs[1], sqlite3_aggregate_count(context)); } - + for (i = 0; i < argc; i++) { /* get the value */ switch (sqlite3_value_type(argv[i])) { @@ -528,7 +528,7 @@ static PHP_METHOD(SQLite, sqliteCreateFunction) &func_name, &func_name_len, &callback, &argc)) { RETURN_FALSE; } - + dbh = Z_PDO_DBH_P(getThis()); PDO_CONSTRUCT_CHECK; @@ -538,7 +538,7 @@ static PHP_METHOD(SQLite, sqliteCreateFunction) RETURN_FALSE; } zend_string_release(cbname); - + H = (pdo_sqlite_db_handle *)dbh->driver_data; func = (struct pdo_sqlite_func*)ecalloc(1, sizeof(*func)); @@ -547,9 +547,9 @@ static PHP_METHOD(SQLite, sqliteCreateFunction) func, php_sqlite3_func_callback, NULL, NULL); if (ret == SQLITE_OK) { func->funcname = estrdup(func_name); - + ZVAL_COPY(&func->func, callback); - + func->argc = argc; func->next = H->funcs; @@ -581,7 +581,7 @@ static PHP_METHOD(SQLite, sqliteCreateFunction) The return value of this function will be used as the return value for this aggregate UDF. */ - + static PHP_METHOD(SQLite, sqliteCreateAggregate) { struct pdo_sqlite_func *func; @@ -598,7 +598,7 @@ static PHP_METHOD(SQLite, sqliteCreateAggregate) &func_name, &func_name_len, &step_callback, &fini_callback, &argc)) { RETURN_FALSE; } - + dbh = Z_PDO_DBH_P(getThis()); PDO_CONSTRUCT_CHECK; @@ -614,7 +614,7 @@ static PHP_METHOD(SQLite, sqliteCreateAggregate) RETURN_FALSE; } zend_string_release(cbname); - + H = (pdo_sqlite_db_handle *)dbh->driver_data; func = (struct pdo_sqlite_func*)ecalloc(1, sizeof(*func)); @@ -623,11 +623,11 @@ static PHP_METHOD(SQLite, sqliteCreateAggregate) func, NULL, php_sqlite3_func_step_callback, php_sqlite3_func_final_callback); if (ret == SQLITE_OK) { func->funcname = estrdup(func_name); - + ZVAL_COPY(&func->step, step_callback); ZVAL_COPY(&func->fini, fini_callback); - + func->argc = argc; func->next = H->funcs; @@ -790,7 +790,7 @@ static int pdo_sqlite_handle_factory(pdo_dbh_t *dbh, zval *driver_options) /* {{ char *filename; H = pecalloc(1, sizeof(pdo_sqlite_db_handle), dbh->is_persistent); - + H->einfo.errcode = 0; H->einfo.errmsg = NULL; dbh->driver_data = H; @@ -825,10 +825,10 @@ static int pdo_sqlite_handle_factory(pdo_dbh_t *dbh, zval *driver_options) /* {{ dbh->max_escaped_char_length = 2; ret = 1; - + cleanup: dbh->methods = &sqlite_methods; - + return ret; } /* }}} */ diff --git a/ext/pdo_sqlite/sqlite_statement.c b/ext/pdo_sqlite/sqlite_statement.c index ae7a5140df..b692f27342 100644 --- a/ext/pdo_sqlite/sqlite_statement.c +++ b/ext/pdo_sqlite/sqlite_statement.c @@ -87,9 +87,9 @@ static int pdo_sqlite_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_d sqlite3_reset(S->stmt); S->done = 1; } - + if (param->is_param) { - + if (param->paramno == -1) { param->paramno = sqlite3_bind_parameter_index(S->stmt, param->name->val) - 1; } @@ -104,7 +104,7 @@ static int pdo_sqlite_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_d } pdo_sqlite_error_stmt(stmt); return 0; - + case PDO_PARAM_INT: case PDO_PARAM_BOOL: if (Z_ISREF(param->parameter)) { @@ -130,7 +130,7 @@ static int pdo_sqlite_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_d } pdo_sqlite_error_stmt(stmt); return 0; - + case PDO_PARAM_LOB: if (Z_ISREF(param->parameter)) { parameter = Z_REFVAL(param->parameter); @@ -156,15 +156,15 @@ static int pdo_sqlite_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_d } else { convert_to_string(parameter); } - + if (SQLITE_OK == sqlite3_bind_blob(S->stmt, param->paramno + 1, Z_STRVAL_P(parameter), Z_STRLEN_P(parameter), SQLITE_STATIC)) { - return 1; + return 1; } return 0; - + case PDO_PARAM_STR: default: if (Z_ISREF(param->parameter)) { @@ -182,7 +182,7 @@ static int pdo_sqlite_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_d Z_STRVAL_P(parameter), Z_STRLEN_P(parameter), SQLITE_STATIC)) { - return 1; + return 1; } } pdo_sqlite_error_stmt(stmt); @@ -203,7 +203,7 @@ static int pdo_sqlite_stmt_fetch(pdo_stmt_t *stmt, pdo_sqlite_stmt *S = (pdo_sqlite_stmt*)stmt->driver_data; int i; if (!S->stmt) { - return 0; + return 0; } if (S->pre_fetched) { S->pre_fetched = 0; @@ -244,7 +244,7 @@ static int pdo_sqlite_stmt_describe(pdo_stmt_t *stmt, int colno) stmt->columns[colno].namelen = strlen(stmt->columns[colno].name); stmt->columns[colno].maxlen = 0xffffffff; stmt->columns[colno].precision = 0; - + switch (sqlite3_column_type(S->stmt, colno)) { case SQLITE_INTEGER: case SQLITE_FLOAT: @@ -293,7 +293,7 @@ static int pdo_sqlite_stmt_col_meta(pdo_stmt_t *stmt, zend_long colno, zval *ret pdo_sqlite_stmt *S = (pdo_sqlite_stmt*)stmt->driver_data; const char *str; zval flags; - + if (!S->stmt) { return FAILURE; } |