Lines Matching refs:CAST
63 #define EATAB {while (isascii(CAST(unsigned char, *l)) && \
64 isspace(CAST(unsigned char, *l))) ++l;}
65 #define LOWCASE(l) (isupper(CAST(unsigned char, l)) ? \
66 tolower(CAST(unsigned char, l)) : (l))
85 #define ALLOC_CHUNK CAST(size_t, 10)
86 #define ALLOC_INCR CAST(size_t, 200)
335 return CAST(off_t, INT_MAX); in maxoff_t()
337 return CAST(off_t, LONG_MAX); in maxoff_t()
346 if (isalpha(CAST(unsigned char, l[1]))) { in get_standard_integer_type()
381 } else if (isdigit(CAST(unsigned char, l[1]))) { in get_standard_integer_type()
392 if (isdigit(CAST(unsigned char, l[2]))) { in get_standard_integer_type()
450 if ((ml = CAST(struct mlist *, emalloc(sizeof(*ml)))) == NULL) in add_mlist()
478 CAST(unsigned long, sizeof(*map->magic[0])), in apprentice_1()
479 CAST(unsigned long, FILE_MAGICSIZE)); in apprentice_1()
556 if ((ms = CAST(struct magic_set *, ecalloc(CAST(size_t, 1u), in file_ms_alloc()
569 if ((ms->c.li = CAST(struct level_info *, emalloc(len))) == NULL) in file_ms_alloc()
620 if ((mlist = CAST(struct mlist *, ecalloc(1, sizeof(*mlist)))) == NULL) { in mlist_alloc()
642 apprentice_unmap(CAST(struct magic_map *, ml->map)); in mlist_free_one()
1080 const struct magic_entry *ma = CAST(const struct magic_entry *, a); in apprentice_sort()
1081 const struct magic_entry *mb = CAST(const struct magic_entry *, b); in apprentice_sort()
1209 if (file_looks_utf8(m->value.us, CAST(size_t, m->vallen), NULL, in set_test_type()
1235 if ((mp = CAST(struct magic_entry *, in addentry()
1244 mset[i].max = CAST(uint32_t, incr); in addentry()
1297 if (CAST(size_t, len - 2) > bang[i].len && in load_1()
1377 isspace(CAST(unsigned char, p[-1]))) && in set_text_binary()
1380 isspace(CAST(unsigned char, p[len]))))) in set_text_binary()
1426 if ((*ma = CAST(struct magic *, emalloc(slen))) == NULL) { in coalesce_entries()
1470 if ((map = CAST(struct magic_map *, ecalloc(1, sizeof(*map)))) == NULL) in apprentice_load()
1508 if ((filearr = CAST(char **, in apprentice_load()
1587 v = CAST(signed char, v); in file_signextend()
1592 v = CAST(short, v); in file_signextend()
1615 v = CAST(int32_t, v); in file_signextend()
1635 v = CAST(int64_t, v); in file_signextend()
1764 isspace(CAST(unsigned char, l[p->len]))) { in get_cond()
1822 while (!isspace(CAST(unsigned char, *++l))) in parse_indirect_modifier()
1848 val = CAST(uint64_t, strtoull(l, &t, 0)); in parse_op_modifier()
1862 while (!isspace(CAST(unsigned char, *++l))) { in parse_string_modifier()
1871 m->str_range = CAST(uint32_t, strtoul(l, &t, 0)); in parse_string_modifier()
1947 if (l[1] == '/' && !isspace(CAST(unsigned char, l[2]))) in parse_string_modifier()
2002 diff = CAST(int32_t, cont_level) - CAST(int32_t, m->cont_level); in parse()
2010 if ((nm = CAST(struct magic *, erealloc(me->mp, in parse()
2016 me->max_count = CAST(uint32_t, cnt); in parse()
2025 if ((m = CAST(struct magic *, emalloc(len))) == NULL) { in parse()
2036 m->lineno = CAST(uint32_t, lineno); in parse()
2065 m->offset = CAST(int32_t, strtol(l, &t, 0)); in parse()
2156 if (isdigit(CAST(unsigned char, *l)) || *l == '-') { in parse()
2157 m->in_offset = CAST(int32_t, strtol(l, &t, 0)); in parse()
2221 && !isalpha(CAST(unsigned char, l[1]))) { in parse()
2318 if (*l == 'x' && ((isascii(CAST(unsigned char, l[1])) && in parse()
2319 isspace(CAST(unsigned char, l[1]))) || !l[1])) { in parse()
2418 if (*el && !isspace(CAST(unsigned char, *el))) { in parse_strength()
2422 m->factor = CAST(uint8_t, factor); in parse_strength()
2448 char *buf = CAST(char *, CAST(void *, m)) + off; in parse_extra()
2453 "`%.*s', new type `%s'", name, CAST(int, len), buf, l); in parse_extra()
2475 if (!isspace(CAST(unsigned char, *l)) && !goodchar(*l, extra)) in parse_extra()
2498 CAST(off_t, offsetof(struct magic, apple)), in parse_apple()
2510 CAST(off_t, offsetof(struct magic, ext)), in parse_ext()
2523 CAST(off_t, offsetof(struct magic, mimetype)), in parse_mime()
2571 for (len = cnt = 0; isdigit(CAST(unsigned char, *ptr)); ptr++, cnt++) \ in check_format_type()
2689 while (isdigit(CAST(unsigned char, *ptr))) in check_format_type()
2693 while (isdigit(CAST(unsigned char , *ptr))) in check_format_type()
2850 ull = CAST(uint64_t, strtoull(*p, &ep, 0)); in getvalue()
2864 for (q = *p; isspace(CAST(unsigned char, *q)); q++) in getvalue()
2867 ull = -CAST(int64_t, ull); in getvalue()
2870 x = CAST(uint64_t, ull & ~0xffULL); in getvalue()
2873 x = CAST(uint64_t, ull & ~0xffffULL); in getvalue()
2876 x = CAST(uint64_t, ull & ~0xffffffffULL); in getvalue()
2918 if (isspace(CAST(unsigned char, c))) in getstr()
2931 *p++ = CAST(char, c); in getstr()
2958 if (isprint(CAST(unsigned char, c))) { in getstr()
2996 *p++ = CAST(char, c); in getstr()
3048 *p++ = CAST(char, val); in getstr()
3064 *p++ = CAST(char, val); in getstr()
3071 m->vallen = CAST(unsigned char, (p - origp)); in getstr()
3076 m->vallen += CAST(unsigned char, l); in getstr()
3086 if (!isascii(CAST(unsigned char, c))) in hextoint()
3088 if (isdigit(CAST(unsigned char, c))) in hextoint()
3202 if ((map = CAST(struct magic_map *, ecalloc(1, sizeof(*map)))) == NULL) { in apprentice_map()
3245 map->len = CAST(size_t, st.sb.st_size); in apprentice_map()
3246 map->p = CAST(void *, emalloc(map->len)); in apprentice_map()
3295 map->magic[0] = CAST(struct magic *, map->p) + 1; in apprentice_map()
3418 spprintf(&buf, MAXPATHLEN, "%.*s.mime%s", CAST(int, q - fn), fn, ext);
3429 spprintf(&buf, MAXPATHLEN, "%.*s%s", CAST(int, q - fn), fn, ext);
3548 m->offset = swap4(CAST(uint32_t, m->offset));
3549 m->in_offset = swap4(CAST(uint32_t, m->in_offset));
3550 m->lineno = swap4(CAST(uint32_t, m->lineno));