diff options
Diffstat (limited to 'ethosu/mlw_codec')
-rw-r--r-- | ethosu/mlw_codec/makefile | 3 | ||||
-rw-r--r-- | ethosu/mlw_codec/mlw_main.c | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/ethosu/mlw_codec/makefile b/ethosu/mlw_codec/makefile index 68eb0d94..aa214f9b 100644 --- a/ethosu/mlw_codec/makefile +++ b/ethosu/mlw_codec/makefile @@ -20,7 +20,8 @@ UNAME=$(shell uname -o) -CFLAGS=-Wall -Werror -Wno-unused-function -Wno-unused-variable +CFLAGS=-Wall -Werror -Wno-unused-variable +CFLAGS+=-fwrapv -fstack-protector-strong -flto -fuse-linker-plugin -ffat-lto-objects ifeq ($(DEBUG),1) CFLAGS+=-g -O0 -DDEBUG diff --git a/ethosu/mlw_codec/mlw_main.c b/ethosu/mlw_codec/mlw_main.c index 9f720495..315c899d 100644 --- a/ethosu/mlw_codec/mlw_main.c +++ b/ethosu/mlw_codec/mlw_main.c @@ -132,7 +132,7 @@ int main(int argc, char *argv[]) if (!decode) { // Encode - int i, n = int16_format ? inbuf_size/sizeof(int16_t) : inbuf_size; + int i, n = int16_format ? inbuf_size/(int)sizeof(int16_t) : inbuf_size; int16_t *weights = malloc( n * sizeof(int16_t) ); for(i=0; i<n; i++) { weights[i] = int16_format ? ((int16_t*)inbuf)[i] : ((int8_t*)inbuf)[i]; @@ -145,7 +145,7 @@ int main(int argc, char *argv[]) int i, n; int16_t *weights; n = mlw_decode( inbuf, inbuf_size, &weights, verbose); - outbuf_size = int16_format ? n*sizeof(int16_t) : n; + outbuf_size = int16_format ? n*(int)sizeof(int16_t) : n; outbuf = malloc( outbuf_size ); assert(outbuf); for(i=0; i<n; i++) { |