mirror of
https://github.com/libretro/scummvm.git
synced 2025-03-05 17:57:14 +00:00
GLK: GLULXE: Unicode strings still need to be uint32 *
This commit is contained in:
parent
910e5204ac
commit
02e1ef7924
@ -231,7 +231,7 @@ union gluniversal_union {
|
||||
int8 _sch; ///< Cs
|
||||
char _ch; ///< Cn
|
||||
char *_charstr; ///< S
|
||||
uint *_unicharstr; ///< U
|
||||
uint32 *_unicharstr; ///< U
|
||||
void *_array; ///< all # arguments
|
||||
uint _ptrflag; ///< [ ... ] or *?
|
||||
};
|
||||
|
@ -1366,11 +1366,11 @@ void Glulxe::ReleaseVMString(char *ptr) {
|
||||
free_temp_string(ptr);
|
||||
}
|
||||
|
||||
uint *Glulxe::DecodeVMUstring(uint addr) {
|
||||
uint32 *Glulxe::DecodeVMUstring(uint addr) {
|
||||
return make_temp_ustring(addr);
|
||||
}
|
||||
|
||||
void Glulxe::ReleaseVMUstring(uint *ptr) {
|
||||
void Glulxe::ReleaseVMUstring(uint32 *ptr) {
|
||||
free_temp_ustring(ptr);
|
||||
}
|
||||
|
||||
|
@ -326,8 +326,8 @@ protected:
|
||||
void WriteStructField(uint addr, uint fieldnum, uint val);
|
||||
char *DecodeVMString(uint addr);
|
||||
void ReleaseVMString(char *ptr);
|
||||
uint *DecodeVMUstring(uint addr);
|
||||
void ReleaseVMUstring(uint *ptr);
|
||||
uint32 *DecodeVMUstring(uint addr);
|
||||
void ReleaseVMUstring(uint32 *ptr);
|
||||
|
||||
/**@}*/
|
||||
|
||||
@ -993,9 +993,9 @@ public:
|
||||
void stream_get_iosys(uint *mode, uint *rock);
|
||||
void stream_set_iosys(uint mode, uint rock);
|
||||
char *make_temp_string(uint addr);
|
||||
uint *make_temp_ustring(uint addr);
|
||||
uint32 *make_temp_ustring(uint addr);
|
||||
void free_temp_string(char *str);
|
||||
void free_temp_ustring(uint *str);
|
||||
void free_temp_ustring(uint32 *str);
|
||||
|
||||
/**@}*/
|
||||
};
|
||||
|
@ -766,10 +766,10 @@ char *Glulxe::make_temp_string(uint addr) {
|
||||
return res;
|
||||
}
|
||||
|
||||
uint *Glulxe::make_temp_ustring(uint addr) {
|
||||
uint32 *Glulxe::make_temp_ustring(uint addr) {
|
||||
int ix, len;
|
||||
uint addr2;
|
||||
uint *res;
|
||||
uint32 *res;
|
||||
|
||||
if (Mem1(addr) != 0xE2)
|
||||
fatal_error("Ustring argument to a Glk call must be unencoded.");
|
||||
@ -778,9 +778,9 @@ uint *Glulxe::make_temp_ustring(uint addr) {
|
||||
for (addr2 = addr; Mem4(addr2); addr2 += 4) { };
|
||||
len = (addr2 - addr) / 4;
|
||||
if ((len + 1) * 4 < STATIC_TEMP_BUFSIZE) {
|
||||
res = (uint *)temp_buf;
|
||||
res = (uint32 *)temp_buf;
|
||||
} else {
|
||||
res = (uint *)glulx_malloc((len + 1) * 4);
|
||||
res = (uint32 *)glulx_malloc((len + 1) * 4);
|
||||
if (!res)
|
||||
fatal_error("Unable to allocate space for ustring argument to Glk call.");
|
||||
}
|
||||
@ -798,8 +798,8 @@ void Glulxe::free_temp_string(char *str) {
|
||||
glulx_free(str);
|
||||
}
|
||||
|
||||
void Glulxe::free_temp_ustring(uint *str) {
|
||||
if (str && str != (uint *)temp_buf)
|
||||
void Glulxe::free_temp_ustring(uint32 *str) {
|
||||
if (str && str != (uint32 *)temp_buf)
|
||||
glulx_free(str);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user