fixed multiple GCC warnings on Ubuntu 11.04

pull/13383/head
Vadim Pisarevsky 14 years ago
parent e05c488868
commit 22970b8270
  1. 18
      3rdparty/libjasper/jas_icc.c
  2. 2
      3rdparty/libjasper/jas_image.c
  3. 8
      3rdparty/libjasper/jas_seq.c
  4. 6
      3rdparty/libjasper/jp2_cod.c
  5. 36
      3rdparty/libjasper/jpc_cs.c
  6. 20
      3rdparty/libjasper/jpc_dec.c
  7. 2
      3rdparty/libjasper/jpc_mqenc.c
  8. 2
      3rdparty/libtiff/tif_dirread.c
  9. 3
      3rdparty/libtiff/tif_unix.c
  10. 9
      modules/core/include/opencv2/core/operations.hpp
  11. 3
      modules/core/src/mathfuncs.cpp
  12. 2
      modules/core/src/rand.cpp
  13. 51
      modules/core/src/stat.cpp
  14. 5
      modules/highgui/src/cap_dc1394_v2.cpp
  15. 16
      modules/imgproc/src/accum.cpp
  16. 2
      modules/imgproc/src/inpaint.cpp
  17. 4
      modules/imgproc/src/linefit.cpp
  18. 6
      modules/imgproc/test/test_convhull.cpp
  19. 2
      modules/imgproc/test/test_subdivisions.cpp
  20. 2
      modules/legacy/src/contourtree.cpp
  21. 4
      modules/python/src1/cv.cpp
  22. 2
      modules/python/src2/gen2.py

