]> granicus.if.org Git - php/commitdiff
Yet another TSRM fix.
authorfoobar <sniper@php.net>
Tue, 7 Aug 2001 20:13:54 +0000 (20:13 +0000)
committerfoobar <sniper@php.net>
Tue, 7 Aug 2001 20:13:54 +0000 (20:13 +0000)
ext/ingres_ii/ii.c
ext/ingres_ii/ii.h
ext/mcal/php_mcal.c
ext/mcal/php_mcal.h
ext/standard/dl.c
ext/standard/dl.h
main/php_ini.c

index ee60350fb4bce3b5c41f345dad7967beaaeece9d..ef69b33396fecaf383ee6c256ce91298a38eaa5d 100644 (file)
@@ -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);
   }
index 3f50b7729720a0749a1aa23616a03be4977ea203..3e205a679e4b1f364f309edfc820a86ad740369d 100644 (file)
@@ -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);
index 3e2958c5b64b7c3ccc77163870c89468a5eb3d58..9ae8422d886c95b497c53990252f8457f68b1fdc 100644 (file)
@@ -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);
 }
 /* }}} */
 
index fb4d24af48e154f3122f2a300d292a3e39f0289c..07b32a2a7fc4e98565a11b497dbd359257e79b9b 100644 (file)
 #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
index ae743dce24f07a39701899be85854bc087aa96d3..b24c693596e1e189ee328503b2e99c5f7409a5a3 100644 (file)
@@ -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 */
index 0e881eaee28a5119768545c3190d7e7f802e09f3..d80d82e0ea47b57346892c170f86348368dc3942 100644 (file)
@@ -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 */
index 31929dffcfe9428323d59025cab23f35797f09e7..b23cd5cbb647bddcb52792137f11f5e0d6930bed 100644 (file)
@@ -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);
 }
 /* }}} */