mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-20 16:47:28 +01:00
cgen: ignore -Wcast-qual when making a roslice
This commit is contained in:
1 parent
70c1a78cd8
commit
bdba035779
3 files changed
+38
-6
No files matched your search
@@ -61,6 +61,20 @@
|
||||
|
||||
// --------
|
||||
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wcast-qual"
|
||||
#endif
|
||||
static inline uint8_t* //
|
||||
wuffs_base__strip_const_from_u8_ptr(const uint8_t* ptr) {
|
||||
return (uint8_t*)ptr;
|
||||
}
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
// --------
|
||||
|
||||
static inline wuffs_base__empty_struct //
|
||||
wuffs_base__ignore_status(wuffs_base__status z) {
|
||||
return wuffs_base__make_empty_struct();
|
||||
|
||||
@@ -171,12 +171,16 @@ func (g *gen) writeExprOther(b *buffer, n *a.Expr, sideEffectsOnly bool, depth u
|
||||
} else {
|
||||
b.writes("wuffs_base__make_slice_u8_ij(")
|
||||
}
|
||||
if lhs.MType().IsReadOnly() {
|
||||
b.writes("(uint8_t*)")
|
||||
lhsIsReadOnly := lhs.MType().IsReadOnly()
|
||||
if lhsIsReadOnly {
|
||||
b.writes("wuffs_base__strip_const_from_u8_ptr(")
|
||||
}
|
||||
if err := g.writeExpr(b, lhs, false, depth); err != nil {
|
||||
return err
|
||||
}
|
||||
if lhsIsReadOnly {
|
||||
b.writes(")")
|
||||
}
|
||||
if mhs == nil {
|
||||
// No-op.
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user