Lines Matching refs:CAST

55 #define	EATAB {while (isascii(CAST(unsigned char, *l)) && \
56 isspace(CAST(unsigned char, *l))) ++l;}
57 #define LOWCASE(l) (isupper(CAST(unsigned char, l)) ? \
58 tolower(CAST(unsigned char, l)) : (l))
77 #define ALLOC_CHUNK CAST(size_t, 10)
78 #define ALLOC_INCR CAST(size_t, 200)
307 return CAST(off_t, INT_MAX); in maxoff_t()
309 return CAST(off_t, LONG_MAX); in maxoff_t()
318 if (isalpha(CAST(unsigned char, l[1]))) { in get_standard_integer_type()
353 } else if (isdigit(CAST(unsigned char, l[1]))) { in get_standard_integer_type()
364 if (isdigit(CAST(unsigned char, l[2]))) { in get_standard_integer_type()
422 if ((ml = CAST(struct mlist *, malloc(sizeof(*ml)))) == NULL) in add_mlist()
450 CAST(unsigned long, sizeof(*map->magic[0])), in apprentice_1()
451 CAST(unsigned long, FILE_MAGICSIZE)); in apprentice_1()
519 if ((ms = CAST(struct magic_set *, calloc(CAST(size_t, 1u), in file_ms_alloc()
532 if ((ms->c.li = CAST(struct level_info *, malloc(len))) == NULL) in file_ms_alloc()
567 p = CAST(char *, map->p); in apprentice_unmap()
592 if ((mlist = CAST(struct mlist *, calloc(1, sizeof(*mlist)))) == NULL) { in mlist_alloc()
614 apprentice_unmap(CAST(struct magic_map *, ml->map)); in mlist_free_one()
1026 const struct magic_entry *ma = CAST(const struct magic_entry *, a); in apprentice_sort()
1027 const struct magic_entry *mb = CAST(const struct magic_entry *, b); in apprentice_sort()
1143 if (file_looks_utf8(m->value.us, CAST(size_t, m->vallen), NULL, in set_test_type()
1169 if ((mp = CAST(struct magic_entry *, in addentry()
1224 if (CAST(size_t, len - 2) > bang[i].len && in load_1()
1304 isspace(CAST(unsigned char, p[-1]))) && in set_text_binary()
1307 isspace(CAST(unsigned char, p[len]))))) in set_text_binary()
1353 if ((*ma = CAST(struct magic *, malloc(slen))) == NULL) { in coalesce_entries()
1396 if ((map = CAST(struct magic_map *, calloc(1, sizeof(*map)))) == NULL) in apprentice_load()
1433 if ((nfilearr = CAST(char **, in apprentice_load()
1516 v = CAST(signed char, v); in file_signextend()
1521 v = CAST(short, v); in file_signextend()
1538 v = CAST(int32_t, v); in file_signextend()
1558 v = CAST(int64_t, v); in file_signextend()
1686 isspace(CAST(unsigned char, l[p->len]))) { in get_cond()
1744 while (!isspace(CAST(unsigned char, *++l))) in parse_indirect_modifier()
1770 val = CAST(uint64_t, strtoull(l, &t, 0)); in parse_op_modifier()
1784 while (!isspace(CAST(unsigned char, *++l))) { in parse_string_modifier()
1793 m->str_range = CAST(uint32_t, strtoul(l, &t, 0)); in parse_string_modifier()
1869 if (l[1] == '/' && !isspace(CAST(unsigned char, l[2]))) in parse_string_modifier()
1924 diff = CAST(int32_t, cont_level) - CAST(int32_t, m->cont_level); in parse()
1932 if ((nm = CAST(struct magic *, realloc(me->mp, in parse()
1938 me->max_count = CAST(uint32_t, cnt); in parse()
1947 if ((m = CAST(struct magic *, malloc(len))) == NULL) { in parse()
1958 m->lineno = CAST(uint32_t, lineno); in parse()
1987 m->offset = CAST(int32_t, strtol(l, &t, 0)); in parse()
2075 if (isdigit(CAST(unsigned char, *l)) || *l == '-') { in parse()
2076 m->in_offset = CAST(int32_t, strtol(l, &t, 0)); in parse()
2140 && !isalpha(CAST(unsigned char, l[1]))) { in parse()
2237 if (*l == 'x' && ((isascii(CAST(unsigned char, l[1])) && in parse()
2238 isspace(CAST(unsigned char, l[1]))) || !l[1])) { in parse()
2336 if (*el && !isspace(CAST(unsigned char, *el))) { in parse_strength()
2340 m->factor = CAST(uint8_t, factor); in parse_strength()
2367 char *buf = CAST(char *, CAST(void *, m)) + off; in parse_extra()
2372 "`%.*s', new type `%s'", name, CAST(int, len), buf, l); in parse_extra()
2394 if (!isspace(CAST(unsigned char, *l)) && !goodchar(*l, extra)) in parse_extra()
2419 CAST(off_t, offsetof(struct magic, apple)), in parse_apple()
2433 CAST(off_t, offsetof(struct magic, ext)), in parse_ext()
2448 CAST(off_t, offsetof(struct magic, mimetype)), in parse_mime()
2495 for (len = cnt = 0; isdigit(CAST(unsigned char, *ptr)); ptr++, cnt++) \ in check_format_type()
2613 while (isdigit(CAST(unsigned char, *ptr))) in check_format_type()
2617 while (isdigit(CAST(unsigned char , *ptr))) in check_format_type()
2767 ull = CAST(uint64_t, strtoull(*p, &ep, 0)); in getvalue()
2781 for (q = *p; isspace(CAST(unsigned char, *q)); q++) in getvalue()
2784 ull = -CAST(int64_t, ull); in getvalue()
2787 x = CAST(uint64_t, ull & ~0xffULL); in getvalue()
2790 x = CAST(uint64_t, ull & ~0xffffULL); in getvalue()
2793 x = CAST(uint64_t, ull & ~0xffffffffULL); in getvalue()
2833 if (isspace(CAST(unsigned char, c))) in getstr()
2857 if (isprint(CAST(unsigned char, c))) { in getstr()
2895 *p++ = CAST(char, c); in getstr()
2947 *p++ = CAST(char, val); in getstr()
2963 *p++ = CAST(char, val); in getstr()
2967 *p++ = CAST(char, c); in getstr()
2972 m->vallen = CAST(unsigned char, (p - origp)); in getstr()
2977 m->vallen += CAST(unsigned char, l); in getstr()
2987 if (!isascii(CAST(unsigned char, c))) in hextoint()
2989 if (isdigit(CAST(unsigned char, c))) in hextoint()
3093 if ((map = CAST(struct magic_map *, calloc(1, sizeof(*map)))) == NULL) { in apprentice_buf()
3121 if ((map = CAST(struct magic_map *, calloc(1, sizeof(*map)))) == NULL) { in apprentice_map()
3144 map->len = CAST(size_t, st.st_size); in apprentice_map()
3147 if ((map->p = mmap(0, CAST(size_t, st.st_size), PROT_READ|PROT_WRITE, in apprentice_map()
3148 MAP_PRIVATE|MAP_FILE, fd, CAST(off_t, 0))) == MAP_FAILED) { in apprentice_map()
3154 if ((map->p = CAST(void *, malloc(map->len))) == NULL) { in apprentice_map()
3170 if (mprotect(map->p, CAST(size_t, st.st_size), PROT_READ) == -1) { in apprentice_map()
3195 ptr = CAST(uint32_t *, map->p); in check_buffer()
3214 entries = CAST(uint32_t, map->len / sizeof(struct magic)); in check_buffer()
3221 map->magic[0] = CAST(struct magic *, map->p) + 1; in check_buffer()
3276 if (write(fd, &hdr, sizeof(hdr)) != CAST(ssize_t, sizeof(hdr))) { in apprentice_compile()
3283 if (write(fd, map->magic[i], len) != CAST(ssize_t, len)) { in apprentice_compile()
3329 if (asprintf(&buf, "%.*s.mime%s", CAST(int, q - fn), fn, ext) in mkdbname()
3338 if (asprintf(&buf, "%.*s%s", CAST(int, q - fn), fn, ext) < 0) in mkdbname()
3456 m->offset = swap4(CAST(uint32_t, m->offset)); in bs1()
3457 m->in_offset = swap4(CAST(uint32_t, m->in_offset)); in bs1()
3458 m->lineno = swap4(CAST(uint32_t, m->lineno)); in bs1()