Make an io_{reader,writer}'s buffer private

This commit is contained in:
Nigel Tao committed 2018-04-27 21:02:48 +10:00
1 parent 8827e222b1
commit a2cf739e52
17 files changed
+379 -399

No files matched your search

+4 -10
View File
@@ -564,26 +564,20 @@ typedef struct wuffs_base__io_limit {
} wuffs_base__io_limit;
typedef struct {
// TODO: move buf into private_impl? As it is, it looks like users can modify
// the buf field to point to a different buffer, which can turn the limit and
// mark fields into dangling pointers.
wuffs_base__io_buffer* buf;
// Do not access the private_impl's fields directly. There is no API/ABI
// compatibility or safety guarantee if you do so.
struct {
wuffs_base__io_buffer* buf;
wuffs_base__io_limit limit;
uint8_t* mark;
} private_impl;
} wuffs_base__io_reader;
typedef struct {
// TODO: move buf into private_impl? As it is, it looks like users can modify
// the buf field to point to a different buffer, which can turn the limit and
// mark fields into dangling pointers.
wuffs_base__io_buffer* buf;
// Do not access the private_impl's fields directly. There is no API/ABI
// compatibility or safety guarantee if you do so.
struct {
wuffs_base__io_buffer* buf;
wuffs_base__io_limit limit;
uint8_t* mark;
} private_impl;
@@ -593,7 +587,7 @@ static inline wuffs_base__io_reader wuffs_base__io_buffer__reader(
wuffs_base__io_buffer* buf) {
wuffs_base__io_reader ret = ((wuffs_base__io_reader){});
if (buf) {
ret.buf = buf;
ret.private_impl.buf = buf;
}
return ret;
}
@@ -602,7 +596,7 @@ static inline wuffs_base__io_writer wuffs_base__io_buffer__writer(
wuffs_base__io_buffer* buf) {
wuffs_base__io_writer ret = ((wuffs_base__io_writer){});
if (buf) {
ret.buf = buf;
ret.private_impl.buf = buf;
}
return ret;
}
+4 -10
View File
@@ -564,26 +564,20 @@ typedef struct wuffs_base__io_limit {
} wuffs_base__io_limit;
typedef struct {
// TODO: move buf into private_impl? As it is, it looks like users can modify
// the buf field to point to a different buffer, which can turn the limit and
// mark fields into dangling pointers.
wuffs_base__io_buffer* buf;
// Do not access the private_impl's fields directly. There is no API/ABI
// compatibility or safety guarantee if you do so.
struct {
wuffs_base__io_buffer* buf;
wuffs_base__io_limit limit;
uint8_t* mark;
} private_impl;
} wuffs_base__io_reader;
typedef struct {
// TODO: move buf into private_impl? As it is, it looks like users can modify
// the buf field to point to a different buffer, which can turn the limit and
// mark fields into dangling pointers.
wuffs_base__io_buffer* buf;
// Do not access the private_impl's fields directly. There is no API/ABI
// compatibility or safety guarantee if you do so.
struct {
wuffs_base__io_buffer* buf;
wuffs_base__io_limit limit;
uint8_t* mark;
} private_impl;
@@ -593,7 +587,7 @@ static inline wuffs_base__io_reader wuffs_base__io_buffer__reader(
wuffs_base__io_buffer* buf) {
wuffs_base__io_reader ret = ((wuffs_base__io_reader){});
if (buf) {
ret.buf = buf;
ret.private_impl.buf = buf;
}
return ret;
}
@@ -602,7 +596,7 @@ static inline wuffs_base__io_writer wuffs_base__io_buffer__writer(
wuffs_base__io_buffer* buf) {
wuffs_base__io_writer ret = ((wuffs_base__io_writer){});
if (buf) {
ret.buf = buf;
ret.private_impl.buf = buf;
}
return ret;
}
+4 -10
View File
@@ -564,26 +564,20 @@ typedef struct wuffs_base__io_limit {
} wuffs_base__io_limit;
typedef struct {
// TODO: move buf into private_impl? As it is, it looks like users can modify
// the buf field to point to a different buffer, which can turn the limit and
// mark fields into dangling pointers.
wuffs_base__io_buffer* buf;
// Do not access the private_impl's fields directly. There is no API/ABI
// compatibility or safety guarantee if you do so.
struct {
wuffs_base__io_buffer* buf;
wuffs_base__io_limit limit;
uint8_t* mark;
} private_impl;
} wuffs_base__io_reader;
typedef struct {
// TODO: move buf into private_impl? As it is, it looks like users can modify
// the buf field to point to a different buffer, which can turn the limit and
// mark fields into dangling pointers.
wuffs_base__io_buffer* buf;
// Do not access the private_impl's fields directly. There is no API/ABI
// compatibility or safety guarantee if you do so.
struct {
wuffs_base__io_buffer* buf;
wuffs_base__io_limit limit;
uint8_t* mark;
} private_impl;
@@ -593,7 +587,7 @@ static inline wuffs_base__io_reader wuffs_base__io_buffer__reader(
wuffs_base__io_buffer* buf) {
wuffs_base__io_reader ret = ((wuffs_base__io_reader){});
if (buf) {
ret.buf = buf;
ret.private_impl.buf = buf;
}
return ret;
}
@@ -602,7 +596,7 @@ static inline wuffs_base__io_writer wuffs_base__io_buffer__writer(
wuffs_base__io_buffer* buf) {
wuffs_base__io_writer ret = ((wuffs_base__io_writer){});
if (buf) {
ret.buf = buf;
ret.private_impl.buf = buf;
}
return ret;
}
+4 -10
View File
@@ -564,26 +564,20 @@ typedef struct wuffs_base__io_limit {
} wuffs_base__io_limit;
typedef struct {
// TODO: move buf into private_impl? As it is, it looks like users can modify
// the buf field to point to a different buffer, which can turn the limit and
// mark fields into dangling pointers.
wuffs_base__io_buffer* buf;
// Do not access the private_impl's fields directly. There is no API/ABI
// compatibility or safety guarantee if you do so.
struct {
wuffs_base__io_buffer* buf;
wuffs_base__io_limit limit;
uint8_t* mark;
} private_impl;
} wuffs_base__io_reader;
typedef struct {
// TODO: move buf into private_impl? As it is, it looks like users can modify
// the buf field to point to a different buffer, which can turn the limit and
// mark fields into dangling pointers.
wuffs_base__io_buffer* buf;
// Do not access the private_impl's fields directly. There is no API/ABI
// compatibility or safety guarantee if you do so.
struct {
wuffs_base__io_buffer* buf;
wuffs_base__io_limit limit;
uint8_t* mark;
} private_impl;
@@ -593,7 +587,7 @@ static inline wuffs_base__io_reader wuffs_base__io_buffer__reader(
wuffs_base__io_buffer* buf) {
wuffs_base__io_reader ret = ((wuffs_base__io_reader){});
if (buf) {
ret.buf = buf;
ret.private_impl.buf = buf;
}
return ret;
}
@@ -602,7 +596,7 @@ static inline wuffs_base__io_writer wuffs_base__io_buffer__writer(
wuffs_base__io_buffer* buf) {
wuffs_base__io_writer ret = ((wuffs_base__io_writer){});
if (buf) {
ret.buf = buf;
ret.private_impl.buf = buf;
}
return ret;
}
+4 -10
View File
@@ -564,26 +564,20 @@ typedef struct wuffs_base__io_limit {
} wuffs_base__io_limit;
typedef struct {
// TODO: move buf into private_impl? As it is, it looks like users can modify
// the buf field to point to a different buffer, which can turn the limit and
// mark fields into dangling pointers.
wuffs_base__io_buffer* buf;
// Do not access the private_impl's fields directly. There is no API/ABI
// compatibility or safety guarantee if you do so.
struct {
wuffs_base__io_buffer* buf;
wuffs_base__io_limit limit;
uint8_t* mark;
} private_impl;
} wuffs_base__io_reader;
typedef struct {
// TODO: move buf into private_impl? As it is, it looks like users can modify
// the buf field to point to a different buffer, which can turn the limit and
// mark fields into dangling pointers.
wuffs_base__io_buffer* buf;
// Do not access the private_impl's fields directly. There is no API/ABI
// compatibility or safety guarantee if you do so.
struct {
wuffs_base__io_buffer* buf;
wuffs_base__io_limit limit;
uint8_t* mark;
} private_impl;
@@ -593,7 +587,7 @@ static inline wuffs_base__io_reader wuffs_base__io_buffer__reader(
wuffs_base__io_buffer* buf) {
wuffs_base__io_reader ret = ((wuffs_base__io_reader){});
if (buf) {
ret.buf = buf;
ret.private_impl.buf = buf;
}
return ret;
}
@@ -602,7 +596,7 @@ static inline wuffs_base__io_writer wuffs_base__io_buffer__writer(
wuffs_base__io_buffer* buf) {
wuffs_base__io_writer ret = ((wuffs_base__io_writer){});
if (buf) {
ret.buf = buf;
ret.private_impl.buf = buf;
}
return ret;
}
+4 -10
View File
@@ -564,26 +564,20 @@ typedef struct wuffs_base__io_limit {
} wuffs_base__io_limit;
typedef struct {
// TODO: move buf into private_impl? As it is, it looks like users can modify
// the buf field to point to a different buffer, which can turn the limit and
// mark fields into dangling pointers.
wuffs_base__io_buffer* buf;
// Do not access the private_impl's fields directly. There is no API/ABI
// compatibility or safety guarantee if you do so.
struct {
wuffs_base__io_buffer* buf;
wuffs_base__io_limit limit;
uint8_t* mark;
} private_impl;
} wuffs_base__io_reader;
typedef struct {
// TODO: move buf into private_impl? As it is, it looks like users can modify
// the buf field to point to a different buffer, which can turn the limit and
// mark fields into dangling pointers.
wuffs_base__io_buffer* buf;
// Do not access the private_impl's fields directly. There is no API/ABI
// compatibility or safety guarantee if you do so.
struct {
wuffs_base__io_buffer* buf;
wuffs_base__io_limit limit;
uint8_t* mark;
} private_impl;
@@ -593,7 +587,7 @@ static inline wuffs_base__io_reader wuffs_base__io_buffer__reader(
wuffs_base__io_buffer* buf) {
wuffs_base__io_reader ret = ((wuffs_base__io_reader){});
if (buf) {
ret.buf = buf;
ret.private_impl.buf = buf;
}
return ret;
}
@@ -602,7 +596,7 @@ static inline wuffs_base__io_writer wuffs_base__io_buffer__writer(
wuffs_base__io_buffer* buf) {
wuffs_base__io_writer ret = ((wuffs_base__io_writer){});
if (buf) {
ret.buf = buf;
ret.private_impl.buf = buf;
}
return ret;
}