Skip to content

Commit

Permalink
MFH
Browse files Browse the repository at this point in the history
  • Loading branch information
foobar committed Mar 10, 2003
1 parent 05ce493 commit 9f34a5b
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 33 deletions.
43 changes: 16 additions & 27 deletions ext/pgsql/pgsql.c
Expand Up @@ -997,7 +997,7 @@ static void php_pgsql_get_result_info(INTERNAL_FUNCTION_PARAMETERS, int entry_ty
#if HAVE_PQCMDTUPLES
Z_LVAL_P(return_value) = atoi(PQcmdTuples(pgsql_result));
#else
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not supportted under this build.");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not supported under this build.");
Z_LVAL_P(return_value) = 0;
#endif
break;
Expand Down Expand Up @@ -1727,7 +1727,7 @@ PHP_FUNCTION(pg_lo_unlink)
zval *pgsql_link = NULL;
long oid_long;
char *oid_string, *end_ptr;
size_t oid_strlen;
int oid_strlen;
PGconn *pgsql;
Oid oid;
int id = -1;
Expand Down Expand Up @@ -1794,7 +1794,7 @@ PHP_FUNCTION(pg_lo_open)
zval *pgsql_link = NULL;
long oid_long;
char *oid_string, *end_ptr, *mode_string;
size_t oid_strlen, mode_strlen;
int oid_strlen, mode_strlen;
PGconn *pgsql;
Oid oid;
int id = -1, pgsql_mode=0, pgsql_lofd;
Expand Down Expand Up @@ -2099,7 +2099,7 @@ PHP_FUNCTION(pg_lo_export)
{
zval *pgsql_link = NULL;
char *file_out, *oid_string, *end_ptr;
size_t oid_strlen;
int oid_strlen;
int id = -1, name_len;
long oid_long;
Oid oid;
Expand Down Expand Up @@ -2442,9 +2442,7 @@ PHP_FUNCTION(pg_copy_to)
case PGRES_COPY_OUT:
if (pgsql_result) {
PQclear(pgsql_result);
if (array_init(return_value) == FAILURE) {
RETURN_FALSE;
}
array_init(return_value);
while (!copydone)
{
if ((ret = PQgetline(pgsql, copybuf, COPYBUFSIZ))) {
Expand Down Expand Up @@ -2601,8 +2599,8 @@ PHP_FUNCTION(pg_copy_from)
PHP_FUNCTION(pg_escape_string)
{
char *from = NULL, *to = NULL;
size_t to_len;
long from_len;
int to_len;
int from_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s",
&from, &from_len) == FAILURE) {
return;
Expand All @@ -2620,7 +2618,7 @@ PHP_FUNCTION(pg_escape_bytea)
{
char *from = NULL, *to = NULL;
size_t to_len;
long from_len;
int from_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s",
&from, &from_len) == FAILURE) {
return;
Expand Down Expand Up @@ -2668,8 +2666,6 @@ static unsigned char * php_pgsql_unescape_bytea(unsigned char *strtext, size_t *
buflen = strlen(strtext); /* will shrink, also we discover if
* strtext */
buffer = (unsigned char *) emalloc(buflen); /* isn't NULL terminated */
if (buffer == NULL)
return NULL;
for (bp = buffer, sp = strtext; *sp != '\0'; bp++, sp++)
{
switch (state)
Expand Down Expand Up @@ -2744,7 +2740,7 @@ PHP_FUNCTION(pg_unescape_bytea)
{
char *from = NULL, *to = NULL;
size_t to_len;
long from_len;
int from_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s",
&from, &from_len) == FAILURE) {
return;
Expand Down Expand Up @@ -2957,7 +2953,7 @@ PHP_FUNCTION(pg_send_query)
/* }}} */


/* {{{ proto resource pg_get_result([resource connection])
/* {{{ proto resource pg_get_result(resource connection)
Get asynchronous query result */
PHP_FUNCTION(pg_get_result)
{
Expand Down Expand Up @@ -3081,7 +3077,7 @@ PHPAPI int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, zval *me
PGresult *pg_result;
char *tmp_name;
smart_str querystr = {0};
size_t new_len;
int new_len;
int i, num_rows;
zval *elem;

Expand Down Expand Up @@ -3269,11 +3265,7 @@ static int php_pgsql_convert_match(const char *str, const char *regex , int icas
return FAILURE;
}
subs = (regmatch_t *)ecalloc(sizeof(regmatch_t), re.re_nsub+1);
if (!subs) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot allocate memory.");
regfree(&re);
return FAILURE;
}

regerr = regexec(&re, str, re.re_nsub+1, subs, 0);
if (regerr == REG_NOMATCH) {
#ifdef PHP_DEBUG
Expand Down Expand Up @@ -3353,11 +3345,7 @@ PHPAPI int php_pgsql_convert(PGconn *pg_link, const char *table_name, const zval
return FAILURE;
}
MAKE_STD_ZVAL(meta);
if (array_init(meta) == FAILURE) {
zval_dtor(meta);
FREE_ZVAL(meta);
return FAILURE;
}
array_init(meta);
if (php_pgsql_meta_data(pg_link, table_name, meta TSRMLS_CC) == FAILURE) {
zval_dtor(meta);
FREE_ZVAL(meta);
Expand Down Expand Up @@ -3981,7 +3969,8 @@ PHPAPI int php_pgsql_insert(PGconn *pg_link, const char *table, zval *var_array,
char buf[256];
char *fld;
smart_str querystr = {0};
int key_type, fld_len, ret = FAILURE;
int key_type, ret = FAILURE;
uint fld_len;
ulong num_idx;
HashPosition pos;

Expand Down Expand Up @@ -4111,7 +4100,7 @@ PHP_FUNCTION(pg_insert)
static inline int build_assignment_string(smart_str *querystr, HashTable *ht, const char *pad, int pad_len TSRMLS_DC)
{
HashPosition pos;
size_t fld_len;
uint fld_len;
int key_type;
ulong num_idx;
char *fld;
Expand Down
4 changes: 2 additions & 2 deletions ext/standard/url_scanner.c
Expand Up @@ -12,7 +12,7 @@
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Author: Hartmut Holzgraefe <hartmut@six.de> |
| Author: Hartmut Holzgraefe <hholzgra@php.net> |
+----------------------------------------------------------------------+
*/
/* $Id$ */
Expand Down Expand Up @@ -88,7 +88,7 @@ static char *url_attr_addon(const char *tag,const char *attr,const char *val,con

/* {{{ url_adapt_ext
*/
char *url_adapt_ext(const char *src, size_t srclen, const char *name, const char *val, size_t *newlen)
char *url_adapt_ext(const char *src, uint srclen, const char *name, const char *val, size_t *newlen)
{
char buf[1024];

Expand Down
6 changes: 3 additions & 3 deletions ext/standard/url_scanner_ex.c
@@ -1,5 +1,5 @@
/* Generated by re2c 0.5 on Wed Feb 12 10:07:57 2003 */
#line 1 "/home/rei/PHP_CVS/STABLE/php4/ext/standard/url_scanner_ex.re"
/* Generated by re2c 0.5 on Tue Mar 11 01:09:00 2003 */
#line 1 "/usr/src/web/php/php4/ext/standard/url_scanner_ex.re"
/*
+----------------------------------------------------------------------+
| PHP Version 4 |
Expand Down Expand Up @@ -860,7 +860,7 @@ char *php_url_scanner_adapt_single_url(const char *url, size_t urllen, const cha
}


static char *url_adapt_ext(const char *src, size_t srclen, size_t *newlen, zend_bool do_flush TSRMLS_DC)
static char *url_adapt_ext(const char *src, uint srclen, uint *newlen, zend_bool do_flush TSRMLS_DC)
{
url_adapt_state_ex_t *ctx;
char *retval;
Expand Down
2 changes: 1 addition & 1 deletion ext/standard/url_scanner_ex.re
Expand Up @@ -359,7 +359,7 @@ char *php_url_scanner_adapt_single_url(const char *url, size_t urllen, const cha
}


static char *url_adapt_ext(const char *src, size_t srclen, size_t *newlen, zend_bool do_flush TSRMLS_DC)
static char *url_adapt_ext(const char *src, uint srclen, uint *newlen, zend_bool do_flush TSRMLS_DC)
{
url_adapt_state_ex_t *ctx;
char *retval;
Expand Down

0 comments on commit 9f34a5b

Please sign in to comment.