29 lines
476 B
Plaintext
29 lines
476 B
Plaintext
|
|
fun to_char<T>(in: T) : char {
|
|
var out:char
|
|
__if_comp__ __C__ {
|
|
simple_passthrough(in = in: out = out:) """
|
|
char out = (char) in;
|
|
"""
|
|
}
|
|
return out;
|
|
}
|
|
|
|
fun to_int<T>(in: T) : int {
|
|
var out:int
|
|
__if_comp__ __C__ {
|
|
simple_passthrough(in = in: out = out:) """
|
|
int out = (int) in;
|
|
"""
|
|
}
|
|
return out;
|
|
}
|
|
fun cast_ptr<T,U>(in: T):U {
|
|
var out:U
|
|
simple_passthrough(in:out:) """
|
|
void* out = in;
|
|
"""
|
|
return out
|
|
}
|
|
|