Lines Matching refs:CAST

51  #define	EATAB {while (isascii(CAST(unsigned char, *l)) && \
118 - if ((ml = CAST(struct mlist *, malloc(sizeof(*ml)))) == NULL)
119 + if ((ml = CAST(struct mlist *, emalloc(sizeof(*ml)))) == NULL)
148 - if ((ms = CAST(struct magic_set *, calloc(CAST(size_t, 1u),
149 + if ((ms = CAST(struct magic_set *, ecalloc(CAST(size_t, 1u),
157 - if ((ms->c.li = CAST(struct level_info *, malloc(len))) == NULL)
158 + if ((ms->c.li = CAST(struct level_info *, emalloc(len))) == NULL)
185 - if (CAST(char *, b) >= CAST(char *, p) &&
186 - CAST(char *, b) <= CAST(char *, p) + map->len)
219 - if ((mlist = CAST(struct mlist *, calloc(1, sizeof(*mlist)))) == NULL) {
220 + if ((mlist = CAST(struct mlist *, ecalloc(1, sizeof(*mlist)))) == NULL) {
227 apprentice_unmap(CAST(struct magic_map *, ml->map));
336 if ((mp = CAST(struct magic_entry *,
391 - if ((*ma = CAST(struct magic *, malloc(slen))) == NULL) {
392 + if ((*ma = CAST(struct magic *, emalloc(slen))) == NULL) {
427 - if ((map = CAST(struct magic_map *, calloc(1, sizeof(*map)))) == NULL)
428 + if ((map = CAST(struct magic_map *, ecalloc(1, sizeof(*map)))) == NULL)
473 - if ((nfilearr = CAST(char **,
475 + if ((filearr = CAST(char **,
516 - if ((nm = CAST(struct magic *, realloc(me->mp,
517 + if ((nm = CAST(struct magic *, erealloc(me->mp,
525 - if ((m = CAST(struct magic *, malloc(len))) == NULL) {
526 + if ((m = CAST(struct magic *, emalloc(len))) == NULL) {
605 - if ((map = CAST(struct magic_map *, calloc(1, sizeof(*map)))) == NULL) {
641 - if ((map = CAST(struct magic_map *, calloc(1, sizeof(*map)))) == NULL) {
642 + if ((map = CAST(struct magic_map *, ecalloc(1, sizeof(*map)))) == NULL) {
690 - map->len = CAST(size_t, st.st_size);
693 - if ((map->p = mmap(0, CAST(size_t, st.st_size), PROT_READ|PROT_WRITE,
694 - MAP_PRIVATE|MAP_FILE, fd, CAST(off_t, 0))) == MAP_FAILED) {
700 - if ((map->p = CAST(void *, malloc(map->len))) == NULL) {
711 + map->len = CAST(size_t, st.sb.st_size);
712 + map->p = CAST(void *, emalloc(map->len));
718 - if (mprotect(map->p, CAST(size_t, st.st_size), PROT_READ) == -1) {
747 - ptr = CAST(uint32_t *, map->p);
770 - entries = CAST(uint32_t, map->len / sizeof(struct magic));
795 map->magic[0] = CAST(struct magic *, map->p) + 1;
862 - if (write(fd, &hdr, sizeof(hdr)) != CAST(ssize_t, sizeof(hdr))) {
871 - if (write(fd, map->magic[i], len) != CAST(ssize_t, len)) {
897 - if (asprintf(&buf, "%.*s.mime%s", CAST(int, q - fn), fn, ext)
901 + spprintf(&buf, MAXPATHLEN, "%.*s.mime%s", CAST(int, q - fn), fn, ext);
913 - if (asprintf(&buf, "%.*s%s", CAST(int, q - fn), fn, ext) < 0)
915 + spprintf(&buf, MAXPATHLEN, "%.*s%s", CAST(int, q - fn), fn, ext);
920 m->offset = swap4(CAST(uint32_t, m->offset));
921 m->in_offset = swap4(CAST(uint32_t, m->in_offset));
922 m->lineno = swap4(CAST(uint32_t, m->lineno));
944 - if ((utf8_buf = CAST(unsigned char *, malloc(mlen))) == NULL) {
945 + if ((utf8_buf = CAST(unsigned char *, emalloc(mlen))) == NULL) {
999 b->elen = CAST(size_t, b->st.st_size) < b->flen ?
1000 CAST(size_t, b->st.st_size) : b->flen;
1037 CDF_TOLE8(CAST(uint64_t, x))))
1108 size_t siz = CAST(size_t, off + len);
1110 - if (CAST(off_t, off + len) != CAST(off_t, siz))
1111 + if (CAST(zend_off_t, off + len) != CAST(zend_off_t, siz))
1119 - if (pread(info->i_fd, buf, len, off) != CAST(ssize_t, len))
1126 return CAST(ssize_t, len);
1131 - if (cdf_read(info, CAST(off_t, 0), buf, sizeof(buf)) == -1)
1132 + if (cdf_read(info, CAST(zend_off_t, 0), buf, sizeof(buf)) == -1)
1157 if ((buf = CAST(char *, CDF_MALLOC(ss))) == NULL) {
1407 - if (lseek(fd, CAST(off_t, 0), SEEK_SET) == CAST(off_t, -1)) {
1423 - if ((*newch = CAST(unsigned char *, malloc(bytes_max + 1))) == NULL)
1424 + if ((*newch = CAST(unsigned char *, emalloc(bytes_max + 1))) == NULL)
1453 - CAST(off_t, elf_getu(swap, elfhdr.e_phoff)), phnum,
1454 + CAST(zend_off_t, elf_getu(swap, elfhdr.e_phoff)), phnum,
1455 CAST(size_t, elf_getu16(swap, elfhdr.e_phentsize)),
1462 - CAST(off_t, elf_getu(swap, elfhdr.e_phoff)), phnum,
1463 + CAST(zend_off_t, elf_getu(swap, elfhdr.e_phoff)), phnum,
1464 CAST(size_t, elf_getu16(swap, elfhdr.e_phentsize)),
1471 - CAST(off_t, elf_getu(swap, elfhdr.e_shoff)), shnum,
1472 + CAST(zend_off_t, elf_getu(swap, elfhdr.e_shoff)), shnum,
1473 CAST(size_t, elf_getu16(swap, elfhdr.e_shentsize)),
1475 CAST(int, elf_getu16(swap, elfhdr.e_shstrndx)),
1483 - *ubuf = CAST(file_unichar_t *, calloc(CAST(size_t, 1), mlen));
1484 + *ubuf = CAST(file_unichar_t *, ecalloc(CAST(size_t, 1), mlen));
1490 if ((nbuf = CAST(unsigned char *,
1491 - calloc(CAST(size_t, 1), mlen))) == NULL) {
1492 + ecalloc(CAST(size_t, 1), mlen))) == NULL) {
2219 - if ((pbuf = CAST(char *, realloc(ms->o.pbuf, psize))) == NULL) {
2220 + if ((pbuf = CAST(char *, erealloc(ms->o.pbuf, psize))) == NULL) {
2227 ms->c.li = CAST(struct level_info *, (ms->c.li == NULL) ?
2350 - if ((pb = (CAST(file_pushbuf_t *, malloc(sizeof(*pb))))) == NULL)
2351 + if ((pb = (CAST(file_pushbuf_t *, emalloc(sizeof(*pb))))) == NULL)
2724 - off_t pos = CAST(off_t, -1);
2733 - if ((buf = CAST(unsigned char *, malloc(ms->bytes_max + SLOP))) == NULL)
2734 + if ((buf = CAST(unsigned char *, emalloc(ms->bytes_max + SLOP))) == NULL)
2790 - pos = lseek(fd, CAST(off_t, 0), SEEK_CUR);
2809 - CAST(size_t, ms->bytes_max - nbytes), 1)) > 0) {
2844 - if (file_buffer(ms, fd, okstat ? &sb : NULL, inname, buf, CAST(size_t, nbytes)) == -1)
2845 + if (file_buffer(ms, stream, &sb, inname, buf, CAST(size_t, nbytes)) == -1)
2851 - if (pos != CAST(off_t, -1))
2913 - CAST(unsigned long, ms->line));
3254 - ms->c.li = CAST(struct level_info *, malloc(len));
3259 + ms->c.li = CAST(struct level_info *, emalloc(len));
3388 - v = CAST(uint64_t, -1);
3404 - copy = CAST(char *, malloc(slen));
3471 - ms->search.s += CAST(int, pmatch.rm_so);
3472 - ms->search.offset += CAST(size_t, pmatch.rm_so);
3473 - ms->search.rm_len = CAST(size_t,
3484 - v = CAST(uint64_t, -1);
3491 - if (v == CAST(uint64_t, -1))