@ -730,9 +730,9 @@ void jas_iccattrtab_dump(jas_iccattrtab_t *attrtab, FILE *out)
fprintf(out, "attrno=%d; attrname=\"%s\"(0x%08x); attrtype=\"%s\"(0x%08x)\n", fprintf(out, "attrno=%d; attrname=\"%s\"(0x%08x); attrtype=\"%s\"(0x%08x)\n",
i, i,
jas_iccsigtostr(attr->name, &buf[0]), jas_iccsigtostr(attr->name, &buf[0]),
attr->name, (unsigned)attr->name,
jas_iccsigtostr(attrval->type, &buf[8]), jas_iccsigtostr(attrval->type, &buf[8]),
attrval->type (unsigned)attrval->type
); );
jas_iccattrval_dump(attrval, out); jas_iccattrval_dump(attrval, out);
fprintf(out, "---\n"); fprintf(out, "---\n");
@ -884,7 +884,7 @@ void jas_iccattrval_dump(jas_iccattrval_t *attrval, FILE *out)
char buf[8]; char buf[8];
jas_iccsigtostr(attrval->type, buf); jas_iccsigtostr(attrval->type, buf);
fprintf(out, "refcnt = %d; type = 0x%08x %s\n", attrval->refcnt, fprintf(out, "refcnt = %d; type = 0x%08x %s\n", attrval->refcnt,
attrval->type, jas_iccsigtostr(attrval->type, &buf[0])); (unsigned)attrval->type, jas_iccsigtostr(attrval->type, &buf[0]));
if (attrval->ops->dump) { if (attrval->ops->dump) {
(*attrval->ops->dump)(attrval, out); (*attrval->ops->dump)(attrval, out);
} }
@ -1041,7 +1041,7 @@ static void jas_icccurv_dump(jas_iccattrval_t *attrval, FILE *out)
{ {
int i; int i;
jas_icccurv_t *curv = &attrval->data.curv; jas_icccurv_t *curv = &attrval->data.curv;
fprintf(out, "number of entires = %d\n", curv->numents); fprintf(out, "number of entires = %d\n", (int)curv->numents);
if (curv->numents == 1) { if (curv->numents == 1) {
fprintf(out, "gamma = %f\n", curv->ents[0] / 256.0); fprintf(out, "gamma = %f\n", curv->ents[0] / 256.0);
} else { } else {
@ -1167,9 +1167,9 @@ static void jas_icctxtdesc_dump(jas_iccattrval_t *attrval, FILE *out)
{ {
jas_icctxtdesc_t *txtdesc = &attrval->data.txtdesc; jas_icctxtdesc_t *txtdesc = &attrval->data.txtdesc;
fprintf(out, "ascii = \"%s\"\n", txtdesc->ascdata); fprintf(out, "ascii = \"%s\"\n", txtdesc->ascdata);
fprintf(out, "uclangcode = %d; uclen = %d\n", txtdesc->uclangcode, fprintf(out, "uclangcode = %d; uclen = %d\n", (int)txtdesc->uclangcode,
txtdesc->uclen); (int)txtdesc->uclen);
fprintf(out, "sccode = %d\n", txtdesc->sccode); fprintf(out, "sccode = %d\n", (int)txtdesc->sccode);
fprintf(out, "maclen = %d\n", txtdesc->maclen); fprintf(out, "maclen = %d\n", txtdesc->maclen);
} }
@ -1401,7 +1401,7 @@ static void jas_icclut8_dump(jas_iccattrval_t *attrval, FILE *out)
fprintf(out, "\n"); fprintf(out, "\n");
} }
fprintf(out, "numintabents=%d, numouttabents=%d\n", fprintf(out, "numintabents=%d, numouttabents=%d\n",
lut8->numintabents, lut8->numouttabents); (int)lut8->numintabents, (int)lut8->numouttabents);
} }
/******************************************************************************\ /******************************************************************************\
@ -1565,7 +1565,7 @@ static void jas_icclut16_dump(jas_iccattrval_t *attrval, FILE *out)
fprintf(out, "\n"); fprintf(out, "\n");
} }
fprintf(out, "numintabents=%d, numouttabents=%d\n", fprintf(out, "numintabents=%d, numouttabents=%d\n",
lut16->numintabents, lut16->numouttabents); (int)lut16->numintabents, (int)lut16->numouttabents);
} }
/******************************************************************************\ /******************************************************************************\

@ -822,7 +822,7 @@ void jas_image_dump(jas_image_t *image, FILE *out)
for (cmptno = 0; cmptno < image->numcmpts_; ++cmptno) { for (cmptno = 0; cmptno < image->numcmpts_; ++cmptno) {
cmpt = image->cmpts_[cmptno]; cmpt = image->cmpts_[cmptno];
fprintf(out, "prec=%d, sgnd=%d, cmpttype=%d\n", cmpt->prec_, fprintf(out, "prec=%d, sgnd=%d, cmpttype=%d\n", cmpt->prec_,
cmpt->sgnd_, cmpt->type_); cmpt->sgnd_, (int)cmpt->type_);
width = jas_image_cmptwidth(image, cmptno); width = jas_image_cmptwidth(image, cmptno);
height = jas_image_cmptheight(image, cmptno); height = jas_image_cmptheight(image, cmptno);
n = JAS_MIN(16, width); n = JAS_MIN(16, width);

@ -423,10 +423,10 @@ int jas_seq2d_output(jas_matrix_t *matrix, FILE *out)
char sbuf[MAXLINELEN + 1]; char sbuf[MAXLINELEN + 1];
int n; int n;
fprintf(out, "%d %d\n", jas_seq2d_xstart(matrix), fprintf(out, "%d %d\n", (int)jas_seq2d_xstart(matrix),
jas_seq2d_ystart(matrix)); (int)jas_seq2d_ystart(matrix));
fprintf(out, "%d %d\n", jas_matrix_numcols(matrix), fprintf(out, "%d %d\n", (int)jas_matrix_numcols(matrix),
jas_matrix_numrows(matrix)); (int)jas_matrix_numrows(matrix));
buf[0] = '\0'; buf[0] = '\0';
for (i = 0; i < jas_matrix_numrows(matrix); ++i) { for (i = 0; i < jas_matrix_numrows(matrix); ++i) {

@ -321,7 +321,7 @@ void jp2_box_dump(jp2_box_t *box, FILE *out)
fprintf(out, "JP2 box: "); fprintf(out, "JP2 box: ");
fprintf(out, "type=%c%s%c (0x%08x); length=%d\n", '"', boxinfo->name, fprintf(out, "type=%c%s%c (0x%08x); length=%d\n", '"', boxinfo->name,
'"', box->type, box->len); '"', (unsigned)box->type, (int)box->len);
if (box->ops->dumpdata) { if (box->ops->dumpdata) {
(*box->ops->dumpdata)(box, out); (*box->ops->dumpdata)(box, out);
} }
@ -433,7 +433,7 @@ static void jp2_cdef_dumpdata(jp2_box_t *box, FILE *out)
unsigned int i; unsigned int i;
for (i = 0; i < cdef->numchans; ++i) { for (i = 0; i < cdef->numchans; ++i) {
fprintf(out, "channo=%d; type=%d; assoc=%d\n", fprintf(out, "channo=%d; type=%d; assoc=%d\n",
cdef->ents[i].channo, cdef->ents[i].type, cdef->ents[i].assoc); (int)cdef->ents[i].channo, (int)cdef->ents[i].type, (int)cdef->ents[i].assoc);
} }
} }
@ -871,7 +871,7 @@ static void jp2_pclr_dumpdata(jp2_box_t *box, FILE *out)
(int) pclr->numchans); (int) pclr->numchans);
for (i = 0; i < pclr->numlutents; ++i) { for (i = 0; i < pclr->numlutents; ++i) {
for (j = 0; j < pclr->numchans; ++j) { for (j = 0; j < pclr->numchans; ++j) {
fprintf(out, "LUT[%d][%d]=%d\n", i, j, pclr->lutdata[i * pclr->numchans + j]); fprintf(out, "LUT[%d][%d]=%d\n", i, j, (int)pclr->lutdata[i * pclr->numchans + j]);
} }
} }
} }

@ -403,9 +403,9 @@ void jpc_ms_dump(jpc_ms_t *ms, FILE *out)
{ {
jpc_mstabent_t *mstabent; jpc_mstabent_t *mstabent;
mstabent = jpc_mstab_lookup(ms->id); mstabent = jpc_mstab_lookup(ms->id);
fprintf(out, "type = 0x%04x (%s);", ms->id, mstabent->name); fprintf(out, "type = 0x%04x (%s);", (unsigned)ms->id, mstabent->name);
if (JPC_MS_HASPARMS(ms->id)) { if (JPC_MS_HASPARMS(ms->id)) {
fprintf(out, " len = %d;", ms->len + 2); fprintf(out, " len = %d;", (int)(ms->len + 2));
if (ms->ops->dumpparms) { if (ms->ops->dumpparms) {
(*ms->ops->dumpparms)(ms, out); (*ms->ops->dumpparms)(ms, out);
} else { } else {
@ -459,7 +459,7 @@ static int jpc_sot_dumpparms(jpc_ms_t *ms, FILE *out)
{ {
jpc_sot_t *sot = &ms->parms.sot; jpc_sot_t *sot = &ms->parms.sot;
fprintf(out, "tileno = %d; len = %d; partno = %d; numparts = %d\n", fprintf(out, "tileno = %d; len = %d; partno = %d; numparts = %d\n",
sot->tileno, sot->len, sot->partno, sot->numparts); (int)sot->tileno, (int)sot->len, sot->partno, sot->numparts);
return 0; return 0;
} }
@ -558,12 +558,12 @@ static int jpc_siz_dumpparms(jpc_ms_t *ms, FILE *out)
{ {
jpc_siz_t *siz = &ms->parms.siz; jpc_siz_t *siz = &ms->parms.siz;
unsigned int i; unsigned int i;
fprintf(out, "caps = 0x%02x;\n", siz->caps); fprintf(out, "caps = 0x%02x;\n", (unsigned)siz->caps);
fprintf(out, "width = %d; height = %d; xoff = %d; yoff = %d;\n", fprintf(out, "width = %d; height = %d; xoff = %d; yoff = %d;\n",
siz->width, siz->height, siz->xoff, siz->yoff); (int)siz->width, (int)siz->height, (int)siz->xoff, (int)siz->yoff);
fprintf(out, "tilewidth = %d; tileheight = %d; tilexoff = %d; " fprintf(out, "tilewidth = %d; tileheight = %d; tilexoff = %d; "
"tileyoff = %d;\n", siz->tilewidth, siz->tileheight, siz->tilexoff, "tileyoff = %d;\n", (int)siz->tilewidth, (int)siz->tileheight, (int)siz->tilexoff,
siz->tileyoff); (int)siz->tileyoff);
for (i = 0; i < siz->numcomps; ++i) { for (i = 0; i < siz->numcomps; ++i) {
fprintf(out, "prec[%d] = %d; sgnd[%d] = %d; hsamp[%d] = %d; " fprintf(out, "prec[%d] = %d; sgnd[%d] = %d; hsamp[%d] = %d; "
"vsamp[%d] = %d\n", i, siz->comps[i].prec, i, "vsamp[%d] = %d\n", i, siz->comps[i].prec, i,
@ -631,7 +631,7 @@ static int jpc_cod_dumpparms(jpc_ms_t *ms, FILE *out)
fprintf(out, "numdlvls = %d; qmfbid = %d; mctrans = %d\n", fprintf(out, "numdlvls = %d; qmfbid = %d; mctrans = %d\n",
cod->compparms.numdlvls, cod->compparms.qmfbid, cod->mctrans); cod->compparms.numdlvls, cod->compparms.qmfbid, cod->mctrans);
fprintf(out, "prg = %d; numlyrs = %d;\n", fprintf(out, "prg = %d; numlyrs = %d;\n",
cod->prg, cod->numlyrs); cod->prg, (int)cod->numlyrs);
fprintf(out, "cblkwidthval = %d; cblkheightval = %d; " fprintf(out, "cblkwidthval = %d; cblkheightval = %d; "
"cblksty = 0x%02x;\n", cod->compparms.cblkwidthval, cod->compparms.cblkheightval, "cblksty = 0x%02x;\n", cod->compparms.cblkwidthval, cod->compparms.cblkheightval,
cod->compparms.cblksty); cod->compparms.cblksty);
@ -709,7 +709,7 @@ static int jpc_coc_dumpparms(jpc_ms_t *ms, FILE *out)
{ {
jpc_coc_t *coc = &ms->parms.coc; jpc_coc_t *coc = &ms->parms.coc;
fprintf(out, "compno = %d; csty = 0x%02x; numdlvls = %d;\n", fprintf(out, "compno = %d; csty = 0x%02x; numdlvls = %d;\n",
coc->compno, coc->compparms.csty, coc->compparms.numdlvls); (int)coc->compno, coc->compparms.csty, coc->compparms.numdlvls);
fprintf(out, "cblkwidthval = %d; cblkheightval = %d; " fprintf(out, "cblkwidthval = %d; cblkheightval = %d; "
"cblksty = 0x%02x; qmfbid = %d;\n", coc->compparms.cblkwidthval, "cblksty = 0x%02x; qmfbid = %d;\n", coc->compparms.cblkwidthval,
coc->compparms.cblkheightval, coc->compparms.cblksty, coc->compparms.qmfbid); coc->compparms.cblkheightval, coc->compparms.cblksty, coc->compparms.qmfbid);
@ -840,7 +840,7 @@ static int jpc_rgn_dumpparms(jpc_ms_t *ms, FILE *out)
{ {
jpc_rgn_t *rgn = &ms->parms.rgn; jpc_rgn_t *rgn = &ms->parms.rgn;
fprintf(out, "compno = %d; roisty = %d; roishift = %d\n", fprintf(out, "compno = %d; roisty = %d; roishift = %d\n",
rgn->compno, rgn->roisty, rgn->roishift); (int)rgn->compno, rgn->roisty, rgn->roishift);
return 0; return 0;
} }
@ -933,7 +933,7 @@ static int jpc_qcc_dumpparms(jpc_ms_t *ms, FILE *out)
jpc_qcc_t *qcc = &ms->parms.qcc; jpc_qcc_t *qcc = &ms->parms.qcc;
int i; int i;
fprintf(out, "compno = %d; qntsty = %d; numguard = %d; " fprintf(out, "compno = %d; qntsty = %d; numguard = %d; "
"numstepsizes = %d\n", qcc->compno, qcc->compparms.qntsty, qcc->compparms.numguard, "numstepsizes = %d\n", (int)qcc->compno, qcc->compparms.qntsty, qcc->compparms.numguard,
qcc->compparms.numstepsizes); qcc->compparms.numstepsizes);
for (i = 0; i < qcc->compparms.numstepsizes; ++i) { for (i = 0; i < qcc->compparms.numstepsizes; ++i) {
fprintf(out, "expn[%d] = 0x%04x; mant[%d] = 0x%04x;\n", fprintf(out, "expn[%d] = 0x%04x; mant[%d] = 0x%04x;\n",
@ -1056,7 +1056,7 @@ static int jpc_sop_putparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *ou
static int jpc_sop_dumpparms(jpc_ms_t *ms, FILE *out) static int jpc_sop_dumpparms(jpc_ms_t *ms, FILE *out)
{ {
jpc_sop_t *sop = &ms->parms.sop; jpc_sop_t *sop = &ms->parms.sop;
fprintf(out, "seqno = %d;\n", sop->seqno); fprintf(out, "seqno = %d;\n", (int)sop->seqno);
return 0; return 0;
} }
@ -1122,7 +1122,7 @@ static int jpc_ppm_putparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *ou
static int jpc_ppm_dumpparms(jpc_ms_t *ms, FILE *out) static int jpc_ppm_dumpparms(jpc_ms_t *ms, FILE *out)
{ {
jpc_ppm_t *ppm = &ms->parms.ppm; jpc_ppm_t *ppm = &ms->parms.ppm;
fprintf(out, "ind=%d; len = %d;\n", ppm->ind, ppm->len); fprintf(out, "ind=%d; len = %d;\n", ppm->ind, (int)ppm->len);
if (ppm->len > 0) { if (ppm->len > 0) {
fprintf(out, "data =\n"); fprintf(out, "data =\n");
jas_memdump(out, ppm->data, ppm->len); jas_memdump(out, ppm->data, ppm->len);
@ -1194,7 +1194,7 @@ static int jpc_ppt_putparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *ou
static int jpc_ppt_dumpparms(jpc_ms_t *ms, FILE *out) static int jpc_ppt_dumpparms(jpc_ms_t *ms, FILE *out)
{ {
jpc_ppt_t *ppt = &ms->parms.ppt; jpc_ppt_t *ppt = &ms->parms.ppt;
fprintf(out, "ind=%d; len = %d;\n", ppt->ind, ppt->len); fprintf(out, "ind=%d; len = %d;\n", ppt->ind, (int)ppt->len);
if (ppt->len > 0) { if (ppt->len > 0) {
fprintf(out, "data =\n"); fprintf(out, "data =\n");
jas_memdump(out, ppt->data, ppt->len); jas_memdump(out, ppt->data, ppt->len);
@ -1301,10 +1301,10 @@ static int jpc_poc_dumpparms(jpc_ms_t *ms, FILE *out)
++pchgno, ++pchg) { ++pchgno, ++pchg) {
fprintf(out, "po[%d] = %d; ", pchgno, pchg->prgord); fprintf(out, "po[%d] = %d; ", pchgno, pchg->prgord);
fprintf(out, "cs[%d] = %d; ce[%d] = %d; ", fprintf(out, "cs[%d] = %d; ce[%d] = %d; ",
pchgno, pchg->compnostart, pchgno, pchg->compnoend); pchgno, (int)pchg->compnostart, pchgno, (int)pchg->compnoend);
fprintf(out, "rs[%d] = %d; re[%d] = %d; ", fprintf(out, "rs[%d] = %d; re[%d] = %d; ",
pchgno, pchg->rlvlnostart, pchgno, pchg->rlvlnoend); pchgno, pchg->rlvlnostart, pchgno, pchg->rlvlnoend);
fprintf(out, "le[%d] = %d\n", pchgno, pchg->lyrnoend); fprintf(out, "le[%d] = %d\n", pchgno, (int)pchg->lyrnoend);
} }
return 0; return 0;
} }
@ -1368,7 +1368,7 @@ static int jpc_crg_dumpparms(jpc_ms_t *ms, FILE *out)
for (compno = 0, comp = crg->comps; compno < crg->numcomps; ++compno, for (compno = 0, comp = crg->comps; compno < crg->numcomps; ++compno,
++comp) { ++comp) {
fprintf(out, "hoff[%d] = %d; voff[%d] = %d\n", compno, fprintf(out, "hoff[%d] = %d; voff[%d] = %d\n", compno,
comp->hoff, compno, comp->voff); (int)comp->hoff, compno, (int)comp->voff);
} }
return 0; return 0;
} }
@ -1430,7 +1430,7 @@ static int jpc_com_dumpparms(jpc_ms_t *ms, FILE *out)
jpc_com_t *com = &ms->parms.com; jpc_com_t *com = &ms->parms.com;
unsigned int i; unsigned int i;
int printable; int printable;
fprintf(out, "regid = %d;\n", com->regid); fprintf(out, "regid = %d;\n", (int)com->regid);
printable = 1; printable = 1;
for (i = 0; i < com->len; ++i) { for (i = 0; i < com->len; ++i) {
if (!isprint(com->data[i])) { if (!isprint(com->data[i])) {

@ -2003,31 +2003,31 @@ static int jpc_dec_dump(jpc_dec_t *dec, FILE *out)
tcomp->numrlvls; ++rlvlno, ++rlvl) { tcomp->numrlvls; ++rlvlno, ++rlvl) {
fprintf(out, "RESOLUTION LEVEL %d\n", rlvlno); fprintf(out, "RESOLUTION LEVEL %d\n", rlvlno);
fprintf(out, "xs =%d, ys = %d, xe = %d, ye = %d, w = %d, h = %d\n", fprintf(out, "xs =%d, ys = %d, xe = %d, ye = %d, w = %d, h = %d\n",
rlvl->xstart, rlvl->ystart, rlvl->xend, rlvl->yend, rlvl->xend - (int)rlvl->xstart, (int)rlvl->ystart, (int)rlvl->xend, (int)rlvl->yend, (int)(rlvl->xend -
rlvl->xstart, rlvl->yend - rlvl->ystart); rlvl->xstart), (int)(rlvl->yend - rlvl->ystart));
for (bandno = 0, band = rlvl->bands; for (bandno = 0, band = rlvl->bands;
bandno < rlvl->numbands; ++bandno, ++band) { bandno < rlvl->numbands; ++bandno, ++band) {
fprintf(out, "BAND %d\n", bandno); fprintf(out, "BAND %d\n", bandno);
fprintf(out, "xs =%d, ys = %d, xe = %d, ye = %d, w = %d, h = %d\n", fprintf(out, "xs =%d, ys = %d, xe = %d, ye = %d, w = %d, h = %d\n",
jas_seq2d_xstart(band->data), jas_seq2d_ystart(band->data), jas_seq2d_xend(band->data), (int)jas_seq2d_xstart(band->data), (int)jas_seq2d_ystart(band->data), (int)jas_seq2d_xend(band->data),
jas_seq2d_yend(band->data), jas_seq2d_xend(band->data) - jas_seq2d_xstart(band->data), (int)jas_seq2d_yend(band->data), (int)(jas_seq2d_xend(band->data) - jas_seq2d_xstart(band->data)),
jas_seq2d_yend(band->data) - jas_seq2d_ystart(band->data)); (int)(jas_seq2d_yend(band->data) - jas_seq2d_ystart(band->data)));
for (prcno = 0, prc = band->prcs; for (prcno = 0, prc = band->prcs;
prcno < rlvl->numprcs; ++prcno, prcno < rlvl->numprcs; ++prcno,
++prc) { ++prc) {
fprintf(out, "CODE BLOCK GROUP %d\n", prcno); fprintf(out, "CODE BLOCK GROUP %d\n", prcno);
fprintf(out, "xs =%d, ys = %d, xe = %d, ye = %d, w = %d, h = %d\n", fprintf(out, "xs =%d, ys = %d, xe = %d, ye = %d, w = %d, h = %d\n",
prc->xstart, prc->ystart, prc->xend, prc->yend, prc->xend - (int)prc->xstart, (int)prc->ystart, (int)prc->xend, (int)prc->yend, (int)(prc->xend -
prc->xstart, prc->yend - prc->ystart); prc->xstart), (int)(prc->yend - prc->ystart));
for (cblkno = 0, cblk = for (cblkno = 0, cblk =
prc->cblks; cblkno < prc->cblks; cblkno <
prc->numcblks; ++cblkno, prc->numcblks; ++cblkno,
++cblk) { ++cblk) {
fprintf(out, "CODE BLOCK %d\n", cblkno); fprintf(out, "CODE BLOCK %d\n", cblkno);
fprintf(out, "xs =%d, ys = %d, xe = %d, ye = %d, w = %d, h = %d\n", fprintf(out, "xs =%d, ys = %d, xe = %d, ye = %d, w = %d, h = %d\n",
jas_seq2d_xstart(cblk->data), jas_seq2d_ystart(cblk->data), jas_seq2d_xend(cblk->data), (int)jas_seq2d_xstart(cblk->data), (int)jas_seq2d_ystart(cblk->data), (int)jas_seq2d_xend(cblk->data),
jas_seq2d_yend(cblk->data), jas_seq2d_xend(cblk->data) - jas_seq2d_xstart(cblk->data), (int)jas_seq2d_yend(cblk->data), (int)(jas_seq2d_xend(cblk->data) - jas_seq2d_xstart(cblk->data)),
jas_seq2d_yend(cblk->data) - jas_seq2d_ystart(cblk->data)); (int)(jas_seq2d_yend(cblk->data) - jas_seq2d_ystart(cblk->data)));
} }
} }
} }

@ -384,7 +384,7 @@ static void jpc_mqenc_setbits(jpc_mqenc_t *mqenc)
int jpc_mqenc_dump(jpc_mqenc_t *mqenc, FILE *out) int jpc_mqenc_dump(jpc_mqenc_t *mqenc, FILE *out)
{ {
fprintf(out, "AREG = %08x, CREG = %08x, CTREG = %d\n", fprintf(out, "AREG = %08x, CREG = %08x, CTREG = %d\n",
mqenc->areg, mqenc->creg, mqenc->ctreg); (unsigned)mqenc->areg, (unsigned)mqenc->creg, (int)mqenc->ctreg);
fprintf(out, "IND = %02d, MPS = %d, QEVAL = %04x\n", fprintf(out, "IND = %02d, MPS = %d, QEVAL = %04x\n",
(int)(*mqenc->curctx - jpc_mqstates), (int)(*mqenc->curctx)->mps, (int)(*mqenc->curctx - jpc_mqstates), (int)(*mqenc->curctx)->mps,
(int)(*mqenc->curctx)->qeval); (int)(*mqenc->curctx)->qeval);

@ -1420,7 +1420,7 @@ TIFFFetchShortPair(TIFF* tif, TIFFDirEntry* dir)
case TIFF_SHORT: case TIFF_SHORT:
case TIFF_SSHORT: case TIFF_SSHORT:
{ {
uint16 v[2]; uint16 v[2]={0,0};
return TIFFFetchShortArray(tif, dir, v) return TIFFFetchShortArray(tif, dir, v)
&& TIFFSetField(tif, dir->tdir_tag, v[0], v[1]); && TIFFSetField(tif, dir->tdir_tag, v[0], v[1]);
} }

@ -36,9 +36,10 @@
#include <stdarg.h> #include <stdarg.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h>
#include <sys/stat.h> #include <sys/stat.h>
#ifdef HAVE_UNISTD_H #if defined HAVE_UNISTD_H || defined __linux__
# include <unistd.h> # include <unistd.h>
#endif #endif

@ -3433,7 +3433,14 @@ public:
static int isInstance(const void* ptr) static int isInstance(const void* ptr)
{ {
static _ClsName dummy; static _ClsName dummy;
return *(const void**)&dummy == *(const void**)ptr; union
{
const void* p;
const void** pp;
} a, b;
a.p = &dummy;
b.p = ptr;
return *a.pp == *b.pp;
} }
static void release(void** dbptr) static void release(void** dbptr)
{ {

@ -558,8 +558,7 @@ void polarToCart( InputArray src1, InputArray src2,
{ {
Mat Mag = src1.getMat(), Angle = src2.getMat(); Mat Mag = src1.getMat(), Angle = src2.getMat();
int type = Angle.type(), depth = Angle.depth(), cn = Angle.channels(); int type = Angle.type(), depth = Angle.depth(), cn = Angle.channels();
if( !Mag.empty() ) CV_Assert( Mag.empty() || (Angle.size == Mag.size && type == Mag.type() && (depth == CV_32F || depth == CV_64F)));
CV_Assert( Angle.size == Mag.size && type == Mag.type() && (depth == CV_32F || depth == CV_64F));
dst1.create( Angle.dims, Angle.size, type ); dst1.create( Angle.dims, Angle.size, type );
dst2.create( Angle.dims, Angle.size, type ); dst2.create( Angle.dims, Angle.size, type );
Mat X = dst1.getMat(), Y = dst2.getMat(); Mat X = dst1.getMat(), Y = dst2.getMat();

@ -801,7 +801,7 @@ cvRandArr( CvRNG* _rng, CvArr* arr, int disttype, CvScalar param1, CvScalar para
// !!! this will only work for current 64-bit MWC RNG !!! // !!! this will only work for current 64-bit MWC RNG !!!
cv::RNG& rng = _rng ? (cv::RNG&)*_rng : cv::theRNG(); cv::RNG& rng = _rng ? (cv::RNG&)*_rng : cv::theRNG();
rng.fill(mat, disttype == CV_RAND_NORMAL ? rng.fill(mat, disttype == CV_RAND_NORMAL ?
cv::RNG::NORMAL : cv::RNG::UNIFORM, (cv::Scalar&)param1, (cv::Scalar&)param2 ); cv::RNG::NORMAL : cv::RNG::UNIFORM, cv::Scalar(param1), cv::Scalar(param2) );
} }
CV_IMPL void cvRandShuffle( CvArr* arr, CvRNG* _rng, double iter_factor ) CV_IMPL void cvRandShuffle( CvArr* arr, CvRNG* _rng, double iter_factor )

@ -466,8 +466,7 @@ int cv::countNonZero( InputArray _src )
cv::Scalar cv::mean( InputArray _src, InputArray _mask ) cv::Scalar cv::mean( InputArray _src, InputArray _mask )
{ {
Mat src = _src.getMat(), mask = _mask.getMat(); Mat src = _src.getMat(), mask = _mask.getMat();
if( !mask.empty() ) CV_Assert( mask.empty() || mask.type() == CV_8U );
CV_Assert( mask.type() == CV_8U );
int k, cn = src.channels(), depth = src.depth(); int k, cn = src.channels(), depth = src.depth();
SumFunc func = sumTab[depth]; SumFunc func = sumTab[depth];
@ -526,8 +525,7 @@ cv::Scalar cv::mean( InputArray _src, InputArray _mask )
void cv::meanStdDev( InputArray _src, OutputArray _mean, OutputArray _sdv, InputArray _mask ) void cv::meanStdDev( InputArray _src, OutputArray _mean, OutputArray _sdv, InputArray _mask )
{ {
Mat src = _src.getMat(), mask = _mask.getMat(); Mat src = _src.getMat(), mask = _mask.getMat();
if( !mask.empty() ) CV_Assert( mask.empty() || mask.type() == CV_8U );
CV_Assert( mask.type() == CV_8U );
int k, cn = src.channels(), depth = src.depth(); int k, cn = src.channels(), depth = src.depth();
SumSqrFunc func = sumSqrTab[depth]; SumSqrFunc func = sumSqrTab[depth];
@ -1059,13 +1057,20 @@ double cv::norm( InputArray _src, int normType, InputArray _mask )
const Mat* arrays[] = {&src, &mask, 0}; const Mat* arrays[] = {&src, &mask, 0};
uchar* ptrs[2]; uchar* ptrs[2];
double result = 0; union
{
double d;
int i;
float f;
}
result;
result.d = 0;
NAryMatIterator it(arrays, ptrs); NAryMatIterator it(arrays, ptrs);
int j, total = (int)it.size, blockSize = total, intSumBlockSize = 0, count = 0; int j, total = (int)it.size, blockSize = total, intSumBlockSize = 0, count = 0;
bool blockSum = (normType == NORM_L1 && depth <= CV_16S) || bool blockSum = (normType == NORM_L1 && depth <= CV_16S) ||
(normType == NORM_L2 && depth <= CV_8S); (normType == NORM_L2 && depth <= CV_8S);
int isum = 0; int isum = 0;
int *ibuf = (int*)&result; int *ibuf = &result.i;
size_t esz = 0; size_t esz = 0;
if( blockSum ) if( blockSum )
@ -1085,7 +1090,7 @@ double cv::norm( InputArray _src, int normType, InputArray _mask )
count += bsz; count += bsz;
if( blockSum && (count + blockSize >= intSumBlockSize || (i+1 >= it.nplanes && j+bsz >= total)) ) if( blockSum && (count + blockSize >= intSumBlockSize || (i+1 >= it.nplanes && j+bsz >= total)) )
{ {
result += isum; result.d += isum;
isum = 0; isum = 0;
count = 0; count = 0;
} }
@ -1100,14 +1105,14 @@ double cv::norm( InputArray _src, int normType, InputArray _mask )
if( depth == CV_64F ) if( depth == CV_64F )
; ;
else if( depth == CV_32F ) else if( depth == CV_32F )
result = (float&)result; result.d = result.f;
else else
result = (int&)result; result.d = result.i;
} }
else if( normType == NORM_L2 ) else if( normType == NORM_L2 )
result = std::sqrt(result); result.d = std::sqrt(result.d);
return result; return result.d;
} }
@ -1159,13 +1164,21 @@ double cv::norm( InputArray _src1, InputArray _src2, int normType, InputArray _m
const Mat* arrays[] = {&src1, &src2, &mask, 0}; const Mat* arrays[] = {&src1, &src2, &mask, 0};
uchar* ptrs[3]; uchar* ptrs[3];
double result = 0; union
{
double d;
float f;
int i;
unsigned u;
}
result;
result.d = 0;
NAryMatIterator it(arrays, ptrs); NAryMatIterator it(arrays, ptrs);
int j, total = (int)it.size, blockSize = total, intSumBlockSize = 0, count = 0; int j, total = (int)it.size, blockSize = total, intSumBlockSize = 0, count = 0;
bool blockSum = (normType == NORM_L1 && depth <= CV_16S) || bool blockSum = (normType == NORM_L1 && depth <= CV_16S) ||
(normType == NORM_L2 && depth <= CV_8S); (normType == NORM_L2 && depth <= CV_8S);
unsigned int isum = 0; unsigned isum = 0;
unsigned int *ibuf = (unsigned int*)&result; unsigned *ibuf = &result.u;
size_t esz = 0; size_t esz = 0;
if( blockSum ) if( blockSum )
@ -1185,7 +1198,7 @@ double cv::norm( InputArray _src1, InputArray _src2, int normType, InputArray _m
count += bsz; count += bsz;
if( blockSum && (count + blockSize >= intSumBlockSize || (i+1 >= it.nplanes && j+bsz >= total)) ) if( blockSum && (count + blockSize >= intSumBlockSize || (i+1 >= it.nplanes && j+bsz >= total)) )
{ {
result += isum; result.d += isum;
isum = 0; isum = 0;
count = 0; count = 0;
} }
@ -1201,14 +1214,14 @@ double cv::norm( InputArray _src1, InputArray _src2, int normType, InputArray _m
if( depth == CV_64F ) if( depth == CV_64F )
; ;
else if( depth == CV_32F ) else if( depth == CV_32F )
result = (float&)result; result.d = result.f;
else else
result = (int&)result; result.d = result.u;
} }
else if( normType == NORM_L2 ) else if( normType == NORM_L2 )
result = std::sqrt(result); result.d = std::sqrt(result.d);
return result; return result.d;
} }

@ -352,7 +352,7 @@ bool CvCaptureCAM_DC1394_v2_CPP::startCapture()
{ {
dc1394video_modes_t videoModes; dc1394video_modes_t videoModes;
dc1394_video_get_supported_modes(dcCam, &videoModes); dc1394_video_get_supported_modes(dcCam, &videoModes);
if (userMode < videoModes.num) if (userMode < (int)videoModes.num)
{ {
dc1394video_mode_t mode = videoModes.modes[userMode]; dc1394video_mode_t mode = videoModes.modes[userMode];
code = dc1394_video_set_mode(dcCam, mode); code = dc1394_video_set_mode(dcCam, mode);
@ -665,14 +665,15 @@ bool CvCaptureCAM_DC1394_v2_CPP::setProperty(int propId, double value)
&& dcCam) && dcCam)
{ {
if (cvRound(value) == CV_CAP_PROP_DC1394_OFF) if (cvRound(value) == CV_CAP_PROP_DC1394_OFF)
{
if ((feature_set.feature[dc1394properties[propId]-DC1394_FEATURE_MIN].on_off_capable) if ((feature_set.feature[dc1394properties[propId]-DC1394_FEATURE_MIN].on_off_capable)
&& (dc1394_feature_set_power(dcCam, (dc1394feature_t)dc1394properties[propId], DC1394_OFF)==DC1394_SUCCESS)) && (dc1394_feature_set_power(dcCam, (dc1394feature_t)dc1394properties[propId], DC1394_OFF)==DC1394_SUCCESS))
{ {
feature_set.feature[dc1394properties[propId]-DC1394_FEATURE_MIN].is_on=DC1394_OFF; feature_set.feature[dc1394properties[propId]-DC1394_FEATURE_MIN].is_on=DC1394_OFF;
return true; return true;
} }
else
return false; return false;
}
//try to turn the feature ON, feature can be ON and at the same time it can be not capable to change state to OFF //try to turn the feature ON, feature can be ON and at the same time it can be not capable to change state to OFF
if ( feature_set.feature[dc1394properties[propId]-DC1394_FEATURE_MIN].is_on == DC1394_OFF && if ( feature_set.feature[dc1394properties[propId]-DC1394_FEATURE_MIN].is_on == DC1394_OFF &&
(feature_set.feature[dc1394properties[propId]-DC1394_FEATURE_MIN].on_off_capable == DC1394_TRUE)) (feature_set.feature[dc1394properties[propId]-DC1394_FEATURE_MIN].on_off_capable == DC1394_TRUE))

@ -356,9 +356,7 @@ void cv::accumulate( InputArray _src, InputOutputArray _dst, InputArray _mask )
int sdepth = src.depth(), ddepth = dst.depth(), cn = src.channels(); int sdepth = src.depth(), ddepth = dst.depth(), cn = src.channels();
CV_Assert( dst.size == src.size && dst.channels() == cn ); CV_Assert( dst.size == src.size && dst.channels() == cn );
CV_Assert( mask.empty() || (mask.size == src.size && mask.type() == CV_8U) );
if( !mask.empty() )
CV_Assert( mask.size == src.size && mask.type() == CV_8U );
int fidx = getAccTabIdx(sdepth, ddepth); int fidx = getAccTabIdx(sdepth, ddepth);
AccFunc func = fidx >= 0 ? accTab[fidx] : 0; AccFunc func = fidx >= 0 ? accTab[fidx] : 0;
@ -380,9 +378,7 @@ void cv::accumulateSquare( InputArray _src, InputOutputArray _dst, InputArray _m
int sdepth = src.depth(), ddepth = dst.depth(), cn = src.channels(); int sdepth = src.depth(), ddepth = dst.depth(), cn = src.channels();
CV_Assert( dst.size == src.size && dst.channels() == cn ); CV_Assert( dst.size == src.size && dst.channels() == cn );
CV_Assert( mask.empty() || (mask.size == src.size && mask.type() == CV_8U) );
if( !mask.empty() )
CV_Assert( mask.size == src.size && mask.type() == CV_8U );
int fidx = getAccTabIdx(sdepth, ddepth); int fidx = getAccTabIdx(sdepth, ddepth);
AccFunc func = fidx >= 0 ? accSqrTab[fidx] : 0; AccFunc func = fidx >= 0 ? accSqrTab[fidx] : 0;
@ -405,9 +401,7 @@ void cv::accumulateProduct( InputArray _src1, InputArray _src2,
CV_Assert( src2.size && src1.size && src2.type() == src1.type() ); CV_Assert( src2.size && src1.size && src2.type() == src1.type() );
CV_Assert( dst.size == src1.size && dst.channels() == cn ); CV_Assert( dst.size == src1.size && dst.channels() == cn );
CV_Assert( mask.empty() || (mask.size == src1.size && mask.type() == CV_8U) );
if( !mask.empty() )
CV_Assert( mask.size == src1.size && mask.type() == CV_8U );
int fidx = getAccTabIdx(sdepth, ddepth); int fidx = getAccTabIdx(sdepth, ddepth);
AccProdFunc func = fidx >= 0 ? accProdTab[fidx] : 0; AccProdFunc func = fidx >= 0 ? accProdTab[fidx] : 0;
@ -430,9 +424,7 @@ void cv::accumulateWeighted( InputArray _src, CV_IN_OUT InputOutputArray _dst,
int sdepth = src.depth(), ddepth = dst.depth(), cn = src.channels(); int sdepth = src.depth(), ddepth = dst.depth(), cn = src.channels();
CV_Assert( dst.size == src.size && dst.channels() == cn ); CV_Assert( dst.size == src.size && dst.channels() == cn );
CV_Assert( mask.empty() || (mask.size == src.size && mask.type() == CV_8U) );
if( !mask.empty() )
CV_Assert( mask.size == src.size && mask.type() == CV_8U );
int fidx = getAccTabIdx(sdepth, ddepth); int fidx = getAccTabIdx(sdepth, ddepth);
AccWFunc func = fidx >= 0 ? accWTab[fidx] : 0; AccWFunc func = fidx >= 0 ? accWTab[fidx] : 0;

@ -103,7 +103,7 @@ public:
for (i=1; i<=num; i++) { for (i=1; i<=num; i++) {
mem[i].prev = mem+i-1; mem[i].prev = mem+i-1;
mem[i].next = mem+i+1; mem[i].next = mem+i+1;
mem[i].i = mem[i].i = -1; mem[i].i = -1;
mem[i].T = FLT_MAX; mem[i].T = FLT_MAX;
} }
tail = mem+i; tail = mem+i;

@ -494,14 +494,12 @@ icvFitLine3D( CvPoint3D32f * points, int count, int dist,
float *w; /* weights */ float *w; /* weights */
float *r; /* square distances */ float *r; /* square distances */
int i, j, k; int i, j, k;
float _line[6], _lineprev[6]; float _line[6]={0,0,0,0,0,0}, _lineprev[6]={0,0,0,0,0,0};
float rdelta = reps != 0 ? reps : 1.0f; float rdelta = reps != 0 ? reps : 1.0f;
float adelta = aeps != 0 ? aeps : 0.01f; float adelta = aeps != 0 ? aeps : 0.01f;
double min_err = DBL_MAX, err = 0; double min_err = DBL_MAX, err = 0;
CvRNG rng = cvRNG(-1); CvRNG rng = cvRNG(-1);
memset( line, 0, 6*sizeof(line[0]) );
switch (dist) switch (dist)
{ {
case CV_DIST_L2: case CV_DIST_L2:

@ -797,7 +797,11 @@ void CV_MinCircleTest::run_func()
if(!test_cpp) if(!test_cpp)
cvMinEnclosingCircle( points, &center, &radius ); cvMinEnclosingCircle( points, &center, &radius );
else else
cv::minEnclosingCircle(cv::cvarrToMat(points), (cv::Point2f&)center, radius); {
cv::Point2f tmpcenter;
cv::minEnclosingCircle(cv::cvarrToMat(points), tmpcenter, radius);
center = tmpcenter;
}
} }

