Sneak a Nasal update in before the next release. This version

*appears* to work correctly on all systems to which I have access
(i386 linux/win32, x86_64 linux, powerpc OS X, Sparc Solaris 10), but
not all systems are capable of running fgfs.  Beyond that, multiple
threading bugs were fixed, and the naCall() API changed slightly to
support named function arguments.

NOTE: this introduces a change in the external API, and therefore this
change *must* be compiled against current FlightGear code.
This commit is contained in:
andy
2005-09-20 21:09:34 +00:00
parent 72984cc4a8
commit 979d3da69c
16 changed files with 295 additions and 199 deletions
+9 -2
View File
@@ -20,7 +20,7 @@ int naStr_len(naRef s)
char* naStr_data(naRef s)
{
if(!IS_STR(s)) return 0;
return s.ref.ptr.str->data;
return (char*)s.ref.ptr.str->data;
}
static void setlen(struct naStr* s, int sz)
@@ -31,6 +31,13 @@ static void setlen(struct naStr* s, int sz)
s->data[sz] = 0; // nul terminate
}
naRef naStr_buf(naRef dst, int len)
{
setlen(dst.ref.ptr.str, len);
naBZero(dst.ref.ptr.str->data, len);
return dst;
}
naRef naStr_fromdata(naRef dst, char* data, int len)
{
if(!IS_STR(dst)) return naNil();
@@ -83,7 +90,7 @@ naRef naStr_fromnum(naRef dest, double num)
int naStr_parsenum(char* str, int len, double* result)
{
return tonum(str, len, result);
return tonum((unsigned char*)str, len, result);
}
int naStr_tonum(naRef str, double* out)