Skip to content
Tcl Source Code Artifact [e91be141e8]
Login

Artifact [e91be141e8]

Artifact e91be141e8f73aadefcd9c31cf295018cb4d8992:

Ticket change [e91be141e8] - Ticket [1787846fffffffff|1787846fff] <i>&quot;wideInt&quot; objType registration</i> status still Open with 5 other changes by das on 2007-09-04 22:23:40.
D 2007-09-04T22:23:40
J assignee dgp
J icomment Logged\sIn:\sYES\s\nuser_id=90580\nOriginator:\sNO\n\nDiscussion\son\schat\swith\skbk\sfrom\searlier\stoday\sabout\sthis\smatter,\she\sis\sok\swith\sthe\schange,\sis\sthere\sanything\sfurther\sthat\sneeds\sto\sbe\sdiscussed\s?\n\n<kbk>\sdas?\n<das>\syes?\n<kbk>\sI'm\slooking\sat\syour\sround\sof\schanges\sto\stclObj.c\s-\sand\sfeeling\sa\sbit\suneasy.\n<das>\sthe\swideInt\schange\s?\n<kbk>\sYes...\n<kbk>\s...\sYou\srealize\sthat\sTcl_GetWideIntFromObj\sisn't\sguaranteed\sto\sleave\sa\swideInt\sint\srep?\n<das>\syes\n<das>\sSetIntFromAny\sdoes\snot\sguarantee\san\sintRep\seither\sAFAICT\s?\n<kbk>\sok...\snow,\sdoes\swhatever\sextension\sis\scalling\sTcl_ConvertToType\sknow\sthat?\n<kbk>\sNo...\swe've\sbeen\smoving\ssteadily\sinto\sa\sworld\swhere\sintRep's\sare\sthe\sbusiness\sonly\sof\sthe\scode\sthat\sowns\sthem.\n<das>\sas\smentioned,\sI\sdon't\scare\sabout\sTcl_ConvertToType()\sin\sffidl\n<das>\sall\sI\sneed\sis\sto\sbe\sable\sto\scompare\sa\sgiven\sobjects'\stype\sto\swideInt\n<das>\sSetWideIntFromAny\sis\sunimportant\sto\sme,\sas\smentioned\sit\scan\sbe\sreverted\n<das>\sall\sI\scare\sabout\sis\sthe\stype\sregistration\n<kbk>\sok...\snow,\swhy\sis\sit\sthat\sffidl\sneeds\sto\scompare\sthe\stype?\n<kbk>\s(Strikes\sme\sas\sa\slittle\sdangerous\sto\shave\sruntime\sbehaviour\sthat\schanges\swith\sshimmering...\sbut\smaybe\sI\smisunderstand\swhat\sffidl\sis\sdoing)\n<das>\spassing\s64bits\sthrough\stcl\sunmolested,\si.e.\san\sobj\screated\swith\sa\s64bit\sint\sby\sTcl_NewWideIntObj\sby\sffidl\sshould\sbe\sable\sto\sbe\sconverted\sback\swithout\sgoing\sthrough\sbignums\sor\sfloats,\sin\sa\sway\scompatible\swith\sboth\s8.4\sand\s8.5\n<das>\sif\sthere\swas\sshimmering,\swe\saccept\sthere\smay\sbe\slossiness,\son\s8.4\sat\sleast\n<das>\son\s8.5,\sI'm\sworking\son\sfixing\sthat\sby\sgoing\sthrough\sbignums\n<kbk>\sRight.\s\s8.5\sshould\sbe\slossless,\sthough.\s\sTcl_NewWideIntObj\swill\screate\seither\san\sint\sor\sa\swide\s(or\sa\sbignum\sonly\sif\sNO_WIDE_TYPE\sis\sdefined).\n<das>\sbut\sI\swant\sto\savoid\sthe\sexpense\sif\sthere\swas\sno\sshimmering\n<kbk>\sTcl_GetWideIntFromObj\swill\sretrieve\sexactly\sthe\swide\sthat\swas\sstored.\n<kbk>\sSimilarly,\sas\slong\sas\syou\sdon't\smess\swith\stcl_precision,\sdoubles\sare\salso\slossless.\n<kbk>\s(except\sthat\ssignalling\sNaNs\swill\sbe\squieted,\sbecause\snasal\sdaemons\slurk\sin\sthat\scorner)\n<das>\swhat\sffidl\sdoes\sin\s8.4\sis\suse\sTcl_GetWideIntFromObj\sonly\son\sobjects\sof\stype\swideInt...\n<das>\sotherwise\suse\sTcl_GetDoubleFromObj\n<kbk>\sand\spresume\sthat\san\sint\swill\sfit\sin\sa\sdouble\s-\swhich\sisn't\strue\son\sa\s64-bit\smachine.\n<das>\sright,\sthe\slatter\smay\sbe\slossy\se.g.\sif\sthere\swas\sshimmering\n<das>\sthis\scould\sbe\sdone\sdifferently\son\s8.5\n<das>\sbut\show\sto\smake\san\sextension\sthat\sworks\son\sboth\n<das>\swith\sthe\ssame\sbinary\n<das>\sin\sany\scase,\sexisting\sffidl\sbinaries\sbreak\sdue\sto\sthe\s"wideInt"\sregistration\sremoval\n<kbk>\sHmmm.\sYou\sknow\sthe\sdata\stype\sthat\syou\sneed?\n<das>\sI\sdon't\sreally\ssee\sthe\sharm\sin\srestoring\sit\n<kbk>\sGiven\sthat\swe've\sidentified\scode\sthat\sbreaks,\sI'm\sinclined\sto\sagree...\snow\sI'm\sjust\sthinking\sabout\swhat\sbest\sto\sdo\smoving\sforward.\n<das>\sit\smay\swell\sbe\sthat\sadding\sSetWideIntFromAny\swas\sa\sbad\sidea\n<kbk>\sSetFooFromAny\sin\sgeneral\sis\sa\sbad\sidea.\s\sIt's\sbetter\sto\slet\sthe\stype\sbe\sdetermined\sby\sTcl_GetFooFromObj.\n<kbk>\sDo\syou\sknow\sthe\sdata\stype\sthat\syou\sneed\sin\sa\sgiven\scontext?\n<das>\sI'll\shave\sto\scheck,\sit\sshould\sbe\spossible,\sbut\scurrently\sthat's\snot\sthe\sway\sthe\scode\sworks\n<das>\smind\syou\sthis\sis\snot\scode\sI\swrote...\sit\sdates\sfrom\s99...\n<kbk>\sYeah.\s\sI\s\sknow\sthat\sffidl\shas\sa\sbloody\shistory...\sand\snumbers\sin\sTcl\sare\salmost\sequally\sbad.\s\s(Bignums\slooked\slike\sthe\sonly\sway\sout\sbecause\swe\srepeated\sprevious\smistakes\swith\sunsigned\swideInts)\n<kbk>\s(And\sthe\sbignum\slibrary\swas\sgoing\sin\sanyway\sso\sthat\sdoubles\scould\sshimmer\slosslessly)\n<das>\syes,\sand\sindeed\sffidl\shas\sproblems\swith\sboth\sunsigned\sints\sand\sunsigned\swideints...\n<das>\se.g.\sthere\sis\sno\sway\sto\sdistingush\sbetween\s-1,\sUINT_MAX\sand\sULLONG_MAX\sand\n<das>\sat\sthe\stcl\slevel...\n<das>\slooking\sto\sremedy\sthat\swith\sthe\s8.5\srev,\sbut\sstaying\scompatible\swith\s8.4\sis\stricky\n<kbk>\sYeah.\s\sI\s*think*\swe\smanaged\sto\sget\sthings\sso\sthat\s8.4\sputs\snumbers\sbetween\sINT_MAX+1\sand\sUINT_MAX\sinto\swides.\s\sBut\sunsigned\swides\sare\sstill\sa\sproblem.\n<das>\sthe\sproblem\sis\sthat\sffidl\sforces\ssuch\sints\sinto\san\sintrep,\snot\sa\swideint\s(pre-8.4\scode...)\n<kbk>\s*That*\sat\sleast\sshould\sbe\sfixable.\n<das>\syes\n<das>\sone\sissue\sis\sperformance,\soften\syou\sjust\swant\squick\sroundtripping\svia\stcl\swithout\sany\sconversions,\se.g.\spassing\sthe\sreturn\sval\sof\sone\sffidl\scallout\sas\sa\sparam\sto\sanother\n<das>\sI\sthink\sthat\sis\sthe\sreason\smost\sof\sthe\stype\scomparisons\sin\sffidl\sare\sdone\scurrently\n<kbk>\sAgain,\s8.5\sis\sgetting\sreasonably\ssmart\sabout\sthat.\s\sMost\sof\sthe\sTcl_GetFooFromObj\swhere\sFoo\sis\sa\snumeric\stype\srecognize\sall\sthe\snumeric\stypes\sand\sdon't\sshimmer.\n<kbk>\s(And\syes,\sI\sunderstand\sthat\syou\sneed\s8.4\scompat...\s:(\s)\n<das>\sI''try\sand\srip\sout\sall\sof\sthat\sugliness\sand\ssee\swhat\shappens...\sat\sleast\swhen\srunning\sagainst\s8.5\n<das>\sit\swould\scertainly\ssimplify\sthe\scode\sa\slot...\n<kbk>\sIf\syou\sfind\splaces\swhere\swe\sget\sit\swrong,\sby\sall\smeans\slog\sit.\s\s"Shimmering"\sof\snumbers\sshould\snow\sbe\s100%\slossless\s(and\sin\smost\scases\swon't\sshimmer)\n<das>\sof\scourse\sI\salso\swanted\sa\sminimal\seffort\sset\sof\schanges\sfor\s8.5...\n<das>\sgreat\n<kbk>\sIn\s8.6,\sI\swant\sto\stake\sout\sTcl_ConvertToType,\sby\sthe\sway.\s\sIt\sserves\sno\suseful\spurpose.\n<das>\ssounds\slike\sa\sgood\sidea,\sthat's\sone\sthing\sffidl\sis\snot\susing\sat\sleast\s;-)\n<das>\sso\sshould\sI\srevert\sthe\sSetWideIntFromAny\saddition\s?\n<das>\sand\sleave\sjust\sthe\stype\sregistration\s?\n<kbk>\sUhm.\s\sThe\sway\syou've\scoded\sit,\sit's\sMostly\sHarmless.\n<das>\syes,\sintentionally\s;-)\sthe\ssame\sas\sSetIntFromAny...\n<kbk>\sOh,\sand\sdon't\sregister\swideInt\sif\sNO_WIDE_INT_TYPE\s(or\showever\sit's\sspelt)\sis\sdefined.\n<das>\sI\sdon't\sthink\sI\sdo\n<das>\sthe\sstruct\sisn't\seven\sdefined\sin\sthat\scase\n<das>\si.e.\stclWideIntType\n<kbk>\sok,\scool.\s\sAnd\sotherwise,\sif\swe've\sidentified\sa\sknown\sdependency\sin\san\sextension,\sthen\sI\sthink\sI'm\sok\swith\sthis.\s\sYou\smight\swant\sto\sdouble-check\swith\sdgp\sas\swell.\n<das>\sok\n<das>\sthanks\n\n
J login das
J mimetype text/plain
J username das
K 1787846fffffffffffffffffffffffffffffffff
U das
Z 9cdbc4887903cd935845d00431b7b00f