<i>many type casts needed when using Tcl_Pkg* API</i> status still Open with 4 other changes
by
.
D 2010-08-31T01:35:03
J icomment Remembering\sthat\s"ClientData"\s==\s"void\s*":\n\nPrevious\ssignature\shad:\n\s\s\sTcl_PkgProvideEx(....,\svoid\s*clientData);\n\s\s\sTcl_PkgRequireEx(...,\svoid\s**clientData_rtn);\n\nIOW:\sput\spointer-to-T\sin,\sget\svoid\s*\sback\sout,\s\swhich\sthe\scaller\smust\sconvert\sback\sto\sa\spointer-to-T.\n\n(Note\sthat\sthe\sPkgRequire()\scall\sdid\snot\srequire\san\sexplicit\scast\seven\sunder\sthe\sold\ssignature\s\swhen\susing\sthe\susual\sidiom,\sand\sthe\sPkgProvide\scall\sonly\sneeded\sa\scast-away-from-const\scast\sif\sthe\sclientData\sis\sa\spointer-to-const-T.)\n\nNew\ssignature\shas:\n\s\s\sTcl_PkgProvideEx(....,\sconst\svoid\s*clientData);\n\s\s\sTcl_PkgRequireEx(...,\svoid\s*rtn);\n\nIOW:\sput\sa\spointer-to-T\sor\spointer-to-const-T\sin,\sget\s*anything*\sback\sout.\s\sThis\spokes\san\seven\sbigger\shole\sin\sthe\stype\ssystem\s(including\sinternally\sremoving\s'const'\squalifiers),\sbut\ssince\s'void\s*'\sis\salready\sinvolved\sthat's\sprobably\snot\sa\sbig\sdeal;\swe're\salready\srelying\son\sthe\scaller\sto\sget\sthings\sright,\sthe\scompiler\swon't\shelp\shere.\n\nAs\slong\sas\sit\sdoes\snot\scause\sa\sregression\sof\s#1091431,\sit's\sprobably\sOK.\s\s(Basically:\smake\ssure\sthat\sif\syou're\schanging\sthe\susual\sidiom\s\n\n\s\s\svoid\s*pkgData\s=\sNULL;\n\s\s\sif\s(Tcl_PkgRequireEx(....,\s&pkgData)\s!=\sNULL\s&&\spkgData\s!=\sNULL)\n\s\s\s\s\s\s\sfooStubsPtr\s=\spkgData;\n\nto\s\n\n\s\s\sTcl_PkgRequireEx(...,\s&fooStubsPtr);\n\nmake\ssure\sthat\s'fooStubsPtr'\sdoesn't\sget\sstomped\sin\scases\swhere\sthe\sPkgRequire()\sfails.\n\n(It\sdoesn't\slook\slike\sthat\sshould\shappen,\sbut\sI\scan't\sreally\stell;\sthe\sPkgRequire()\scodepath\shas\sgotten\sa\slot\smore\sconvoluted\ssince\slast\sI\slooked\sat\sit.)\n
J login jenglish
J mimetype text/plain
J username jenglish
K 2997642fffffffffffffffffffffffffffffffff
U jenglish
Z 104176f9a39e9d39c228ec4028639ecc