Fix signed left-shifts added in e93acb2d228c. Since we now require C99, this is undefined behavior. Thanks to Luc Trudeau for the report and Alex Converse for the suggestion on how to make the macro safe for all integer sizes. Change-Id: I99a1342dfedb3e17a6869269be317c2ed26bfe9b