Skip to content

Commit 79c513d

Browse files
committed
Some pedantic fixes for gcc.
1 parent 255a5a8 commit 79c513d

File tree

4 files changed

+15
-7
lines changed

4 files changed

+15
-7
lines changed

ext/pdo/pdo_dbh.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ static zend_object_handlers pdo_dbh_object_handlers = {
392392
NULL
393393
};
394394

395-
static void pdo_dbh_free_storage(void *object TSRMLS_DC)
395+
static void pdo_dbh_free_storage(zend_object *object TSRMLS_DC)
396396
{
397397
pdo_dbh_t *dbh = (pdo_dbh_t*)object;
398398

ext/pdo/pdo_stmt.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ static int describe_columns(pdo_stmt_t *stmt TSRMLS_DC)
114114

115115
static void param_dtor(void *data)
116116
{
117-
TSRMLS_FETCH();
118117
struct pdo_bound_param_data *param = (struct pdo_bound_param_data *)data;
118+
TSRMLS_FETCH();
119119

120120
/* tell the driver that it is going away */
121121
if (param->stmt->methods->param_hook) {
@@ -179,9 +179,9 @@ static int really_register_bound_param(struct pdo_bound_param_data *param, pdo_s
179179

180180
if (param->name) {
181181
param->name = estrndup(param->name, param->namelen);
182-
zend_hash_update(hash, param->name, param->namelen, param, sizeof(*param), &pparam);
182+
zend_hash_update(hash, param->name, param->namelen, param, sizeof(*param), (void**)&pparam);
183183
} else {
184-
zend_hash_index_update(hash, param->paramno, param, sizeof(*param), &pparam);
184+
zend_hash_index_update(hash, param->paramno, param, sizeof(*param), (void**)&pparam);
185185
}
186186

187187
/* tell the driver we just created a parameter */
@@ -467,7 +467,7 @@ static PHP_METHOD(PDOStatement, rowCount)
467467

468468

469469

470-
extern function_entry pdo_dbstmt_functions[] = {
470+
function_entry pdo_dbstmt_functions[] = {
471471
PHP_ME(PDOStatement, execute, NULL, ZEND_ACC_PUBLIC)
472472
PHP_ME(PDOStatement, fetch, NULL, ZEND_ACC_PUBLIC)
473473
PHP_ME(PDOStatement, bindParam, second_arg_force_ref, ZEND_ACC_PUBLIC)
@@ -607,7 +607,7 @@ zend_object_handlers pdo_dbstmt_object_handlers = {
607607
NULL
608608
};
609609

610-
void pdo_dbstmt_free_storage(void *object TSRMLS_DC)
610+
void pdo_dbstmt_free_storage(zend_object *object TSRMLS_DC)
611611
{
612612
pdo_stmt_t *stmt = (pdo_stmt_t*)object;
613613

ext/pdo/php_pdo_driver.h

+8
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@
2121
/* forward declarations */
2222
typedef struct _pdo_dbh_t pdo_dbh_t;
2323
typedef struct _pdo_stmt_t pdo_stmt_t;
24+
struct pdo_bound_param_data;
25+
26+
#ifndef TRUE
27+
# define TRUE 1
28+
#endif
29+
#ifndef FALSE
30+
# define FALSE 0
31+
#endif
2432

2533
#define PDO_DRIVER_API 20040513
2634

ext/pdo/php_pdo_int.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ extern zend_class_entry *pdo_dbh_ce;
3131
extern zend_object_value pdo_dbstmt_new(zend_class_entry *ce TSRMLS_DC);
3232
extern function_entry pdo_dbstmt_functions[];
3333
extern zend_class_entry *pdo_dbstmt_ce;
34-
void pdo_dbstmt_free_storage(void *object TSRMLS_DC);
34+
void pdo_dbstmt_free_storage(zend_object *object TSRMLS_DC);
3535
extern zend_object_handlers pdo_dbstmt_object_handlers;
3636

3737
extern pdo_driver_t *pdo_find_driver(const char *name, int namelen);

0 commit comments

Comments
 (0)