Author: chromatic
Date: Tue Apr 10 23:36:43 2007
New Revision: 18134
Modified:
trunk/config/init/hints/mswin32.pm
trunk/src/events.c
trunk/src/exceptions.c
trunk/src/gc/dod.c
trunk/src/library.c
trunk/src/objects.c
trunk/src/pmc/os.pmc
trunk/src/string.c
Log:
Borland C++ on Windows fixes from Steve Peters (RT #42271).
Modified: trunk/config/init/hints/mswin32.pm
==============================================================================
--- trunk/config/init/hints/mswin32.pm (original)
+++ trunk/config/init/hints/mswin32.pm Tue Apr 10 23:36:43 2007
@@ -145,7 +145,7 @@
share_ext => '.dll',
load_ext => '.dll',
cc => ${cc},
- ccflags => '-O2 -w-8066 -DWIN32 -DNO_STRICT -DNDEBUG
-D_CONSOLE',
+ ccflags => '-O2 -w-8066 -DWIN32 -DNO_STRICT -DNDEBUG -D_CONSOLE
-w-par -w-aus -w-ccc -w-rch',
cc_o_out => '-o',
cc_exe_out => '-e',
cc_debug => '-v',
@@ -162,10 +162,10 @@
link => ${cc},
linkflags => '',
- ar => 'tlib',
+ ar => 'tlib /a /P128',
ar_flags => '',
ar_out => '',
- ar_extra => '/au',
+ ar_extra => '',
slash => '\\',
blib_dir => 'blib\\lib',
make_and => "\n\t",
Modified: trunk/src/events.c
==============================================================================
--- trunk/src/events.c (original)
+++ trunk/src/events.c Tue Apr 10 23:36:43 2007
@@ -939,7 +939,7 @@
QUEUE_ENTRY *entry;
parrot_event* event;
- while ((entry = peek_entry(event_q))) {
+ while ((entry = peek_entry(event_q)) != NULL) {
/*
* one or more entries arrived - we hold the mutex again
* so we have to use the nonsyc_pop_entry to pop off event entries
Modified: trunk/src/exceptions.c
==============================================================================
--- trunk/src/exceptions.c (original)
+++ trunk/src/exceptions.c Tue Apr 10 23:36:43 2007
@@ -235,7 +235,7 @@
message = VTABLE_get_string_keyed_int(interp, exception, 0);
/* [TODO: replace quadratic search with something linear, hopefully without
trashing abstraction layers. -- rgr, 17-Sep-06.] */
- while ((e = stack_entry(interp, interp->dynamic_env, depth))) {
+ while ((e = stack_entry(interp, interp->dynamic_env, depth)) != NULL) {
if (e->entry_type == STACK_ENTRY_PMC) {
handler = UVal_pmc(e->entry);
if (handler && handler->vtable->base_type ==
Modified: trunk/src/gc/dod.c
==============================================================================
--- trunk/src/gc/dod.c (original)
+++ trunk/src/gc/dod.c Tue Apr 10 23:36:43 2007
@@ -253,11 +253,11 @@
* get created as constant PMCs.
*/
for (i = 1; i < (unsigned int)interp->n_vtable_max; i++) {
- VTABLE *vtable;
+ VTABLE *vtable = interp->vtables[i];
/*
* XXX dynpmc groups have empty slots for abstract objects
*/
- if ((vtable = interp->vtables[i])) {
+ if (vtable) {
#if 0
if (vtable->class)
pobject_lives(interp, (PObj *)vtable->class);
Modified: trunk/src/library.c
==============================================================================
--- trunk/src/library.c (original)
+++ trunk/src/library.c Tue Apr 10 23:36:43 2007
@@ -176,7 +176,7 @@
assert(path->encoding == Parrot_fixed_8_encoding_ptr ||
path->encoding == Parrot_utf8_encoding_ptr);
- while (cnv = strchr(path->strstart, path_separator))
+ while ((cnv = strchr(path->strstart, path_separator)) != NULL)
*cnv = win32_path_separator;
}
Modified: trunk/src/objects.c
==============================================================================
--- trunk/src/objects.c (original)
+++ trunk/src/objects.c Tue Apr 10 23:36:43 2007
@@ -42,7 +42,7 @@
{
int i;
const char *meth;
- for (i = 0; (meth = Parrot_vtable_slot_names[i]); ++i) {
+ for (i = 0; (meth = Parrot_vtable_slot_names[i]) != NULL; ++i) {
if (!*meth)
continue;
/* XXX slot_names still have __ in front */
@@ -309,7 +309,7 @@
memset(&meth_str, 0, sizeof (meth_str));
meth_str.encoding = Parrot_fixed_8_encoding_ptr;
meth_str.charset = Parrot_default_charset_ptr;
- for (i = 0; (meth = Parrot_vtable_slot_names[i]); ++i) {
+ for (i = 0; (meth = Parrot_vtable_slot_names[i]) != NULL; ++i) {
if (!*meth)
continue;
meth_str.strstart = const_cast(meth);
@@ -746,7 +746,8 @@
return NULL;
meth = VTABLE_get_string(interp, prop);
#else
- if (!(props = PMC_metadata(class)))
+ props = PMC_metadata(class);
+ if (!props)
return NULL;
b = parrot_hash_get_bucket(interp,
(Hash*) PMC_struct_val(props), prop_str);
Modified: trunk/src/pmc/os.pmc
==============================================================================
--- trunk/src/pmc/os.pmc (original)
+++ trunk/src/pmc/os.pmc Tue Apr 10 23:36:43 2007
@@ -19,9 +19,12 @@
*/
-#ifdef _MSC_VER
+#if defined(_MSC_VER)
# include <direct.h>
# include <io.h>
+#elif defined(__BORLANDC__)
+# include <dir.h>
+# include <dirent.h>
#else
# include <dirent.h>
#endif
Modified: trunk/src/string.c
==============================================================================
--- trunk/src/string.c (original)
+++ trunk/src/string.c Tue Apr 10 23:36:43 2007
@@ -528,6 +528,7 @@
return NULL;
break;
}
+ return NULL;
}
/*