RE: [Plib-devel] ssg Borland
Brought to you by:
sjbaker
From: Fay J. F C. AAC/W. <joh...@eg...> - 2004-05-04 16:03:18
|
The variable type "sgMat4" is typedef'ed to "sgFloat [4][4]", so I think the argument is equivalent to const sgFloat m[4][4] This is a pointer to a constant array rather than being a constant pointer to an array. As such, an assignment like m = w ; is legal while an assignment like m[0][0] = 1.0 ; is not legal. Or so I surmise. The MSVC help files say this about "const": <begin quote> The const keyword can also be used in pointer declarations. char *const aptr = mybuf; // Constant pointer *aptr = 'a'; // Legal aptr = yourbuf; // Error A pointer to a variable declared as const can be assigned only to a pointer that is also declared as const. const char *bptr = mybuf; // Pointer to constant data *bptr = 'a'; // Error bptr = yourbuf; // Legal <end quote> John F. Fay joh...@eg... -----Original Message----- From: pli...@li... [mailto:pli...@li...]On Behalf Of Wolfram Kuss Sent: Tuesday, May 04, 2004 7:58 AM To: pli...@li... Subject: Re: [Plib-devel] ssg Borland <snip> >ssgVtxTable.cxx > >Within void ssgVtxTable::transform ( const sgMat4 m ) there is a line that >says: > > > >m = w; Maybe this is a stupid question, but why do other compilers not even warn? I checked and MSVC has no problems with that line. Bye bye, Wolfram. |