|
From: <kar...@us...> - 2006-05-18 19:16:22
|
Revision: 1379 Author: karstenw Date: 2006-05-18 12:16:05 -0700 (Thu, 18 May 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1379&view=rev Log Message: ----------- adapted setlonglongintvalue() implementation & usage to the rest of setXYvalue() semantic Modified Paths: -------------- Frontier/branches/Int64/Common/headers/lang.h Frontier/branches/Int64/Common/source/langhash.c Frontier/branches/Int64/Common/source/langscan.c Frontier/branches/Int64/Common/source/langvalue.c Frontier/branches/Int64/build_XCode/FrontierFat_i64.xcodeproj/project.pbxproj Modified: Frontier/branches/Int64/Common/headers/lang.h =================================================================== --- Frontier/branches/Int64/Common/headers/lang.h 2006-05-17 18:29:15 UTC (rev 1378) +++ Frontier/branches/Int64/Common/headers/lang.h 2006-05-18 19:16:05 UTC (rev 1379) @@ -1060,8 +1060,9 @@ extern boolean setlongvalue (long, tyvaluerecord *); #if LONGINT_LONGDATE == 1 -extern boolean setlonglongintvalue (Handle x, tyvaluerecord *val); +extern boolean setlonglongintvalue (tylonglongint x, tyvaluerecord *val); + extern boolean setlongdatevalue (Handle x, tyvaluerecord *val); extern boolean coercetolonglong (tyvaluerecord *v); @@ -1069,8 +1070,6 @@ extern boolean getlonglongintparam(hdltreenode hfirst, short pnum, tyvaluerecord *v); 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/source/langhash.c =================================================================== --- Frontier/branches/Int64/Common/source/langhash.c 2006-05-17 18:29:15 UTC (rev 1378) +++ Frontier/branches/Int64/Common/source/langhash.c 2006-05-18 19:16:05 UTC (rev 1379) @@ -2695,14 +2695,25 @@ #if LONGINT_LONGDATE == 1 // LONGLONGINTCONSTRUCTIONSITE case longlongintvaluetype: - case longdatetimevaluetype: - break; + case longdatetimevaluetype: { + // break; + + tylonglongint lln = **val.data.longlongintvalue; + + // any processor specific handling here??? # if defined (WIN95VERSION) # endif # if defined (MACVERSION) # endif + + + if (!hashpackdata (&lpi->s2, &lln, sizeof (lln), &rec.data.longvalue)) + goto error; + + break; + } #endif #ifdef oplanglists @@ -3923,8 +3934,3 @@ return (true); } /*hashvaltostrings*/ - - - - - Modified: Frontier/branches/Int64/Common/source/langscan.c =================================================================== --- Frontier/branches/Int64/Common/source/langscan.c 2006-05-17 18:29:15 UTC (rev 1378) +++ Frontier/branches/Int64/Common/source/langscan.c 2006-05-18 19:16:05 UTC (rev 1379) @@ -513,7 +513,7 @@ } else { - setllintvaluewrap (x, val); + setlonglongintvalue (x, val); } #else setlongvalue (x, val); Modified: Frontier/branches/Int64/Common/source/langvalue.c =================================================================== --- Frontier/branches/Int64/Common/source/langvalue.c 2006-05-17 18:29:15 UTC (rev 1378) +++ Frontier/branches/Int64/Common/source/langvalue.c 2006-05-18 19:16:05 UTC (rev 1379) @@ -232,21 +232,9 @@ #if LONGINT_LONGDATE == 1 -boolean setlonglongintvalue (Handle x, tyvaluerecord *val) { +boolean setlonglongintvalue (tylonglongint x, tyvaluerecord *val) { /* - set val to be a the long long value x. - */ - if (x == nil) - newclearhandle(sizeof(tylonglongint), &x); - - return(setheapvalue(x, longlongintvaluetype, val)); -} /* setlonglongintvalue */ - - -boolean setllintvaluewrap (tylonglongint x, tyvaluerecord *val) { - - /* modelled after setdoublevalue() set val to be a the long long value x. @@ -2367,7 +2355,7 @@ case doublevaluetype: f = **(*v).data.doublevalue; - if (longrangeerror (f)) + if (longlongrangeerror (f)) return (false); x = (long) f; @@ -2398,23 +2386,10 @@ return (false); } /*switch*/ - { - Handle llv; + return (setlonglongintvalue (x, v)); + } /* coercetolonglong */ - // MEMORYLEAK - if (!newhandle(sizeof(tylonglongint), &llv)) - return (false); - if (!sethandlecontents(&x, sizeof(tylonglongint), llv)) - return (false); - - // MEMORYLEAK - what happens with old handle (~.data.binaryvalue)? - return (setlonglongintvalue (llv, v)); - } - return(true); // have a happy compiler -} /* coercetolonglong */ - - static boolean coercetolongdate (tyvaluerecord *v) { @@ -4026,7 +4001,11 @@ // UNTESTED // LONGLONGINTCONSTRUCTIONSITE case longlongintvaluetype: + return(9); + + // 2006-05-18 - was initially on 8 case longdatetimevaluetype: + return(8); #endif case rectvaluetype: @@ -4084,8 +4063,8 @@ 2004-12-30 SMD: now extern instead of static */ - register tyvaluetype t1 = (*v1).valuetype; - register tyvaluetype t2 = (*v2).valuetype; + tyvaluetype t1 = (*v1).valuetype; + tyvaluetype t2 = (*v2).valuetype; if (t1 == t2) /*easy case; short circuit*/ return (true); @@ -6817,15 +6796,9 @@ case longlongintvaluetype: case longdatetimevaluetype: { - Handle h; tylonglongint n = **v1.data.longlongintvalue + **v2.data.longlongintvalue; - // this is unsafe as hell - newhandle(sizeof(tylonglongint), &h); - - sethandlecontents(&n, sizeof(tylonglongint), h); - - fl = setlonglongintvalue (h, vreturned); + fl = setlonglongintvalue (n, vreturned); break; } #endif @@ -6995,15 +6968,10 @@ case longlongintvaluetype: case longdatetimevaluetype: { - Handle h; tylonglongint n = **v1.data.longlongintvalue - **v2.data.longlongintvalue; - - // this is unsafe as hell - newhandle(sizeof(tylonglongint), &h); - - sethandlecontents(&n, sizeof(tylonglongint), h); - - fl = setlonglongintvalue (h, vreturned); + + fl = setlonglongintvalue (n, vreturned); + break; } #endif @@ -7095,15 +7063,10 @@ case longlongintvaluetype: case longdatetimevaluetype: { - Handle h; tylonglongint n = **v1.data.longlongintvalue * **v2.data.longlongintvalue; - - // this is unsafe as hell - newhandle(sizeof(tylonglongint), &h); - - sethandlecontents(&n, sizeof(tylonglongint), h); - - fl = setlonglongintvalue (h, vreturned); + + fl = setlonglongintvalue (n, vreturned); + break; } #endif @@ -7264,15 +7227,10 @@ case longlongintvaluetype: case longdatetimevaluetype: { - Handle h; tylonglongint n = **v1.data.longlongintvalue / **v2.data.longlongintvalue; - - // this is unsafe as hell - newhandle(sizeof(tylonglongint), &h); - - sethandlecontents(&n, sizeof(tylonglongint), h); - - fl = setlonglongintvalue (h, vreturned); + + fl = setlonglongintvalue (n, vreturned); + break; } #endif @@ -7353,15 +7311,10 @@ case longlongintvaluetype: case longdatetimevaluetype: { - Handle h; tylonglongint n = **v1.data.longlongintvalue % **v2.data.longlongintvalue; - - // this is unsafe as hell - newhandle(sizeof(tylonglongint), &h); - - sethandlecontents(&n, sizeof(tylonglongint), h); - - fl = setlonglongintvalue (h, vreturned); + + fl = setlonglongintvalue (n, vreturned); + break; } #endif @@ -7915,15 +7868,7 @@ case longdatetimevaluetype: if (nil == (*vreturned).data.longlongintvalue) { - Handle h; - - if (!newhandle(sizeof(tylonglongint), &h)) - return (false); - - clearhandle(h); - - if (!setlonglongintvalue (h, vreturned)) - return (false); + setlonglongintvalue (0LL, vreturned); } **((*vreturned).data.longlongintvalue) = -(**v1.data.longlongintvalue); break; Modified: Frontier/branches/Int64/build_XCode/FrontierFat_i64.xcodeproj/project.pbxproj =================================================================== --- Frontier/branches/Int64/build_XCode/FrontierFat_i64.xcodeproj/project.pbxproj 2006-05-17 18:29:15 UTC (rev 1378) +++ Frontier/branches/Int64/build_XCode/FrontierFat_i64.xcodeproj/project.pbxproj 2006-05-18 19:16:05 UTC (rev 1379) @@ -2973,7 +2973,7 @@ /* Begin PBXProject section */ 65152560072BFC6500411831 /* Project object */ = { isa = PBXProject; - buildConfigurationList = 657A823409F18A6100331344 /* Build configuration list for PBXProject "FrontierFat" */; + buildConfigurationList = 657A823409F18A6100331344 /* Build configuration list for PBXProject "FrontierFat_i64" */; buildSettings = { }; buildStyles = ( @@ -3940,7 +3940,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Development; }; - 657A823409F18A6100331344 /* Build configuration list for PBXProject "FrontierFat" */ = { + 657A823409F18A6100331344 /* Build configuration list for PBXProject "FrontierFat_i64" */ = { isa = XCConfigurationList; buildConfigurations = ( 657A823509F18A6100331344 /* Development */, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |