mirror of
https://github.com/cc65/cc65.git
synced 2024-06-28 03:29:39 +00:00
Replace unary negation with subtraction
Remove MSVC pragma.
This commit is contained in:
parent
2c16453a9f
commit
82c8bd6e2b
|
@ -772,14 +772,11 @@ static SymEntry* ParseStructDecl (const char* Name)
|
||||||
*/
|
*/
|
||||||
if (BitOffs > 0) {
|
if (BitOffs > 0) {
|
||||||
if (FieldWidth <= 0 || (BitOffs + FieldWidth) > INT_BITS) {
|
if (FieldWidth <= 0 || (BitOffs + FieldWidth) > INT_BITS) {
|
||||||
/* Bits needed to byte-align the next field. MSVC complains
|
/* Bits needed to byte-align the next field.
|
||||||
** about unary negation of unsigned, but it's intended.
|
** MSVC complains about unary negation of unsigned,
|
||||||
** Disable the warning for the next line only.
|
** so it has been rewritten as subtraction.
|
||||||
*/
|
*/
|
||||||
#ifdef _MSC_VER
|
unsigned PaddingBits = (0 - BitOffs) % CHAR_BITS;
|
||||||
#pragma warning(disable: 4146)
|
|
||||||
#endif
|
|
||||||
unsigned PaddingBits = -BitOffs % CHAR_BITS;
|
|
||||||
|
|
||||||
/* We need an anonymous name */
|
/* We need an anonymous name */
|
||||||
AnonName (Ident, "bit-field");
|
AnonName (Ident, "bit-field");
|
||||||
|
|
Loading…
Reference in New Issue
Block a user