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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user