It seems better to avoid "int" at all from sizes calculations to make
the code more robust for future changes.
Signed-off-by: Karel Zak <kzak@redhat.com>
Window size depends on page size.
e.g. 128MB on x86_64. ( = N_PAGES_IN_WINDOW * 4096 ). */
-#define N_PAGES_IN_WINDOW (32 * 1024)
+#define N_PAGES_IN_WINDOW ((size_t)(32 * 1024))
struct colinfo {
static size_t ncolumns;
struct fincore_control {
- const int pagesize;
+ const size_t pagesize;
struct libscols_table *tb; /* output */
off_t file_size,
off_t *count_incore)
{
- size_t window_size = (size_t)N_PAGES_IN_WINDOW * ctl->pagesize;
+ size_t window_size = N_PAGES_IN_WINDOW * ctl->pagesize;
off_t file_offset;
void *window = NULL;
int rc = 0;