|
From: <kar...@us...> - 2006-05-13 17:31:47
|
Revision: 1375 Author: karstenw Date: 2006-05-13 10:30:47 -0700 (Sat, 13 May 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1375&view=rev Log Message: ----------- further hacks and tweaks on the road to really BIG ints. Modified Paths: -------------- Frontier/branches/Int64/Common/IOAToolkit/ioaedittext.h Frontier/branches/Int64/Common/headers/FastTimes.h Frontier/branches/Int64/Common/headers/aeutils.h Frontier/branches/Int64/Common/headers/claybrowserstruc.h Frontier/branches/Int64/Common/headers/dockmenu.h Frontier/branches/Int64/Common/headers/icon.h Frontier/branches/Int64/Common/headers/lang.h Frontier/branches/Int64/Common/headers/langregexp.h Frontier/branches/Int64/Common/headers/ops.h Frontier/branches/Int64/Common/headers/player.h Frontier/branches/Int64/Common/headers/serialnumber.h Frontier/branches/Int64/Common/headers/services.h Frontier/branches/Int64/Common/headers/shellprint.h Frontier/branches/Int64/Common/source/aeutils.c Frontier/branches/Int64/Common/source/dockmenu.c Frontier/branches/Int64/Common/source/frontierconfig.c Frontier/branches/Int64/Common/source/langscan.c Frontier/branches/Int64/Common/source/langvalue.c Frontier/branches/Int64/Common/source/ops.c Frontier/branches/Int64/Common/source/player.c Frontier/branches/Int64/Common/source/services.c Frontier/branches/Int64/FrontierSDK/Toolkits/AppletToolkit/Headers/appletfiles.h Frontier/branches/Int64/FrontierSDK/Toolkits/AppletToolkit/Headers/appletfont.h Frontier/branches/Int64/FrontierSDK/Toolkits/AppletToolkit/Headers/appleticons.h Modified: Frontier/branches/Int64/Common/IOAToolkit/ioaedittext.h =================================================================== --- Frontier/branches/Int64/Common/IOAToolkit/ioaedittext.h 2006-05-13 17:29:57 UTC (rev 1374) +++ Frontier/branches/Int64/Common/IOAToolkit/ioaedittext.h 2006-05-13 17:30:47 UTC (rev 1375) @@ -42,4 +42,4 @@ boolean emptytextbehindbullets (hdlobject); -boolean settextbehindbullets (hdlobject, void *); \ No newline at end of file +boolean settextbehindbullets (hdlobject, void *); Modified: Frontier/branches/Int64/Common/headers/FastTimes.h =================================================================== --- Frontier/branches/Int64/Common/headers/FastTimes.h 2006-05-13 17:29:57 UTC (rev 1374) +++ Frontier/branches/Int64/Common/headers/FastTimes.h 2006-05-13 17:30:47 UTC (rev 1375) @@ -34,4 +34,4 @@ /* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */ /* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */ -#endif /* __FAST_TIMES_HEADER__ */ \ No newline at end of file +#endif /* __FAST_TIMES_HEADER__ */ Modified: Frontier/branches/Int64/Common/headers/aeutils.h =================================================================== --- Frontier/branches/Int64/Common/headers/aeutils.h 2006-05-13 17:29:57 UTC (rev 1374) +++ Frontier/branches/Int64/Common/headers/aeutils.h 2006-05-13 17:30:47 UTC (rev 1375) @@ -39,4 +39,4 @@ extern boolean newdescnull (AEDesc *desc, DescType typeCode); // MJL 08/12/03: Broken boolean obj spec fix -extern boolean nildatahandle (AEDesc *desc); \ No newline at end of file +extern boolean nildatahandle (AEDesc *desc); Modified: Frontier/branches/Int64/Common/headers/claybrowserstruc.h =================================================================== --- Frontier/branches/Int64/Common/headers/claybrowserstruc.h 2006-05-13 17:29:57 UTC (rev 1374) +++ Frontier/branches/Int64/Common/headers/claybrowserstruc.h 2006-05-13 17:30:47 UTC (rev 1375) @@ -67,4 +67,5 @@ extern boolean browserdeletedummyvalues (hdlheadrecord); -#endif \ No newline at end of file +#endif + Modified: Frontier/branches/Int64/Common/headers/dockmenu.h =================================================================== --- Frontier/branches/Int64/Common/headers/dockmenu.h 2006-05-13 17:29:57 UTC (rev 1374) +++ Frontier/branches/Int64/Common/headers/dockmenu.h 2006-05-13 17:30:47 UTC (rev 1375) @@ -37,4 +37,4 @@ pascal OSStatus dockcommandhandler (EventHandlerCallRef nextHandler, EventRef theEvent, void* userData); -#endif \ No newline at end of file +#endif Modified: Frontier/branches/Int64/Common/headers/icon.h =================================================================== --- Frontier/branches/Int64/Common/headers/icon.h 2006-05-13 17:29:57 UTC (rev 1374) +++ Frontier/branches/Int64/Common/headers/icon.h 2006-05-13 17:30:47 UTC (rev 1375) @@ -66,4 +66,4 @@ extern boolean ploticoncustom (const Rect *r, short align, short transform, bigstring bsiconname); /*7.0b9 PBS*/ -boolean customicongetrnum (bigstring bstype, short *rnum); \ No newline at end of file +boolean customicongetrnum (bigstring bstype, short *rnum); Modified: Frontier/branches/Int64/Common/headers/lang.h =================================================================== --- Frontier/branches/Int64/Common/headers/lang.h 2006-05-13 17:29:57 UTC (rev 1374) +++ Frontier/branches/Int64/Common/headers/lang.h 2006-05-13 17:30:47 UTC (rev 1375) @@ -1070,7 +1070,7 @@ extern boolean getlonglongintvalue (hdltreenode hfirst, short pnum, tylonglongint *lval); - +extern boolean setllintvaluewrap (tylonglongint x, tyvaluerecord *val); #endif extern boolean setdatevalue (unsigned long, tyvaluerecord *); Modified: Frontier/branches/Int64/Common/headers/langregexp.h =================================================================== --- Frontier/branches/Int64/Common/headers/langregexp.h 2006-05-13 17:29:57 UTC (rev 1374) +++ Frontier/branches/Int64/Common/headers/langregexp.h 2006-05-13 17:30:47 UTC (rev 1375) @@ -44,4 +44,4 @@ extern boolean regexptextsearch (byte *, long, long *, long *); -#endif /*flregexpverbs*/ \ No newline at end of file +#endif /*flregexpverbs*/ Modified: Frontier/branches/Int64/Common/headers/ops.h =================================================================== --- Frontier/branches/Int64/Common/headers/ops.h 2006-05-13 17:29:57 UTC (rev 1374) +++ Frontier/branches/Int64/Common/headers/ops.h 2006-05-13 17:30:47 UTC (rev 1375) @@ -71,7 +71,10 @@ extern boolean stringtoshort (bigstring, short *); #if LONGINT_LONGDATE == 1 + extern boolean longlonginttostring(tylonglongint theInt, bigstring bs, int radix); +extern boolean stringtolonglongint (bigstring bs, tylonglongint *llival); + #endif extern boolean stringtonumber (bigstring, long *); @@ -122,4 +125,4 @@ extern unsigned long bcdtolong (unsigned long); /* 2004-11-16 creedon */ -#endif \ No newline at end of file +#endif Modified: Frontier/branches/Int64/Common/headers/player.h =================================================================== --- Frontier/branches/Int64/Common/headers/player.h 2006-05-13 17:29:57 UTC (rev 1374) +++ Frontier/branches/Int64/Common/headers/player.h 2006-05-13 17:30:47 UTC (rev 1375) @@ -46,4 +46,4 @@ boolean playerstopmovie (void); -#endif /*MACVERSION -- Mac-only feature*/ \ No newline at end of file +#endif /*MACVERSION -- Mac-only feature*/ Modified: Frontier/branches/Int64/Common/headers/serialnumber.h =================================================================== --- Frontier/branches/Int64/Common/headers/serialnumber.h 2006-05-13 17:29:57 UTC (rev 1374) +++ Frontier/branches/Int64/Common/headers/serialnumber.h 2006-05-13 17:30:47 UTC (rev 1375) @@ -27,4 +27,4 @@ extern boolean validateserialnumber (void); -extern boolean isvalidserialnumber (bigstring bs); \ No newline at end of file +extern boolean isvalidserialnumber (bigstring bs); Modified: Frontier/branches/Int64/Common/headers/services.h =================================================================== --- Frontier/branches/Int64/Common/headers/services.h 2006-05-13 17:29:57 UTC (rev 1374) +++ Frontier/branches/Int64/Common/headers/services.h 2006-05-13 17:30:47 UTC (rev 1375) @@ -25,4 +25,4 @@ ******************************************************************************/ -extern void initservices (void); \ No newline at end of file +extern void initservices (void); Modified: Frontier/branches/Int64/Common/headers/shellprint.h =================================================================== --- Frontier/branches/Int64/Common/headers/shellprint.h 2006-05-13 17:29:57 UTC (rev 1374) +++ Frontier/branches/Int64/Common/headers/shellprint.h 2006-05-13 17:30:47 UTC (rev 1375) @@ -89,4 +89,4 @@ extern boolean isprintingactive (void); -extern boolean getprintscale (long * scaleMult, long * scaleDiv); \ No newline at end of file +extern boolean getprintscale (long * scaleMult, long * scaleDiv); Modified: Frontier/branches/Int64/Common/source/aeutils.c =================================================================== --- Frontier/branches/Int64/Common/source/aeutils.c 2006-05-13 17:29:57 UTC (rev 1374) +++ Frontier/branches/Int64/Common/source/aeutils.c 2006-05-13 17:30:47 UTC (rev 1375) @@ -187,4 +187,4 @@ } /*copydatahandle*/ -#endif \ No newline at end of file +#endif Modified: Frontier/branches/Int64/Common/source/dockmenu.c =================================================================== --- Frontier/branches/Int64/Common/source/dockmenu.c 2006-05-13 17:29:57 UTC (rev 1374) +++ Frontier/branches/Int64/Common/source/dockmenu.c 2006-05-13 17:30:47 UTC (rev 1375) @@ -554,4 +554,4 @@ disposemenu (hmenu); } /*rundockmenu*/ -#endif \ No newline at end of file +#endif Modified: Frontier/branches/Int64/Common/source/frontierconfig.c =================================================================== --- Frontier/branches/Int64/Common/source/frontierconfig.c 2006-05-13 17:29:57 UTC (rev 1374) +++ Frontier/branches/Int64/Common/source/frontierconfig.c 2006-05-13 17:30:47 UTC (rev 1375) @@ -182,6 +182,3 @@ initconfigrecord (&config); } /*initconfig*/ - - - \ No newline at end of file Modified: Frontier/branches/Int64/Common/source/langscan.c =================================================================== --- Frontier/branches/Int64/Common/source/langscan.c 2006-05-13 17:29:57 UTC (rev 1374) +++ Frontier/branches/Int64/Common/source/langscan.c 2006-05-13 17:30:47 UTC (rev 1375) @@ -461,17 +461,42 @@ (*val).data.binaryvalue = x; } else { +#if LONGINT_LONGDATE == 1 + tylonglongint x; +#else long x; +#endif bigstring bstest; if (flhex) { - +#if LONGINT_LONGDATE == 1 if (stringlength (bsnumber) > 10) goto overflow; - +#else + if (stringlength (bsnumber) > 20) + goto overflow; +#endif hexstringtonumber (bsnumber, &x); } else { +#if LONGINT_LONGDATE == 1 + stringtolonglongint (bsnumber, &x); + + popleadingchars (bsnumber, '0'); + + longlonginttostring (x, bstest, 10); + + popleadingchars (bstest, '0'); + + if (!equalstrings (bsnumber, bstest)) + goto overflow; + + if (x > 2147483647LL) + { + x = -x; + x = -x; + } +#else stringtonumber (bsnumber, &x); popleadingchars (bsnumber, '0'); @@ -482,9 +507,13 @@ if (!equalstrings (bsnumber, bstest)) goto overflow; +#endif } - +#if LONGINT_LONGDATE == 1 setlongvalue (x, val); +#else + setllintvaluewrap (x, val); +#endif } #ifdef fldebug @@ -878,7 +907,7 @@ if (isdigit (ch)) { - if (!parsepopnumber (&val)) /*might be a long or a float*/ + if (!parsepopnumber (&val)) /*might be a longlongint, long or a float*/ return (errortoken); if (!newconstnode (val, nodetoken)) Modified: Frontier/branches/Int64/Common/source/langvalue.c =================================================================== --- Frontier/branches/Int64/Common/source/langvalue.c 2006-05-13 17:29:57 UTC (rev 1374) +++ Frontier/branches/Int64/Common/source/langvalue.c 2006-05-13 17:30:47 UTC (rev 1375) @@ -242,6 +242,22 @@ return(setheapvalue(x, longlongintvaluetype, val)); } /* setlonglongintvalue */ + + +boolean setllintvaluewrap (tylonglongint x, tyvaluerecord *val) { + + /* + set val to be a the long long value x. + */ + Handle h = newclearhandle(sizeof(tylonglongint), &x); + + **h = x; + + return(setlonglongintvalue(h, val)); +} /* setlonglongintvalue */ + + + #endif @@ -2294,7 +2310,7 @@ if (flinhibitnilcoercion) return (false); - x = 0; // LLONG_MAX; // for testing + x = 0; break; Modified: Frontier/branches/Int64/Common/source/ops.c =================================================================== --- Frontier/branches/Int64/Common/source/ops.c 2006-05-13 17:29:57 UTC (rev 1374) +++ Frontier/branches/Int64/Common/source/ops.c 2006-05-13 17:30:47 UTC (rev 1375) @@ -299,6 +299,60 @@ return stringreverse(bs); } + +boolean +stringtolonglongint ( + bigstring bs, + tylonglongint *llival) +{ + + // 2006-05-13 - kw - first write; modelled after stringtonumber + long + i, + n = (long)stringlength (bs); + + *llival = 0; + + for (i = 1; i <= n; ++i) + { + byte ch = bs [i]; + + if (!isdigit (ch)) + { + if ( (i > 1) + || ( ch != '+' + && ch != '-')) + { + /*not a leading +/-*/ + setstringlength (bs, i - 1); + break; + } + } + } + + if (isemptystring (bs)) + { + *llival = 0; + } + else + { + n = (long)stringlength (bs); + for ( i = 1; i <= n; i++) + { + byte ch = bs [i]; + if (isdigit(ch)) + { + *llival *= 10; + *llival += (ch - '0'); + } + if (ch == '-') + *llival = -(*llival); + } + } + + return (true); +} /*stringtolonglongint*/ + #endif @@ -1018,4 +1072,4 @@ } while (bcd != 0); return (ret); - } /* bcdtolong */ \ No newline at end of file + } /* bcdtolong */ Modified: Frontier/branches/Int64/Common/source/player.c =================================================================== --- Frontier/branches/Int64/Common/source/player.c 2006-05-13 17:29:57 UTC (rev 1374) +++ Frontier/branches/Int64/Common/source/player.c 2006-05-13 17:30:47 UTC (rev 1375) @@ -715,4 +715,4 @@ return (true); } /*playerstart*/ -#endif /*MACVERSION -- Mac-only feature*/ \ No newline at end of file +#endif /*MACVERSION -- Mac-only feature*/ Modified: Frontier/branches/Int64/Common/source/services.c =================================================================== --- Frontier/branches/Int64/Common/source/services.c 2006-05-13 17:29:57 UTC (rev 1374) +++ Frontier/branches/Int64/Common/source/services.c 2006-05-13 17:30:47 UTC (rev 1375) @@ -274,4 +274,4 @@ */ servicesinstallhandlers (); - } /*initservices*/ \ No newline at end of file + } /*initservices*/ Modified: Frontier/branches/Int64/FrontierSDK/Toolkits/AppletToolkit/Headers/appletfiles.h =================================================================== --- Frontier/branches/Int64/FrontierSDK/Toolkits/AppletToolkit/Headers/appletfiles.h 2006-05-13 17:29:57 UTC (rev 1374) +++ Frontier/branches/Int64/FrontierSDK/Toolkits/AppletToolkit/Headers/appletfiles.h 2006-05-13 17:30:47 UTC (rev 1375) @@ -157,4 +157,4 @@ boolean filegetvolumename (short, bigstring); -#endif \ No newline at end of file +#endif Modified: Frontier/branches/Int64/FrontierSDK/Toolkits/AppletToolkit/Headers/appletfont.h =================================================================== --- Frontier/branches/Int64/FrontierSDK/Toolkits/AppletToolkit/Headers/appletfont.h 2006-05-13 17:29:57 UTC (rev 1374) +++ Frontier/branches/Int64/FrontierSDK/Toolkits/AppletToolkit/Headers/appletfont.h 2006-05-13 17:30:47 UTC (rev 1375) @@ -50,4 +50,4 @@ short getfontheight (void); -#endif \ No newline at end of file +#endif Modified: Frontier/branches/Int64/FrontierSDK/Toolkits/AppletToolkit/Headers/appleticons.h =================================================================== --- Frontier/branches/Int64/FrontierSDK/Toolkits/AppletToolkit/Headers/appleticons.h 2006-05-13 17:29:57 UTC (rev 1374) +++ Frontier/branches/Int64/FrontierSDK/Toolkits/AppletToolkit/Headers/appleticons.h 2006-05-13 17:30:47 UTC (rev 1375) @@ -43,4 +43,4 @@ boolean geticonsuite (short, Handle *); -#endif \ No newline at end of file +#endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |