diff options
author | Anatol Belski <ab@php.net> | 2014-12-13 23:06:14 +0100 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2014-12-13 23:06:14 +0100 |
commit | bdeb220f48825642f84cdbf3ff23a30613c92e86 (patch) | |
tree | 1a6cf34d20420e4815b4becb21311a4457d84103 /ext/com_dotnet/com_persist.c | |
parent | bb66f385d09e7e55390e9f57fcbca08f6b43ff91 (diff) | |
download | php-git-bdeb220f48825642f84cdbf3ff23a30613c92e86.tar.gz |
first shot remove TSRMLS_* things
Diffstat (limited to 'ext/com_dotnet/com_persist.c')
-rw-r--r-- | ext/com_dotnet/com_persist.c | 102 |
1 files changed, 51 insertions, 51 deletions
diff --git a/ext/com_dotnet/com_persist.c b/ext/com_dotnet/com_persist.c index dbe8b45300..eec1389ade 100644 --- a/ext/com_dotnet/com_persist.c +++ b/ext/com_dotnet/com_persist.c @@ -45,12 +45,12 @@ typedef struct { } php_istream; static int le_istream; -static void istream_destructor(php_istream *stm TSRMLS_DC); +static void istream_destructor(php_istream *stm); -static void istream_dtor(zend_resource *rsrc TSRMLS_DC) +static void istream_dtor(zend_resource *rsrc) { php_istream *stm = (php_istream *)rsrc->ptr; - istream_destructor(stm TSRMLS_CC); + istream_destructor(stm); } #define FETCH_STM() \ @@ -249,7 +249,7 @@ static struct IStreamVtbl php_istream_vtbl = { stm_clone }; -static void istream_destructor(php_istream *stm TSRMLS_DC) +static void istream_destructor(php_istream *stm) { if (stm->res) { zend_resource *res = stm->res; @@ -268,7 +268,7 @@ static void istream_destructor(php_istream *stm TSRMLS_DC) } /* }}} */ -PHP_COM_DOTNET_API IStream *php_com_wrapper_export_stream(php_stream *stream TSRMLS_DC) +PHP_COM_DOTNET_API IStream *php_com_wrapper_export_stream(php_stream *stream) { php_istream *stm = (php_istream*)CoTaskMemAlloc(sizeof(*stm)); zval *tmp; @@ -283,7 +283,7 @@ PHP_COM_DOTNET_API IStream *php_com_wrapper_export_stream(php_stream *stream TSR stm->stream = stream; GC_REFCOUNT(stream->res)++; - tmp = zend_list_insert(stm, le_istream TSRMLS_CC); + tmp = zend_list_insert(stm, le_istream); stm->res = Z_RES_P(tmp); return (IStream*)stm; @@ -295,7 +295,7 @@ PHP_COM_DOTNET_API IStream *php_com_wrapper_export_stream(php_stream *stream TSR #define CPH_FETCH() php_com_persist_helper *helper = (php_com_persist_helper*)Z_OBJ_P(getThis()); -#define CPH_NO_OBJ() if (helper->unk == NULL) { php_com_throw_exception(E_INVALIDARG, "No COM object is associated with this helper instance" TSRMLS_CC); return; } +#define CPH_NO_OBJ() if (helper->unk == NULL) { php_com_throw_exception(E_INVALIDARG, "No COM object is associated with this helper instance"); return; } typedef struct { zend_object std; @@ -351,7 +351,7 @@ CPH_METHOD(GetCurFileName) if (res == S_OK) { size_t len; char *str = php_com_olestring_to_string(olename, - &len, helper->codepage TSRMLS_CC); + &len, helper->codepage); RETVAL_STRINGL(str, len); // TODO: avoid reallocarion??? efree(str); @@ -361,9 +361,9 @@ CPH_METHOD(GetCurFileName) CoTaskMemFree(olename); RETURN_FALSE; } - php_com_throw_exception(res, NULL TSRMLS_CC); + php_com_throw_exception(res, NULL); } else { - php_com_throw_exception(res, NULL TSRMLS_CC); + php_com_throw_exception(res, NULL); } } /* }}} */ @@ -384,24 +384,24 @@ CPH_METHOD(SaveToFile) res = get_persist_file(helper); if (helper->ipf) { - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p!|b", + if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "p!|b", &filename, &filename_len, &remember)) { - php_com_throw_exception(E_INVALIDARG, "Invalid arguments" TSRMLS_CC); + php_com_throw_exception(E_INVALIDARG, "Invalid arguments"); return; } if (filename) { - fullpath = expand_filepath(filename, NULL TSRMLS_CC); + fullpath = expand_filepath(filename, NULL); if (!fullpath) { RETURN_FALSE; } - if (php_check_open_basedir(fullpath TSRMLS_CC)) { + if (php_check_open_basedir(fullpath)) { efree(fullpath); RETURN_FALSE; } - olefilename = php_com_string_to_olestring(filename, strlen(fullpath), helper->codepage TSRMLS_CC); + olefilename = php_com_string_to_olestring(filename, strlen(fullpath), helper->codepage); efree(fullpath); } res = IPersistFile_Save(helper->ipf, olefilename, remember); @@ -423,11 +423,11 @@ CPH_METHOD(SaveToFile) } if (FAILED(res)) { - php_com_throw_exception(res, NULL TSRMLS_CC); + php_com_throw_exception(res, NULL); } } else { - php_com_throw_exception(res, NULL TSRMLS_CC); + php_com_throw_exception(res, NULL); } } /* }}} */ @@ -448,33 +448,33 @@ CPH_METHOD(LoadFromFile) res = get_persist_file(helper); if (helper->ipf) { - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|l", + if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "p|l", &filename, &filename_len, &flags)) { - php_com_throw_exception(E_INVALIDARG, "Invalid arguments" TSRMLS_CC); + php_com_throw_exception(E_INVALIDARG, "Invalid arguments"); return; } - if (!(fullpath = expand_filepath(filename, NULL TSRMLS_CC))) { + if (!(fullpath = expand_filepath(filename, NULL))) { RETURN_FALSE; } - if (php_check_open_basedir(fullpath TSRMLS_CC)) { + if (php_check_open_basedir(fullpath)) { efree(fullpath); RETURN_FALSE; } - olefilename = php_com_string_to_olestring(fullpath, strlen(fullpath), helper->codepage TSRMLS_CC); + olefilename = php_com_string_to_olestring(fullpath, strlen(fullpath), helper->codepage); efree(fullpath); res = IPersistFile_Load(helper->ipf, olefilename, (DWORD)flags); efree(olefilename); if (FAILED(res)) { - php_com_throw_exception(res, NULL TSRMLS_CC); + php_com_throw_exception(res, NULL); } } else { - php_com_throw_exception(res, NULL TSRMLS_CC); + php_com_throw_exception(res, NULL); } } /* }}} */ @@ -497,13 +497,13 @@ CPH_METHOD(GetMaxStreamSize) if (helper->ips) { res = IPersistStream_GetSizeMax(helper->ips, &size); } else { - php_com_throw_exception(res, NULL TSRMLS_CC); + php_com_throw_exception(res, NULL); return; } } if (res != S_OK) { - php_com_throw_exception(res, NULL TSRMLS_CC); + php_com_throw_exception(res, NULL); } else { /* TODO: handle 64 bit properly */ RETURN_LONG((zend_long)size.QuadPart); @@ -525,12 +525,12 @@ CPH_METHOD(InitNew) res = IPersistStreamInit_InitNew(helper->ipsi); if (res != S_OK) { - php_com_throw_exception(res, NULL TSRMLS_CC); + php_com_throw_exception(res, NULL); } else { RETURN_TRUE; } } else { - php_com_throw_exception(res, NULL TSRMLS_CC); + php_com_throw_exception(res, NULL); } } /* }}} */ @@ -545,21 +545,21 @@ CPH_METHOD(LoadFromStream) HRESULT res; CPH_FETCH(); - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zstm)) { - php_com_throw_exception(E_INVALIDARG, "invalid arguments" TSRMLS_CC); + if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zstm)) { + php_com_throw_exception(E_INVALIDARG, "invalid arguments"); return; } php_stream_from_zval_no_verify(stream, zstm); if (stream == NULL) { - php_com_throw_exception(E_INVALIDARG, "expected a stream" TSRMLS_CC); + php_com_throw_exception(E_INVALIDARG, "expected a stream"); return; } - stm = php_com_wrapper_export_stream(stream TSRMLS_CC); + stm = php_com_wrapper_export_stream(stream); if (stm == NULL) { - php_com_throw_exception(E_UNEXPECTED, "failed to wrap stream" TSRMLS_CC); + php_com_throw_exception(E_UNEXPECTED, "failed to wrap stream"); return; } @@ -573,7 +573,7 @@ CPH_METHOD(LoadFromStream) res = OleLoadFromStream(stm, &IID_IDispatch, &disp); if (SUCCEEDED(res)) { - php_com_wrap_dispatch(return_value, disp, COMG(code_page) TSRMLS_CC); + php_com_wrap_dispatch(return_value, disp, COMG(code_page)); } } else { res = get_persist_stream_init(helper); @@ -589,7 +589,7 @@ CPH_METHOD(LoadFromStream) IStream_Release(stm); if (FAILED(res)) { - php_com_throw_exception(res, NULL TSRMLS_CC); + php_com_throw_exception(res, NULL); RETURN_NULL(); } } @@ -607,21 +607,21 @@ CPH_METHOD(SaveToStream) CPH_NO_OBJ(); - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zstm)) { - php_com_throw_exception(E_INVALIDARG, "invalid arguments" TSRMLS_CC); + if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zstm)) { + php_com_throw_exception(E_INVALIDARG, "invalid arguments"); return; } php_stream_from_zval_no_verify(stream, zstm); if (stream == NULL) { - php_com_throw_exception(E_INVALIDARG, "expected a stream" TSRMLS_CC); + php_com_throw_exception(E_INVALIDARG, "expected a stream"); return; } - stm = php_com_wrapper_export_stream(stream TSRMLS_CC); + stm = php_com_wrapper_export_stream(stream); if (stm == NULL) { - php_com_throw_exception(E_UNEXPECTED, "failed to wrap stream" TSRMLS_CC); + php_com_throw_exception(E_UNEXPECTED, "failed to wrap stream"); return; } @@ -638,7 +638,7 @@ CPH_METHOD(SaveToStream) IStream_Release(stm); if (FAILED(res)) { - php_com_throw_exception(res, NULL TSRMLS_CC); + php_com_throw_exception(res, NULL); return; } @@ -654,9 +654,9 @@ CPH_METHOD(__construct) zval *zobj = NULL; CPH_FETCH(); - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|O!", + if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "|O!", &zobj, php_com_variant_class_entry)) { - php_com_throw_exception(E_INVALIDARG, "invalid arguments" TSRMLS_CC); + php_com_throw_exception(E_INVALIDARG, "invalid arguments"); return; } @@ -667,7 +667,7 @@ CPH_METHOD(__construct) obj = CDNO_FETCH(zobj); if (V_VT(&obj->v) != VT_DISPATCH || V_DISPATCH(&obj->v) == NULL) { - php_com_throw_exception(E_INVALIDARG, "parameter must represent an IDispatch COM object" TSRMLS_CC); + php_com_throw_exception(E_INVALIDARG, "parameter must represent an IDispatch COM object"); return; } @@ -693,7 +693,7 @@ static const zend_function_entry com_persist_helper_methods[] = { PHP_FE_END }; -static void helper_free_storage(zend_object *obj TSRMLS_DC) +static void helper_free_storage(zend_object *obj) { php_com_persist_helper *object = (php_com_persist_helper*)obj; @@ -709,18 +709,18 @@ static void helper_free_storage(zend_object *obj TSRMLS_DC) if (object->unk) { IUnknown_Release(object->unk); } - zend_object_std_dtor(&object->std TSRMLS_CC); + zend_object_std_dtor(&object->std); } -static zend_object* helper_clone(zval *obj TSRMLS_DC) +static zend_object* helper_clone(zval *obj) { php_com_persist_helper *clone, *object = (php_com_persist_helper*)Z_OBJ_P(obj); clone = emalloc(sizeof(*object)); memcpy(clone, object, sizeof(*object)); - zend_object_std_init(&clone->std, object->std.ce TSRMLS_CC); + zend_object_std_init(&clone->std, object->std.ce); if (clone->ipf) { IPersistFile_AddRef(clone->ipf); @@ -737,14 +737,14 @@ static zend_object* helper_clone(zval *obj TSRMLS_DC) return (zend_object*)clone; } -static zend_object* helper_new(zend_class_entry *ce TSRMLS_DC) +static zend_object* helper_new(zend_class_entry *ce) { php_com_persist_helper *helper; helper = emalloc(sizeof(*helper)); memset(helper, 0, sizeof(*helper)); - zend_object_std_init(&helper->std, helper_ce TSRMLS_CC); + zend_object_std_init(&helper->std, helper_ce); helper->std.handlers = &helper_handlers; return &helper->std; @@ -760,7 +760,7 @@ int php_com_persist_minit(INIT_FUNC_ARGS) INIT_CLASS_ENTRY(ce, "COMPersistHelper", com_persist_helper_methods); ce.create_object = helper_new; - helper_ce = zend_register_internal_class(&ce TSRMLS_CC); + helper_ce = zend_register_internal_class(&ce); helper_ce->ce_flags |= ZEND_ACC_FINAL; le_istream = zend_register_list_destructors_ex(istream_dtor, |