mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-18 00:32:11 +01:00
Remove obsolete set_min_inclusive_x etc methods
This commit is contained in:
1 parent
52feb10ad3
commit
0702faf836
11 files changed
+1
-511
No files matched your search
@@ -353,66 +353,6 @@ static inline wuffs_base__rect_ie_u32 wuffs_base__utility__make_rect_ie_u32(
|
||||
});
|
||||
}
|
||||
|
||||
// ---------------- Ranges and Rects
|
||||
|
||||
static inline wuffs_base__empty_struct
|
||||
wuffs_base__rect_ii_u32__set_min_inclusive_x(wuffs_base__rect_ii_u32* r,
|
||||
uint32_t x) {
|
||||
r->min_inclusive_x = x;
|
||||
return ((wuffs_base__empty_struct){});
|
||||
}
|
||||
|
||||
static inline wuffs_base__empty_struct
|
||||
wuffs_base__rect_ii_u32__set_min_inclusive_y(wuffs_base__rect_ii_u32* r,
|
||||
uint32_t y) {
|
||||
r->min_inclusive_y = y;
|
||||
return ((wuffs_base__empty_struct){});
|
||||
}
|
||||
|
||||
static inline wuffs_base__empty_struct
|
||||
wuffs_base__rect_ii_u32__set_max_inclusive_x(wuffs_base__rect_ii_u32* r,
|
||||
uint32_t x) {
|
||||
r->max_inclusive_x = x;
|
||||
return ((wuffs_base__empty_struct){});
|
||||
}
|
||||
|
||||
static inline wuffs_base__empty_struct
|
||||
wuffs_base__rect_ii_u32__set_max_inclusive_y(wuffs_base__rect_ii_u32* r,
|
||||
uint32_t y) {
|
||||
r->max_inclusive_y = y;
|
||||
return ((wuffs_base__empty_struct){});
|
||||
}
|
||||
|
||||
// --------
|
||||
|
||||
static inline wuffs_base__empty_struct
|
||||
wuffs_base__rect_ie_u32__set_min_inclusive_x(wuffs_base__rect_ie_u32* r,
|
||||
uint32_t x) {
|
||||
r->min_inclusive_x = x;
|
||||
return ((wuffs_base__empty_struct){});
|
||||
}
|
||||
|
||||
static inline wuffs_base__empty_struct
|
||||
wuffs_base__rect_ie_u32__set_min_inclusive_y(wuffs_base__rect_ie_u32* r,
|
||||
uint32_t y) {
|
||||
r->min_inclusive_y = y;
|
||||
return ((wuffs_base__empty_struct){});
|
||||
}
|
||||
|
||||
static inline wuffs_base__empty_struct
|
||||
wuffs_base__rect_ie_u32__set_max_exclusive_x(wuffs_base__rect_ie_u32* r,
|
||||
uint32_t x) {
|
||||
r->max_exclusive_x = x;
|
||||
return ((wuffs_base__empty_struct){});
|
||||
}
|
||||
|
||||
static inline wuffs_base__empty_struct
|
||||
wuffs_base__rect_ie_u32__set_max_exclusive_y(wuffs_base__rect_ie_u32* r,
|
||||
uint32_t y) {
|
||||
r->max_exclusive_y = y;
|
||||
return ((wuffs_base__empty_struct){});
|
||||
}
|
||||
|
||||
// ---------------- I/O
|
||||
|
||||
static inline bool wuffs_base__io_buffer__is_valid(wuffs_base__io_buffer buf) {
|
||||
|
||||
@@ -114,10 +114,6 @@ const basePrivateH = "" +
|
||||
" uint64_t min_inclusive,\n uint64_t max_exclusive) {\n return ((wuffs_base__range_ie_u64){\n .min_inclusive = min_inclusive,\n .max_exclusive = max_exclusive,\n });\n}\n\nstatic inline wuffs_base__rect_ii_u32 wuffs_base__utility__make_rect_ii_u32(\n wuffs_base__utility* ignored,\n uint32_t min_inclusive_x,\n uint32_t min_inclusive_y,\n uint32_t max_inclusive_x,\n uint32_t max_inclusive_y) {\n return ((wuffs_base__rect_ii_u32){\n .min_inclusive_x = min_inclusive_x,\n .min_inclusive_y = min_inclusive_y,\n .max_inclusive_x = max_inclusive_x,\n .max_inclusive_y = max_inclusive_y,\n });\n}\n\nstatic inline wuffs_base__rect_ie_u32 wuffs_base__utility__make_rect_ie_u32(\n wuffs_base__utility* ignored,\n uint32_t min_inclusive_x,\n uint32_t min_inclusive_y,\n uint32_t max_exclusive_x,\n uint32_t max_exclusive_y) {\n return ((wuffs_base__rect_ie_u32){\n .min_inclusive_x = min_inclusive_x,\n .min_inclusive_y = min_inclusive_y,\n .max_exclusive_x = max_exclusive_x,\n" +
|
||||
" .max_exclusive_y = max_exclusive_y,\n });\n}\n\n" +
|
||||
"" +
|
||||
"// ---------------- Ranges and Rects\n\nstatic inline wuffs_base__empty_struct\nwuffs_base__rect_ii_u32__set_min_inclusive_x(wuffs_base__rect_ii_u32* r,\n uint32_t x) {\n r->min_inclusive_x = x;\n return ((wuffs_base__empty_struct){});\n}\n\nstatic inline wuffs_base__empty_struct\nwuffs_base__rect_ii_u32__set_min_inclusive_y(wuffs_base__rect_ii_u32* r,\n uint32_t y) {\n r->min_inclusive_y = y;\n return ((wuffs_base__empty_struct){});\n}\n\nstatic inline wuffs_base__empty_struct\nwuffs_base__rect_ii_u32__set_max_inclusive_x(wuffs_base__rect_ii_u32* r,\n uint32_t x) {\n r->max_inclusive_x = x;\n return ((wuffs_base__empty_struct){});\n}\n\nstatic inline wuffs_base__empty_struct\nwuffs_base__rect_ii_u32__set_max_inclusive_y(wuffs_base__rect_ii_u32* r,\n uint32_t y) {\n r->max_inclusive_y = y;\n return ((wuffs_base__empty_struct){});\n}\n\n" +
|
||||
"" +
|
||||
"// --------\n\nstatic inline wuffs_base__empty_struct\nwuffs_base__rect_ie_u32__set_min_inclusive_x(wuffs_base__rect_ie_u32* r,\n uint32_t x) {\n r->min_inclusive_x = x;\n return ((wuffs_base__empty_struct){});\n}\n\nstatic inline wuffs_base__empty_struct\nwuffs_base__rect_ie_u32__set_min_inclusive_y(wuffs_base__rect_ie_u32* r,\n uint32_t y) {\n r->min_inclusive_y = y;\n return ((wuffs_base__empty_struct){});\n}\n\nstatic inline wuffs_base__empty_struct\nwuffs_base__rect_ie_u32__set_max_exclusive_x(wuffs_base__rect_ie_u32* r,\n uint32_t x) {\n r->max_exclusive_x = x;\n return ((wuffs_base__empty_struct){});\n}\n\nstatic inline wuffs_base__empty_struct\nwuffs_base__rect_ie_u32__set_max_exclusive_y(wuffs_base__rect_ie_u32* r,\n uint32_t y) {\n r->max_exclusive_y = y;\n return ((wuffs_base__empty_struct){});\n}\n\n" +
|
||||
"" +
|
||||
"// ---------------- I/O\n\nstatic inline bool wuffs_base__io_buffer__is_valid(wuffs_base__io_buffer buf) {\n return (buf.ptr || (buf.len == 0)) && (buf.len >= buf.wi) &&\n (buf.wi >= buf.ri);\n}\n\nstatic inline bool wuffs_base__io_reader__is_eof(wuffs_base__io_reader o) {\n wuffs_base__io_buffer* buf = o.private_impl.buf;\n return buf && buf->closed && (buf->ptr + buf->wi == o.private_impl.bounds[1]);\n}\n\nstatic inline bool wuffs_base__io_reader__is_valid(wuffs_base__io_reader o) {\n wuffs_base__io_buffer* buf = o.private_impl.buf;\n // Note: if making this function public (i.e. moving it to base-header.h), it\n // also needs to allow NULL (i.e. implicit, callee-calculated) bounds.\n return buf ? ((buf->ptr <= o.private_impl.bounds[0]) &&\n (o.private_impl.bounds[0] <= o.private_impl.bounds[1]) &&\n (o.private_impl.bounds[1] <= buf->ptr + buf->len))\n : ((o.private_impl.bounds[0] == NULL) &&\n (o.private_impl.bounds[1] == NULL));\n}\n\nstatic inline bool wuf" +
|
||||
"fs_base__io_writer__is_valid(wuffs_base__io_writer o) {\n wuffs_base__io_buffer* buf = o.private_impl.buf;\n // Note: if making this function public (i.e. moving it to base-header.h), it\n // also needs to allow NULL (i.e. implicit, callee-calculated) bounds.\n return buf ? ((buf->ptr <= o.private_impl.bounds[0]) &&\n (o.private_impl.bounds[0] <= o.private_impl.bounds[1]) &&\n (o.private_impl.bounds[1] <= buf->ptr + buf->len))\n : ((o.private_impl.bounds[0] == NULL) &&\n (o.private_impl.bounds[1] == NULL));\n}\n\nstatic inline uint32_t wuffs_base__io_writer__copy_from_history32(\n uint8_t** ptr_ptr,\n uint8_t* start,\n uint8_t* end,\n uint32_t distance,\n uint32_t length) {\n if (!distance) {\n return 0;\n }\n uint8_t* ptr = *ptr_ptr;\n if ((size_t)(ptr - start) < (size_t)(distance)) {\n return 0;\n }\n start = ptr - distance;\n size_t n = end - ptr;\n if ((size_t)(length) > n) {\n length = n;\n } else {\n n = length;\n }\n // TODO: unrolling" +
|
||||
" by 3 seems best for the std/deflate benchmarks, but that\n // is mostly because 3 is the minimum length for the deflate format. This\n // function implementation shouldn't overfit to that one format. Perhaps the\n // copy_from_history32 Wuffs method should also take an unroll hint argument,\n // and the cgen can look if that argument is the constant expression '3'.\n //\n // See also wuffs_base__io_writer__copy_from_history32__bco below.\n //\n // Alternatively, or additionally, have a sloppy_copy_from_history32 method\n // that copies 8 bytes at a time, possibly writing more than length bytes?\n for (; n >= 3; n -= 3) {\n *ptr++ = *start++;\n *ptr++ = *start++;\n *ptr++ = *start++;\n }\n for (; n; n--) {\n *ptr++ = *start++;\n }\n *ptr_ptr = ptr;\n return length;\n}\n\n// wuffs_base__io_writer__copy_from_history32__bco is a Bounds Check Optimized\n// version of the wuffs_base__io_writer__copy_from_history32 function above.\n// The caller needs to prove that:\n// - distance > 0\n// - distance <= (*ptr_pt" +
|
||||
|
||||
Reference in new issue
Block a user