cvs: /php4/ext/pgsql pgsql.c /php4/ext/standard basic_functions.h rand.c

From: Date: Sun, 26 Dec 1999 00:19:15 +0000
Subject: cvs: /php4/ext/pgsql pgsql.c /php4/ext/standard basic_functions.h rand.c
Groups: php.version4 
Request: Send a blank email to php-version4+get-8504@lists.php.net to get a copy of this message
zeev Sat Dec 25 19:19:15 1999 EDT Modified files: /php4/ext/pgsql pgsql.c /php4/ext/standard basic_functions.h rand.c Log: - Change uint32 to php_uint32 (PostgreSQL defines uint32, and perhaps other packages too) - PostgreSQL finally compiles&links Index: php4/ext/pgsql/pgsql.c diff -u php4/ext/pgsql/pgsql.c:1.35 php4/ext/pgsql/pgsql.c:1.36 --- php4/ext/pgsql/pgsql.c:1.35 Sat Dec 25 18:59:14 1999 +++ php4/ext/pgsql/pgsql.c Sat Dec 25 19:18:44 1999 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: pgsql.c,v 1.35 1999/12/25 23:59:14 zeev Exp $ */ +/* $Id: pgsql.c,v 1.36 1999/12/26 00:18:44 zeev Exp $ */ #include <stdlib.h> @@ -694,7 +694,7 @@ /* }}} */ -char *get_fieldname(PGconn *pgsql, Oid oid, HashTable *list) +char *get_field_name(PGconn *pgsql, Oid oid, HashTable *list) { PGresult *result; char hashed_oid_key[32]; @@ -794,7 +794,7 @@ /* {{{ proto string pg_fieldname(int result, int field_number) Returns the name of the field */ -PHP_FUNCTION(pg_field_name) +PHP_FUNCTION(pg_fieldname) { php_pgsql_get_field_info(INTERNAL_FUNCTION_PARAM_PASSTHRU,PHP_PG_FIELD_NAME); } Index: php4/ext/standard/basic_functions.h diff -u php4/ext/standard/basic_functions.h:1.38 php4/ext/standard/basic_functions.h:1.39 --- php4/ext/standard/basic_functions.h:1.38 Fri Dec 17 15:55:24 1999 +++ php4/ext/standard/basic_functions.h Sat Dec 25 19:18:44 1999 @@ -29,7 +29,7 @@ */ -/* $Id: basic_functions.h,v 1.38 1999/12/17 20:55:24 zeev Exp $ */ +/* $Id: basic_functions.h,v 1.39 1999/12/26 00:18:44 zeev Exp $ */ #ifndef _BASIC_FUNCTIONS_H #define _BASIC_FUNCTIONS_H @@ -115,10 +115,10 @@ #if SIZEOF_INT == 4 /* Most 32-bit and 64-bit systems have 32-bit ints */ -typedef unsigned int uint32; +typedef unsigned int php_uint32; #elif SIZEOF_LONG == 4 /* 16-bit systems? */ -typedef unsigned long uint32; +typedef unsigned long php_uint32; #else #error Need type which holds 32 bits #endif @@ -148,8 +148,8 @@ struct stat lsb; /* rand.c */ - uint32 state[MT_N+1]; /* state vector + 1 extra to not violate ANSI C */ - uint32 *next; /* next random value is computed from here */ + php_uint32 state[MT_N+1]; /* state vector + 1 extra to not violate ANSI C */ + php_uint32 *next; /* next random value is computed from here */ int left; /* can *next++ this many times before reloading */ } php_basic_globals; Index: php4/ext/standard/rand.c diff -u php4/ext/standard/rand.c:1.10 php4/ext/standard/rand.c:1.11 --- php4/ext/standard/rand.c:1.10 Sat Dec 18 17:35:28 1999 +++ php4/ext/standard/rand.c Sat Dec 25 19:18:44 1999 @@ -19,7 +19,7 @@ | Based on code from: Shawn Cokus <Cokus@math.washington.edu> | +----------------------------------------------------------------------+ */ -/* $Id: rand.c,v 1.10 1999/12/18 22:35:28 zeev Exp $ */ +/* $Id: rand.c,v 1.11 1999/12/26 00:18:44 zeev Exp $ */ #include <stdlib.h> @@ -76,7 +76,7 @@ - uint32 must be an unsigned integer type capable of holding at least 32 + php_uint32 must be an unsigned integer type capable of holding at least 32 bits; exactly 32 should be fastest, but 64 is better on an Alpha with GCC at -O3 optimization so try your options and see what's best for you @@ -92,7 +92,7 @@ #define loBits(u) ((u) & 0x7FFFFFFFU) /* mask the highest bit of u */ #define mixBits(u, v) (hiBit(u)|loBits(v)) /* move hi bit of u to hi bit of v */ -static void seedMT(uint32 seed BLS_DC) +static void seedMT(php_uint32 seed BLS_DC) { /* We initialize state[0..(N-1)] via the generator @@ -140,7 +140,7 @@ so-- that's why the only change I made is to restrict to odd seeds. */ - register uint32 x = (seed | 1U) & 0xFFFFFFFFU, *s = BG(state); + register php_uint32 x = (seed | 1U) & 0xFFFFFFFFU, *s = BG(state); register int j; for(BG(left)=0, *s++=x, j=N; --j; @@ -148,9 +148,9 @@ } -static uint32 reloadMT(BLS_D) +static php_uint32 reloadMT(BLS_D) { - register uint32 *p0=BG(state), *p2=BG(state)+2, *pM=BG(state)+M, s0, s1; + register php_uint32 *p0=BG(state), *p2=BG(state)+2, *pM=BG(state)+M, s0, s1; register int j; if(BG(left) < -1) @@ -172,9 +172,9 @@ } -static inline uint32 randomMT(void) +static inline php_uint32 randomMT(void) { - uint32 y; + php_uint32 y; BLS_FETCH(); if(--BG(left) < 0)

« previous php.version4 (#8504) next »