[trunk] remove some warnings from -Wall -Wextra -pedantic

This commit is contained in:
Mickael Savinaud 2012-10-26 10:04:55 +00:00
parent bcc386e3bb
commit cdea5c8eef
4 changed files with 17 additions and 62 deletions

View File

@ -66,7 +66,11 @@ _itoa(int i, char *a, int r) {
* Default callback function. * Default callback function.
* Do nothing. * Do nothing.
*/ */
static void opj_default_callback (const char *msg, void *client_data){} static void opj_default_callback (const char *msg, void *client_data)
{
OPJ_ARG_NOT_USED(msg);
OPJ_ARG_NOT_USED(client_data);
}
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */

View File

@ -218,6 +218,8 @@ opj_bool opj_mct_encode_custom(
OPJ_UINT32 lMultiplicator = 1 << 13; OPJ_UINT32 lMultiplicator = 1 << 13;
OPJ_INT32 * lMctPtr; OPJ_INT32 * lMctPtr;
OPJ_ARG_NOT_USED(isSigned);
lCurrentData = (OPJ_INT32 *) opj_malloc((pNbComp + lNbMatCoeff) * sizeof(OPJ_INT32)); lCurrentData = (OPJ_INT32 *) opj_malloc((pNbComp + lNbMatCoeff) * sizeof(OPJ_INT32));
if (! lCurrentData) { if (! lCurrentData) {
return OPJ_FALSE; return OPJ_FALSE;
@ -267,6 +269,8 @@ opj_bool opj_mct_decode_custom(
OPJ_FLOAT32 * lCurrentResult = 00; OPJ_FLOAT32 * lCurrentResult = 00;
OPJ_FLOAT32 ** lData = (OPJ_FLOAT32 **) pData; OPJ_FLOAT32 ** lData = (OPJ_FLOAT32 **) pData;
OPJ_ARG_NOT_USED(isSigned);
lCurrentData = (OPJ_FLOAT32 *) opj_malloc (2 * pNbComp * sizeof(OPJ_FLOAT32)); lCurrentData = (OPJ_FLOAT32 *) opj_malloc (2 * pNbComp * sizeof(OPJ_FLOAT32));
if (! lCurrentData) { if (! lCurrentData) {
return OPJ_FALSE; return OPJ_FALSE;

View File

@ -560,29 +560,7 @@ typedef void * opj_codec_t;
/** The stream was opened for writing. */ /** The stream was opened for writing. */
#define OPJ_STREAM_WRITE 0x0002 #define OPJ_STREAM_WRITE 0x0002
/**
Byte input-output stream (CIO)
DEPRECATED
*/
typedef struct opj_cio {
/** codec context */
opj_common_ptr cinfo;
/** open mode (read/write) either OPJ_STREAM_READ or OPJ_STREAM_WRITE */
int openmode;
/** pointer to the start of the buffer */
unsigned char *buffer;
/** buffer size in bytes */
/* FIXME: MM length is 'int' ?? */
int length;
/** pointer to the start of the stream */
unsigned char *start;
/** pointer to the end of the stream */
unsigned char *end;
/** pointer to the current position */
unsigned char *bp;
} opj_cio_t;
/* /*
@ -1069,39 +1047,7 @@ OPJ_API opj_image_t* OPJ_CALLCONV opj_image_tile_create(OPJ_UINT32 numcmpts, opj
========================================================== ==========================================================
stream functions definitions stream functions definitions
========================================================== ==========================================================
*/
/* CIO functions are DEPRECATED see following stream functions */
/**
Open and allocate a memory stream for read / write.
On reading, the user must provide a buffer containing encoded data. The buffer will be
wrapped by the returned CIO handle.
On writing, buffer parameters must be set to 0: a buffer will be allocated by the library
to contain encoded data.
@param cinfo Codec context info
@param buffer Reading: buffer address. Writing: NULL
@param length Reading: buffer length. Writing: 0
@return Returns a CIO handle if successful, returns NULL otherwise
*/
opj_cio_t* opj_cio_open(opj_common_ptr cinfo, unsigned char *buffer, int length);
/**
Close and free a CIO handle
@param cio CIO handle to free
*/
void opj_cio_close(opj_cio_t *cio);
/**
Get position in byte stream
@param cio CIO handle
@return Returns the position in bytes
*/
OPJ_OFF_T cio_tell(opj_cio_t *cio);
/**
Set position in byte stream
@param cio CIO handle
@param pos Position, in number of bytes, from the beginning of the stream
*/
void cio_seek(opj_cio_t *cio, int pos);
/* <----------- */ /* <----------- */
/* V2 framework */ /* V2 framework */

View File

@ -169,20 +169,20 @@ static void opj_t1_dec_refpass_step(opj_t1_t *t1,
OPJ_BYTE type, OPJ_BYTE type,
OPJ_UINT32 vsc); OPJ_UINT32 vsc);
static void INLINE opj_t1_dec_refpass_step_raw( static INLINE void opj_t1_dec_refpass_step_raw(
opj_t1_t *t1, opj_t1_t *t1,
opj_flag_t *flagsp, opj_flag_t *flagsp,
int *datap, int *datap,
int poshalf, int poshalf,
int neghalf, int neghalf,
int vsc); int vsc);
static void INLINE opj_t1_dec_refpass_step_mqc( static INLINE void opj_t1_dec_refpass_step_mqc(
opj_t1_t *t1, opj_t1_t *t1,
opj_flag_t *flagsp, opj_flag_t *flagsp,
int *datap, int *datap,
int poshalf, int poshalf,
int neghalf); int neghalf);
static void INLINE opj_t1_dec_refpass_step_mqc_vsc( static INLINE void opj_t1_dec_refpass_step_mqc_vsc(
opj_t1_t *t1, opj_t1_t *t1,
opj_flag_t *flagsp, opj_flag_t *flagsp,
int *datap, int *datap,
@ -401,8 +401,8 @@ static INLINE void opj_t1_dec_sigpass_step_raw(
int vsc) int vsc)
{ {
int v, flag; int v, flag;
opj_raw_t *raw = t1->raw; /* RAW component */ opj_raw_t *raw = t1->raw; /* RAW component */
OPJ_ARG_NOT_USED(orient);
flag = vsc ? ((*flagsp) & (~(T1_SIG_S | T1_SIG_SE | T1_SIG_SW | T1_SGN_S))) : (*flagsp); flag = vsc ? ((*flagsp) & (~(T1_SIG_S | T1_SIG_SE | T1_SIG_SW | T1_SGN_S))) : (*flagsp);
if ((flag & T1_SIG_OTH) && !(flag & (T1_SIG | T1_VISIT))) { if ((flag & T1_SIG_OTH) && !(flag & (T1_SIG | T1_VISIT))) {
@ -1130,6 +1130,7 @@ static OPJ_FLOAT64 opj_t1_getwmsedec(
const OPJ_FLOAT64 * mct_norms) const OPJ_FLOAT64 * mct_norms)
{ {
OPJ_FLOAT64 w1 = 1, w2, wmsedec; OPJ_FLOAT64 w1 = 1, w2, wmsedec;
OPJ_ARG_NOT_USED(numcomps);
if (mct_norms) { if (mct_norms) {
w1 = mct_norms[compno]; w1 = mct_norms[compno];
@ -1337,11 +1338,11 @@ opj_bool opj_t1_decode_cblks( opj_t1_t* t1,
tiledp += tile_w; tiledp += tile_w;
} }
} }
//opj_free(cblk->data); /*opj_free(cblk->data);
//opj_free(cblk->segs); opj_free(cblk->segs);*/
/*cblk->segs = 00;*/ /*cblk->segs = 00;*/
} /* cblkno */ } /* cblkno */
//opj_free(precinct->cblks.dec); /*opj_free(precinct->cblks.dec);*/
} /* precno */ } /* precno */
} /* bandno */ } /* bandno */
} /* resno */ } /* resno */