mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 03:51:18 +00:00
- unsigned % signed and unsigned / signed is no longer allowed without explicit casts, except for const denominators. #2928
This commit is contained in:
@@ -272,7 +272,7 @@ macro fetch_mul(ptr, y, AtomicOrdering $ordering = SEQ_CONSISTENT)
|
||||
|
||||
@require $defined(*ptr) : "Expected a pointer"
|
||||
@require @is_native_atomic_value(*ptr) : "Only types that are native atomic may be used."
|
||||
@require $defined(*ptr * y) : "/ must be defined between the values."
|
||||
@require $defined(*ptr / y) : "/ must be defined between the values."
|
||||
@require $ordering != NOT_ATOMIC && $ordering != UNORDERED : "Acquire ordering is not valid."
|
||||
*>
|
||||
macro fetch_div(ptr, y, AtomicOrdering $ordering = SEQ_CONSISTENT)
|
||||
|
||||
@@ -158,7 +158,7 @@ macro double? decfloat(char[] chars, int $bits, int $emin, int sign)
|
||||
if (rp % 9)
|
||||
{
|
||||
long rpm9 = rp >= 0 ? rp % 9 : rp % 9 + 9;
|
||||
int p10 = P10S[8 - rpm9];
|
||||
uint p10 = P10S[8 - rpm9];
|
||||
uint carry = 0;
|
||||
for (k = a; k != z; k++)
|
||||
{
|
||||
|
||||
@@ -377,13 +377,13 @@ fn usz? Formatter.floatformat(&self, FloatFormatting formatting, double y) @priv
|
||||
j %= 9;
|
||||
int i;
|
||||
for (i = 10, j++; j < 9; i *= 10, j++);
|
||||
x = *d % i;
|
||||
x = *d % (uint)i;
|
||||
// Are there any significant digits past j?
|
||||
if (x || (d + 1) != z)
|
||||
{
|
||||
double round = 2 / math::DOUBLE_EPSILON;
|
||||
double small;
|
||||
if (((*d / i) & 1) || (i == 1000000000 && d > a && (d[-1] & 1)))
|
||||
if (((*d / (uint)i) & 1) || (i == 1000000000 && d > a && (d[-1] & 1)))
|
||||
{
|
||||
round += 2;
|
||||
}
|
||||
@@ -437,7 +437,7 @@ fn usz? Formatter.floatformat(&self, FloatFormatting formatting, double y) @priv
|
||||
// Count trailing zeros in last place
|
||||
if (z > a && z[-1])
|
||||
{
|
||||
for (int i = 10, j = 0; z[-1] % i == 0; i *= 10, j++);
|
||||
for (int i = 10, j = 0; z[-1] % (uint)i == 0; i *= 10, j++);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user