Lines Matching refs:CAST
65 #define SIZE_T_MAX CAST(size_t, ~0ULL)
81 #define NEED_SWAP (cdf_bo.u == CAST(uint32_t, 0x01020304))
84 (CAST(uint64_t, NEED_SWAP ? _cdf_tole8(x) : CAST(uint64_t, x)))
86 (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
88 (CAST(uint16_t, NEED_SWAP ? _cdf_tole2(x) : CAST(uint16_t, x)))
90 CDF_TOLE2(CAST(uint16_t, x)) : \
92 CDF_TOLE4(CAST(uint32_t, x)) : \
93 CDF_TOLE8(CAST(uint64_t, x))))
213 CDF_TOLE4(CAST(uint32_t, h->h_secid_first_sector_in_short_sat)); in cdf_swap_header()
217 CDF_TOLE4(CAST(uint32_t, h->h_secid_first_sector_in_master_sat)); in cdf_swap_header()
222 CDF_TOLE4(CAST(uint32_t, h->h_master_sat[i])); in cdf_swap_header()
256 d->d_left_child = CDF_TOLE4(CAST(uint32_t, d->d_left_child)); in cdf_swap_dir()
257 d->d_right_child = CDF_TOLE4(CAST(uint32_t, d->d_right_child)); in cdf_swap_dir()
258 d->d_storage = CDF_TOLE4(CAST(uint32_t, d->d_storage)); in cdf_swap_dir()
262 d->d_created = CDF_TOLE8(CAST(uint64_t, d->d_created)); in cdf_swap_dir()
263 d->d_modified = CDF_TOLE8(CAST(uint64_t, d->d_modified)); in cdf_swap_dir()
265 CAST(uint32_t, d->d_stream_first_sector)); in cdf_swap_dir()
328 if (e >= b && CAST(size_t, e - b) <= ss * sst->sst_len) in cdf_check_stream_offset()
341 size_t siz = CAST(size_t, off + len); in cdf_read()
343 if (CAST(zend_off_t, off + len) != CAST(zend_off_t, siz)) in cdf_read()
348 return CAST(ssize_t, len); in cdf_read()
360 return CAST(ssize_t, len); in cdf_read()
372 if (cdf_read(info, CAST(zend_off_t, 0), buf, sizeof(buf)) == -1) in cdf_read_header()
406 if (SIZE_T_MAX / ss < CAST(size_t, id)) in cdf_read_sector()
411 return cdf_read(info, CAST(off_t, pos), RCAST(char *, buf) + offs, len); in cdf_read_sector()
421 if (SIZE_T_MAX / ss < CAST(size_t, id)) in cdf_read_short_sector()
468 if ((sat->sat_tab = CAST(cdf_secid_t *, CDF_CALLOC(sat->sat_len, ss))) in cdf_read_sat()
476 h->h_master_sat[i]) != CAST(ssize_t, ss)) { in cdf_read_sat()
482 if ((msa = CAST(cdf_secid_t *, CDF_CALLOC(1, ss))) == NULL) in cdf_read_sat()
494 CAST(ssize_t, ss)) { in cdf_read_sat()
499 sec = CDF_TOLE4(CAST(uint32_t, msa[k])); in cdf_read_sat()
509 sec) != CAST(ssize_t, ss)) { in cdf_read_sat()
515 mid = CDF_TOLE4(CAST(uint32_t, msa[nsatpersec])); in cdf_read_sat()
534 cdf_secid_t maxsector = CAST(cdf_secid_t, (sat->sat_len * size) in cdf_count_chain()
554 sid = CDF_TOLE4(CAST(uint32_t, sat->sat_tab[sid])); in cdf_count_chain()
565 return CAST(size_t, -1); in cdf_count_chain()
582 if (scn->sst_len == CAST(size_t, -1)) in cdf_read_long_sector_chain()
601 sid)) != CAST(ssize_t, ss)) { in cdf_read_long_sector_chain()
609 sid = CDF_TOLE4(CAST(uint32_t, sat->sat_tab[sid])); in cdf_read_long_sector_chain()
628 if (scn->sst_len == CAST(size_t, -1)) in cdf_read_short_sector_chain()
647 sid) != CAST(ssize_t, ss)) { in cdf_read_short_sector_chain()
651 sid = CDF_TOLE4(CAST(uint32_t, ssat->sat_tab[sid])); in cdf_read_short_sector_chain()
682 if (ns == CAST(size_t, -1)) in cdf_read_dir()
688 dir->dir_tab = CAST(cdf_directory_t *, in cdf_read_dir()
693 if ((buf = CAST(char *, CDF_MALLOC(ss))) == NULL) { in cdf_read_dir()
704 CAST(ssize_t, ss)) { in cdf_read_dir()
712 sid = CDF_TOLE4(CAST(uint32_t, sat->sat_tab[sid])); in cdf_read_dir()
737 if (ssat->sat_len == CAST(size_t, -1)) in cdf_read_ssat()
740 ssat->sat_tab = CAST(cdf_secid_t *, CDF_CALLOC(ssat->sat_len, ss)); in cdf_read_ssat()
756 CAST(ssize_t, ss)) { in cdf_read_ssat()
760 sid = CDF_TOLE4(CAST(uint32_t, sat->sat_tab[sid])); in cdf_read_ssat()
810 return CAST(unsigned char, *d) - CDF_TOLE2(*s); in cdf_namecmp()
861 return CAST(int, i); in cdf_find_stream()
874 return CAST(const void *, CAST(const uint8_t *, p) + l); in cdf_offset()
900 if (ofs > CAST(size_t, e - p)) { in cdf_get_property_info_pos()
905 return CAST(const uint8_t *, cdf_offset(CAST(const void *, p), ofs)); in cdf_get_property_info_pos()
919 inp = CAST(cdf_property_info_t *, in cdf_grow_info()
941 if (CAST(size_t, CAST(const char *, e) - CAST(const char *, p)) < len) in cdf_copy_info()
976 shp = CAST(const cdf_section_header_t *, in cdf_read_property_info()
999 p = CAST(const uint8_t *, cdf_offset(sst->sst_tab, offs + sizeof(sh))); in cdf_read_property_info()
1000 e = CAST(const uint8_t *, cdf_offset(shp, sh.sh_len)); in cdf_read_property_info()
1008 left = CAST(size_t, e - q); in cdf_read_property_info()
1080 inp[i].pi_str.s_buf = CAST(const char *, in cdf_read_property_info()
1081 CAST(const void *, &q[o4])); in cdf_read_property_info()
1125 CAST(const cdf_summary_info_header_t *, sst->sst_tab); in cdf_unpack_summary_info()
1127 CAST(const cdf_section_declaration_t *, RCAST(const void *, in cdf_unpack_summary_info()
1156 ce[i].f = CAST(t, CDF_TOLE(cep->f))
1163 const char *b = CAST(const char *, sst->sst_tab); in cdf_unpack_catalog()
1182 *cat = CAST(cdf_catalog_t *, in cdf_unpack_catalog()
1188 b = CAST(const char *, sst->sst_tab); in cdf_unpack_catalog()
1208 np = CAST(const uint16_t *, CAST(const void *, (b + 16))); in cdf_unpack_catalog()
1209 nb = CAST(const char *, CAST(const void *, in cdf_unpack_catalog()
1280 secs = CAST(int, ts % 60); in cdf_print_elapsed_time()
1282 mins = CAST(int, ts % 60); in cdf_print_elapsed_time()
1284 hours = CAST(int, ts % 24); in cdf_print_elapsed_time()
1286 days = CAST(int, ts); in cdf_print_elapsed_time()
1290 if (CAST(size_t, len) >= bufsiz) in cdf_print_elapsed_time()
1296 if (CAST(size_t, len) >= bufsiz) in cdf_print_elapsed_time()
1301 if (CAST(size_t, len) >= bufsiz) in cdf_print_elapsed_time()
1313 buf[i] = CAST(char, p[i]); in cdf_u16tos8()