Il 04/09/2012 09:10, Wenchao Xia ha scritto: > >>> + >>> +/** >>> + * QBlockInfoImageStatic: information about the block image. >>> + * >>> + * @loc: location info. >>> + * @fmt_type: format type. >>> + * @virt_size: virtual size in bytes. >>> + * @backing_loc: backing file location, its type is QB_PROT_NONE if >>> not exist. >>> + * @allocated_size: allocated size in bytes, negative if not available. >> >> Reading this... >> >>> + * @encrypt: encrypt flag. >>> + */ >>> +struct QBlockInfoImageStatic { >>> + struct QBlockOptionLoc loc; >>> + enum QBlockFormat fmt_type; >>> + size_t virt_size; >>> + /* advance info */ >>> + struct QBlockOptionLoc backing_loc; >>> + size_t allocated_size; >> >> ...negative is not possible for size_t. Did you mean ssize_t? >> > you are right.
size_t is a *pointer* size. It is 32-bits on Use int64_t or uint64_t always when dealing with file sizes and offsets. In particular, do not use off_t, it is a recipe for pain and ABI incompatibilities. Paolo