Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does operand like 32i64 mean?

Please help me understand this expression:

(dwStreamSizeMax >> 32i64)

I've never seen operands like 32i64 before. Thank you.

like image 603
walruz Avatar asked Apr 03 '14 06:04

walruz


2 Answers

From MSDN C++ Integer Constants:

64-bit integer-suffix: i64 LL ll

That is, 32i64 would be 64-bit sized constant of integer type, of value of 32. That is, it is (__int64) 32, or (int64_t) 32.

dwStreamSizeMax >> 32i64

Note that in the quoted expression even for 64-bit dwStreamSizeMax maximal shift bit count which makes sense is 63, which fits into 8-bit value (BYTE), hence 64-bit size specifier there is redundant.

like image 94
Roman R. Avatar answered Nov 10 '22 20:11

Roman R.


It's the suffix for a 64-bit integer literal, not unlike L for a long or ULL for an unsigned long long. However, I believe it's a Microsoft-ism and not portable C++.

C++11 only provides suffixes for long and long long types (and their unsigned counterparts), the latter which is guaranteed to be 64 bits or more.

like image 21
paxdiablo Avatar answered Nov 10 '22 21:11

paxdiablo