diff options
Diffstat (limited to 'file')
-rw-r--r-- | file/src/.splintrc | 6 | ||||
-rw-r--r-- | file/src/Makefile.am | 2 | ||||
-rw-r--r-- | file/src/apprentice.c | 38 | ||||
-rw-r--r-- | file/src/ascmagic.c | 2 | ||||
-rw-r--r-- | file/src/compress.c | 18 | ||||
-rw-r--r-- | file/src/file.c | 46 | ||||
-rw-r--r-- | file/src/readelf.c | 16 | ||||
-rw-r--r-- | file/src/softmagic.c | 240 |
8 files changed, 181 insertions, 187 deletions
diff --git a/file/src/.splintrc b/file/src/.splintrc index 9f1cae6e8..fbbb555cb 100644 --- a/file/src/.splintrc +++ b/file/src/.splintrc @@ -20,7 +20,6 @@ -compmempass -compdestroy -evalorder --exitarg -formatconst -macroredef -modobserver # 9 @@ -42,11 +41,6 @@ -temptrans --looploopbreak --loopswitchbreak --looploopcontinue --switchloopbreak --switchswitchbreak -whileempty -constuse diff --git a/file/src/Makefile.am b/file/src/Makefile.am index f1ac1af5e..076ffc31a 100644 --- a/file/src/Makefile.am +++ b/file/src/Makefile.am @@ -4,7 +4,7 @@ BUILT_SOURCES = listobjs EXTRA_DIST = test.c pkglibdir = @prefix@/lib/rpm -#MAGIC = $(pkglibdir)/magic +MAGIC = $(pkglibdir)/magic AM_CPPFLAGS = -DMAGIC='"$(MAGIC)"' diff --git a/file/src/apprentice.c b/file/src/apprentice.c index 31d94abc5..b1ad3fee1 100644 --- a/file/src/apprentice.c +++ b/file/src/apprentice.c @@ -667,14 +667,14 @@ parse(struct magic_set *ms, struct magic **magicp, uint32_t *nmagicp, char *l, switch (*l) { case CHAR_IGNORE_LOWERCASE: m->mask |= STRING_IGNORE_LOWERCASE; - break; + /*@switchbreak@*/ break; case CHAR_COMPACT_BLANK: m->mask |= STRING_COMPACT_BLANK; - break; + /*@switchbreak@*/ break; case CHAR_COMPACT_OPTIONAL_BLANK: m->mask |= STRING_COMPACT_OPTIONAL_BLANK; - break; + /*@switchbreak@*/ break; default: if (ms->flags & MAGIC_CHECK) file_magwarn(ms, @@ -881,31 +881,31 @@ getstr(struct magic_set *ms, char *s, char *p, int plen, int *slen) default: *p++ = (char) c; - break; + /*@switchbreak@*/ break; case 'n': *p++ = '\n'; - break; + /*@switchbreak@*/ break; case 'r': *p++ = '\r'; - break; + /*@switchbreak@*/ break; case 'b': *p++ = '\b'; - break; + /*@switchbreak@*/ break; case 't': *p++ = '\t'; - break; + /*@switchbreak@*/ break; case 'f': *p++ = '\f'; - break; + /*@switchbreak@*/ break; case 'v': *p++ = '\v'; - break; + /*@switchbreak@*/ break; /* \ and up to 3 octal digits */ case '0': @@ -929,7 +929,7 @@ getstr(struct magic_set *ms, char *s, char *p, int plen, int *slen) else --s; *p++ = (char)val; - break; + /*@switchbreak@*/ break; /* \x and up to 2 hex digits */ case 'x': @@ -945,7 +945,7 @@ getstr(struct magic_set *ms, char *s, char *p, int plen, int *slen) } else --s; *p++ = (char)val; - break; + /*@switchbreak@*/ break; } } else *p++ = (char)c; @@ -999,31 +999,31 @@ file_showstr(FILE *fp, const char *s, size_t len) case '\n': (void) fputc('n', fp); - break; + /*@switchbreak@*/ break; case '\r': (void) fputc('r', fp); - break; + /*@switchbreak@*/ break; case '\b': (void) fputc('b', fp); - break; + /*@switchbreak@*/ break; case '\t': (void) fputc('t', fp); - break; + /*@switchbreak@*/ break; case '\f': (void) fputc('f', fp); - break; + /*@switchbreak@*/ break; case '\v': (void) fputc('v', fp); - break; + /*@switchbreak@*/ break; default: (void) fprintf(fp, "%.3o", c & 0377); - break; + /*@switchbreak@*/ break; } } } diff --git a/file/src/ascmagic.c b/file/src/ascmagic.c index e1d5bc36b..ad48965b1 100644 --- a/file/src/ascmagic.c +++ b/file/src/ascmagic.c @@ -208,7 +208,7 @@ file_ascmagic(struct magic_set *ms, const unsigned char *buf, size_t nbytes) */ for (end = i + 1; end < nbytes; end++) if (ISSPC(ubuf[end])) - break; + /*@innerbreak@*/ break; /* * compare the word thus isolated against the token list diff --git a/file/src/compress.c b/file/src/compress.c index 06e8ae7ef..51437ce73 100644 --- a/file/src/compress.c +++ b/file/src/compress.c @@ -149,7 +149,7 @@ swrite(int fd, const void *buf, size_t n) default: n -= rv; buf = ((const char *)buf) + rv; - break; + /*@switchbreak@*/ break; } while (n > 0); return rn; @@ -176,7 +176,7 @@ sread(int fd, void *buf, size_t n) default: n -= rv; buf = ((char *)buf) + rv; - break; + /*@switchbreak@*/ break; } while (n > 0); return rn; @@ -354,7 +354,7 @@ uncompressbuf(struct magic_set *ms, size_t method, const unsigned char *old, execvp(compr[method].argv[0], (char *const *)compr[method].argv); - exit(1); + exit(EXIT_FAILURE); /*@notreached@*/ break; case -1: file_error(ms, errno, "could not fork"); @@ -368,16 +368,16 @@ uncompressbuf(struct magic_set *ms, size_t method, const unsigned char *old, case 0: /* child */ (void)close(fdout[0]); if (swrite(fdin[1], old, n) != n) - exit(1); - exit(0); - /*@notreached@*/ break; + exit(EXIT_FAILURE); + exit(EXIT_SUCCESS); + /*@notreached@*/ /*@innerbreak@*/ break; case -1: - exit(1); - /*@notreached@*/ break; + exit(EXIT_FAILURE); + /*@notreached@*/ /*@innerbreak@*/ break; default: /* parent */ - break; + /*@innerbreak@*/ break; } (void) close(fdin[1]); fdin[1] = -1; diff --git a/file/src/file.c b/file/src/file.c index 425b82bea..fb47ef387 100644 --- a/file/src/file.c +++ b/file/src/file.c @@ -226,56 +226,56 @@ main(int argc, char *argv[]) case 0 : if (longindex == 1) help(); - break; + /*@switchbreak@*/ break; #endif case 'b': ++bflag; - break; + /*@switchbreak@*/ break; case 'c': action = FILE_CHECK; - break; + /*@switchbreak@*/ break; case 'C': action = FILE_COMPILE; - break; + /*@switchbreak@*/ break; case 'd': flags |= MAGIC_DEBUG|MAGIC_CHECK; - break; + /*@switchbreak@*/ break; case 'f': if(action) usage(); load(magicfile, flags); unwrap(optarg); ++didsomefiles; - break; + /*@switchbreak@*/ break; case 'F': separator = optarg; - break; + /*@switchbreak@*/ break; case 'i': flags |= MAGIC_MIME; - break; + /*@switchbreak@*/ break; case 'k': flags |= MAGIC_CONTINUE; - break; + /*@switchbreak@*/ break; case 'm': magicfile = optarg; - break; + /*@switchbreak@*/ break; case 'n': ++nobuffer; - break; + /*@switchbreak@*/ break; case 'N': ++nopad; - break; + /*@switchbreak@*/ break; #if defined(HAVE_UTIME) || defined(HAVE_UTIMES) case 'p': flags |= MAGIC_PRESERVE_ATIME; - break; + /*@switchbreak@*/ break; #endif case 'r': flags |= MAGIC_RAW; - break; + /*@switchbreak@*/ break; case 's': flags |= MAGIC_DEVICES; - break; + /*@switchbreak@*/ break; case 'v': (void) fprintf(stdout, "%s-%d.%.2d\n", progname, FILE_VERSION_MAJOR, patchlevel); @@ -284,16 +284,16 @@ main(int argc, char *argv[]) return 1; case 'z': flags |= MAGIC_COMPRESS; - break; + /*@switchbreak@*/ break; #ifdef S_IFLNK case 'L': flags |= MAGIC_SYMLINK; - break; + /*@switchbreak@*/ break; #endif case '?': default: errflg++; - break; + /*@switchbreak@*/ break; } if (errflg) { @@ -352,12 +352,12 @@ load(/*@unused@*/ const char *m, int flags) magic = magic_open(flags); if (magic == NULL) { (void)fprintf(stderr, "%s: %s\n", progname, strerror(errno)); - exit(1); + exit(EXIT_FAILURE); } if (magic_load(magic, magicfile) == -1) { (void)fprintf(stderr, "%s: %s\n", progname, magic_error(magic)); - exit(1); + exit(EXIT_FAILURE); } } @@ -378,7 +378,7 @@ unwrap(char *fn) if ((f = fopen(fn, "r")) == NULL) { (void)fprintf(stderr, "%s: Cannot open `%s' (%s).\n", progname, fn, strerror(errno)); - exit(1); + exit(EXIT_FAILURE); } while (fgets(buf, MAXPATHLEN, f) != NULL) { @@ -517,7 +517,7 @@ usage(void) #ifdef HAVE_GETOPT_LONG (void)fputs("Try `file --help' for more information.\n", stderr); #endif - exit(1); + exit(EXIT_FAILURE); } #ifdef HAVE_GETOPT_LONG @@ -549,6 +549,6 @@ help(void) " --help display this help and exit\n" " --version output version information and exit\n" ); - exit(0); + exit(EXIT_SUCCESS); } #endif diff --git a/file/src/readelf.c b/file/src/readelf.c index cd20bedc6..527263172 100644 --- a/file/src/readelf.c +++ b/file/src/readelf.c @@ -273,11 +273,11 @@ dophn_core(struct magic_set *ms, int class, int swap, int fd, off_t off, offset = 0; for (;;) { if (offset >= (size_t)bufsize) - break; + /*@innerbreak@*/ break; offset = donote(ms, nbuf, offset, (size_t)bufsize, class, swap, 4); if (offset == 0) - break; + /*@innerbreak@*/ break; } } @@ -595,7 +595,7 @@ donote(struct magic_set *ms, unsigned char *nbuf, size_t offset, size_t size, if (j == 0) goto tryanother; else - break; + /*@innerbreak@*/ break; } else { /* * A nonprintable @@ -700,10 +700,10 @@ dophn_exec(struct magic_set *ms, int class, int swap, int fd, off_t off, switch (ph_type) { case PT_DYNAMIC: linking_style = "dynamically"; - break; + /*@switchbreak@*/ break; case PT_INTERP: shared_libraries = " (uses shared libs)"; - break; + /*@switchbreak@*/ break; case PT_NOTE: if ((align = ph_align) & 0x80000000) { if (file_printf(ms, @@ -730,17 +730,17 @@ dophn_exec(struct magic_set *ms, int class, int swap, int fd, off_t off, offset = 0; for (;;) { if (offset >= (size_t)bufsize) - break; + /*@innerbreak@*/ break; offset = donote(ms, nbuf, offset, (size_t)bufsize, class, swap, align); if (offset == 0) - break; + /*@innerbreak@*/ break; } if (lseek(fd, savedoffset, SEEK_SET) == (off_t)-1) { file_badseek(ms); return -1; } - break; + /*@switchbreak@*/ break; } } if (file_printf(ms, ", %s linked%s", linking_style, shared_libraries) diff --git a/file/src/softmagic.c b/file/src/softmagic.c index 82bc72930..707b1c526 100644 --- a/file/src/softmagic.c +++ b/file/src/softmagic.c @@ -134,9 +134,9 @@ match(struct magic_set *ms, struct magic *magic, uint32_t nmagic, return -1; case 0: flush++; - break; + /*@switchbreak@*/ break; default: - break; + /*@switchbreak@*/ break; } if (flush) { /* @@ -171,7 +171,7 @@ match(struct magic_set *ms, struct magic *magic, uint32_t nmagic, while (magic[magindex+1].cont_level != 0 && ++magindex < nmagic) { if (cont_level < magic[magindex].cont_level) - continue; + /*@innercontinue@*/ continue; if (cont_level > magic[magindex].cont_level) { /* * We're at the end of the level @@ -190,7 +190,7 @@ match(struct magic_set *ms, struct magic *magic, uint32_t nmagic, case -1: return -1; case 0: - break; + /*@switchbreak@*/ break; default: /* * This continuation matched. @@ -347,28 +347,28 @@ mconvert(struct magic_set *ms, union VALUETYPE *p, struct magic *m) switch (m->mask_op&0x7F) { case FILE_OPAND: p->b &= m->mask; - break; + /*@innerbreak@*/ break; case FILE_OPOR: p->b |= m->mask; - break; + /*@innerbreak@*/ break; case FILE_OPXOR: p->b ^= m->mask; - break; + /*@innerbreak@*/ break; case FILE_OPADD: p->b += m->mask; - break; + /*@innerbreak@*/ break; case FILE_OPMINUS: p->b -= m->mask; - break; + /*@innerbreak@*/ break; case FILE_OPMULTIPLY: p->b *= m->mask; - break; + /*@innerbreak@*/ break; case FILE_OPDIVIDE: p->b /= m->mask; - break; + /*@innerbreak@*/ break; case FILE_OPMODULO: p->b %= m->mask; - break; + /*@innerbreak@*/ break; } if (m->mask_op & FILE_OPINVERSE) p->b = ~p->b; @@ -378,28 +378,28 @@ mconvert(struct magic_set *ms, union VALUETYPE *p, struct magic *m) switch (m->mask_op&0x7F) { case FILE_OPAND: p->h &= m->mask; - break; + /*@innerbreak@*/ break; case FILE_OPOR: p->h |= m->mask; - break; + /*@innerbreak@*/ break; case FILE_OPXOR: p->h ^= m->mask; - break; + /*@innerbreak@*/ break; case FILE_OPADD: p->h += m->mask; - break; + /*@innerbreak@*/ break; case FILE_OPMINUS: p->h -= m->mask; - break; + /*@innerbreak@*/ break; case FILE_OPMULTIPLY: p->h *= m->mask; - break; + /*@innerbreak@*/ break; case FILE_OPDIVIDE: p->h /= m->mask; - break; + /*@innerbreak@*/ break; case FILE_OPMODULO: p->h %= m->mask; - break; + /*@innerbreak@*/ break; } if (m->mask_op & FILE_OPINVERSE) p->h = ~p->h; @@ -411,28 +411,28 @@ mconvert(struct magic_set *ms, union VALUETYPE *p, struct magic *m) switch (m->mask_op&0x7F) { case FILE_OPAND: p->l &= m->mask; - break; + /*@innerbreak@*/ break; case FILE_OPOR: p->l |= m->mask; - break; + /*@innerbreak@*/ break; case FILE_OPXOR: p->l ^= m->mask; - break; + /*@innerbreak@*/ break; case FILE_OPADD: p->l += m->mask; - break; + /*@innerbreak@*/ break; case FILE_OPMINUS: p->l -= m->mask; - break; + /*@innerbreak@*/ break; case FILE_OPMULTIPLY: p->l *= m->mask; - break; + /*@innerbreak@*/ break; case FILE_OPDIVIDE: p->l /= m->mask; - break; + /*@innerbreak@*/ break; case FILE_OPMODULO: p->l %= m->mask; - break; + /*@innerbreak@*/ break; } if (m->mask_op & FILE_OPINVERSE) p->l = ~p->l; @@ -470,28 +470,28 @@ mconvert(struct magic_set *ms, union VALUETYPE *p, struct magic *m) switch (m->mask_op&0x7F) { case FILE_OPAND: p->h &= m->mask; - break; + /*@innerbreak@*/ break; case FILE_OPOR: p->h |= m->mask; - break; + /*@innerbreak@*/ break; case FILE_OPXOR: p->h ^= m->mask; - break; + /*@innerbreak@*/ break; case FILE_OPADD: p->h += m->mask; - break; + /*@innerbreak@*/ break; case FILE_OPMINUS: p->h -= m->mask; - break; + /*@innerbreak@*/ break; case FILE_OPMULTIPLY: p->h *= m->mask; - break; + /*@innerbreak@*/ break; case FILE_OPDIVIDE: p->h /= m->mask; - break; + /*@innerbreak@*/ break; case FILE_OPMODULO: p->h %= m->mask; - break; + /*@innerbreak@*/ break; } if (m->mask_op & FILE_OPINVERSE) p->h = ~p->h; @@ -505,28 +505,28 @@ mconvert(struct magic_set *ms, union VALUETYPE *p, struct magic *m) switch (m->mask_op&0x7F) { case FILE_OPAND: p->l &= m->mask; - break; + /*@innerbreak@*/ break; case FILE_OPOR: p->l |= m->mask; - break; + /*@innerbreak@*/ break; case FILE_OPXOR: p->l ^= m->mask; - break; + /*@innerbreak@*/ break; case FILE_OPADD: p->l += m->mask; - break; + /*@innerbreak@*/ break; case FILE_OPMINUS: p->l -= m->mask; - break; + /*@innerbreak@*/ break; case FILE_OPMULTIPLY: p->l *= m->mask; - break; + /*@innerbreak@*/ break; case FILE_OPDIVIDE: p->l /= m->mask; - break; + /*@innerbreak@*/ break; case FILE_OPMODULO: p->l %= m->mask; - break; + /*@innerbreak@*/ break; } if (m->mask_op & FILE_OPINVERSE) p->l = ~p->l; @@ -537,28 +537,28 @@ mconvert(struct magic_set *ms, union VALUETYPE *p, struct magic *m) switch (m->mask_op&0x7F) { case FILE_OPAND: p->h &= m->mask; - break; + /*@innerbreak@*/ break; case FILE_OPOR: p->h |= m->mask; - break; + /*@innerbreak@*/ break; case FILE_OPXOR: p->h ^= m->mask; - break; + /*@innerbreak@*/ break; case FILE_OPADD: p->h += m->mask; - break; + /*@innerbreak@*/ break; case FILE_OPMINUS: p->h -= m->mask; - break; + /*@innerbreak@*/ break; case FILE_OPMULTIPLY: p->h *= m->mask; - break; + /*@innerbreak@*/ break; case FILE_OPDIVIDE: p->h /= m->mask; - break; + /*@innerbreak@*/ break; case FILE_OPMODULO: p->h %= m->mask; - break; + /*@innerbreak@*/ break; } if (m->mask_op & FILE_OPINVERSE) p->h = ~p->h; @@ -572,28 +572,28 @@ mconvert(struct magic_set *ms, union VALUETYPE *p, struct magic *m) switch (m->mask_op&0x7F) { case FILE_OPAND: p->l &= m->mask; - break; + /*@innerbreak@*/ break; case FILE_OPOR: p->l |= m->mask; - break; + /*@innerbreak@*/ break; case FILE_OPXOR: p->l ^= m->mask; - break; + /*@innerbreak@*/ break; case FILE_OPADD: p->l += m->mask; - break; + /*@innerbreak@*/ break; case FILE_OPMINUS: p->l -= m->mask; - break; + /*@innerbreak@*/ break; case FILE_OPMULTIPLY: p->l *= m->mask; - break; + /*@innerbreak@*/ break; case FILE_OPDIVIDE: p->l /= m->mask; - break; + /*@innerbreak@*/ break; case FILE_OPMODULO: p->l %= m->mask; - break; + /*@innerbreak@*/ break; } if (m->mask_op & FILE_OPINVERSE) p->l = ~p->l; @@ -735,28 +735,28 @@ mget(struct magic_set *ms, union VALUETYPE *p, const unsigned char *s, switch (m->in_op&0x7F) { case FILE_OPAND: offset = p->b & m->in_offset; - break; + /*@innerbreak@*/ break; case FILE_OPOR: offset = p->b | m->in_offset; - break; + /*@innerbreak@*/ break; case FILE_OPXOR: offset = p->b ^ m->in_offset; - break; + /*@innerbreak@*/ break; case FILE_OPADD: offset = p->b + m->in_offset; - break; + /*@innerbreak@*/ break; case FILE_OPMINUS: offset = p->b - m->in_offset; - break; + /*@innerbreak@*/ break; case FILE_OPMULTIPLY: offset = p->b * m->in_offset; - break; + /*@innerbreak@*/ break; case FILE_OPDIVIDE: offset = p->b / m->in_offset; - break; + /*@innerbreak@*/ break; case FILE_OPMODULO: offset = p->b % m->in_offset; - break; + /*@innerbreak@*/ break; } } else offset = p->b; @@ -770,42 +770,42 @@ mget(struct magic_set *ms, union VALUETYPE *p, const unsigned char *s, offset = (short)((p->hs[0]<<8)| (p->hs[1])) & m->in_offset; - break; + /*@innerbreak@*/ break; case FILE_OPOR: offset = (short)((p->hs[0]<<8)| (p->hs[1])) | m->in_offset; - break; + /*@innerbreak@*/ break; case FILE_OPXOR: offset = (short)((p->hs[0]<<8)| (p->hs[1])) ^ m->in_offset; - break; + /*@innerbreak@*/ break; case FILE_OPADD: offset = (short)((p->hs[0]<<8)| (p->hs[1])) + m->in_offset; - break; + /*@innerbreak@*/ break; case FILE_OPMINUS: offset = (short)((p->hs[0]<<8)| (p->hs[1])) - m->in_offset; - break; + /*@innerbreak@*/ break; case FILE_OPMULTIPLY: offset = (short)((p->hs[0]<<8)| (p->hs[1])) * m->in_offset; - break; + /*@innerbreak@*/ break; case FILE_OPDIVIDE: offset = (short)((p->hs[0]<<8)| (p->hs[1])) / m->in_offset; - break; + /*@innerbreak@*/ break; case FILE_OPMODULO: offset = (short)((p->hs[0]<<8)| (p->hs[1])) % m->in_offset; - break; + /*@innerbreak@*/ break; } } else offset = (short)((p->hs[0]<<8)| @@ -820,42 +820,42 @@ mget(struct magic_set *ms, union VALUETYPE *p, const unsigned char *s, offset = (short)((p->hs[1]<<8)| (p->hs[0])) & m->in_offset; - break; + /*@innerbreak@*/ break; case FILE_OPOR: offset = (short)((p->hs[1]<<8)| (p->hs[0])) | m->in_offset; - break; + /*@innerbreak@*/ break; case FILE_OPXOR: offset = (short)((p->hs[1]<<8)| (p->hs[0])) ^ m->in_offset; - break; + /*@innerbreak@*/ break; case FILE_OPADD: offset = (short)((p->hs[1]<<8)| (p->hs[0])) + m->in_offset; - break; + /*@innerbreak@*/ break; case FILE_OPMINUS: offset = (short)((p->hs[1]<<8)| (p->hs[0])) - m->in_offset; - break; + /*@innerbreak@*/ break; case FILE_OPMULTIPLY: offset = (short)((p->hs[1]<<8)| (p->hs[0])) * m->in_offset; - break; + /*@innerbreak@*/ break; case FILE_OPDIVIDE: offset = (short)((p->hs[1]<<8)| (p->hs[0])) / m->in_offset; - break; + /*@innerbreak@*/ break; case FILE_OPMODULO: offset = (short)((p->hs[1]<<8)| (p->hs[0])) % m->in_offset; - break; + /*@innerbreak@*/ break; } } else offset = (short)((p->hs[1]<<8)| @@ -868,28 +868,28 @@ mget(struct magic_set *ms, union VALUETYPE *p, const unsigned char *s, switch (m->in_op & 0x7F) { case FILE_OPAND: offset = p->h & m->in_offset; - break; + /*@innerbreak@*/ break; case FILE_OPOR: offset = p->h | m->in_offset; - break; + /*@innerbreak@*/ break; case FILE_OPXOR: offset = p->h ^ m->in_offset; - break; + /*@innerbreak@*/ break; case FILE_OPADD: offset = p->h + m->in_offset; - break; + /*@innerbreak@*/ break; case FILE_OPMINUS: offset = p->h - m->in_offset; - break; + /*@innerbreak@*/ break; case FILE_OPMULTIPLY: offset = p->h * m->in_offset; - break; + /*@innerbreak@*/ break; case FILE_OPDIVIDE: offset = p->h / m->in_offset; - break; + /*@innerbreak@*/ break; case FILE_OPMODULO: offset = p->h % m->in_offset; - break; + /*@innerbreak@*/ break; } } else @@ -906,56 +906,56 @@ mget(struct magic_set *ms, union VALUETYPE *p, const unsigned char *s, (p->hl[2]<<8)| (p->hl[3])) & m->in_offset; - break; + /*@innerbreak@*/ break; case FILE_OPOR: offset = (int32_t)((p->hl[0]<<24)| (p->hl[1]<<16)| (p->hl[2]<<8)| (p->hl[3])) | m->in_offset; - break; + /*@innerbreak@*/ break; case FILE_OPXOR: offset = (int32_t)((p->hl[0]<<24)| (p->hl[1]<<16)| (p->hl[2]<<8)| (p->hl[3])) ^ m->in_offset; - break; + /*@innerbreak@*/ break; case FILE_OPADD: offset = (int32_t)((p->hl[0]<<24)| (p->hl[1]<<16)| (p->hl[2]<<8)| (p->hl[3])) + m->in_offset; - break; + /*@innerbreak@*/ break; case FILE_OPMINUS: offset = (int32_t)((p->hl[0]<<24)| (p->hl[1]<<16)| (p->hl[2]<<8)| (p->hl[3])) - m->in_offset; - break; + /*@innerbreak@*/ break; case FILE_OPMULTIPLY: offset = (int32_t)((p->hl[0]<<24)| (p->hl[1]<<16)| (p->hl[2]<<8)| (p->hl[3])) * m->in_offset; - break; + /*@innerbreak@*/ break; case FILE_OPDIVIDE: offset = (int32_t)((p->hl[0]<<24)| (p->hl[1]<<16)| (p->hl[2]<<8)| (p->hl[3])) / m->in_offset; - break; + /*@innerbreak@*/ break; case FILE_OPMODULO: offset = (int32_t)((p->hl[0]<<24)| (p->hl[1]<<16)| (p->hl[2]<<8)| (p->hl[3])) % m->in_offset; - break; + /*@innerbreak@*/ break; } } else offset = (int32_t)((p->hl[0]<<24)| @@ -974,56 +974,56 @@ mget(struct magic_set *ms, union VALUETYPE *p, const unsigned char *s, (p->hl[1]<<8)| (p->hl[0])) & m->in_offset; - break; + /*@innerbreak@*/ break; case FILE_OPOR: offset = (int32_t)((p->hl[3]<<24)| (p->hl[2]<<16)| (p->hl[1]<<8)| (p->hl[0])) | m->in_offset; - break; + /*@innerbreak@*/ break; case FILE_OPXOR: offset = (int32_t)((p->hl[3]<<24)| (p->hl[2]<<16)| (p->hl[1]<<8)| (p->hl[0])) ^ m->in_offset; - break; + /*@innerbreak@*/ break; case FILE_OPADD: offset = (int32_t)((p->hl[3]<<24)| (p->hl[2]<<16)| (p->hl[1]<<8)| (p->hl[0])) + m->in_offset; - break; + /*@innerbreak@*/ break; case FILE_OPMINUS: offset = (int32_t)((p->hl[3]<<24)| (p->hl[2]<<16)| (p->hl[1]<<8)| (p->hl[0])) - m->in_offset; - break; + /*@innerbreak@*/ break; case FILE_OPMULTIPLY: offset = (int32_t)((p->hl[3]<<24)| (p->hl[2]<<16)| (p->hl[1]<<8)| (p->hl[0])) * m->in_offset; - break; + /*@innerbreak@*/ break; case FILE_OPDIVIDE: offset = (int32_t)((p->hl[3]<<24)| (p->hl[2]<<16)| (p->hl[1]<<8)| (p->hl[0])) / m->in_offset; - break; + /*@innerbreak@*/ break; case FILE_OPMODULO: offset = (int32_t)((p->hl[3]<<24)| (p->hl[2]<<16)| (p->hl[1]<<8)| (p->hl[0])) % m->in_offset; - break; + /*@innerbreak@*/ break; } } else offset = (int32_t)((p->hl[3]<<24)| @@ -1038,28 +1038,28 @@ mget(struct magic_set *ms, union VALUETYPE *p, const unsigned char *s, switch (m->in_op & 0x7F) { case FILE_OPAND: offset = p->l & m->in_offset; - break; + /*@innerbreak@*/ break; case FILE_OPOR: offset = p->l | m->in_offset; - break; + /*@innerbreak@*/ break; case FILE_OPXOR: offset = p->l ^ m->in_offset; - break; + /*@innerbreak@*/ break; case FILE_OPADD: offset = p->l + m->in_offset; - break; + /*@innerbreak@*/ break; case FILE_OPMINUS: offset = p->l - m->in_offset; - break; + /*@innerbreak@*/ break; case FILE_OPMULTIPLY: offset = p->l * m->in_offset; - break; + /*@innerbreak@*/ break; case FILE_OPDIVIDE: offset = p->l / m->in_offset; - break; + /*@innerbreak@*/ break; case FILE_OPMODULO: offset = p->l % m->in_offset; - break; + /*@innerbreak@*/ break; /* case TOOMANYSWITCHBLOCKS: * ugh = p->eye % m->strain; * rub; @@ -1143,13 +1143,13 @@ mcheck(struct magic_set *ms, union VALUETYPE *p, struct magic *m) if (0L == m->mask) { /* normal string: do it fast */ while (--len >= 0) if ((v = *b++ - *a++) != '\0') - break; + /*@loopbreak@*/ break; } else { /* combine the others */ while (--len >= 0) { if ((m->mask & STRING_IGNORE_LOWERCASE) && islower(*a)) { if ((v = tolower(*b++) - *a++) != '\0') - break; + /*@loopbreak@*/ break; } else if ((m->mask & STRING_COMPACT_BLANK) && isspace(*a)) { a++; @@ -1158,7 +1158,7 @@ mcheck(struct magic_set *ms, union VALUETYPE *p, struct magic *m) b++; } else { v = 1; - break; + /*@loopbreak@*/ break; } } else if (isspace(*a) && (m->mask & STRING_COMPACT_OPTIONAL_BLANK)) { @@ -1167,7 +1167,7 @@ mcheck(struct magic_set *ms, union VALUETYPE *p, struct magic *m) b++; } else { if ((v = *b++ - *a++) != '\0') - break; + /*@loopbreak@*/ break; } } } |