fx: stringstream: make internal virtual functions static
This commit is contained in:
+13
-18
@@ -167,9 +167,8 @@ fx_stringstream *fx_stringstream_create_with_buffer(char *buf, size_t max)
|
||||
}
|
||||
|
||||
fx_stream_cfg *cfg = fx_object_get_protected(s, FX_TYPE_STREAM);
|
||||
struct fx_stringstream_p *p = fx_object_get_private(
|
||||
s,
|
||||
FX_TYPE_STRINGSTREAM);
|
||||
struct fx_stringstream_p *p
|
||||
= fx_object_get_private(s, FX_TYPE_STRINGSTREAM);
|
||||
|
||||
cfg->s_mode = FX_STREAM_READ | FX_STREAM_WRITE | Z__FX_STREAM_STATIC;
|
||||
|
||||
@@ -189,9 +188,8 @@ fx_stringstream *fx_stringstream_create(void)
|
||||
}
|
||||
|
||||
fx_stream_cfg *cfg = fx_object_get_protected(s, FX_TYPE_STREAM);
|
||||
struct fx_stringstream_p *p = fx_object_get_private(
|
||||
s,
|
||||
FX_TYPE_STRINGSTREAM);
|
||||
struct fx_stringstream_p *p
|
||||
= fx_object_get_private(s, FX_TYPE_STRINGSTREAM);
|
||||
|
||||
cfg->s_mode = FX_STREAM_READ | FX_STREAM_WRITE | Z__FX_STREAM_STATIC;
|
||||
|
||||
@@ -268,41 +266,38 @@ static void stringstream_fini(fx_object *obj, void *priv)
|
||||
}
|
||||
}
|
||||
|
||||
enum fx_status stream_getc(fx_stream *stream, fx_wchar *c)
|
||||
static enum fx_status stream_getc(fx_stream *stream, fx_wchar *c)
|
||||
{
|
||||
struct fx_stringstream_p *s = fx_object_get_private(
|
||||
stream,
|
||||
FX_TYPE_STRINGSTREAM);
|
||||
struct fx_stringstream_p *s
|
||||
= fx_object_get_private(stream, FX_TYPE_STRINGSTREAM);
|
||||
|
||||
enum fx_status status = __getc(s, c);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
enum fx_status stream_read(
|
||||
static enum fx_status stream_read(
|
||||
fx_stream *stream,
|
||||
void *buf,
|
||||
size_t count,
|
||||
size_t *nr_read)
|
||||
{
|
||||
struct fx_stringstream_p *s = fx_object_get_private(
|
||||
stream,
|
||||
FX_TYPE_STRINGSTREAM);
|
||||
struct fx_stringstream_p *s
|
||||
= fx_object_get_private(stream, FX_TYPE_STRINGSTREAM);
|
||||
|
||||
enum fx_status status = __gets(s, buf, count, nr_read);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
enum fx_status stream_write(
|
||||
static enum fx_status stream_write(
|
||||
fx_stream *stream,
|
||||
const void *buf,
|
||||
size_t count,
|
||||
size_t *nr_written)
|
||||
{
|
||||
struct fx_stringstream_p *s = fx_object_get_private(
|
||||
stream,
|
||||
FX_TYPE_STRINGSTREAM);
|
||||
struct fx_stringstream_p *s
|
||||
= fx_object_get_private(stream, FX_TYPE_STRINGSTREAM);
|
||||
|
||||
enum fx_status status = __puts(s, (const char *)buf, count, nr_written);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user