iliaa           Wed Oct 15 22:57:22 2008 UTC

  Modified files:              
    /php-src/ext/fileinfo/libmagic      apprentice.c file.h magic.c magic.h 
                                        print.c softmagic.c 
  Log:
  
  MFB: removed dead-code
  
http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/libmagic/apprentice.c?r1=1.12&r2=1.13&diff_format=u
Index: php-src/ext/fileinfo/libmagic/apprentice.c
diff -u php-src/ext/fileinfo/libmagic/apprentice.c:1.12 
php-src/ext/fileinfo/libmagic/apprentice.c:1.13
--- php-src/ext/fileinfo/libmagic/apprentice.c:1.12     Tue Sep 16 22:21:40 2008
+++ php-src/ext/fileinfo/libmagic/apprentice.c  Wed Oct 15 22:57:22 2008
@@ -1290,9 +1290,6 @@
                if (check_format(ms, m) == -1)
                        return -1;
        }
-       if (action == FILE_CHECK) {
-               file_mdump(m);
-       }
        m->mimetype[0] = '\0';          /* initialise MIME type to none */
        if (m->cont_level == 0)
                ++(*nmentryp);          /* make room for next */
http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/libmagic/file.h?r1=1.5&r2=1.6&diff_format=u
Index: php-src/ext/fileinfo/libmagic/file.h
diff -u php-src/ext/fileinfo/libmagic/file.h:1.5 
php-src/ext/fileinfo/libmagic/file.h:1.6
--- php-src/ext/fileinfo/libmagic/file.h:1.5    Sun Sep  7 20:29:54 2008
+++ php-src/ext/fileinfo/libmagic/file.h        Wed Oct 15 22:57:22 2008
@@ -349,7 +349,6 @@
 protected void file_error(struct magic_set *, int, const char *, ...);
 protected void file_magerror(struct magic_set *, const char *, ...);
 protected void file_magwarn(struct magic_set *, const char *, ...);
-protected void file_mdump(struct magic *);
 protected void file_showstr(FILE *, const char *, size_t);
 protected size_t file_mbswidth(const char *);
 protected const char *file_getbuffer(struct magic_set *);
http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/libmagic/magic.c?r1=1.4&r2=1.5&diff_format=u
Index: php-src/ext/fileinfo/libmagic/magic.c
diff -u php-src/ext/fileinfo/libmagic/magic.c:1.4 
php-src/ext/fileinfo/libmagic/magic.c:1.5
--- php-src/ext/fileinfo/libmagic/magic.c:1.4   Sun Sep  7 20:29:54 2008
+++ php-src/ext/fileinfo/libmagic/magic.c       Wed Oct 15 22:57:22 2008
@@ -208,14 +208,6 @@
        return ml ? 0 : -1;
 }
 
-public int
-magic_check(struct magic_set *ms, const char *magicfile)
-{
-       struct mlist *ml = file_apprentice(ms, magicfile, FILE_CHECK);
-       free_mlist(ml);
-       return ml ? 0 : -1;
-}
-
 private void
 close_and_restore(const struct magic_set *ms, const char *name, int fd,
     const struct stat *sb)
http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/libmagic/magic.h?r1=1.2&r2=1.3&diff_format=u
Index: php-src/ext/fileinfo/libmagic/magic.h
diff -u php-src/ext/fileinfo/libmagic/magic.h:1.2 
php-src/ext/fileinfo/libmagic/magic.h:1.3
--- php-src/ext/fileinfo/libmagic/magic.h:1.2   Sun Sep  7 20:29:54 2008
+++ php-src/ext/fileinfo/libmagic/magic.h       Wed Oct 15 22:57:22 2008
@@ -73,7 +73,6 @@
 
 int magic_load(magic_t, const char *);
 int magic_compile(magic_t, const char *);
-int magic_check(magic_t, const char *);
 int magic_errno(magic_t);
 
 #ifdef __cplusplus
http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/libmagic/print.c?r1=1.3&r2=1.4&diff_format=u
Index: php-src/ext/fileinfo/libmagic/print.c
diff -u php-src/ext/fileinfo/libmagic/print.c:1.3 
php-src/ext/fileinfo/libmagic/print.c:1.4
--- php-src/ext/fileinfo/libmagic/print.c:1.3   Fri Aug 29 12:05:35 2008
+++ php-src/ext/fileinfo/libmagic/print.c       Wed Oct 15 22:57:22 2008
@@ -46,137 +46,6 @@
 
 #define SZOF(a)        (sizeof(a) / sizeof(a[0]))
 
