removed more redefinitions of primitive types in Hawk and HawkStd
This commit is contained in:
parent
19c1a9e831
commit
c22d3369c9
@ -194,7 +194,7 @@ int Hawk::Console::setFileName (const hawk_ooch_t* name)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int Hawk::Console::setFNR (int_t fnr)
|
int Hawk::Console::setFNR (hawk_int_t fnr)
|
||||||
{
|
{
|
||||||
hawk_val_t* tmp;
|
hawk_val_t* tmp;
|
||||||
int n;
|
int n;
|
||||||
@ -231,7 +231,7 @@ const hawk_bch_t* Hawk::Value::getEmptyMbs()
|
|||||||
return EMPTY_STRING;
|
return EMPTY_STRING;
|
||||||
}
|
}
|
||||||
|
|
||||||
Hawk::Value::IntIndex::IntIndex (int_t x)
|
Hawk::Value::IntIndex::IntIndex (hawk_int_t x)
|
||||||
{
|
{
|
||||||
ptr = buf;
|
ptr = buf;
|
||||||
len = 0;
|
len = 0;
|
||||||
@ -239,8 +239,8 @@ Hawk::Value::IntIndex::IntIndex (int_t x)
|
|||||||
#define NTOC(n) (HAWK_T("0123456789")[n])
|
#define NTOC(n) (HAWK_T("0123456789")[n])
|
||||||
|
|
||||||
int base = 10;
|
int base = 10;
|
||||||
int_t last = x % base;
|
hawk_int_t last = x % base;
|
||||||
int_t y = 0;
|
hawk_int_t y = 0;
|
||||||
int dig = 0;
|
int dig = 0;
|
||||||
|
|
||||||
if (x < 0) buf[len++] = HAWK_T('-');
|
if (x < 0) buf[len++] = HAWK_T('-');
|
||||||
@ -422,16 +422,16 @@ void Hawk::Value::clear ()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Hawk::Value::operator Hawk::int_t () const
|
Hawk::Value::operator hawk_int_t () const
|
||||||
{
|
{
|
||||||
int_t v;
|
hawk_int_t v;
|
||||||
if (this->getInt(&v) <= -1) v = 0;
|
if (this->getInt(&v) <= -1) v = 0;
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
Hawk::Value::operator Hawk::flt_t () const
|
Hawk::Value::operator hawk_flt_t () const
|
||||||
{
|
{
|
||||||
flt_t v;
|
hawk_flt_t v;
|
||||||
if (this->getFlt(&v) <= -1) v = 0.0;
|
if (this->getFlt(&v) <= -1) v = 0.0;
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
@ -454,9 +454,9 @@ Hawk::Value::operator const hawk_bch_t* () const
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int Hawk::Value::getInt (int_t* v) const
|
int Hawk::Value::getInt (hawk_int_t* v) const
|
||||||
{
|
{
|
||||||
int_t lv = 0;
|
hawk_int_t lv = 0;
|
||||||
|
|
||||||
HAWK_ASSERT (this->val != HAWK_NULL);
|
HAWK_ASSERT (this->val != HAWK_NULL);
|
||||||
|
|
||||||
@ -474,9 +474,9 @@ int Hawk::Value::getInt (int_t* v) const
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int Hawk::Value::getFlt (flt_t* v) const
|
int Hawk::Value::getFlt (hawk_flt_t* v) const
|
||||||
{
|
{
|
||||||
flt_t rv = 0;
|
hawk_flt_t rv = 0;
|
||||||
|
|
||||||
HAWK_ASSERT (this->val != HAWK_NULL);
|
HAWK_ASSERT (this->val != HAWK_NULL);
|
||||||
|
|
||||||
@ -494,7 +494,7 @@ int Hawk::Value::getFlt (flt_t* v) const
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int Hawk::Value::getNum (int_t* lv, flt_t* fv) const
|
int Hawk::Value::getNum (hawk_int_t* lv, hawk_flt_t* fv) const
|
||||||
{
|
{
|
||||||
HAWK_ASSERT (this->val != HAWK_NULL);
|
HAWK_ASSERT (this->val != HAWK_NULL);
|
||||||
|
|
||||||
@ -641,7 +641,7 @@ int Hawk::Value::setVal (Run* r, hawk_val_t* v)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int Hawk::Value::setInt (int_t v)
|
int Hawk::Value::setInt (hawk_int_t v)
|
||||||
{
|
{
|
||||||
if (this->run == HAWK_NULL)
|
if (this->run == HAWK_NULL)
|
||||||
{
|
{
|
||||||
@ -652,7 +652,7 @@ int Hawk::Value::setInt (int_t v)
|
|||||||
return this->setInt(this->run, v);
|
return this->setInt(this->run, v);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Hawk::Value::setInt (Run* r, int_t v)
|
int Hawk::Value::setInt (Run* r, hawk_int_t v)
|
||||||
{
|
{
|
||||||
hawk_val_t* tmp;
|
hawk_val_t* tmp;
|
||||||
tmp = hawk_rtx_makeintval(r->rtx, v);
|
tmp = hawk_rtx_makeintval(r->rtx, v);
|
||||||
@ -667,7 +667,7 @@ int Hawk::Value::setInt (Run* r, int_t v)
|
|||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
int Hawk::Value::setFlt (flt_t v)
|
int Hawk::Value::setFlt (hawk_flt_t v)
|
||||||
{
|
{
|
||||||
if (this->run == HAWK_NULL)
|
if (this->run == HAWK_NULL)
|
||||||
{
|
{
|
||||||
@ -678,7 +678,7 @@ int Hawk::Value::setFlt (flt_t v)
|
|||||||
return this->setFlt(this->run, v);
|
return this->setFlt(this->run, v);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Hawk::Value::setFlt (Run* r, flt_t v)
|
int Hawk::Value::setFlt (Run* r, hawk_flt_t v)
|
||||||
{
|
{
|
||||||
hawk_val_t* tmp;
|
hawk_val_t* tmp;
|
||||||
tmp = hawk_rtx_makefltval(r->rtx, v);
|
tmp = hawk_rtx_makefltval(r->rtx, v);
|
||||||
@ -917,13 +917,13 @@ int Hawk::Value::setIndexedVal (Run* r, const Index& idx, hawk_val_t* v)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int Hawk::Value::setIndexedInt (const Index& idx, int_t v)
|
int Hawk::Value::setIndexedInt (const Index& idx, hawk_int_t v)
|
||||||
{
|
{
|
||||||
if (run == HAWK_NULL) return -1;
|
if (run == HAWK_NULL) return -1;
|
||||||
return this->setIndexedInt (run, idx, v);
|
return this->setIndexedInt (run, idx, v);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Hawk::Value::setIndexedInt (Run* r, const Index& idx, int_t v)
|
int Hawk::Value::setIndexedInt (Run* r, const Index& idx, hawk_int_t v)
|
||||||
{
|
{
|
||||||
hawk_val_t* tmp = hawk_rtx_makeintval (r->rtx, v);
|
hawk_val_t* tmp = hawk_rtx_makeintval (r->rtx, v);
|
||||||
if (tmp == HAWK_NULL)
|
if (tmp == HAWK_NULL)
|
||||||
@ -939,13 +939,13 @@ int Hawk::Value::setIndexedInt (Run* r, const Index& idx, int_t v)
|
|||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
int Hawk::Value::setIndexedFlt (const Index& idx, flt_t v)
|
int Hawk::Value::setIndexedFlt (const Index& idx, hawk_flt_t v)
|
||||||
{
|
{
|
||||||
if (run == HAWK_NULL) return -1;
|
if (run == HAWK_NULL) return -1;
|
||||||
return this->setIndexedFlt(run, idx, v);
|
return this->setIndexedFlt(run, idx, v);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Hawk::Value::setIndexedFlt (Run* r, const Index& idx, flt_t v)
|
int Hawk::Value::setIndexedFlt (Run* r, const Index& idx, hawk_flt_t v)
|
||||||
{
|
{
|
||||||
hawk_val_t* tmp = hawk_rtx_makefltval(r->rtx, v);
|
hawk_val_t* tmp = hawk_rtx_makefltval(r->rtx, v);
|
||||||
if (tmp == HAWK_NULL)
|
if (tmp == HAWK_NULL)
|
||||||
@ -1208,7 +1208,7 @@ void Hawk::Run::formatError (hawk_errnum_t code, const hawk_loc_t* loc, const ha
|
|||||||
va_end (ap);
|
va_end (ap);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Hawk::Run::setGlobal (int id, int_t v)
|
int Hawk::Run::setGlobal (int id, hawk_int_t v)
|
||||||
{
|
{
|
||||||
HAWK_ASSERT (this->rtx != HAWK_NULL);
|
HAWK_ASSERT (this->rtx != HAWK_NULL);
|
||||||
|
|
||||||
@ -1221,7 +1221,7 @@ int Hawk::Run::setGlobal (int id, int_t v)
|
|||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
int Hawk::Run::setGlobal (int id, flt_t v)
|
int Hawk::Run::setGlobal (int id, hawk_flt_t v)
|
||||||
{
|
{
|
||||||
HAWK_ASSERT (this->rtx != HAWK_NULL);
|
HAWK_ASSERT (this->rtx != HAWK_NULL);
|
||||||
|
|
||||||
@ -2551,13 +2551,13 @@ int Hawk::functionHandler (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi)
|
|||||||
return rxtn->run->awk->dispatch_function(rxtn->run, fi);
|
return rxtn->run->awk->dispatch_function(rxtn->run, fi);
|
||||||
}
|
}
|
||||||
|
|
||||||
Hawk::flt_t Hawk::pow (hawk_t* awk, flt_t x, flt_t y)
|
hawk_flt_t Hawk::pow (hawk_t* awk, hawk_flt_t x, hawk_flt_t y)
|
||||||
{
|
{
|
||||||
xtn_t* xtn = GET_XTN(awk);
|
xtn_t* xtn = GET_XTN(awk);
|
||||||
return xtn->hawk->pow(x, y);
|
return xtn->hawk->pow(x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
Hawk::flt_t Hawk::mod (hawk_t* awk, flt_t x, flt_t y)
|
hawk_flt_t Hawk::mod (hawk_t* awk, hawk_flt_t x, hawk_flt_t y)
|
||||||
{
|
{
|
||||||
xtn_t* xtn = GET_XTN(awk);
|
xtn_t* xtn = GET_XTN(awk);
|
||||||
return xtn->hawk->mod(x, y);
|
return xtn->hawk->mod(x, y);
|
||||||
|
@ -376,12 +376,6 @@ private:
|
|||||||
class HAWK_EXPORT Hawk: public Uncopyable, public Mmged
|
class HAWK_EXPORT Hawk: public Uncopyable, public Mmged
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// redefine flt_t. To access Types::flt_t, use the fully qualified
|
|
||||||
// name as it's overriding Types::flt_t.
|
|
||||||
typedef hawk_flt_t flt_t;
|
|
||||||
typedef hawk_int_t int_t;
|
|
||||||
typedef hawk_uint_t uint_t;
|
|
||||||
|
|
||||||
typedef hawk_errstr_t errstr_t;
|
typedef hawk_errstr_t errstr_t;
|
||||||
typedef hawk_errinf_t errinf_t;
|
typedef hawk_errinf_t errinf_t;
|
||||||
|
|
||||||
@ -819,7 +813,7 @@ public:
|
|||||||
Mode getMode () const;
|
Mode getMode () const;
|
||||||
|
|
||||||
int setFileName (const hawk_ooch_t* name);
|
int setFileName (const hawk_ooch_t* name);
|
||||||
int setFNR (int_t fnr);
|
int setFNR (hawk_int_t fnr);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
hawk_ooch_t* filename;
|
hawk_ooch_t* filename;
|
||||||
@ -902,7 +896,7 @@ public:
|
|||||||
class HAWK_EXPORT IntIndex: public Index
|
class HAWK_EXPORT IntIndex: public Index
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
IntIndex (int_t num);
|
IntIndex (hawk_int_t num);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// 2^32: 4294967296
|
// 2^32: 4294967296
|
||||||
@ -912,7 +906,7 @@ public:
|
|||||||
// -(2^64/2): -9223372036854775808
|
// -(2^64/2): -9223372036854775808
|
||||||
// -(2^128/2): -170141183460469231731687303715884105728
|
// -(2^128/2): -170141183460469231731687303715884105728
|
||||||
#if HAWK_SIZEOF_LONG_T > 16
|
#if HAWK_SIZEOF_LONG_T > 16
|
||||||
# error SIZEOF(int_t) TOO LARGE.
|
# error SIZEOF(hawk_int_t) TOO LARGE.
|
||||||
# error INCREASE THE BUFFER SIZE TO SUPPORT IT.
|
# error INCREASE THE BUFFER SIZE TO SUPPORT IT.
|
||||||
#elif HAWK_SIZEOF_LONG_T == 16
|
#elif HAWK_SIZEOF_LONG_T == 16
|
||||||
hawk_ooch_t buf[41];
|
hawk_ooch_t buf[41];
|
||||||
@ -995,8 +989,8 @@ public:
|
|||||||
void clear ();
|
void clear ();
|
||||||
|
|
||||||
operator hawk_val_t* () const { return val; }
|
operator hawk_val_t* () const { return val; }
|
||||||
operator int_t () const;
|
operator hawk_int_t () const;
|
||||||
operator flt_t () const;
|
operator hawk_flt_t () const;
|
||||||
operator const hawk_ooch_t* () const;
|
operator const hawk_ooch_t* () const;
|
||||||
#if defined(HAWK_OOCH_IS_UCH)
|
#if defined(HAWK_OOCH_IS_UCH)
|
||||||
operator const hawk_bch_t* () const;
|
operator const hawk_bch_t* () const;
|
||||||
@ -1007,14 +1001,14 @@ public:
|
|||||||
return operator hawk_val_t* ();
|
return operator hawk_val_t* ();
|
||||||
}
|
}
|
||||||
|
|
||||||
int_t toInt () const
|
hawk_int_t toInt () const
|
||||||
{
|
{
|
||||||
return operator int_t ();
|
return operator hawk_int_t ();
|
||||||
}
|
}
|
||||||
|
|
||||||
flt_t toFlt () const
|
hawk_flt_t toFlt () const
|
||||||
{
|
{
|
||||||
return operator flt_t ();
|
return operator hawk_flt_t ();
|
||||||
}
|
}
|
||||||
|
|
||||||
const hawk_ooch_t* toStr (hawk_oow_t* len) const
|
const hawk_ooch_t* toStr (hawk_oow_t* len) const
|
||||||
@ -1047,19 +1041,19 @@ public:
|
|||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
int getInt (int_t* v) const;
|
int getInt (hawk_int_t* v) const;
|
||||||
int getFlt (flt_t* v) const;
|
int getFlt (hawk_flt_t* v) const;
|
||||||
int getNum (int_t* lv, flt_t* fv) const;
|
int getNum (hawk_int_t* lv, hawk_flt_t* fv) const;
|
||||||
int getStr (const hawk_ooch_t** str, hawk_oow_t* len) const;
|
int getStr (const hawk_ooch_t** str, hawk_oow_t* len) const;
|
||||||
int getMbs (const hawk_bch_t** str, hawk_oow_t* len) const;
|
int getMbs (const hawk_bch_t** str, hawk_oow_t* len) const;
|
||||||
|
|
||||||
int setVal (hawk_val_t* v);
|
int setVal (hawk_val_t* v);
|
||||||
int setVal (Run* r, hawk_val_t* v);
|
int setVal (Run* r, hawk_val_t* v);
|
||||||
|
|
||||||
int setInt (int_t v);
|
int setInt (hawk_int_t v);
|
||||||
int setInt (Run* r, int_t v);
|
int setInt (Run* r, hawk_int_t v);
|
||||||
int setFlt (flt_t v);
|
int setFlt (hawk_flt_t v);
|
||||||
int setFlt (Run* r, flt_t v);
|
int setFlt (Run* r, hawk_flt_t v);
|
||||||
|
|
||||||
int setStr (const hawk_uch_t* str, hawk_oow_t len, bool numeric = false);
|
int setStr (const hawk_uch_t* str, hawk_oow_t len, bool numeric = false);
|
||||||
int setStr (Run* r, const hawk_uch_t* str, hawk_oow_t len, bool numeric = false);
|
int setStr (Run* r, const hawk_uch_t* str, hawk_oow_t len, bool numeric = false);
|
||||||
@ -1077,10 +1071,10 @@ public:
|
|||||||
|
|
||||||
int setIndexedVal (const Index& idx, hawk_val_t* v);
|
int setIndexedVal (const Index& idx, hawk_val_t* v);
|
||||||
int setIndexedVal (Run* r, const Index& idx, hawk_val_t* v);
|
int setIndexedVal (Run* r, const Index& idx, hawk_val_t* v);
|
||||||
int setIndexedInt (const Index& idx, int_t v);
|
int setIndexedInt (const Index& idx, hawk_int_t v);
|
||||||
int setIndexedInt (Run* r, const Index& idx, int_t v);
|
int setIndexedInt (Run* r, const Index& idx, hawk_int_t v);
|
||||||
int setIndexedFlt (const Index& idx, flt_t v);
|
int setIndexedFlt (const Index& idx, hawk_flt_t v);
|
||||||
int setIndexedFlt (Run* r, const Index& idx, flt_t v);
|
int setIndexedFlt (Run* r, const Index& idx, hawk_flt_t v);
|
||||||
|
|
||||||
int setIndexedStr (const Index& idx, const hawk_ooch_t* str, hawk_oow_t len, bool numeric = false);
|
int setIndexedStr (const Index& idx, const hawk_ooch_t* str, hawk_oow_t len, bool numeric = false);
|
||||||
int setIndexedStr (Run* r, const Index& idx, const hawk_ooch_t* str, hawk_oow_t len, bool numeric = false);
|
int setIndexedStr (Run* r, const Index& idx, const hawk_ooch_t* str, hawk_oow_t len, bool numeric = false);
|
||||||
@ -1213,7 +1207,7 @@ public:
|
|||||||
/// to \a v.
|
/// to \a v.
|
||||||
/// \return 0 on success, -1 on failure
|
/// \return 0 on success, -1 on failure
|
||||||
///
|
///
|
||||||
int setGlobal (int id, int_t v);
|
int setGlobal (int id, hawk_int_t v);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// The setGlobal() function sets the value of a global
|
/// The setGlobal() function sets the value of a global
|
||||||
@ -1221,7 +1215,7 @@ public:
|
|||||||
/// to \a v.
|
/// to \a v.
|
||||||
/// \return 0 on success, -1 on failure
|
/// \return 0 on success, -1 on failure
|
||||||
///
|
///
|
||||||
int setGlobal (int id, flt_t v);
|
int setGlobal (int id, hawk_flt_t v);
|
||||||
|
|
||||||
///
|
///
|
||||||
/// The setGlobal() function sets the value of a global
|
/// The setGlobal() function sets the value of a global
|
||||||
@ -1680,8 +1674,8 @@ protected:
|
|||||||
/// \}
|
/// \}
|
||||||
|
|
||||||
// primitive handlers
|
// primitive handlers
|
||||||
virtual flt_t pow (flt_t x, flt_t y) = 0;
|
virtual hawk_flt_t pow (hawk_flt_t x, hawk_flt_t y) = 0;
|
||||||
virtual flt_t mod (flt_t x, flt_t y) = 0;
|
virtual hawk_flt_t mod (hawk_flt_t x, hawk_flt_t y) = 0;
|
||||||
|
|
||||||
virtual void* modopen (const hawk_mod_spec_t* spec) = 0;
|
virtual void* modopen (const hawk_mod_spec_t* spec) = 0;
|
||||||
virtual void modclose (void* handle) = 0;
|
virtual void modclose (void* handle) = 0;
|
||||||
@ -1708,8 +1702,8 @@ protected:
|
|||||||
static int functionHandler (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi);
|
static int functionHandler (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi);
|
||||||
|
|
||||||
|
|
||||||
static flt_t pow (hawk_t* awk, flt_t x, flt_t y);
|
static hawk_flt_t pow (hawk_t* awk, hawk_flt_t x, hawk_flt_t y);
|
||||||
static flt_t mod (hawk_t* awk, flt_t x, flt_t y);
|
static hawk_flt_t mod (hawk_t* awk, hawk_flt_t x, hawk_flt_t y);
|
||||||
|
|
||||||
static void* modopen (hawk_t* awk, const hawk_mod_spec_t* spec);
|
static void* modopen (hawk_t* awk, const hawk_mod_spec_t* spec);
|
||||||
static void modclose (hawk_t* awk, void* handle);
|
static void modclose (hawk_t* awk, void* handle);
|
||||||
|
@ -30,7 +30,6 @@
|
|||||||
#include <hawk-std.h> // for hawk_stdmodXXX() functions
|
#include <hawk-std.h> // for hawk_stdmodXXX() functions
|
||||||
#include "hawk-prv.h"
|
#include "hawk-prv.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
// TODO: remove the following definitions and find a way to share the similar definitions in std.c
|
// TODO: remove the following definitions and find a way to share the similar definitions in std.c
|
||||||
#if defined(HAWK_ENABLE_LIBLTDL)
|
#if defined(HAWK_ENABLE_LIBLTDL)
|
||||||
@ -252,7 +251,7 @@ int HawkStd::build_argcv (Run* run)
|
|||||||
this->runarg.ptr[i].len, true) <= -1) return -1;
|
this->runarg.ptr[i].len, true) <= -1) return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
run->setGlobal (this->gbl_argc, (int_t)this->runarg.len);
|
run->setGlobal (this->gbl_argc, (hawk_int_t)this->runarg.len);
|
||||||
run->setGlobal (this->gbl_argv, argv);
|
run->setGlobal (this->gbl_argv, argv);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -418,14 +417,14 @@ int HawkStd::setioattr (
|
|||||||
hawk_find_oochar(ptr[1], l[1], HAWK_T('\0')) ||
|
hawk_find_oochar(ptr[1], l[1], HAWK_T('\0')) ||
|
||||||
hawk_find_oochar(ptr[2], l[2], HAWK_T('\0')))
|
hawk_find_oochar(ptr[2], l[2], HAWK_T('\0')))
|
||||||
{
|
{
|
||||||
return ret.setInt ((int_t)-1);
|
return ret.setInt ((hawk_int_t)-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
int tmout;
|
int tmout;
|
||||||
if ((tmout = timeout_code (ptr[1])) >= 0)
|
if ((tmout = timeout_code (ptr[1])) >= 0)
|
||||||
{
|
{
|
||||||
int_t lv;
|
hawk_int_t lv;
|
||||||
flt_t fv;
|
hawk_flt_t fv;
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
n = args[2].getNum(&lv, &fv);
|
n = args[2].getNum(&lv, &fv);
|
||||||
@ -446,7 +445,7 @@ int HawkStd::setioattr (
|
|||||||
nsec = fv - ioattr->tmout[tmout].sec;
|
nsec = fv - ioattr->tmout[tmout].sec;
|
||||||
ioattr->tmout[tmout].nsec = HAWK_SEC_TO_NSEC(nsec);
|
ioattr->tmout[tmout].nsec = HAWK_SEC_TO_NSEC(nsec);
|
||||||
}
|
}
|
||||||
return ret.setInt ((int_t)0);
|
return ret.setInt ((hawk_int_t)0);
|
||||||
}
|
}
|
||||||
#if defined(HAWK_OOCH_IS_UCH)
|
#if defined(HAWK_OOCH_IS_UCH)
|
||||||
else if (hawk_comp_oocstr(ptr[1], HAWK_T("codepage"), 1) == 0 ||
|
else if (hawk_comp_oocstr(ptr[1], HAWK_T("codepage"), 1) == 0 ||
|
||||||
@ -459,7 +458,7 @@ int HawkStd::setioattr (
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
cmgr = hawk_get_cmgr_by_name(ptr[2]);
|
cmgr = hawk_get_cmgr_by_name(ptr[2]);
|
||||||
if (cmgr == HAWK_NULL) return ret.setInt ((int_t)-1);
|
if (cmgr == HAWK_NULL) return ret.setInt ((hawk_int_t)-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
ioattr = find_or_make_ioattr(ptr[0], l[0]);
|
ioattr = find_or_make_ioattr(ptr[0], l[0]);
|
||||||
@ -473,7 +472,7 @@ int HawkStd::setioattr (
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// unknown attribute name
|
// unknown attribute name
|
||||||
return ret.setInt ((int_t)-1);
|
return ret.setInt ((hawk_int_t)-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -501,7 +500,7 @@ int HawkStd::getioattr (
|
|||||||
if ((tmout = timeout_code(ptr[1])) >= 0)
|
if ((tmout = timeout_code(ptr[1])) >= 0)
|
||||||
{
|
{
|
||||||
if (ioattr->tmout[tmout].nsec == 0)
|
if (ioattr->tmout[tmout].nsec == 0)
|
||||||
xx = args[2].setInt ((int_t)ioattr->tmout[tmout].sec);
|
xx = args[2].setInt ((hawk_int_t)ioattr->tmout[tmout].sec);
|
||||||
else
|
else
|
||||||
xx = args[2].setFlt ((hawk_flt_t)ioattr->tmout[tmout].sec + HAWK_NSEC_TO_SEC((hawk_flt_t)ioattr->tmout[tmout].nsec));
|
xx = args[2].setFlt ((hawk_flt_t)ioattr->tmout[tmout].sec + HAWK_NSEC_TO_SEC((hawk_flt_t)ioattr->tmout[tmout].nsec));
|
||||||
}
|
}
|
||||||
@ -515,7 +514,7 @@ int HawkStd::getioattr (
|
|||||||
}
|
}
|
||||||
|
|
||||||
// unknown attribute name or errors
|
// unknown attribute name or errors
|
||||||
return ret.setInt ((int_t)xx);
|
return ret.setInt ((hawk_int_t)xx);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(ENABLE_NWIO)
|
#if defined(ENABLE_NWIO)
|
||||||
@ -909,7 +908,7 @@ int HawkStd::open_console_in (Console& io)
|
|||||||
|
|
||||||
// ok to find ARGV[this->runarg_index] as ARGV[0]
|
// ok to find ARGV[this->runarg_index] as ARGV[0]
|
||||||
// has been skipped.
|
// has been skipped.
|
||||||
ibuflen = hawk_int_to_oocstr (this->runarg_index, 10, HAWK_NULL, ibuf, HAWK_COUNTOF(ibuf));
|
ibuflen = hawk_int_to_oocstr(this->runarg_index, 10, HAWK_NULL, ibuf, HAWK_COUNTOF(ibuf));
|
||||||
|
|
||||||
pair = hawk_htb_search (map, ibuf, ibuflen);
|
pair = hawk_htb_search (map, ibuf, ibuflen);
|
||||||
HAWK_ASSERT (pair != HAWK_NULL);
|
HAWK_ASSERT (pair != HAWK_NULL);
|
||||||
@ -1143,12 +1142,12 @@ void HawkStd::freeMem (void* ptr)
|
|||||||
|
|
||||||
// miscellaneous primitive
|
// miscellaneous primitive
|
||||||
|
|
||||||
HawkStd::flt_t HawkStd::pow (flt_t x, flt_t y)
|
hawk_flt_t HawkStd::pow (hawk_flt_t x, hawk_flt_t y)
|
||||||
{
|
{
|
||||||
return hawk_stdmathpow (this->awk, x, y);
|
return hawk_stdmathpow (this->awk, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
HawkStd::flt_t HawkStd::mod (flt_t x, flt_t y)
|
hawk_flt_t HawkStd::mod (hawk_flt_t x, hawk_flt_t y)
|
||||||
{
|
{
|
||||||
return hawk_stdmathmod (this->awk, x, y);
|
return hawk_stdmathmod (this->awk, x, y);
|
||||||
}
|
}
|
||||||
|
@ -199,8 +199,8 @@ protected:
|
|||||||
void* reallocMem (void* ptr, hawk_oow_t n);
|
void* reallocMem (void* ptr, hawk_oow_t n);
|
||||||
void freeMem (void* ptr);
|
void freeMem (void* ptr);
|
||||||
|
|
||||||
flt_t pow (flt_t x, flt_t y);
|
hawk_flt_t pow (hawk_flt_t x, hawk_flt_t y);
|
||||||
flt_t mod (flt_t x, flt_t y);
|
hawk_flt_t mod (hawk_flt_t x, hawk_flt_t y);
|
||||||
|
|
||||||
void* modopen (const hawk_mod_spec_t* spec);
|
void* modopen (const hawk_mod_spec_t* spec);
|
||||||
void modclose (void* handle);
|
void modclose (void* handle);
|
||||||
|
Loading…
Reference in New Issue
Block a user