summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAleksandr Kukuev <askukuev@avito.ru>2020-05-11 20:32:02 (GMT)
committerAleksandr Kukuev <askukuev@avito.ru>2020-05-11 20:32:02 (GMT)
commit7a75b045bde89e77e3573f91821d0314251aac1d (patch)
tree231495e582fa11464fa5fa64a0972176b90959b7 /lib
parentf39b79fb02962a1cd880bbdecb6dffba4f754a11 (diff)
downloadlz4-7a75b045bde89e77e3573f91821d0314251aac1d.zip
lz4-7a75b045bde89e77e3573f91821d0314251aac1d.tar.gz
lz4-7a75b045bde89e77e3573f91821d0314251aac1d.tar.bz2
Reducing stack usage in _t_alignment checks
Diffstat (limited to 'lib')
-rw-r--r--lib/lz4.c4
-rw-r--r--lib/lz4hc.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/lz4.c b/lib/lz4.c
index 82ab490..fef9845 100644
--- a/lib/lz4.c
+++ b/lib/lz4.c
@@ -1349,8 +1349,8 @@ LZ4_stream_t* LZ4_createStream(void)
while actually aligning LZ4_stream_t on 4 bytes. */
static size_t LZ4_stream_t_alignment(void)
{
- struct { char c; LZ4_stream_t t; } t_a;
- return sizeof(t_a) - sizeof(t_a.t);
+ typedef struct { char c; LZ4_stream_t t; } t_a;
+ return sizeof(t_a) - sizeof(LZ4_stream_t);
}
#endif
diff --git a/lib/lz4hc.c b/lib/lz4hc.c
index b75514f..687f87e 100644
--- a/lib/lz4hc.c
+++ b/lib/lz4hc.c
@@ -886,8 +886,8 @@ int LZ4_sizeofStateHC(void) { return (int)sizeof(LZ4_streamHC_t); }
* while actually aligning LZ4_streamHC_t on 4 bytes. */
static size_t LZ4_streamHC_t_alignment(void)
{
- struct { char c; LZ4_streamHC_t t; } t_a;
- return sizeof(t_a) - sizeof(t_a.t);
+ typedef struct { char c; LZ4_streamHC_t t; } t_a;
+ return sizeof(t_a) - sizeof(LZ4_streamHC_t);
}
#endif