Fix some warnings by casting
for compilers which cannot detect the affectations as ok.
This commit is contained in:
1 parent
c520b7d0be
commit
652653af0b
3 files changed
+5
-5
No files matched your search
+1
-1
@@ -114,7 +114,7 @@ genint_init(genint_t s, unsigned int n)
|
||||
}
|
||||
s->n = n;
|
||||
s->data = ptr;
|
||||
s->max = alloc-1;
|
||||
s->max = (unsigned int) (alloc-1);
|
||||
s->mask0 = (index == 0) ? -GENINT_ONE : ~((GENINT_ONE<<(GENINT_LIMBSIZE-index))-1);
|
||||
s->mask_master = (((GENINT_ONE << alloc) - 1) << (GENINT_LIMBSIZE-alloc)) >> GENINT_ABA_CPT;
|
||||
atomic_init (&s->master, (genint_limb_t)0);
|
||||
|
||||
+3
-3
@@ -160,13 +160,13 @@ m_serial_bin_write_float(m_serial_write_t serial, const long double data, const
|
||||
|
||||
FILE *f = (FILE *)serial->data[0].p;
|
||||
if (size_of_type == sizeof f1) {
|
||||
f1 = data;
|
||||
f1 = (float) data;
|
||||
n = fwrite (M_ASSIGN_CAST(const void*, &f1), sizeof f1, 1, f);
|
||||
} else if (size_of_type == sizeof f2) {
|
||||
f2 = data;
|
||||
f2 = (double) data;
|
||||
n = fwrite (M_ASSIGN_CAST(const void*, &f2), sizeof f2, 1, f);
|
||||
} else if (size_of_type == sizeof f3) {
|
||||
f3 = data;
|
||||
f3 = (long double) data;
|
||||
n = fwrite (M_ASSIGN_CAST(const void*, &f3), sizeof f3, 1, f);
|
||||
} else {
|
||||
M_ASSERT_INIT(false, "a float of suitable size");
|
||||
|
||||
+1
-1
@@ -366,7 +366,7 @@ static inline int sharedi_integer_cref(int *p) { return *p; }
|
||||
M_CALL_INIT(oplist, s->buffer[i].x); \
|
||||
atomic_init (&s->buffer[i].cpt, 0U); \
|
||||
} \
|
||||
genint_init(s->core, n); \
|
||||
genint_init(s->core, (unsigned int) n); \
|
||||
SHAREDI_RESOURCE_CONTRACT(s); \
|
||||
} \
|
||||
\
|
||||
|
||||
Reference in new issue
Block a user