-protected void
-file_mdump(struct magic *m)
-{
-       private const char optyp[] = { FILE_OPS };
-
-       (void) fprintf(stderr, "[%u", m->lineno);
-       (void) fprintf(stderr, ">>>>>>>> %u" + 8 - (m->cont_level & 7),
-                      m->offset);
-
-       if (m->flag & INDIR) {
-               (void) fprintf(stderr, "(%s,",
-                              /* Note: type is unsigned */
-                              (m->in_type < file_nnames) ? 
-                                       file_names[m->in_type] : "*bad*");
-               if (m->in_op & FILE_OPINVERSE)
-                       (void) fputc('~', stderr);
-               (void) fprintf(stderr, "%c%u),",
-                              ((m->in_op & FILE_OPS_MASK) < SZOF(optyp)) ? 
-                                       optyp[m->in_op & FILE_OPS_MASK] : '?',
-                               m->in_offset);
-       }
-       (void) fprintf(stderr, " %s%s", (m->flag & UNSIGNED) ? "u" : "",
-                      /* Note: type is unsigned */
-                      (m->type < file_nnames) ? file_names[m->type] : "*bad*");
-       if (m->mask_op & FILE_OPINVERSE)
-               (void) fputc('~', stderr);
-
-       if (IS_LIBMAGIC_STRING(m->type)) {
-               if (m->str_flags) {
-                       (void) fputc('/', stderr);
-                       if (m->str_flags & STRING_COMPACT_BLANK) 
-                               (void) fputc(CHAR_COMPACT_BLANK, stderr);
-                       if (m->str_flags & STRING_COMPACT_OPTIONAL_BLANK) 
-                               (void) fputc(CHAR_COMPACT_OPTIONAL_BLANK,
-                                   stderr);
-                       if (m->str_flags & STRING_IGNORE_LOWERCASE) 
-                               (void) fputc(CHAR_IGNORE_LOWERCASE, stderr);
-                       if (m->str_flags & STRING_IGNORE_UPPERCASE) 
-                               (void) fputc(CHAR_IGNORE_UPPERCASE, stderr);
-                       if (m->str_flags & REGEX_OFFSET_START) 
-                               (void) fputc(CHAR_REGEX_OFFSET_START, stderr);
-               }
-               if (m->str_range)
-                       (void) fprintf(stderr, "/%u", m->str_range);
-       }
-       else {
-               if ((m->mask_op & FILE_OPS_MASK) < SZOF(optyp))
-                       (void) fputc(optyp[m->mask_op & FILE_OPS_MASK], stderr);
-               else
-                       (void) fputc('?', stderr);
-                       
-               if (m->num_mask) {
-                       (void) fprintf(stderr, "%.8llx",
-                           (unsigned long long)m->num_mask);
-               }
-       }
-       (void) fprintf(stderr, ",%c", m->reln);
-
-       if (m->reln != 'x') {
-               switch (m->type) {
-               case FILE_BYTE:
-               case FILE_SHORT:
-               case FILE_LONG:
-               case FILE_LESHORT:
-               case FILE_LELONG:
-               case FILE_MELONG:
-               case FILE_BESHORT:
-               case FILE_BELONG:
-                       (void) fprintf(stderr, "%d", m->value.l);
-                       break;
-               case FILE_BEQUAD:
-               case FILE_LEQUAD:
-               case FILE_QUAD:
-                       (void) fprintf(stderr, "%lld",
-                           (unsigned long long)m->value.q);
-                       break;
-               case FILE_PSTRING:
-               case FILE_STRING:
-               case FILE_REGEX:
-               case FILE_BESTRING16:
-               case FILE_LESTRING16:
-               case FILE_SEARCH:
-                       file_showstr(stderr, m->value.s, (size_t)m->vallen);
-                       break;
-               case FILE_DATE:
-               case FILE_LEDATE:
-               case FILE_BEDATE:
-               case FILE_MEDATE:
-                       (void)fprintf(stderr, "%s,",
-                           file_fmttime(m->value.l, 1));
-                       break;
-               case FILE_LDATE:
-               case FILE_LELDATE:
-               case FILE_BELDATE:
-               case FILE_MELDATE:
-                       (void)fprintf(stderr, "%s,",
-                           file_fmttime(m->value.l, 0));
-                       break;
-               case FILE_QDATE:
-               case FILE_LEQDATE:
-               case FILE_BEQDATE:
-                       (void)fprintf(stderr, "%s,",
-                           file_fmttime((uint32_t)m->value.q, 1));
-                       break;
-               case FILE_QLDATE:
-               case FILE_LEQLDATE:
-               case FILE_BEQLDATE:
-                       (void)fprintf(stderr, "%s,",
-                           file_fmttime((uint32_t)m->value.q, 0));
-                       break;
-               case FILE_FLOAT:
-               case FILE_BEFLOAT:
-               case FILE_LEFLOAT:
-                       (void) fprintf(stderr, "%G", m->value.f);
-                       break;
-               case FILE_DOUBLE:
-               case FILE_BEDOUBLE:
-               case FILE_LEDOUBLE:
-                       (void) fprintf(stderr, "%G", m->value.d);
-                       break;
-               case FILE_DEFAULT:
-                       /* XXX - do anything here? */
-                       break;
-               default:
-                       (void) fputs("*bad*", stderr);
-                       break;
-               }
-       }
-       (void) fprintf(stderr, ",\"%s\"]\n", m->desc);
-}
-
 /*VARARGS*/
 protected void
 file_magwarn(struct magic_set *ms, const char *f, ...)
http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/libmagic/softmagic.c?r1=1.6&r2=1.7&diff_format=u
Index: php-src/ext/fileinfo/libmagic/softmagic.c
diff -u php-src/ext/fileinfo/libmagic/softmagic.c:1.6 
php-src/ext/fileinfo/libmagic/softmagic.c:1.7
--- php-src/ext/fileinfo/libmagic/softmagic.c:1.6       Fri Aug 29 10:53:07 2008
+++ php-src/ext/fileinfo/libmagic/softmagic.c   Wed Oct 15 22:57:22 2008
@@ -877,7 +877,6 @@
 
        if ((ms->flags & MAGIC_DEBUG) != 0) {
                mdebug(offset, (char *)(void *)p, sizeof(union VALUETYPE));
-               file_mdump(m);
        }
 
        if (m->flag & INDIR) {
@@ -1347,7 +1346,6 @@
                if ((ms->flags & MAGIC_DEBUG) != 0) {
                        mdebug(offset, (char *)(void *)p,
                            sizeof(union VALUETYPE));
-                       file_mdump(m);
                }
        }
 



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to