diff options
Diffstat (limited to 'ext/pdo_oci/oci_statement.c')
-rw-r--r-- | ext/pdo_oci/oci_statement.c | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/ext/pdo_oci/oci_statement.c b/ext/pdo_oci/oci_statement.c index bf0a1b4b44..3148162d61 100644 --- a/ext/pdo_oci/oci_statement.c +++ b/ext/pdo_oci/oci_statement.c @@ -214,7 +214,7 @@ static sb4 oci_bind_input_cb(dvoid *ctx, OCIBind *bindp, ub4 iter, ub4 index, dv /* regular string bind */ convert_to_string(parameter); *bufpp = Z_STRVAL_P(parameter); - *alenp = Z_STRLEN_P(parameter); + *alenp = (ub4) Z_STRLEN_P(parameter); } *piecep = OCI_ONE_PIECE; @@ -258,7 +258,7 @@ static sb4 oci_bind_output_cb(dvoid *ctx, OCIBind *bindp, ub4 iter, ub4 index, d Z_STR_P(parameter) = ecalloc(1, Z_STRLEN_P(parameter)+1); P->used_for_output = 1; - P->actual_len = Z_STRLEN_P(parameter); + P->actual_len = (ub4) Z_STRLEN_P(parameter); *alenpp = &P->actual_len; *bufpp = Z_STRVAL_P(parameter); *piecep = OCI_ONE_PIECE; @@ -311,15 +311,15 @@ static int oci_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *pa case PDO_PARAM_LOB: /* P->thing is now an OCILobLocator * */ P->oci_type = SQLT_BLOB; - value_sz = sizeof(OCILobLocator*); + value_sz = (sb4) sizeof(OCILobLocator*); break; case PDO_PARAM_STR: default: P->oci_type = SQLT_CHR; - value_sz = param->max_value_len; + value_sz = (sb4) param->max_value_len; if (param->max_value_len == 0) { - value_sz = 1332; /* maximum size before value is interpreted as a LONG value */ + value_sz = (sb4) 1332; /* maximum size before value is interpreted as a LONG value */ } } @@ -327,12 +327,12 @@ static int oci_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *pa if (param->name) { STMT_CALL(OCIBindByName, (S->stmt, &P->bind, S->err, (text*)param->name->val, - param->name->len, 0, value_sz, P->oci_type, + (sb4) param->name->len, 0, value_sz, P->oci_type, &P->indicator, 0, &P->retcode, 0, 0, OCI_DATA_AT_EXEC)); } else { STMT_CALL(OCIBindByPos, (S->stmt, - &P->bind, S->err, param->paramno+1, + &P->bind, S->err, ((ub4)param->paramno)+1, 0, value_sz, P->oci_type, &P->indicator, 0, &P->retcode, 0, 0, OCI_DATA_AT_EXEC)); @@ -403,9 +403,9 @@ static int oci_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *pa } consume = buf; do { - amt = n; + amt = (ub4) n; OCILobWrite(S->H->svc, S->err, (OCILobLocator*)P->thing, - &amt, offset, consume, n, + &amt, offset, consume, (ub4) n, OCI_ONE_PIECE, NULL, NULL, 0, SQLCS_IMPLICIT); offset += amt; @@ -422,9 +422,9 @@ static int oci_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *pa if (n) { OCILobOpen(S->H->svc, S->err, (OCILobLocator*)P->thing, OCI_LOB_READWRITE); while (n) { - amt = n; + amt = (ub4) n; OCILobWrite(S->H->svc, S->err, (OCILobLocator*)P->thing, - &amt, offset, consume, n, + &amt, offset, consume, (ub4) n, OCI_ONE_PIECE, NULL, NULL, 0, SQLCS_IMPLICIT); consume += amt; @@ -461,7 +461,7 @@ static int oci_stmt_fetch(pdo_stmt_t *stmt, enum pdo_fetch_orientation ori, zend case PDO_FETCH_ORI_ABS: ociori = OCI_FETCH_ABSOLUTE; break; case PDO_FETCH_ORI_REL: ociori = OCI_FETCH_RELATIVE; break; } - S->last_err = OCIStmtFetch2(S->stmt, S->err, 1, ociori, offset, OCI_DEFAULT); + S->last_err = OCIStmtFetch2(S->stmt, S->err, 1, ociori, (sb4) offset, OCI_DEFAULT); #else S->last_err = OCIStmtFetch(S->stmt, S->err, 1, OCI_FETCH_NEXT, OCI_DEFAULT); #endif @@ -586,7 +586,7 @@ static int oci_stmt_describe(pdo_stmt_t *stmt, int colno) /* {{{ */ S->cols[colno].datalen = 1024; #endif } else { - S->cols[colno].datalen = col->maxlen; + S->cols[colno].datalen = (ub4) col->maxlen; } if (dtype == SQLT_BIN) { S->cols[colno].datalen *= 3; @@ -623,9 +623,9 @@ static size_t oci_blob_write(php_stream *stream, const char *buf, size_t count) ub4 amt; sword r; - amt = count; + amt = (ub4) count; r = OCILobWrite(self->S->H->svc, self->S->err, self->lob, - &amt, self->offset, (char*)buf, count, + &amt, self->offset, (char*)buf, (ub4) count, OCI_ONE_PIECE, NULL, NULL, 0, SQLCS_IMPLICIT); @@ -643,9 +643,9 @@ static size_t oci_blob_read(php_stream *stream, char *buf, size_t count) ub4 amt; sword r; - amt = count; + amt = (ub4) count; r = OCILobRead(self->S->H->svc, self->S->err, self->lob, - &amt, self->offset, buf, count, + &amt, self->offset, buf, (ub4) count, NULL, NULL, 0, SQLCS_IMPLICIT); if (r != OCI_SUCCESS && r != OCI_NEED_DATA) { @@ -661,8 +661,8 @@ static size_t oci_blob_read(php_stream *stream, char *buf, size_t count) static int oci_blob_close(php_stream *stream, int close_handle) { - struct oci_lob_self *self = (struct oci_lob_self*)stream->abstract; - pdo_stmt_t *stmt = self->stmt; + struct oci_lob_self *self = (struct oci_lob_self *)stream->abstract; + /* pdo_stmt_t *stmt = self->stmt; */ if (close_handle) { OCILobClose(self->S->H->svc, self->S->err, self->lob); @@ -680,14 +680,14 @@ static int oci_blob_flush(php_stream *stream) return 0; } -static int oci_blob_seek(php_stream *stream, off_t offset, int whence, off_t *newoffset) +static int oci_blob_seek(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffset) { struct oci_lob_self *self = (struct oci_lob_self*)stream->abstract; if (offset >= PDO_OCI_LOBMAXSIZE) { return -1; } else { - self->offset = offset + 1; /* Oracle LOBS are 1-based, but PHP is 0-based */ + self->offset = (ub4) offset + 1; /* Oracle LOBS are 1-based, but PHP is 0-based */ return 0; } } @@ -723,7 +723,7 @@ static php_stream *oci_create_lob_stream(pdo_stmt_t *stmt, OCILobLocator *lob) return NULL; } -static int oci_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, unsigned long *len, int *caller_frees) /* {{{ */ +static int oci_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, size_t *len, int *caller_frees) /* {{{ */ { pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data; pdo_oci_column *C = &S->cols[colno]; @@ -742,19 +742,19 @@ static int oci_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, unsigned lo *ptr = (char*)oci_create_lob_stream(stmt, (OCILobLocator*)C->data); OCILobOpen(S->H->svc, S->err, (OCILobLocator*)C->data, OCI_LOB_READONLY); } - *len = 0; + *len = (size_t) 0; return *ptr ? 1 : 0; } *ptr = C->data; - *len = C->fetched_len; + *len = (size_t) C->fetched_len; return 1; } else { /* it was truncated */ php_error_docref(NULL, E_WARNING, "column %d data was too large for buffer and was truncated to fit it", colno); *ptr = C->data; - *len = C->fetched_len; + *len = (size_t) C->fetched_len; return 1; } } /* }}} */ |