|
From: <kar...@us...> - 2006-06-06 19:53:43
|
Revision: 1398 Author: karstenw Date: 2006-06-06 12:53:23 -0700 (Tue, 06 Jun 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1398&view=rev Log Message: ----------- more coercion Modified Paths: -------------- Frontier/branches/Int64/Common/source/langvalue.c Modified: Frontier/branches/Int64/Common/source/langvalue.c =================================================================== --- Frontier/branches/Int64/Common/source/langvalue.c 2006-06-02 20:36:09 UTC (rev 1397) +++ Frontier/branches/Int64/Common/source/langvalue.c 2006-06-06 19:53:23 UTC (rev 1398) @@ -635,7 +635,7 @@ memtodisklong (typeid); - // kw - 2005-12-12 filemaker empty string fix + // 2005-12-12 kw: filemaker empty string fix // we need to be able to handle empty strings that arrive as a binary['utxt'] if (x == nil) newhandle(0, &x); @@ -1963,7 +1963,7 @@ boolean getbinarylonglong (Handle x, tylonglongint *n) { /* - 2006-06-02 - kw --- modelled after getbinarynumber() + 2006-06-02 kw: modelled after getbinarynumber() return a tylonglongint interpretation of the binary handle. @@ -2066,7 +2066,9 @@ // LONGLONGINTCONSTRUCTIONSITE case longlongintvaluetype: case longdatetimevaluetype: - { + fl = **(*v).data.longlongintvalue != 0; + break; + /*{ tylonglongint n; Handle x; @@ -2082,7 +2084,7 @@ releaseheaptmp (x); break; - } + }*/ #endif case binaryvaluetype: { @@ -2172,6 +2174,7 @@ long x; double f; + tylonglongint lln; switch ((*v).valuetype) { @@ -2252,7 +2255,22 @@ // LONGLONGINTCONSTRUCTIONSITE case longlongintvaluetype: case longdatetimevaluetype: - { + lln = **(*v).data.longlongintvalue; + if ( (lln > LONG_MAX) + || (lln < LONG_MIN)) + { + // longlongvalue is out of range + x = 0; + return (false); + } + else + { + // we're in range + x = (long)lln; + return (true); + } + break; + /*{ tylonglongint lln; boolean fl = false; @@ -2277,7 +2295,7 @@ } return (fl); break; - } + }*/ #endif case binaryvaluetype: { @@ -2430,7 +2448,7 @@ boolean coercetolongdate (tyvaluerecord *v) { - // kw - 2006-02-12 --- modeled after coercetodate + // 2006-02-12 kw: modeled after coercetodate tylonglongint x; @@ -2480,7 +2498,7 @@ case stringvaluetype: { bigstring bs; - unsigned long ltime; // kw - 2006-02-02 renamed due to shadow warning + unsigned long ltime; // 2006-02-02 kw: renamed due to shadow warning pullstringvalue (v, bs); @@ -2810,7 +2828,7 @@ case stringvaluetype: { bigstring bs; - unsigned long ltime; // kw - 2006-02-02 renamed due to shadow warning + unsigned long ltime; // 2006-02-02 kw: renamed due to shadow warning pullstringvalue (v, bs); @@ -4064,7 +4082,7 @@ return (7); #if LONGINT_LONGDATE == 1 // in coercionweight() - // 2006-05-09 - kw --- this is my first & fast guess where these should sort in + // 2006-05-09 kw: this is my first & fast guess where these should sort in // UNTESTED // LONGLONGINTCONSTRUCTIONSITE case longlongintvaluetype: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |