projects
/
cacao.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* src/vm/primitive.c: Removed.
[cacao.git]
/
src
/
vm
/
string.c
diff --git
a/src/vm/string.c
b/src/vm/string.c
index 2d215c15c1cb18099ee6759ffb1a823303413b3a..74400828214dddca58a96e3403a2af24e4842b42 100644
(file)
--- a/
src/vm/string.c
+++ b/
src/vm/string.c
@@
-27,6
+27,8
@@
#include <assert.h>
#include <assert.h>
+#include "vmcore/system.h"
+
#include "vm/types.h"
#include "vm/global.h"
#include "vm/types.h"
#include "vm/global.h"
@@
-43,7
+45,7
@@
#include "vm/array.h"
#include "vm/builtin.h"
#include "vm/exceptions.h"
#include "vm/array.h"
#include "vm/builtin.h"
#include "vm/exceptions.h"
-#include "vm/primitive.h"
+#include "vm/primitive.h
pp
"
#include "vm/stringlocal.h"
#include "vm/vm.h"
#include "vm/stringlocal.h"
#include "vm/vm.h"
@@
-139,7
+141,7
@@
void stringtable_update(void)
if (!a->header.objheader.vftbl)
/* vftbl of character-array is NULL */
a->header.objheader.vftbl =
if (!a->header.objheader.vftbl)
/* vftbl of character-array is NULL */
a->header.objheader.vftbl =
-
primitive_arrayclass_get
_by_type(ARRAYTYPE_CHAR)->vftbl;
+
Primitive_get_arrayclass
_by_type(ARRAYTYPE_CHAR)->vftbl;
/* follow link in external hash chain */
s = s->hashlink;
/* follow link in external hash chain */
s = s->hashlink;
@@
-228,7
+230,8
@@
java_handle_t *javastring_safe_new_from_utf8(const char *text)
s4 nbytes;
s4 len;
s4 nbytes;
s4 len;
- assert(text);
+ if (text == NULL)
+ return NULL;
/* Get number of bytes. We need this to completely emulate the messy */
/* behaviour of the RI. :( */
/* Get number of bytes. We need this to completely emulate the messy */
/* behaviour of the RI. :( */
@@
-586,7
+589,7
@@
static java_object_t *literalstring_u2(java_chararray_t *a, u4 length,
/* location in hashtable found, complete arrayheader */
ca->header.objheader.vftbl =
/* location in hashtable found, complete arrayheader */
ca->header.objheader.vftbl =
-
primitive_arrayclass_get
_by_type(ARRAYTYPE_CHAR)->vftbl;
+
Primitive_get_arrayclass
_by_type(ARRAYTYPE_CHAR)->vftbl;
ca->header.size = length;
assert(class_java_lang_String);
ca->header.size = length;
assert(class_java_lang_String);
@@
-759,13
+762,13
@@
java_handle_t *javastring_intern(java_handle_t *s)
}
}
-/* javastring_
print *
***********************************************************
+/* javastring_
fprint
***********************************************************
- Print the given Java string.
+ Print the given Java string
to the given stream
.
*******************************************************************************/
*******************************************************************************/
-void javastring_
print(java_handle_t *s
)
+void javastring_
fprint(java_handle_t *s, FILE *stream
)
{
java_lang_String *so;
java_handle_chararray_t *value;
{
java_lang_String *so;
java_handle_chararray_t *value;
@@
-782,7
+785,7
@@
void javastring_print(java_handle_t *s)
for (i = offset; i < offset + count; i++) {
c = LLNI_array_direct(value, i);
for (i = offset; i < offset + count; i++) {
c = LLNI_array_direct(value, i);
-
putchar(c
);
+
fputc(c, stream
);
}
}
}
}