summaryrefslogtreecommitdiffstats
path: root/examples/blockStreaming_ringBuffer.c
diff options
context:
space:
mode:
authorYann Collet <yann.collet.73@gmail.com>2014-11-03 08:29:45 (GMT)
committerYann Collet <yann.collet.73@gmail.com>2014-11-03 08:29:45 (GMT)
commit3de7f00a0b83f0f8ad861789d8da1ad697b1f05a (patch)
treebd1f7da1480be7fdd67ddca328660219d1ef5e8b /examples/blockStreaming_ringBuffer.c
parentb005e1b42e2d5b533ba30dcc4728243e72563c07 (diff)
downloadlz4-3de7f00a0b83f0f8ad861789d8da1ad697b1f05a.zip
lz4-3de7f00a0b83f0f8ad861789d8da1ad697b1f05a.tar.gz
lz4-3de7f00a0b83f0f8ad861789d8da1ad697b1f05a.tar.bz2
Updated ring buffer examples
Diffstat (limited to 'examples/blockStreaming_ringBuffer.c')
-rw-r--r--examples/blockStreaming_ringBuffer.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/examples/blockStreaming_ringBuffer.c b/examples/blockStreaming_ringBuffer.c
index bfdbed1..eda721f 100644
--- a/examples/blockStreaming_ringBuffer.c
+++ b/examples/blockStreaming_ringBuffer.c
@@ -1,18 +1,32 @@
// LZ4 streaming API example : ring buffer
-// Copyright : Takayuki Matsuoka
+// Based on sample code from Takayuki Matsuoka
-#define _CRT_SECURE_NO_WARNINGS // for MSVC
-#include "lz4.h"
+/**************************************
+ * Compiler Options
+ **************************************/
+#ifdef _MSC_VER /* Visual Studio */
+# define _CRT_SECURE_NO_WARNINGS // for MSVC
+# define snprintf sprintf_s
+#endif
+#ifdef __GNUC__
+# pragma GCC diagnostic ignored "-Wmissing-braces" /* GCC bug 53119 : doesn't accept { 0 } as initializer (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53119) */
+#endif
+
+/**************************************
+ * Includes
+ **************************************/
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
+#include "lz4.h"
+
enum {
MESSAGE_MAX_BYTES = 1024,
- RING_BUFFER_BYTES = 1024 * 256 + MESSAGE_MAX_BYTES,
+ RING_BUFFER_BYTES = 1024 * 8 + MESSAGE_MAX_BYTES,
DICT_BYTES = 65536,
};