@ -214,7 +214,7 @@ int CV_SubdivTest::validate_test_results( int /*test_case_idx*/ )
double xrange = img_size.width*(1 - FLT_EPSILON); double xrange = img_size.width*(1 - FLT_EPSILON);
double yrange = img_size.height*(1 - FLT_EPSILON); double yrange = img_size.height*(1 - FLT_EPSILON);
subdiv = subdiv = cvCreateSubdivDelaunay2D( subdiv = cvCreateSubdivDelaunay2D(
cvRect( 0, 0, img_size.width, img_size.height ), storage ); cvRect( 0, 0, img_size.width, img_size.height ), storage );
CvSeq* seq = cvCreateSeq( 0, sizeof(*seq), sizeof(CvPoint2D32f), storage ); CvSeq* seq = cvCreateSeq( 0, sizeof(*seq), sizeof(CvPoint2D32f), storage );

@ -715,8 +715,6 @@ cvContourFromContourTree( const CvContourTree* tree,
criteria = cvCheckTermCriteria( criteria, 0., 100 ); criteria = cvCheckTermCriteria( criteria, 0., 100 );
lpt = tree->total; lpt = tree->total;
ptr_buf = NULL;
level_buf = NULL;
i_buf = 0; i_buf = 0;
cur_level = 0; cur_level = 0;
log_iter = (char) (criteria.type == CV_TERMCRIT_ITER || log_iter = (char) (criteria.type == CV_TERMCRIT_ITER ||

@ -150,7 +150,7 @@ static void translate_error_to_exception(void)
cvSetErrStatus(0); cvSetErrStatus(0);
} }
#define ERRCHK do { if (cvGetErrStatus() != 0) { translate_error_to_exception(); return NULL; } } while (0) #define ERRCHK do { if (cvGetErrStatus() != 0) { translate_error_to_exception(); return 0; } } while (0)
#define ERRWRAPN(F, N) \ #define ERRWRAPN(F, N) \
do { \ do { \
try \ try \
@ -3355,7 +3355,7 @@ static PyObject *pycvReshapeMatND(PyObject *self, PyObject *args)
CvMatND *cva; CvMatND *cva;
if (!convert_to_CvMatND(o, &cva, "src")) if (!convert_to_CvMatND(o, &cva, "src"))
return NULL; return NULL;
ints dims; ints dims={0,0};
if (new_dims != NULL) { if (new_dims != NULL) {
if (!convert_to_ints(new_dims, &dims, "new_dims")) if (!convert_to_ints(new_dims, &dims, "new_dims"))
return NULL; return NULL;

@ -161,7 +161,7 @@ simple_argtype_mapping = {
"int": ("int", "i", "0"), "int": ("int", "i", "0"),
"float": ("float", "f", "0.f"), "float": ("float", "f", "0.f"),
"double": ("double", "d", "0"), "double": ("double", "d", "0"),
"c_string": ("char*", "s", '""') "c_string": ("char*", "s", '(char*)""')
} }
class ClassProp(object): class ClassProp(object):

Loading…
Cancel
Save