Add __maybe_unused macro and use to stop warnings from lzma dummy allocs.

This commit is contained in:
ckolivas 2012-03-07 12:58:58 +11:00
parent f225f9f173
commit e6ae7c528a
4 changed files with 10 additions and 2 deletions

View file

@ -83,6 +83,7 @@ AM_CONDITIONAL([STATIC], [test "x$static" = "xyes"])
AC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h sys/mman.h)
AC_CHECK_HEADERS(ctype.h errno.h sys/resource.h)
AC_CHECK_HEADERS(endian.h sys/endian.h arpa/inet.h)
AC_CHECK_HEADERS(alloca.h)
AC_TYPE_OFF_T
AC_TYPE_SIZE_T

View file

@ -20,6 +20,8 @@
#ifndef LRZIP_PRIV_H
#define LRZIP_PRIV_H
#include "config.h"
#define NUM_STREAMS 2
#define STREAM_BUFSIZE (1024 * 1024 * 10)
@ -117,6 +119,7 @@ extern int errno;
#define likely(x) __builtin_expect(!!(x), 1)
#define unlikely(x) __builtin_expect(!!(x), 0)
#define __maybe_unused __attribute__((unused))
typedef long long int i64;
typedef uint32_t u32;

View file

@ -5,6 +5,8 @@
#include "LzFindMt.h"
#include "lrzip.h"
void MtSync_Construct(CMtSync *p)
{
p->wasCreated = False;
@ -454,7 +456,7 @@ void MatchFinderMt_Destruct(CMatchFinderMt *p, ISzAlloc *alloc)
static unsigned MY_STD_CALL HashThreadFunc2(void *p) { HashThreadFunc((CMatchFinderMt *)p); return 0; }
static unsigned MY_STD_CALL BtThreadFunc2(void *p)
{
Byte allocaDummy[0x180];
__maybe_unused Byte allocaDummy[0x180];
int i = 0;
for (i = 0; i < 16; i++)
allocaDummy[i] = (Byte)i;

View file

@ -17,6 +17,8 @@
#include "LzFindMt.h"
#endif
#include "lrzip.h"
#ifdef SHOW_STAT
static int ttt = 0;
#endif
@ -2156,7 +2158,7 @@ static SRes LzmaEnc_Encode2(CLzmaEnc *p, ICompressProgress *progress)
SRes res = SZ_OK;
#ifndef _7ZIP_ST
Byte allocaDummy[0x300];
__maybe_unused Byte allocaDummy[0x300];
int i = 0;
for (i = 0; i < 16; i++)
allocaDummy[i] = (Byte)i;