@@ -718,7 +718,7 @@ Tsman::execCREATE_FILE_IMPL_REQ(Signal* signal)
718
718
client_unlock (number (), __LINE__);
719
719
}
720
720
721
- static inline Uint64 DIV (Uint64 a, Uint64 b){ return (a + b - 1 ) / b;}
721
+ static inline Uint64 DIV (Uint64 a, Uint64 b){ return (a + b - Uint64 ( 1 ) ) / b;}
722
722
723
723
void
724
724
Tsman::release_extent_pages (Signal* signal, Ptr<Datafile> ptr)
@@ -858,7 +858,7 @@ Tsman::calculate_extent_pages_in_file(Uint64 extents,
858
858
ndbrequire (eh_words < File_formats::Datafile::extent_page_words (v2));
859
859
Uint64 extents_per_page = (Uint64)
860
860
File_formats::Datafile::extent_page_words (v2) / eh_words;
861
- return (extents + extents_per_page - 1 ) / extents_per_page;
861
+ return (extents + extents_per_page - Uint64 ( 1 ) ) / extents_per_page;
862
862
}
863
863
864
864
int
@@ -942,11 +942,11 @@ Tsman::open_file(Signal* signal,
942
942
req->file_size_hi = hi;
943
943
req->file_size_lo = lo;
944
944
945
- Uint64 pages = (Uint64 (hi) << 32 | lo) / File_formats::NDB_PAGE_SIZE;
945
+ Uint64 pages = (Uint64 (hi) << 32 | Uint64 ( lo)) / Uint64 ( File_formats::NDB_PAGE_SIZE) ;
946
946
Uint32 extent_size = ts_ptr.p ->m_extent_size ; // Extent size in #pages
947
- Uint64 extents = (pages + extent_size - 1 ) / extent_size;
948
- extents = extents ? extents : 1 ;
949
- Uint64 data_pages = extents * extent_size;
947
+ Uint64 extents = (pages + Uint64 ( extent_size) - Uint64 ( 1 )) / Uint64 ( extent_size) ;
948
+ extents = extents ? extents : Uint64 ( 1 ) ;
949
+ Uint64 data_pages = extents * Uint64 ( extent_size) ;
950
950
951
951
/* *
952
952
* We always calculate the file size by using the v1 format to ensure
@@ -956,7 +956,7 @@ Tsman::open_file(Signal* signal,
956
956
extent_size,
957
957
data_pages,
958
958
v2);
959
- Uint64 tot_pages = 1 + extent_pages + data_pages;
959
+ Uint64 tot_pages = Uint64 ( 1 ) + extent_pages + data_pages;
960
960
961
961
// TODO check overflow in cast
962
962
ptr.p ->m_create .m_extent_pages = Uint32 (extent_pages);
@@ -965,7 +965,7 @@ Tsman::open_file(Signal* signal,
965
965
/* *
966
966
* Update file size
967
967
*/
968
- Uint64 bytes = tot_pages * File_formats::NDB_PAGE_SIZE;
968
+ Uint64 bytes = tot_pages * Uint64 ( File_formats::NDB_PAGE_SIZE) ;
969
969
hi = (Uint32)(bytes >> 32 );
970
970
lo = (Uint32)(bytes & 0xFFFFFFFF );
971
971
req->file_size_hi = hi;
@@ -1202,8 +1202,10 @@ Tsman::execFSOPENCONF(Signal* signal)
1202
1202
Uint64 file_size_lo = conf->file_size_lo ;
1203
1203
Uint64 file_size = (file_size_hi << 32 ) + file_size_lo;
1204
1204
Uint64 calc_file_size =
1205
- (1 + ptr.p ->m_create .m_data_pages + ptr.p ->m_create .m_extent_pages ) *
1206
- File_formats::NDB_PAGE_SIZE;
1205
+ (Uint64 (1 ) +
1206
+ Uint64 (ptr.p ->m_create .m_data_pages ) +
1207
+ Uint64 (ptr.p ->m_create .m_extent_pages )) *
1208
+ Uint64 (File_formats::NDB_PAGE_SIZE);
1207
1209
if (file_size != calc_file_size)
1208
1210
{
1209
1211
/* *
@@ -1218,7 +1220,7 @@ Tsman::execFSOPENCONF(Signal* signal)
1218
1220
data_pages,
1219
1221
false );
1220
1222
Uint64 calc_file_size_v1 =
1221
- (1 + data_pages + extent_pages) * File_formats::NDB_PAGE_SIZE;
1223
+ (Uint64 ( 1 ) + data_pages + extent_pages) * Uint64 ( File_formats::NDB_PAGE_SIZE) ;
1222
1224
if (file_size == calc_file_size_v1)
1223
1225
{
1224
1226
jam ();
0 commit comments