conversion problem with template, const with gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi:

I am really puzzled with errors like the following:

g++  -c pymat.cpp -o pymat.o -I/usr/local/matlab6p5/extern/include -I/usr/include/python2.2/numarray -I/usr/include/python2.2 
pymat.cpp: In function `mxArray* makeMxFromNumeric(const PyArrayObject*)':
pymat.cpp:216: invalid conversion from `const maybelong*' to `int*'
pymat.cpp:216:   initializing argument 5 of `void copyNumeric2Mx(T*, int, int, 
   double*, int*) [with T = char]'

where copyNumeric2Mx is a template function:

template <class T>
void copyNumeric2Mx(T *pSrc, int pRows, int pCols, double *pDst, int *pStrides)
{ // ... }

for each instantiated template function like in the following:
  case PyArray_CHAR:
        copyNumeric2Mx((char *)(pSrc->data), lRows, lCols, lR, pSrc->strides);
        break;

    case PyArray_UBYTE:
        copyNumeric2Mx((unsigned char *)(pSrc->data), lRows, lCols, lR, pSrc->strides);
        break;

    case PyArray_SBYTE:
        copyNumeric2Mx((signed char *)(pSrc->data), lRows, lCols, lR, pSrc->strides);
        break;

    case PyArray_SHORT: 
        copyNumeric2Mx((short *)(pSrc->data), lRows, lCols, lR, pSrc->strides);
        break;

Anybody can help me?
Thanks
Roy


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux