Changeset 4138


Ignore:
Timestamp:
Feb 26, 2019, 1:49:52 PM (18 months ago)
Author:
yura
Message:
  • size_t has 64 bits, but constant '1' - only 32. Use '1UL' instead of '1'.
Location:
to-imperative/trunk/c++/libp++
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • to-imperative/trunk/c++/libp++/pxx_common.cc

    r3143 r4138  
    113113    }
    114114    for (i = 0; i < sizeof(exps_of_two) / sizeof(exps_of_two[0]); i++) {
    115       exps_of_two[i] = 1 << i;
     115      exps_of_two[i] = 1UL << i;
    116116    }
    117117
  • to-imperative/trunk/c++/libp++/pxx_heap.cc

    r2187 r4138  
    4646{
    4747  cur_size_log = get_order(_init_size == 0 ? page_size : _init_size);
    48   current_size = 1 << cur_size_log;
     48  current_size = 1UL << cur_size_log;
    4949  if (_max_size != 0) {
    5050    max_size_log = get_order(_max_size);
    51     max_size = 1 << max_size_log;
     51    max_size = 1UL << max_size_log;
    5252  } else {
    5353    max_size = max_size_log = 0;
  • to-imperative/trunk/c++/libp++/pxx_heap_allocator.cc

    r2187 r4138  
    4949  Heap (_init_size, _max_size, _start, _fd)
    5050{
    51   min_free_size = (1 << get_order(sizeof(HeapAllocator::BlockHeader)));
     51  min_free_size = (1UL << get_order(sizeof(HeapAllocator::BlockHeader)));
    5252  for (unsigned i = 0; i < sizeof(size_t) * 8; i++)
    5353    lists[i].size = exps_of_two[i];
Note: See TracChangeset for help on using the changeset viewer.