From 26e5f9bab74c0b19e6312bde594d3961a1b1b572 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Fri, 26 Sep 2014 21:30:22 +0200 Subject: cleanup TSRMLS_FETCH in ext/fileinfo --- ext/fileinfo/libmagic/apprentice.c | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'ext/fileinfo/libmagic/apprentice.c') diff --git a/ext/fileinfo/libmagic/apprentice.c b/ext/fileinfo/libmagic/apprentice.c index c1dc5aa1fa..732ed8babb 100644 --- a/ext/fileinfo/libmagic/apprentice.c +++ b/ext/fileinfo/libmagic/apprentice.c @@ -960,8 +960,6 @@ load_1(struct magic_set *ms, int action, const char *fn, int *errs, php_stream *stream; - TSRMLS_FETCH(); - ms->file = fn; stream = php_stream_open_wrapper((char *)fn, "rb", REPORT_ERRORS, NULL); @@ -1151,8 +1149,6 @@ apprentice_load(struct magic_set *ms, const char *fn, int action) php_stream *dir; php_stream_dirent d; - TSRMLS_FETCH(); - memset(mset, 0, sizeof(mset)); ms->flags |= MAGIC_CHECK; /* Enable checks for parsed files */ @@ -2607,9 +2603,6 @@ apprentice_map(struct magic_set *ms, const char *fn) php_stream *stream = NULL; php_stream_statbuf st; - - TSRMLS_FETCH(); - if ((map = CAST(struct magic_map *, ecalloc(1, sizeof(*map)))) == NULL) { file_oomem(ms, sizeof(*map)); efree(map); @@ -2761,8 +2754,6 @@ apprentice_compile(struct magic_set *ms, struct magic_map *map, const char *fn) uint32_t i; php_stream *stream; - TSRMLS_FETCH(); - dbname = mkdbname(ms, fn, 0); if (dbname == NULL) @@ -2820,7 +2811,6 @@ mkdbname(struct magic_set *ms, const char *fn, int strip) { const char *p, *q; char *buf; - TSRMLS_FETCH(); if (strip) { if ((p = strrchr(fn, '/')) != NULL) -- cgit v1.2.1 From c00424e427930a33e6d8645cc3f23fb78ed29b9f Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Wed, 15 Oct 2014 09:37:55 +0200 Subject: bring back all the TSRMLS_FETCH() stuff for better comparability with the mainstream --- ext/fileinfo/libmagic/apprentice.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'ext/fileinfo/libmagic/apprentice.c') diff --git a/ext/fileinfo/libmagic/apprentice.c b/ext/fileinfo/libmagic/apprentice.c index 732ed8babb..c1dc5aa1fa 100644 --- a/ext/fileinfo/libmagic/apprentice.c +++ b/ext/fileinfo/libmagic/apprentice.c @@ -960,6 +960,8 @@ load_1(struct magic_set *ms, int action, const char *fn, int *errs, php_stream *stream; + TSRMLS_FETCH(); + ms->file = fn; stream = php_stream_open_wrapper((char *)fn, "rb", REPORT_ERRORS, NULL); @@ -1149,6 +1151,8 @@ apprentice_load(struct magic_set *ms, const char *fn, int action) php_stream *dir; php_stream_dirent d; + TSRMLS_FETCH(); + memset(mset, 0, sizeof(mset)); ms->flags |= MAGIC_CHECK; /* Enable checks for parsed files */ @@ -2603,6 +2607,9 @@ apprentice_map(struct magic_set *ms, const char *fn) php_stream *stream = NULL; php_stream_statbuf st; + + TSRMLS_FETCH(); + if ((map = CAST(struct magic_map *, ecalloc(1, sizeof(*map)))) == NULL) { file_oomem(ms, sizeof(*map)); efree(map); @@ -2754,6 +2761,8 @@ apprentice_compile(struct magic_set *ms, struct magic_map *map, const char *fn) uint32_t i; php_stream *stream; + TSRMLS_FETCH(); + dbname = mkdbname(ms, fn, 0); if (dbname == NULL) @@ -2811,6 +2820,7 @@ mkdbname(struct magic_set *ms, const char *fn, int strip) { const char *p, *q; char *buf; + TSRMLS_FETCH(); if (strip) { if ((p = strrchr(fn, '/')) != NULL) -- cgit v1.2.1 From bdeb220f48825642f84cdbf3ff23a30613c92e86 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Sat, 13 Dec 2014 23:06:14 +0100 Subject: first shot remove TSRMLS_* things --- ext/fileinfo/libmagic/apprentice.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'ext/fileinfo/libmagic/apprentice.c') diff --git a/ext/fileinfo/libmagic/apprentice.c b/ext/fileinfo/libmagic/apprentice.c index c1dc5aa1fa..83eb1f44f7 100644 --- a/ext/fileinfo/libmagic/apprentice.c +++ b/ext/fileinfo/libmagic/apprentice.c @@ -960,7 +960,6 @@ load_1(struct magic_set *ms, int action, const char *fn, int *errs, php_stream *stream; - TSRMLS_FETCH(); ms->file = fn; stream = php_stream_open_wrapper((char *)fn, "rb", REPORT_ERRORS, NULL); @@ -1151,7 +1150,6 @@ apprentice_load(struct magic_set *ms, const char *fn, int action) php_stream *dir; php_stream_dirent d; - TSRMLS_FETCH(); memset(mset, 0, sizeof(mset)); ms->flags |= MAGIC_CHECK; /* Enable checks for parsed files */ @@ -2608,7 +2606,6 @@ apprentice_map(struct magic_set *ms, const char *fn) php_stream_statbuf st; - TSRMLS_FETCH(); if ((map = CAST(struct magic_map *, ecalloc(1, sizeof(*map)))) == NULL) { file_oomem(ms, sizeof(*map)); @@ -2761,7 +2758,6 @@ apprentice_compile(struct magic_set *ms, struct magic_map *map, const char *fn) uint32_t i; php_stream *stream; - TSRMLS_FETCH(); dbname = mkdbname(ms, fn, 0); @@ -2820,7 +2816,6 @@ mkdbname(struct magic_set *ms, const char *fn, int strip) { const char *p, *q; char *buf; - TSRMLS_FETCH(); if (strip) { if ((p = strrchr(fn, '/')) != NULL) -- cgit v1.2.1