summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfoobar <sniper@php.net>2001-08-07 20:13:54 +0000
committerfoobar <sniper@php.net>2001-08-07 20:13:54 +0000
commit001df0d028c61bf939bc18eb8047e46f9fbe7a75 (patch)
tree00a69e8d1096f17c47b220e25c14f668d65f4816
parent4c5a6cbb82e37dada3c35b1402e25af4cba8f99c (diff)
downloadphp-git-001df0d028c61bf939bc18eb8047e46f9fbe7a75.tar.gz
Yet another TSRM fix.
-rw-r--r--ext/ingres_ii/ii.c29
-rw-r--r--ext/ingres_ii/ii.h4
-rw-r--r--ext/mcal/php_mcal.c17
-rw-r--r--ext/mcal/php_mcal.h18
-rw-r--r--ext/standard/dl.c5
-rw-r--r--ext/standard/dl.h2
-rw-r--r--main/php_ini.c2
7 files changed, 32 insertions, 45 deletions
diff --git a/ext/ingres_ii/ii.c b/ext/ingres_ii/ii.c
index ee60350fb4..ef69b33396 100644
--- a/ext/ingres_ii/ii.c
+++ b/ext/ingres_ii/ii.c
@@ -143,10 +143,9 @@ static int _rollback_transaction(II_LINK *link)
return 0;
}
-static void _close_ii_link(II_LINK *link)
+static void _close_ii_link(II_LINK *link TSRMLS_DC)
{
IIAPI_DISCONNPARM disconnParm;
- TSRMLS_FETCH();
if(link->tranHandle && _rollback_transaction(link)) {
php_error(E_WARNING,"Ingres II: Unable to rollback transaction !!");
@@ -171,7 +170,7 @@ static void php_close_ii_link(zend_rsrc_list_entry *rsrc TSRMLS_DC)
{
II_LINK *link = (II_LINK *)rsrc->ptr;
- _close_ii_link(link);
+ _close_ii_link(link TSRMLS_CC);
}
@@ -181,7 +180,7 @@ static void _close_ii_plink(zend_rsrc_list_entry *rsrc TSRMLS_DC)
{
II_LINK *link = (II_LINK *)rsrc->ptr;
- _close_ii_link(link);
+ _close_ii_link(link TSRMLS_CC);
IIG(num_persistent)--;
}
@@ -223,9 +222,8 @@ static void _clean_ii_plink(zend_rsrc_list_entry *rsrc TSRMLS_DC)
/* sets the default link
*/
-static void php_ii_set_default_link(int id)
+static void php_ii_set_default_link(int id TSRMLS_DC)
{
- TSRMLS_FETCH();
if (IIG(default_link)!=-1) {
zend_list_delete(IIG(default_link));
@@ -531,7 +529,7 @@ static void php_ii_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)
zend_list_addref((int) link);
return_value->value.lval = (int) link;
- php_ii_set_default_link((int) link);
+ php_ii_set_default_link((int) link TSRMLS_CC);
return_value->type = IS_RESOURCE;
efree(hashed_details);
@@ -588,7 +586,7 @@ static void php_ii_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)
}
efree(hashed_details);
- php_ii_set_default_link(return_value->value.lval);
+ php_ii_set_default_link(return_value->value.lval TSRMLS_CC);
}
/* {{{ proto resource ingres_connect([string database [, string username [, string password]]])
@@ -836,6 +834,7 @@ static void php_ii_field_info(INTERNAL_FUNCTION_PARAMETERS, int info_type)
fun_name = "ii_field_scale";
break;
default:
+ fun_name = "foobar";
break;
}
php_error(E_WARNING,"Ingres II: %s() called with wrong index (%d)",fun_name,index);
@@ -990,15 +989,15 @@ PHP_FUNCTION(ingres_field_scale)
/* Fetch a row of result
*/
-static void php_ii_fetch(INTERNAL_FUNCTION_PARAMETERS, II_LINK *ii_link, int result_type TSRMLS_DC)
+static void php_ii_fetch(INTERNAL_FUNCTION_PARAMETERS, II_LINK *ii_link, int result_type)
{
IIAPI_GETCOLPARM getColParm;
IIAPI_DATAVALUE *columnData;
IIAPI_CONVERTPARM convertParm;
int i,j,k;
int more;
- double value_double;
- long value_long;
+ double value_double=0;
+ long value_long=0;
char *value_char_p;
int len, should_copy, correct_length;
@@ -1197,8 +1196,7 @@ PHP_FUNCTION(ingres_fetch_array)
ZEND_FETCH_RESOURCE2(ii_link, II_LINK *, link, link_id, "Ingres II Link", le_ii_link, le_ii_plink);
- php_ii_fetch(INTERNAL_FUNCTION_PARAM_PASSTHRU, ii_link,
- (argc == 0 ? II_BOTH : Z_LVAL_PP(result_type)) TSRMLS_CC);
+ php_ii_fetch(INTERNAL_FUNCTION_PARAM_PASSTHRU, ii_link, (argc == 0 ? II_BOTH : Z_LVAL_PP(result_type)));
}
/* }}} */
@@ -1222,7 +1220,7 @@ PHP_FUNCTION(ingres_fetch_row)
ZEND_FETCH_RESOURCE2(ii_link, II_LINK *, link, link_id, "Ingres II Link", le_ii_link, le_ii_plink);
- php_ii_fetch(INTERNAL_FUNCTION_PARAM_PASSTHRU, ii_link, II_NUM TSRMLS_CC);
+ php_ii_fetch(INTERNAL_FUNCTION_PARAM_PASSTHRU, ii_link, II_NUM);
}
/* }}} */
@@ -1250,8 +1248,7 @@ PHP_FUNCTION(ingres_fetch_object)
ZEND_FETCH_RESOURCE2(ii_link, II_LINK *, link, link_id, "Ingres II Link", le_ii_link, le_ii_plink);
- php_ii_fetch(INTERNAL_FUNCTION_PARAM_PASSTHRU, ii_link,
- (argc == 0 ? II_BOTH : Z_LVAL_PP(result_type)) TSRMLS_CC);
+ php_ii_fetch(INTERNAL_FUNCTION_PARAM_PASSTHRU, ii_link, (argc == 0 ? II_BOTH : Z_LVAL_PP(result_type)));
if(Z_TYPE_P(return_value)==IS_ARRAY) {
convert_to_object(return_value);
}
diff --git a/ext/ingres_ii/ii.h b/ext/ingres_ii/ii.h
index 3f50b77297..3e205a679e 100644
--- a/ext/ingres_ii/ii.h
+++ b/ext/ingres_ii/ii.h
@@ -44,10 +44,10 @@ static int ii_success(IIAPI_GENPARM *genParm);
#define II_NO_DATA 2
static int _close_statement(II_LINK *link);
static int _rollback_transaction(II_LINK *link);
-static void _close_ii_link(II_LINK *link);
+static void _close_ii_link(II_LINK *link TSRMLS_DC);
static void _close_ii_plink(zend_rsrc_list_entry *link TSRMLS_DC);
static int php_ii_get_default_link(INTERNAL_FUNCTION_PARAMETERS);
-static void php_ii_set_default_link(int id);
+static void php_ii_set_default_link(int id TSRMLS_DC);
static void php_ii_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent);
static char *php_ii_field_name(II_LINK *ii_link, int index);
static void php_ii_field_info(INTERNAL_FUNCTION_PARAMETERS, int info_type);
diff --git a/ext/mcal/php_mcal.c b/ext/mcal/php_mcal.c
index 3e2958c5b6..9ae8422d88 100644
--- a/ext/mcal/php_mcal.c
+++ b/ext/mcal/php_mcal.c
@@ -45,7 +45,7 @@
#include "winsock.h"
#endif
-void cal_close_it(zend_rsrc_list_entry *rsrc TSRMLS_DC);
+static void cal_close_it(zend_rsrc_list_entry *rsrc TSRMLS_DC);
typedef struct _php_mcal_le_struct {
CALSTREAM *mcal_stream;
@@ -123,11 +123,12 @@ ZEND_GET_MODULE(php_mcal)
and nothing will link to this module, we can use the simple
thread local_ storage
*/
-int le_mcal;
+static int le_mcal;
char *mcal_user;
char *mcal_password;
-void cal_close_it (zend_rsrc_list_entry *rsrc TSRMLS_DC)
+
+static void cal_close_it (zend_rsrc_list_entry *rsrc TSRMLS_DC)
{
pils *mcal_le_struct = (pils *)rsrc->ptr;
@@ -209,7 +210,7 @@ static int add_assoc_object(zval *arg, char *key, zval *tmp)
return zend_hash_update(symtable, key, strlen(key)+1, (void *)&tmp, sizeof(zval *), NULL);
}
-void php_mcal_do_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
+static void php_mcal_do_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
{
zval **calendar, **user, **passwd, **options;
CALSTREAM *mcal_stream;
@@ -248,13 +249,13 @@ void php_mcal_do_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
RETURN_LONG(ind);
}
-void php_mcal_event_init(struct _php_mcal_le_struct *mystruct)
+static void php_mcal_event_init(struct _php_mcal_le_struct *mystruct)
{
calevent_free(mystruct->event);
mystruct->event=calevent_new();
}
-void _php_make_event_object(zval *myzvalue, CALEVENT *event)
+static void _php_make_event_object(zval *myzvalue, CALEVENT *event TSRMLS_DC)
{
zval *start, *end, *recurend, *attrlist;
CALATTR *attr;
@@ -469,7 +470,7 @@ PHP_FUNCTION(mcal_fetch_event)
}
calevent_free(mcal_le_struct->event);
mcal_le_struct->event = myevent;
- _php_make_event_object(return_value, mcal_le_struct->event);
+ _php_make_event_object(return_value, mcal_le_struct->event TSRMLS_CC);
}
/* }}} */
@@ -492,7 +493,7 @@ PHP_FUNCTION(mcal_fetch_current_stream_event)
php_error(E_WARNING, "Unable to find stream pointer");
RETURN_FALSE;
}
- _php_make_event_object(return_value, mcal_le_struct->event);
+ _php_make_event_object(return_value, mcal_le_struct->event TSRMLS_CC);
}
/* }}} */
diff --git a/ext/mcal/php_mcal.h b/ext/mcal/php_mcal.h
index fb4d24af48..07b32a2a7f 100644
--- a/ext/mcal/php_mcal.h
+++ b/ext/mcal/php_mcal.h
@@ -10,24 +10,14 @@
#endif
/* Functions accessable to PHP */
-/* extern zend_module_entry php_mcal_module_entry; */
extern zend_module_entry php_mcal_module_entry;
#define php_mcal_module_ptr &php_mcal_module_entry
-#define phpext_mcal_ptr php_mcal_module_ptr
-
-#ifdef ZEND_VERSION
-PHP_MINIT_FUNCTION(mcal);
-PHP_MINFO_FUNCTION(mcal);
-#else
-int PHP_MINIT_FUNCTION(INIT_FUNC_ARGS);
-void PHP_MINFO_FUNCTION(void);
-#endif
-
extern int mcal_init_request(INIT_FUNC_ARGS);
extern int mcal_end_request(void);
-void make_event_object();
-void php_mcal_event_init();
+
+PHP_MINIT_FUNCTION(mcal);
+PHP_MINFO_FUNCTION(mcal);
PHP_FUNCTION(mcal_open);
PHP_FUNCTION(mcal_popen);
@@ -69,10 +59,10 @@ PHP_FUNCTION(mcal_event_set_recur_monthly_wday);
PHP_FUNCTION(mcal_event_set_recur_yearly);
PHP_FUNCTION(mcal_fetch_current_stream_event);
-
#else
#define php_mcal_module_ptr NULL
#endif /* HAVE_MCAL */
+#define phpext_mcal_ptr php_mcal_module_ptr
#endif
diff --git a/ext/standard/dl.c b/ext/standard/dl.c
index ae743dce24..b24c693596 100644
--- a/ext/standard/dl.c
+++ b/ext/standard/dl.c
@@ -75,7 +75,7 @@ PHP_FUNCTION(dl)
} else if (PG(safe_mode)) {
php_error(E_ERROR, "Dynamically loaded extensions aren't allowed when running in SAFE MODE.");
} else {
- php_dl(*file, MODULE_TEMPORARY, return_value);
+ php_dl(*file, MODULE_TEMPORARY, return_value TSRMLS_CC);
}
}
@@ -92,7 +92,7 @@ PHP_FUNCTION(dl)
/* {{{ php_dl
*/
-void php_dl(pval *file, int type, pval *return_value)
+void php_dl(pval *file, int type, pval *return_value TSRMLS_DC)
{
void *handle;
char *libpath;
@@ -100,7 +100,6 @@ void php_dl(pval *file, int type, pval *return_value)
zend_module_entry *(*get_module)(void);
int error_type;
char *extension_dir;
- TSRMLS_FETCH();
if (type==MODULE_PERSISTENT) {
/* Use the configuration hash directly, the INI mechanism is not yet initialized */
diff --git a/ext/standard/dl.h b/ext/standard/dl.h
index 0e881eaee2..d80d82e0ea 100644
--- a/ext/standard/dl.h
+++ b/ext/standard/dl.h
@@ -23,7 +23,7 @@
#ifndef DL_H
#define DL_H
-void php_dl(pval *file,int type,pval *return_value);
+void php_dl(pval *file,int type,pval *return_value TSRMLS_DC);
/* dynamic loading functions */
diff --git a/main/php_ini.c b/main/php_ini.c
index 31929dffcf..b23cd5cbb6 100644
--- a/main/php_ini.c
+++ b/main/php_ini.c
@@ -182,7 +182,7 @@ static void php_load_function_extension_cb(void *arg TSRMLS_DC)
zval *extension = (zval *) arg;
zval zval;
- php_dl(extension, MODULE_PERSISTENT, &zval);
+ php_dl(extension, MODULE_PERSISTENT, &zval TSRMLS_CC);
}
/* }}} */