mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-19 19:10:17 +00:00
fix types
This commit is contained in:
parent
ca7552c9f6
commit
f22191faa6
@ -10,6 +10,9 @@ typedef uint16_t py_Name;
|
||||
typedef int16_t py_Type;
|
||||
typedef struct py_Str py_Str;
|
||||
|
||||
typedef int64_t py_i64;
|
||||
typedef double py_f64;
|
||||
|
||||
/// Generic reference.
|
||||
typedef py_TValue* py_Ref;
|
||||
/// An object reference which has the same lifespan as the object.
|
||||
@ -46,8 +49,8 @@ bool py_exec(const char*);
|
||||
bool py_eval(const char*);
|
||||
|
||||
/************* Values Creation *************/
|
||||
void py_newint(py_Ref, int64_t);
|
||||
void py_newfloat(py_Ref, double);
|
||||
void py_newint(py_Ref, py_i64);
|
||||
void py_newfloat(py_Ref, py_f64);
|
||||
void py_newbool(py_Ref, bool);
|
||||
void py_newstr(py_Ref, const char*);
|
||||
void py_newstrn(py_Ref, const char*, int);
|
||||
@ -94,9 +97,9 @@ void py_newnativefunc(py_Ref out, py_CFunction);
|
||||
/// @param udsize size of your userdata. You can use `py_touserdata()` to get the pointer to it.
|
||||
void py_newobject(py_Ref out, py_Type type, int slots, int udsize);
|
||||
/************* Type Cast *************/
|
||||
int64_t py_toint(const py_Ref);
|
||||
double py_tofloat(const py_Ref);
|
||||
bool py_castfloat(const py_Ref, double* out);
|
||||
py_i64 py_toint(const py_Ref);
|
||||
py_f64 py_tofloat(const py_Ref);
|
||||
bool py_castfloat(const py_Ref, py_f64* out);
|
||||
bool py_tobool(const py_Ref);
|
||||
py_Type py_totype(const py_Ref);
|
||||
const char* py_tostr(const py_Ref);
|
||||
@ -245,7 +248,7 @@ int py_lt(const py_Ref, const py_Ref);
|
||||
int py_ge(const py_Ref, const py_Ref);
|
||||
int py_gt(const py_Ref, const py_Ref);
|
||||
|
||||
bool py_hash(const py_Ref, int64_t* out);
|
||||
bool py_hash(const py_Ref, py_i64* out);
|
||||
|
||||
/// Python equivalent to `lhs is rhs`.
|
||||
bool py_isidentical(const py_Ref, const py_Ref);
|
||||
|
Loading…
x
Reference in New Issue
Block a user