m2/pge-boot/GSymbolKey.o \
m2/pge-boot/GSysStorage.o \
m2/pge-boot/Glibc.o \
+ m2/pge-boot/Gwrapc.o \
m2/pge-boot/Gerrno.o \
m2/pge-boot/GUnixArgs.o \
m2/pge-boot/Gtermios.o \
return isnan (x);
}
+/* SeekSet return the system libc SEEK_SET value. */
+
+int
+wrapc_SeekSet (void)
+{
+ return SEEK_SET;
+}
+
+/* SeekEnd return the system libc SEEK_END value. */
+
+int
+wrapc_SeekEnd (void)
+{
+ return SEEK_END;
+}
+
+/* ReadOnly return the system value of O_RDONLY. */
+
+int
+wrapc_ReadOnly (void)
+{
+ return O_RDONLY;
+}
+
+/* WriteOnly return the system value of O_WRONLY. */
+
+int
+wrapc_WriteOnly (void)
+{
+ return O_WRONLY;
+}
+
/* init - init/finish functions for the module */
void
FROM StrLib IMPORT StrLen, StrConCat, StrCopy ;
FROM Storage IMPORT ALLOCATE, DEALLOCATE ;
FROM NumberIO IMPORT CardToStr ;
-FROM libc IMPORT exit, open, creat, read, write, close, lseek, strncpy, memcpy ;
FROM Indexing IMPORT Index, InitIndex, InBounds, HighIndice, PutIndice, GetIndice ;
FROM M2RTS IMPORT InstallTerminationProcedure ;
+FROM libc IMPORT exit, open, creat, read, write, close, lseek, strncpy, memcpy ;
+FROM wrapc IMPORT SeekSet, SeekEnd, ReadOnly, WriteOnly ;
+
CONST
- SEEK_SET = 0 ; (* relative from beginning of the file *)
- SEEK_END = 2 ; (* relative to the end of the file *)
- UNIXREADONLY = 0 ;
- UNIXWRITEONLY = 1 ;
- CreatePermissions = 666B;
MaxBufferLength = 1024*16 ;
MaxErrorString = 1024* 8 ;
+ CreatePermissions = 666B;
TYPE
FileUsage = (unused, openedforread, openedforwrite, openedforrandom) ;
THEN
unixfd := creat(name.address, CreatePermissions)
ELSE
- unixfd := open(name.address, UNIXWRITEONLY, 0)
+ unixfd := open(name.address, INTEGER (WriteOnly ()), 0)
END
ELSE
- unixfd := open(name.address, UNIXREADONLY, 0)
+ unixfd := open(name.address, INTEGER (ReadOnly ()), 0)
END ;
IF unixfd<0
THEN
filled := 0
END
END ;
- offset := lseek (unixfd, VAL (CSSIZE_T, pos), SEEK_SET) ;
+ offset := lseek (unixfd, VAL (CSSIZE_T, pos), SeekSet ()) ;
IF (offset>=0) AND (pos=offset)
THEN
abspos := pos
filled := 0
END
END ;
- offset := lseek (unixfd, VAL (CSSIZE_T, pos), SEEK_END) ;
+ offset := lseek (unixfd, VAL (CSSIZE_T, pos), SeekEnd ()) ;
IF offset>=0
THEN
abspos := offset ;
PROCEDURE isnanl (x: LONGREAL) : INTEGER ;
+(*
+ SeekSet - return the system libc SEEK_SET value.
+*)
+
+PROCEDURE SeekSet () : INTEGER ;
+
+
+(*
+ SeekEnd - return the system libc SEEK_END value.
+*)
+
+PROCEDURE SeekEnd () : INTEGER ;
+
+
+(*
+ ReadOnly - return the system value of O_RDONLY.
+*)
+
+PROCEDURE ReadOnly () : BITSET ;
+
+
+(*
+ WriteOnly - return the system value of O_WRONLY.
+*)
+
+PROCEDURE WriteOnly () : BITSET ;
+
+
END wrapc.
#define EXTERN
#endif
+#undef BUILD_MC_LIBC_TRACE
+
+#if defined(BUILD_MC_LIBC_TRACE)
+static bool initialzed_trace = false;
+static bool trace_on = false;
+
+static
+void
+check_init (void)
+{
+ if (! initialzed_trace)
+ {
+ initialzed_trace = true;
+ trace_on = ((getenv ("MC_LIBC_TRACE") != NULL));
+ }
+}
+#endif
+
+static
+void
+tracedb (const char *format, ...)
+{
+#if defined(BUILD_MC_LIBC_TRACE)
+ check_init ();
+ if (trace_on)
+ {
+ va_list arg;
+ va_start (arg, format);
+ {
+ vfprintf (stdout, format, arg);
+ fflush (stdout);
+ }
+ va_end (arg);
+ }
+#endif
+}
+
+static
+void
+tracedb_open (const char *p, int flags, mode_t mode)
+{
+#if defined(BUILD_MC_LIBC_TRACE)
+ bool item_written = false;
+ tracedb ("libc_open (%s, flags = 0x%x = ", p, flags);
+
+ int bits = (flags & O_ACCMODE);
+ tracedb ("bits = 0x%x", bits);
+ if (bits == O_RDONLY)
+ {
+ tracedb ("O_RDONLY");
+ item_written = true;
+ }
+ if ((flags & O_WRONLY) != 0)
+ {
+ if (item_written)
+ tracedb (" | ");
+ tracedb ("O_WRONLY");
+ item_written = true;
+ }
+ if ((flags & O_RDWR) != 0)
+ {
+ if (item_written)
+ tracedb (" | ");
+ tracedb ("O_RDWR");
+ item_written = true;
+ }
+ tracedb (", 0x%x)\n", mode);
+#endif
+}
+
+static
+void
+tracedb_result (int result)
+{
+#if defined(BUILD_MC_LIBC_TRACE)
+ tracedb (" result = %d", result);
+ if (result == -1)
+ tracedb (", errno = %s", strerror (errno));
+ tracedb ("\n");
+#endif
+}
+
EXTERN
int
libc_read (int fd, void *a, int nbytes)
{
- return read (fd, a, nbytes);
+ tracedb ("libc_read (%d, %p, %d)\n", fd, a, nbytes);
+ int result = read (fd, a, nbytes);
+ tracedb_result (result);
+ return result;
}
EXTERN
int
libc_write (int fd, void *a, int nbytes)
{
- return write (fd, a, nbytes);
+ tracedb ("libc_write (%d, %p, %d)\n", fd, a, nbytes);
+ int result = write (fd, a, nbytes);
+ tracedb_result (result);
+ return result;
}
EXTERN
int
libc_close (int fd)
{
- return close (fd);
+ tracedb ("libc_close (%d)\n", fd);
+ int result = close (fd);
+ tracedb_result (result);
+ return result;
}
EXTERN
int
libc_creat (char *p, mode_t mode)
{
- return creat (p, mode);
+ tracedb ("libc_creat (%s, 0x%x)\n", p, mode);
+ int result = creat (p, mode);
+ tracedb_result (result);
+ return result;
}
EXTERN
int
libc_open (char *p, int flags, mode_t mode)
{
- return open (p, flags, mode);
+ tracedb_open (p, flags, mode);
+ int result = open (p, flags, mode);
+ tracedb_result (result);
+ return result;
}
EXTERN
off_t
libc_lseek (int fd, off_t offset, int whence)
{
- return lseek (fd, offset, whence);
+ tracedb ("libc_lseek (%s, %p, %d)\n", fd, offset, whence);
+ int result = lseek (fd, offset, whence);
+ tracedb_result (result);
+ return result;
}
EXTERN
#endif
}
+/* SeekSet return the system libc SEEK_SET value. */
+
+int
+wrapc_SeekSet (void)
+{
+ return SEEK_SET;
+}
+
+/* SeekEnd return the system libc SEEK_END value. */
+
+int
+wrapc_SeekEnd (void)
+{
+ return SEEK_END;
+}
+
+/* ReadOnly return the system value of O_RDONLY. */
+
+int
+wrapc_ReadOnly (void)
+{
+ return O_RDONLY;
+}
+
+/* WriteOnly return the system value of O_WRONLY. */
+
+int
+wrapc_WriteOnly (void)
+{
+ return O_WRONLY;
+}
+
/* init constructor for the module. */
void
(*c).next->contents.next = NULL;
ConcatContents (&(*c).next->contents, (const char *) a, _a_high, h, o);
AddDebugInfo ((*c).next);
- (*c).next = AssignDebug ((*c).next, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 722, (const char *) "ConcatContents", 14);
+ (*c).next = AssignDebug ((*c).next, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 722, (const char *) "ConcatContents", 14);
}
else
{
AddDebugInfo ((*c).next);
if (TraceOn)
{
- (*c).next = AssignDebug ((*c).next, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 917, (const char *) "ConcatContentsAddress", 21);
+ (*c).next = AssignDebug ((*c).next, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 917, (const char *) "ConcatContentsAddress", 21);
}
}
else
AddDebugInfo (s);
if (TraceOn)
{
- s = AssignDebug (s, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 758, (const char *) "InitString", 10);
+ s = AssignDebug (s, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 758, (const char *) "InitString", 10);
}
return s;
/* static analysis guarentees a RETURN statement will be used before here. */
AddDebugInfo (s);
if (TraceOn)
{
- s = AssignDebug (s, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 957, (const char *) "InitStringCharStar", 18);
+ s = AssignDebug (s, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 957, (const char *) "InitStringCharStar", 18);
}
return s;
/* static analysis guarentees a RETURN statement will be used before here. */
s = DynamicStrings_InitString ((const char *) &a.array[0], 1);
if (TraceOn)
{
- s = AssignDebug (s, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 977, (const char *) "InitStringChar", 14);
+ s = AssignDebug (s, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 977, (const char *) "InitStringChar", 14);
}
return s;
/* static analysis guarentees a RETURN statement will be used before here. */
s = DynamicStrings_Assign (DynamicStrings_InitString ((const char *) "", 0), s);
if (TraceOn)
{
- s = AssignDebug (s, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 1198, (const char *) "Dup", 3);
+ s = AssignDebug (s, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 1198, (const char *) "Dup", 3);
}
return s;
/* static analysis guarentees a RETURN statement will be used before here. */
a = DynamicStrings_ConCat (DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "", 0), a), b);
if (TraceOn)
{
- a = AssignDebug (a, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 1218, (const char *) "Add", 3);
+ a = AssignDebug (a, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 1218, (const char *) "Add", 3);
}
return a;
/* static analysis guarentees a RETURN statement will be used before here. */
t = DynamicStrings_InitStringCharStar (a);
if (TraceOn)
{
- t = AssignDebug (t, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 1275, (const char *) "EqualCharStar", 13);
+ t = AssignDebug (t, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 1275, (const char *) "EqualCharStar", 13);
}
t = AddToGarbage (t, s);
if (DynamicStrings_Equal (t, s))
t = DynamicStrings_InitString ((const char *) a, _a_high);
if (TraceOn)
{
- t = AssignDebug (t, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 1305, (const char *) "EqualArray", 10);
+ t = AssignDebug (t, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 1305, (const char *) "EqualArray", 10);
}
t = AddToGarbage (t, s);
if (DynamicStrings_Equal (t, s))
}
if (TraceOn)
{
- s = AssignDebug (s, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 1337, (const char *) "Mult", 4);
+ s = AssignDebug (s, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 1337, (const char *) "Mult", 4);
}
return s;
/* static analysis guarentees a RETURN statement will be used before here. */
AddDebugInfo (t->contents.next);
if (TraceOn)
{
- t->contents.next = AssignDebug (t->contents.next, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 1405, (const char *) "Slice", 5);
+ t->contents.next = AssignDebug (t->contents.next, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 1405, (const char *) "Slice", 5);
}
}
t = t->contents.next;
}
if (TraceOn)
{
- d = AssignDebug (d, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 1422, (const char *) "Slice", 5);
+ d = AssignDebug (d, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 1422, (const char *) "Slice", 5);
}
return d;
/* static analysis guarentees a RETURN statement will be used before here. */
}
if (TraceOn)
{
- s = AssignDebug (s, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 1534, (const char *) "RemoveComment", 13);
+ s = AssignDebug (s, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 1534, (const char *) "RemoveComment", 13);
}
return s;
/* static analysis guarentees a RETURN statement will be used before here. */
s = DynamicStrings_Slice (s, (int ) (i), 0);
if (TraceOn)
{
- s = AssignDebug (s, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 1646, (const char *) "RemoveWhitePrefix", 17);
+ s = AssignDebug (s, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 1646, (const char *) "RemoveWhitePrefix", 17);
}
return s;
/* static analysis guarentees a RETURN statement will be used before here. */
s = DynamicStrings_Slice (s, 0, i+1);
if (TraceOn)
{
- s = AssignDebug (s, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 1668, (const char *) "RemoveWhitePostfix", 18);
+ s = AssignDebug (s, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 1668, (const char *) "RemoveWhitePostfix", 18);
}
return s;
/* static analysis guarentees a RETURN statement will be used before here. */
if (frameHead == NULL)
{
stop ();
- M2RTS_Halt ((const char *) "mismatched number of PopAllocation's compared to PushAllocation's", 65, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, (const char *) "PopAllocationExemption", 22, 174);
+ M2RTS_Halt ((const char *) "mismatched number of PopAllocation's compared to PushAllocation's", 65, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, (const char *) "PopAllocationExemption", 22, 174);
}
else
{
# include "GStrLib.h"
# include "GStorage.h"
# include "GNumberIO.h"
-# include "Glibc.h"
# include "GIndexing.h"
# include "GM2RTS.h"
+# include "Glibc.h"
+# include "Gwrapc.h"
typedef unsigned int FIO_File;
FIO_File FIO_StdErr;
FIO_File FIO_StdOut;
FIO_File FIO_StdIn;
-# define SEEK_SET 0
-# define SEEK_END 2
-# define UNIXREADONLY 0
-# define UNIXWRITEONLY 1
-# define CreatePermissions 0666
# define MaxBufferLength (1024*16)
# define MaxErrorString (1024*8)
+# define CreatePermissions 0666
typedef struct FIO_NameInfo_r FIO_NameInfo;
typedef struct FIO_buf_r FIO_buf;
return f; /* create new slot */
}
}
- ReturnException ("../../gcc-read-write/gcc/m2/gm2-libs/FIO.def", 25, 1);
+ ReturnException ("../../gcc/m2/gm2-libs/FIO.def", 25, 1);
__builtin_unreachable ();
}
}
else
{
- fd->unixfd = libc_open (fd->name.address, UNIXWRITEONLY, 0);
+ fd->unixfd = libc_open (fd->name.address, (int ) (wrapc_WriteOnly ()), 0);
}
}
else
{
- fd->unixfd = libc_open (fd->name.address, UNIXREADONLY, 0);
+ fd->unixfd = libc_open (fd->name.address, (int ) (wrapc_ReadOnly ()), 0);
}
if (fd->unixfd < 0)
{
fd->buffer->position = 0;
fd->buffer->filled = 0;
}
- offset = libc_lseek (fd->unixfd, pos, SEEK_SET);
+ offset = static_cast<long int> (libc_lseek (fd->unixfd, (ssize_t ) (pos), wrapc_SeekSet ()));
if ((offset >= 0) && (pos == offset))
{
fd->abspos = pos;
fd->buffer->position = 0;
fd->buffer->filled = 0;
}
- offset = libc_lseek (fd->unixfd, pos, SEEK_END);
+ offset = static_cast<long int> (libc_lseek (fd->unixfd, (ssize_t ) (pos), wrapc_SeekEnd ()));
if (offset >= 0)
{
fd->abspos = offset;
{
return (n >= i->Low) && (n <= i->High);
}
- ReturnException ("../../gcc-read-write/gcc/m2/mc/Indexing.def", 20, 1);
+ ReturnException ("../../gcc/m2/mc/Indexing.def", 20, 1);
__builtin_unreachable ();
}
{
return i->High;
}
- ReturnException ("../../gcc-read-write/gcc/m2/mc/Indexing.def", 20, 1);
+ ReturnException ("../../gcc/m2/mc/Indexing.def", 20, 1);
__builtin_unreachable ();
}
{
return i->Low;
}
- ReturnException ("../../gcc-read-write/gcc/m2/mc/Indexing.def", 20, 1);
+ ReturnException ("../../gcc/m2/mc/Indexing.def", 20, 1);
__builtin_unreachable ();
}
extern "C" void M2Dependent_RequestDependant (void * modulename, void * libname, void * dependantmodule, void * dependantlibname);
+/*
+ InitDependencyList - initialize all fields of DependencyList.
+*/
+
+static void InitDependencyList (M2Dependent_DependencyList *depList, PROC proc, M2Dependent_DependencyState state);
+
/*
CreateModule - creates a new module entry and returns the
ModuleChain.
static void CheckInitialized (void);
+/*
+ InitDependencyList - initialize all fields of DependencyList.
+*/
+
+static void InitDependencyList (M2Dependent_DependencyList *depList, PROC proc, M2Dependent_DependencyState state)
+{
+ (*depList).proc = proc;
+ (*depList).forced = false;
+ (*depList).forc = false;
+ (*depList).appl = false;
+ (*depList).state = state;
+}
+
+
/*
CreateModule - creates a new module entry and returns the
ModuleChain.
mptr->libname = libname;
mptr->init = init;
mptr->fini = fini;
- mptr->dependency.proc = dependencies;
- mptr->dependency.state = M2Dependent_unregistered;
+ InitDependencyList (&mptr->dependency, dependencies, M2Dependent_unregistered);
mptr->prev = NULL;
mptr->next = NULL;
if (HexTrace)
n = RTExceptions_GetNumber (e);
if (n == (UINT_MAX))
{
- RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_exException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/M2EXCEPTION.mod")), 47, 6, const_cast<void*> (reinterpret_cast<const void*>("M2Exception")), const_cast<void*> (reinterpret_cast<const void*>("current coroutine is not in the exceptional execution state")));
+ RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_exException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc/m2/gm2-libs/M2EXCEPTION.mod")), 47, 6, const_cast<void*> (reinterpret_cast<const void*>("M2Exception")), const_cast<void*> (reinterpret_cast<const void*>("current coroutine is not in the exceptional execution state")));
}
else
{
return (M2EXCEPTION_M2Exceptions) (n);
}
- ReturnException ("../../gcc-read-write/gcc/m2/gm2-libs/M2EXCEPTION.def", 25, 1);
+ ReturnException ("../../gcc/m2/gm2-libs/M2EXCEPTION.def", 25, 1);
__builtin_unreachable ();
}
}
else
{
- Debug_Halt ((const char *) "max push back stack exceeded, increase MaxPushBackStack", 55, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/PushBackInput.mod", 54, (const char *) "PutCh", 5, 151);
+ Debug_Halt ((const char *) "max push back stack exceeded, increase MaxPushBackStack", 55, (const char *) "../../gcc/m2/gm2-libs/PushBackInput.mod", 39, (const char *) "PutCh", 5, 151);
}
return ch;
/* static analysis guarentees a RETURN statement will be used before here. */
l -= 1;
if ((PushBackInput_PutCh (a[l])) != a[l])
{
- Debug_Halt ((const char *) "assert failed", 13, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/PushBackInput.mod", 54, (const char *) "PutString", 9, 132);
+ Debug_Halt ((const char *) "assert failed", 13, (const char *) "../../gcc/m2/gm2-libs/PushBackInput.mod", 39, (const char *) "PutString", 9, 132);
}
}
}
i -= 1;
if ((PushBackInput_PutCh (DynamicStrings_char (s, static_cast<int> (i)))) != (DynamicStrings_char (s, static_cast<int> (i))))
{
- Debug_Halt ((const char *) "assert failed", 13, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/PushBackInput.mod", 54, (const char *) "PutStr", 6, 113);
+ Debug_Halt ((const char *) "assert failed", 13, (const char *) "../../gcc/m2/gm2-libs/PushBackInput.mod", 39, (const char *) "PutStr", 6, 113);
}
}
}
static void indexf (void * a)
{
- RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_indexException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 614, 9, const_cast<void*> (reinterpret_cast<const void*>("indexf")), const_cast<void*> (reinterpret_cast<const void*>("array index out of bounds")));
+ RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_indexException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc/m2/gm2-libs/RTExceptions.mod")), 614, 9, const_cast<void*> (reinterpret_cast<const void*>("indexf")), const_cast<void*> (reinterpret_cast<const void*>("array index out of bounds")));
}
static void range (void * a)
{
- RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_rangeException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 626, 9, const_cast<void*> (reinterpret_cast<const void*>("range")), const_cast<void*> (reinterpret_cast<const void*>("assignment out of range")));
+ RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_rangeException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc/m2/gm2-libs/RTExceptions.mod")), 626, 9, const_cast<void*> (reinterpret_cast<const void*>("range")), const_cast<void*> (reinterpret_cast<const void*>("assignment out of range")));
}
static void casef (void * a)
{
- RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_caseSelectException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 638, 9, const_cast<void*> (reinterpret_cast<const void*>("casef")), const_cast<void*> (reinterpret_cast<const void*>("case selector out of range")));
+ RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_caseSelectException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc/m2/gm2-libs/RTExceptions.mod")), 638, 9, const_cast<void*> (reinterpret_cast<const void*>("casef")), const_cast<void*> (reinterpret_cast<const void*>("case selector out of range")));
}
static void invalidloc (void * a)
{
- RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_invalidLocation)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 650, 9, const_cast<void*> (reinterpret_cast<const void*>("invalidloc")), const_cast<void*> (reinterpret_cast<const void*>("invalid address referenced")));
+ RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_invalidLocation)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc/m2/gm2-libs/RTExceptions.mod")), 650, 9, const_cast<void*> (reinterpret_cast<const void*>("invalidloc")), const_cast<void*> (reinterpret_cast<const void*>("invalid address referenced")));
}
static void function (void * a)
{
- RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_functionException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 662, 9, const_cast<void*> (reinterpret_cast<const void*>("function")), const_cast<void*> (reinterpret_cast<const void*>("... function ... "))); /* --fixme-- what has happened ? */
+ RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_functionException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc/m2/gm2-libs/RTExceptions.mod")), 662, 9, const_cast<void*> (reinterpret_cast<const void*>("function")), const_cast<void*> (reinterpret_cast<const void*>("... function ... "))); /* --fixme-- what has happened ? */
}
static void wholevalue (void * a)
{
- RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_wholeValueException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 674, 9, const_cast<void*> (reinterpret_cast<const void*>("wholevalue")), const_cast<void*> (reinterpret_cast<const void*>("illegal whole value exception")));
+ RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_wholeValueException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc/m2/gm2-libs/RTExceptions.mod")), 674, 9, const_cast<void*> (reinterpret_cast<const void*>("wholevalue")), const_cast<void*> (reinterpret_cast<const void*>("illegal whole value exception")));
}
static void wholediv (void * a)
{
- RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_wholeDivException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 686, 9, const_cast<void*> (reinterpret_cast<const void*>("wholediv")), const_cast<void*> (reinterpret_cast<const void*>("illegal whole value exception")));
+ RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_wholeDivException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc/m2/gm2-libs/RTExceptions.mod")), 686, 9, const_cast<void*> (reinterpret_cast<const void*>("wholediv")), const_cast<void*> (reinterpret_cast<const void*>("illegal whole value exception")));
}
static void realvalue (void * a)
{
- RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_realValueException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 698, 9, const_cast<void*> (reinterpret_cast<const void*>("realvalue")), const_cast<void*> (reinterpret_cast<const void*>("illegal real value exception")));
+ RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_realValueException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc/m2/gm2-libs/RTExceptions.mod")), 698, 9, const_cast<void*> (reinterpret_cast<const void*>("realvalue")), const_cast<void*> (reinterpret_cast<const void*>("illegal real value exception")));
}
static void realdiv (void * a)
{
- RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_realDivException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 710, 9, const_cast<void*> (reinterpret_cast<const void*>("realdiv")), const_cast<void*> (reinterpret_cast<const void*>("real number division by zero exception")));
+ RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_realDivException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc/m2/gm2-libs/RTExceptions.mod")), 710, 9, const_cast<void*> (reinterpret_cast<const void*>("realdiv")), const_cast<void*> (reinterpret_cast<const void*>("real number division by zero exception")));
}
static void complexvalue (void * a)
{
- RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_complexValueException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 722, 9, const_cast<void*> (reinterpret_cast<const void*>("complexvalue")), const_cast<void*> (reinterpret_cast<const void*>("illegal complex value exception")));
+ RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_complexValueException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc/m2/gm2-libs/RTExceptions.mod")), 722, 9, const_cast<void*> (reinterpret_cast<const void*>("complexvalue")), const_cast<void*> (reinterpret_cast<const void*>("illegal complex value exception")));
}
static void complexdiv (void * a)
{
- RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_complexDivException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 734, 9, const_cast<void*> (reinterpret_cast<const void*>("complexdiv")), const_cast<void*> (reinterpret_cast<const void*>("complex number division by zero exception")));
+ RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_complexDivException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc/m2/gm2-libs/RTExceptions.mod")), 734, 9, const_cast<void*> (reinterpret_cast<const void*>("complexdiv")), const_cast<void*> (reinterpret_cast<const void*>("complex number division by zero exception")));
}
static void protection (void * a)
{
- RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_protException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 746, 9, const_cast<void*> (reinterpret_cast<const void*>("protection")), const_cast<void*> (reinterpret_cast<const void*>("protection exception")));
+ RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_protException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc/m2/gm2-libs/RTExceptions.mod")), 746, 9, const_cast<void*> (reinterpret_cast<const void*>("protection")), const_cast<void*> (reinterpret_cast<const void*>("protection exception")));
}
static void systemf (void * a)
{
- RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_sysException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 758, 9, const_cast<void*> (reinterpret_cast<const void*>("systemf")), const_cast<void*> (reinterpret_cast<const void*>("system exception")));
+ RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_sysException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc/m2/gm2-libs/RTExceptions.mod")), 758, 9, const_cast<void*> (reinterpret_cast<const void*>("systemf")), const_cast<void*> (reinterpret_cast<const void*>("system exception")));
}
static void coroutine (void * a)
{
- RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_coException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 770, 9, const_cast<void*> (reinterpret_cast<const void*>("coroutine")), const_cast<void*> (reinterpret_cast<const void*>("coroutine exception")));
+ RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_coException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc/m2/gm2-libs/RTExceptions.mod")), 770, 9, const_cast<void*> (reinterpret_cast<const void*>("coroutine")), const_cast<void*> (reinterpret_cast<const void*>("coroutine exception")));
}
static void exception (void * a)
{
- RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_exException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 782, 9, const_cast<void*> (reinterpret_cast<const void*>("exception")), const_cast<void*> (reinterpret_cast<const void*>("exception exception")));
+ RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_exException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc/m2/gm2-libs/RTExceptions.mod")), 782, 9, const_cast<void*> (reinterpret_cast<const void*>("exception")), const_cast<void*> (reinterpret_cast<const void*>("exception exception")));
}
{
if (currentEHB == NULL)
{
- M2RTS_Halt ((const char *) "currentEHB has not been initialized yet", 39, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod", 53, (const char *) "GetBaseExceptionBlock", 21, 600);
+ M2RTS_Halt ((const char *) "currentEHB has not been initialized yet", 39, (const char *) "../../gcc/m2/gm2-libs/RTExceptions.mod", 38, (const char *) "GetBaseExceptionBlock", 21, 600);
}
else
{
return currentEHB;
}
- ReturnException ("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.def", 25, 1);
+ ReturnException ("../../gcc/m2/gm2-libs/RTExceptions.def", 25, 1);
__builtin_unreachable ();
}
default:
- CaseException ("../../gcc-read-write/gcc/m2/gm2-libs/RTint.def", 25, 1);
+ CaseException ("../../gcc/m2/gm2-libs/RTint.def", 25, 1);
__builtin_unreachable ();
}
vec = vec->pending;
RTco_signal (lock);
return vptr->no;
}
- ReturnException ("../../gcc-read-write/gcc/m2/gm2-libs/RTint.def", 25, 1);
+ ReturnException ("../../gcc/m2/gm2-libs/RTint.def", 25, 1);
__builtin_unreachable ();
}
vptr = FindVectorNo (vec);
if (vptr == NULL)
{
- M2RTS_Halt ((const char *) "cannot find vector supplied", 27, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/RTint.mod", 46, (const char *) "ReArmTimeVector", 15, 287);
+ M2RTS_Halt ((const char *) "cannot find vector supplied", 27, (const char *) "../../gcc/m2/gm2-libs/RTint.mod", 31, (const char *) "ReArmTimeVector", 15, 287);
}
else
{
vptr = FindVectorNo (vec);
if (vptr == NULL)
{
- M2RTS_Halt ((const char *) "cannot find vector supplied", 27, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/RTint.mod", 46, (const char *) "GetTimeVector", 13, 313);
+ M2RTS_Halt ((const char *) "cannot find vector supplied", 27, (const char *) "../../gcc/m2/gm2-libs/RTint.mod", 31, (const char *) "GetTimeVector", 13, 313);
}
else
{
vptr = FindVectorNo (vec);
if (vptr == NULL)
{
- M2RTS_Halt ((const char *) "cannot find vector supplied", 27, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/RTint.mod", 46, (const char *) "AttachVector", 12, 340);
+ M2RTS_Halt ((const char *) "cannot find vector supplied", 27, (const char *) "../../gcc/m2/gm2-libs/RTint.mod", 31, (const char *) "AttachVector", 12, 340);
}
else
{
RTco_signal (lock);
return prevArg;
}
- ReturnException ("../../gcc-read-write/gcc/m2/gm2-libs/RTint.def", 25, 1);
+ ReturnException ("../../gcc/m2/gm2-libs/RTint.def", 25, 1);
__builtin_unreachable ();
}
vptr = FindVectorNo (vec);
if (vptr == NULL)
{
- M2RTS_Halt ((const char *) "cannot find vector supplied", 27, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/RTint.mod", 46, (const char *) "IncludeVector", 13, 374);
+ M2RTS_Halt ((const char *) "cannot find vector supplied", 27, (const char *) "../../gcc/m2/gm2-libs/RTint.mod", 31, (const char *) "IncludeVector", 13, 374);
}
else
{
vptr = FindPendingVector (vec);
if (vptr == NULL)
{
- M2RTS_Halt ((const char *) "cannot find pending vector supplied", 35, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/RTint.mod", 46, (const char *) "ExcludeVector", 13, 416);
+ M2RTS_Halt ((const char *) "cannot find pending vector supplied", 35, (const char *) "../../gcc/m2/gm2-libs/RTint.mod", 31, (const char *) "ExcludeVector", 13, 416);
}
else
{
default:
- CaseException ("../../gcc-read-write/gcc/m2/gm2-libs/RTint.def", 25, 1);
+ CaseException ("../../gcc/m2/gm2-libs/RTint.def", 25, 1);
__builtin_unreachable ();
}
vec = vec->pending;
}
if ((untilInterrupt && (((inSet == NULL) && (outSet == NULL)) || (maxFd == -1))) && ! found)
{
- M2RTS_Halt ((const char *) "deadlock found, no more processes to run and no interrupts active", 65, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/RTint.mod", 46, (const char *) "Listen", 6, 733);
+ M2RTS_Halt ((const char *) "deadlock found, no more processes to run and no interrupts active", 65, (const char *) "../../gcc/m2/gm2-libs/RTint.mod", 31, (const char *) "Listen", 6, 733);
}
/* printf('}
') ; */
extern "C" bool SArgs_GetArg (DynamicStrings_String *s, unsigned int n)
{
int i;
+ void * a;
SArgs_PtrToPtrToChar ppc;
i = (int ) (n);
if (i < (UnixArgs_GetArgC ()))
{
- /* ppc := ADDRESS (VAL (PtrToPtrToChar, ArgV) + (i * CARDINAL (TSIZE(PtrToChar)))) ; */
- ppc = static_cast<SArgs_PtrToPtrToChar> ((void *) (((SArgs_PtrToChar) (UnixArgs_GetArgV ()))+(n*sizeof (SArgs_PtrToChar))));
+ a = (void *) (UnixArgs_GetArgV ());
+ a = reinterpret_cast<void *> (reinterpret_cast<char *> (a)+n*sizeof (SArgs_PtrToChar));
+ ppc = static_cast<SArgs_PtrToPtrToChar> (a);
(*s) = DynamicStrings_InitStringCharStar (reinterpret_cast<void *> ((*ppc)));
return true;
}
M2RTS_HALT (-1);
__builtin_unreachable ();
}
- ReturnException ("../../gcc-read-write/gcc/m2/gm2-libs/StdIO.def", 25, 1);
+ ReturnException ("../../gcc/m2/gm2-libs/StdIO.def", 25, 1);
__builtin_unreachable ();
}
M2RTS_HALT (-1);
__builtin_unreachable ();
}
- ReturnException ("../../gcc-read-write/gcc/m2/gm2-libs/StdIO.def", 25, 1);
+ ReturnException ("../../gcc/m2/gm2-libs/StdIO.def", 25, 1);
__builtin_unreachable ();
}
int point;
unsigned int poTen;
- Assert ((IsDigit (DynamicStrings_char (s, 0))) || ((DynamicStrings_char (s, 0)) == '.'), (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/StringConvert.mod", 54, 1220, (const char *) "ToSigFig", 8);
+ Assert ((IsDigit (DynamicStrings_char (s, 0))) || ((DynamicStrings_char (s, 0)) == '.'), (const char *) "../../gcc/m2/gm2-libs/StringConvert.mod", 39, 1220, (const char *) "ToSigFig", 8);
point = DynamicStrings_Index (s, '.', 0);
if (point < 0)
{
{
int point;
- Assert ((IsDigit (DynamicStrings_char (s, 0))) || ((DynamicStrings_char (s, 0)) == '.'), (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/StringConvert.mod", 54, 1069, (const char *) "ToDecimalPlaces", 15);
+ Assert ((IsDigit (DynamicStrings_char (s, 0))) || ((DynamicStrings_char (s, 0)) == '.'), (const char *) "../../gcc/m2/gm2-libs/StringConvert.mod", 39, 1069, (const char *) "ToDecimalPlaces", 15);
point = DynamicStrings_Index (s, '.', 0);
if (point < 0)
{
(*a) = libc_malloc (static_cast<size_t> (size));
if ((*a) == NULL)
{
- Debug_Halt ((const char *) "out of memory error", 19, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/SysStorage.mod", 51, (const char *) "ALLOCATE", 8, 51);
+ Debug_Halt ((const char *) "out of memory error", 19, (const char *) "../../gcc/m2/gm2-libs/SysStorage.mod", 36, (const char *) "ALLOCATE", 8, 51);
}
if (enableTrace && trace)
{
}
if ((libc_memset ((*a), 0, static_cast<size_t> (size))) != (*a))
{
- Debug_Halt ((const char *) "memset should have returned the first parameter", 47, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/SysStorage.mod", 51, (const char *) "DEALLOCATE", 10, 78);
+ Debug_Halt ((const char *) "memset should have returned the first parameter", 47, (const char *) "../../gcc/m2/gm2-libs/SysStorage.mod", 36, (const char *) "DEALLOCATE", 10, 78);
}
}
if (enableDeallocation)
(*a) = libc_realloc ((*a), static_cast<size_t> (size));
if ((*a) == NULL)
{
- Debug_Halt ((const char *) "out of memory error", 19, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/SysStorage.mod", 51, (const char *) "REALLOCATE", 10, 122);
+ Debug_Halt ((const char *) "out of memory error", 19, (const char *) "../../gcc/m2/gm2-libs/SysStorage.mod", 36, (const char *) "REALLOCATE", 10, 122);
}
if (enableTrace && trace)
{
extern "C" int libc_close (int d);
extern "C" int libc_open (void * filename, int oflag, ...);
extern "C" int libc_creat (void * filename, unsigned int mode);
-extern "C" long int libc_lseek (int fd, long int offset, int whence);
+extern "C" ssize_t libc_lseek (int fd, ssize_t offset, int whence);
extern "C" void libc_perror (const char *string_, unsigned int _string_high);
extern "C" int libc_readv (int fd, void * v, int n);
extern "C" int libc_writev (int fd, void * v, int n);
d->at.firstUsed = 0;
return d;
}
- ReturnException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ ReturnException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
}
M2RTS_HALT (-1);
__builtin_unreachable ();
- ReturnException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ ReturnException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
default:
- CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ CaseException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
}
default:
- CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ CaseException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
switch (f->kind)
default:
- CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ CaseException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
}
default:
- CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ CaseException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
/* fill in, n. */
default:
- CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ CaseException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
}
default:
- CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ CaseException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
/* static analysis guarentees a RETURN statement will be used before here. */
default:
- CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ CaseException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
/* static analysis guarentees a RETURN statement will be used before here. */
default:
- CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ CaseException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
/* static analysis guarentees a RETURN statement will be used before here. */
M2RTS_HALT (-1);
__builtin_unreachable ();
}
- ReturnException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ ReturnException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
M2RTS_HALT (-1);
__builtin_unreachable ();
}
- ReturnException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ ReturnException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
default:
- CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ CaseException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
}
}
M2RTS_HALT (-1);
__builtin_unreachable ();
- ReturnException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ ReturnException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
default:
- CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ CaseException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
return n;
default:
- CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ CaseException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
M2RTS_HALT (-1);
__builtin_unreachable ();
- ReturnException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ ReturnException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
default:
- CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ CaseException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
M2RTS_HALT (-1);
__builtin_unreachable ();
- ReturnException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ ReturnException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
default:
- CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ CaseException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
return true;
default:
- CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ CaseException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
}
default:
- CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ CaseException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
}
default:
- CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ CaseException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
/* static analysis guarentees a RETURN statement will be used before here. */
default:
- CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ CaseException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
}
default:
- CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ CaseException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
}
return s;
}
}
- ReturnException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ ReturnException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
return c;
}
}
- ReturnException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ ReturnException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
M2RTS_HALT (-1); /* finish the cacading elsif statement. */
__builtin_unreachable ();
}
- ReturnException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ ReturnException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
M2RTS_HALT (-1); /* finish the cacading elsif statement. */
__builtin_unreachable ();
}
- ReturnException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ ReturnException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
default:
- CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ CaseException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
mcPretty_setNeedSpace (p);
default:
- CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ CaseException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
}
default:
- CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ CaseException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
}
default:
- CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ CaseException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
}
default:
- CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ CaseException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
outText (p, (const char *) ";", 1);
default:
- CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ CaseException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
if (n != NULL)
default:
- CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ CaseException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
- ReturnException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ ReturnException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
default:
- CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ CaseException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
}
default:
- CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ CaseException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
}
default:
- CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ CaseException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
M2RTS_HALT (-1);
__builtin_unreachable ();
- ReturnException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ ReturnException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
default:
- CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ CaseException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
mcPretty_setNeedSpace (p);
default:
- CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ CaseException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
}
default:
- CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ CaseException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
- ReturnException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ ReturnException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
default:
- CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ CaseException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
/* static analysis guarentees a RETURN statement will be used before here. */
default:
- CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ CaseException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
}
default:
- CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ CaseException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
}
default:
- CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ CaseException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
}
default:
- CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ CaseException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
/* static analysis guarentees a RETURN statement will be used before here. */
default:
- CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ CaseException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
/* static analysis guarentees a RETURN statement will be used before here. */
default:
- CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ CaseException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
M2RTS_HALT (-1);
__builtin_unreachable ();
- ReturnException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ ReturnException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
default:
- CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ CaseException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
/* static analysis guarentees a RETURN statement will be used before here. */
default:
- CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ CaseException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
return n;
return nameKey_makeKey ((const char *) "MIN", 3);
break;
+ case decl_pointerref:
+ return nameKey_NulName;
+ break;
+
case decl_funccall:
return nameKey_NulName;
break;
__builtin_unreachable ();
break;
}
- ReturnException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ ReturnException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
default:
- CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ CaseException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
importEnumFields (m, n);
default:
- CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ CaseException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
}
default:
- CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ CaseException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
/* static analysis guarentees a RETURN statement will be used before here. */
default:
- CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ CaseException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
}
M2RTS_HALT (-1); /* most likely op needs a clause as above. */
__builtin_unreachable ();
}
- ReturnException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ ReturnException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
M2RTS_HALT (-1); /* most likely op needs a clause as above. */
__builtin_unreachable ();
}
- ReturnException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ ReturnException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
default:
- CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ CaseException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
}
default:
- CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ CaseException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
}
default:
- CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ CaseException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
}
default:
- CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
+ CaseException ("../../gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
closeOutput ();
return true;
}
}
- ReturnException ("../../gcc-read-write/gcc/m2/mc/keyc.def", 20, 1);
+ ReturnException ("../../gcc/m2/mc/keyc.def", 20, 1);
__builtin_unreachable ();
}
off_t lseek(int fildes, off_t offset, int whence);
*/
-EXTERN long int libc_lseek (int fd, long int offset, int whence);
+EXTERN ssize_t libc_lseek (int fd, ssize_t offset, int whence);
/*
perror - writes errno and string. (ARRAY OF CHAR is translated onto ADDRESS).
default:
- CaseException ("../../gcc-read-write/gcc/m2/mc/mcComment.def", 20, 1);
+ CaseException ("../../gcc/m2/mc/mcComment.def", 20, 1);
__builtin_unreachable ();
}
if (cd->used)
}
mcflex_mcError (DynamicStrings_string (DynamicStrings_InitString ((const char *) "failed to find module name", 26)));
libc_exit (1);
- ReturnException ("../../gcc-read-write/gcc/m2/mc/mcComp.def", 20, 1);
+ ReturnException ("../../gcc/m2/mc/mcComp.def", 20, 1);
__builtin_unreachable ();
}
mcPrintf_fprintf1 (FIO_StdErr, (const char *) "failed to open %s\\n", 19, (const unsigned char *) &s, (sizeof (s)-1));
libc_exit (1);
}
- ReturnException ("../../gcc-read-write/gcc/m2/mc/mcComp.def", 20, 1);
+ ReturnException ("../../gcc/m2/mc/mcComp.def", 20, 1);
__builtin_unreachable ();
}
{
if (! q)
{
- mcError_internalError ((const char *) "assert failed", 13, (const char *) "../../gcc-read-write/gcc/m2/mc/mcDebug.mod", 42, 35);
+ mcError_internalError ((const char *) "assert failed", 13, (const char *) "../../gcc/m2/mc/mcDebug.mod", 27, 35);
}
}
s = DynamicStrings_ConCatChar (s, '^');
s = SFIO_WriteS (FIO_StdOut, s);
FIO_WriteLine (FIO_StdOut);
- mcError_internalError ((const char *) m, _m_high, (const char *) "../../gcc-read-write/gcc/m2/mc/mcMetaError.mod", 46, 97);
+ mcError_internalError ((const char *) m, _m_high, (const char *) "../../gcc/m2/mc/mcMetaError.mod", 31, 97);
}
{
if (a != b)
{
- mcError_internalError ((const char *) "different string returned", 25, (const char *) "../../gcc-read-write/gcc/m2/mc/mcMetaError.mod", 46, 109);
+ mcError_internalError ((const char *) "different string returned", 25, (const char *) "../../gcc/m2/mc/mcMetaError.mod", 31, 109);
}
return a;
/* static analysis guarentees a RETURN statement will be used before here. */
case mcMetaError_chained:
if (e == NULL)
{
- mcError_internalError ((const char *) "should not be chaining an error onto an empty error note", 56, (const char *) "../../gcc-read-write/gcc/m2/mc/mcMetaError.mod", 46, 355);
+ mcError_internalError ((const char *) "should not be chaining an error onto an empty error note", 56, (const char *) "../../gcc/m2/mc/mcMetaError.mod", 31, 355);
}
else
{
default:
- mcError_internalError ((const char *) "unexpected enumeration value", 28, (const char *) "../../gcc-read-write/gcc/m2/mc/mcMetaError.mod", 46, 369);
+ mcError_internalError ((const char *) "unexpected enumeration value", 28, (const char *) "../../gcc/m2/mc/mcMetaError.mod", 31, 369);
break;
}
return e;
Indexing_DeleteIndice (s->list, Indexing_HighIndice (s->list));
return a;
}
- ReturnException ("../../gcc-read-write/gcc/m2/mc/mcStack.def", 20, 1);
+ ReturnException ("../../gcc/m2/mc/mcStack.def", 20, 1);
__builtin_unreachable ();
}
{
return Indexing_GetIndice (s->list, i);
}
- ReturnException ("../../gcc-read-write/gcc/m2/mc/mcStack.def", 20, 1);
+ ReturnException ("../../gcc/m2/mc/mcStack.def", 20, 1);
__builtin_unreachable ();
}
s = DynamicStrings_InitStringCharStar (FIO_getFileName (f));
FIO_Close (f);
f = SFIO_OpenToRead (s);
- while (! (FIO_EOF (f)))
+ while ((! (FIO_EOF (f))) && (FIO_IsNoError (f)))
{
b = FIO_ReadNBytes (f, maxBuffer, &buffer);
- b = FIO_WriteNBytes (destFile, b, &buffer);
+ if (FIO_IsNoError (f))
+ {
+ b = FIO_WriteNBytes (destFile, b, &buffer);
+ }
+ else if (! (FIO_EOF (f)))
+ {
+ /* avoid dangling else. */
+ libc_printf ((const char *) "mcStream.mod:copy: error seen when reading file fragment: %s\\n", 62, DynamicStrings_string (s));
+ libc_exit (1);
+ }
}
FIO_Close (f);
}
(*p) = ASCII_nul;
return doMakeKey (n, higha);
}
- ReturnException ("../../gcc-read-write/gcc/m2/mc/nameKey.def", 20, 1);
+ ReturnException ("../../gcc/m2/mc/nameKey.def", 20, 1);
__builtin_unreachable ();
}
return doMakeKey (n, higha);
}
}
- ReturnException ("../../gcc-read-write/gcc/m2/mc/nameKey.def", 20, 1);
+ ReturnException ("../../gcc/m2/mc/nameKey.def", 20, 1);
__builtin_unreachable ();
}
(*father) = t;
if (t == NULL)
{
- Debug_Halt ((const char *) "parameter t should never be NIL", 31, (const char *) "../../gcc-read-write/gcc/m2/mc/symbolKey.mod", 44, (const char *) "findNodeAndParentInTree", 23, 203);
+ Debug_Halt ((const char *) "parameter t should never be NIL", 31, (const char *) "../../gcc/m2/mc/symbolKey.mod", 29, (const char *) "findNodeAndParentInTree", 23, 203);
}
(*child) = t->left;
if ((*child) != NULL)
}
else
{
- Debug_Halt ((const char *) "symbol already stored", 21, (const char *) "../../gcc-read-write/gcc/m2/mc/symbolKey.mod", 44, (const char *) "putSymKey", 9, 119);
+ Debug_Halt ((const char *) "symbol already stored", 21, (const char *) "../../gcc/m2/mc/symbolKey.mod", 29, (const char *) "putSymKey", 9, 119);
}
}
}
else
{
- Debug_Halt ((const char *) "trying to delete a symbol that is not in the tree - the compiler never expects this to occur", 92, (const char *) "../../gcc-read-write/gcc/m2/mc/symbolKey.mod", 44, (const char *) "delSymKey", 9, 186);
+ Debug_Halt ((const char *) "trying to delete a symbol that is not in the tree - the compiler never expects this to occur", 92, (const char *) "../../gcc/m2/mc/symbolKey.mod", 29, (const char *) "delSymKey", 9, 186);
}
}
for (j=0; j<=c->nArgs; j++)
{
offset = (unsigned int ) (((varargs_ptrToByte) (v->contents))-((varargs_ptrToByte) (v->arg.array[j].ptr)));
- c->arg.array[j].ptr = reinterpret_cast<void *> ((varargs_ptrToByte) (((varargs_ptrToByte) (c->contents))+offset));
+ c->arg.array[j].ptr = reinterpret_cast<void *> ((varargs_ptrToByte) (c->contents));
+ c->arg.array[j].ptr = reinterpret_cast<void *> (reinterpret_cast<char *> (c->arg.array[j].ptr)+offset);
c->arg.array[j].len = v->arg.array[j].len;
}
return c;
*/
EXTERN int wrapc_isfinitel (long double x);
+
+/*
+ isnan - provide non builtin alternative to the gcc builtin isnan.
+ Returns 1 if x is a NaN otherwise return 0.
+*/
+
+EXTERN int wrapc_isnan (double x);
+
+/*
+ isnanf - provide non builtin alternative to the gcc builtin isnanf.
+ Returns 1 if x is a NaN otherwise return 0.
+*/
+
+EXTERN int wrapc_isnanf (float x);
+
+/*
+ isnanl - provide non builtin alternative to the gcc builtin isnanl.
+ Returns 1 if x is a NaN otherwise return 0.
+*/
+
+EXTERN int wrapc_isnanl (long double x);
+
+/*
+ SeekSet - return the system libc SEEK_SET value.
+*/
+
+EXTERN int wrapc_SeekSet (void);
+
+/*
+ SeekEnd - return the system libc SEEK_END value.
+*/
+
+EXTERN int wrapc_SeekEnd (void);
+
+/*
+ ReadOnly - return the system value of O_RDONLY.
+*/
+
+EXTERN unsigned int wrapc_ReadOnly (void);
+
+/*
+ WriteOnly - return the system value of O_WRONLY.
+*/
+
+EXTERN unsigned int wrapc_WriteOnly (void);
# ifdef __cplusplus
}
# endif
im : RETURN makeKey ('IM') |
max : RETURN makeKey ('MAX') |
min : RETURN makeKey ('MIN') |
+ pointerref : RETURN NulName |
funccall : RETURN NulName |
identlist : RETURN NulName
IMPLEMENTATION MODULE mcStream ;
-FROM FIO IMPORT File, OpenToWrite, OpenToRead, EOF, ReadNBytes, WriteNBytes, Close, getFileName ;
-FROM libc IMPORT unlink, printf, getpid ;
+FROM FIO IMPORT File, OpenToWrite, OpenToRead, EOF, ReadNBytes, WriteNBytes, Close, getFileName, IsNoError ;
+FROM libc IMPORT unlink, printf, getpid, exit ;
FROM Indexing IMPORT InitIndex, InBounds, HighIndice, LowIndice, PutIndice, GetIndice, Index, ForeachIndiceInIndexDo ;
FROM DynamicStrings IMPORT String, InitString, InitStringCharStar, string ;
FROM FormatStrings IMPORT Sprintf2 ;
s := InitStringCharStar(getFileName (f)) ;
Close (f) ;
f := SFIO.OpenToRead (s) ;
- WHILE NOT EOF (f) DO
+ WHILE (NOT EOF (f)) AND IsNoError (f) DO
b := ReadNBytes (f, HIGH (buffer), ADR (buffer)) ;
- b := WriteNBytes (destFile, b, ADR (buffer))
+ IF IsNoError (f)
+ THEN
+ b := WriteNBytes (destFile, b, ADR (buffer))
+ ELSIF NOT EOF (f)
+ THEN
+ printf ("mcStream.mod:copy: error seen when reading file fragment: %s\n",
+ string (s)) ;
+ exit (1)
+ END
END ;
Close (f)
END
contents := memcpy (contents, v^.contents, size) ;
FOR j := 0 TO nArgs DO
offset := VAL (CARDINAL, VAL (ptrToByte, v^.contents) - VAL (ptrToByte, v^.arg[j].ptr)) ;
- arg[j].ptr := VAL (ptrToByte, VAL (ptrToByte, contents) + offset) ;
+ arg[j].ptr := VAL (ptrToByte, contents) ;
+ INC (arg[j].ptr, offset) ;
arg[j].len := v^.arg[j].len ;
END
END ;
extern "C" DynamicStrings_String DynamicStrings_Assign (DynamicStrings_String a, DynamicStrings_String b);
+/*
+ ReplaceChar - returns string s after it has changed all occurances of from to to.
+*/
+
+extern "C" DynamicStrings_String DynamicStrings_ReplaceChar (DynamicStrings_String s, char from, char to);
+
/*
Dup - duplicate a String, s, returning the copy of s.
*/
(*c).next->contents.next = NULL;
ConcatContents (&(*c).next->contents, (const char *) a, _a_high, h, o);
AddDebugInfo ((*c).next);
- (*c).next = AssignDebug ((*c).next, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 722, (const char *) "ConcatContents", 14);
+ (*c).next = AssignDebug ((*c).next, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 722, (const char *) "ConcatContents", 14);
}
else
{
AddDebugInfo ((*c).next);
if (TraceOn)
{
- (*c).next = AssignDebug ((*c).next, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 917, (const char *) "ConcatContentsAddress", 21);
+ (*c).next = AssignDebug ((*c).next, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 917, (const char *) "ConcatContentsAddress", 21);
}
}
else
AddDebugInfo (s);
if (TraceOn)
{
- s = AssignDebug (s, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 758, (const char *) "InitString", 10);
+ s = AssignDebug (s, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 758, (const char *) "InitString", 10);
}
return s;
/* static analysis guarentees a RETURN statement will be used before here. */
AddDebugInfo (s);
if (TraceOn)
{
- s = AssignDebug (s, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 957, (const char *) "InitStringCharStar", 18);
+ s = AssignDebug (s, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 957, (const char *) "InitStringCharStar", 18);
}
return s;
/* static analysis guarentees a RETURN statement will be used before here. */
s = DynamicStrings_InitString ((const char *) &a.array[0], 1);
if (TraceOn)
{
- s = AssignDebug (s, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 977, (const char *) "InitStringChar", 14);
+ s = AssignDebug (s, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 977, (const char *) "InitStringChar", 14);
}
return s;
/* static analysis guarentees a RETURN statement will be used before here. */
}
+/*
+ ReplaceChar - returns string s after it has changed all occurances of from to to.
+*/
+
+extern "C" DynamicStrings_String DynamicStrings_ReplaceChar (DynamicStrings_String s, char from, char to)
+{
+ DynamicStrings_String t;
+ unsigned int i;
+
+ t = s;
+ while (t != NULL)
+ {
+ i = 0;
+ while (i < t->contents.len)
+ {
+ if (t->contents.buf.array[i] == from)
+ {
+ t->contents.buf.array[i] = to;
+ }
+ i += 1;
+ }
+ t = t->contents.next;
+ }
+ return s;
+ /* static analysis guarentees a RETURN statement will be used before here. */
+ __builtin_unreachable ();
+}
+
+
/*
Dup - duplicate a String, s, returning the copy of s.
*/
s = DynamicStrings_Assign (DynamicStrings_InitString ((const char *) "", 0), s);
if (TraceOn)
{
- s = AssignDebug (s, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 1173, (const char *) "Dup", 3);
+ s = AssignDebug (s, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 1198, (const char *) "Dup", 3);
}
return s;
/* static analysis guarentees a RETURN statement will be used before here. */
a = DynamicStrings_ConCat (DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "", 0), a), b);
if (TraceOn)
{
- a = AssignDebug (a, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 1193, (const char *) "Add", 3);
+ a = AssignDebug (a, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 1218, (const char *) "Add", 3);
}
return a;
/* static analysis guarentees a RETURN statement will be used before here. */
t = DynamicStrings_InitStringCharStar (a);
if (TraceOn)
{
- t = AssignDebug (t, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 1250, (const char *) "EqualCharStar", 13);
+ t = AssignDebug (t, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 1275, (const char *) "EqualCharStar", 13);
}
t = AddToGarbage (t, s);
if (DynamicStrings_Equal (t, s))
t = DynamicStrings_InitString ((const char *) a, _a_high);
if (TraceOn)
{
- t = AssignDebug (t, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 1280, (const char *) "EqualArray", 10);
+ t = AssignDebug (t, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 1305, (const char *) "EqualArray", 10);
}
t = AddToGarbage (t, s);
if (DynamicStrings_Equal (t, s))
}
if (TraceOn)
{
- s = AssignDebug (s, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 1312, (const char *) "Mult", 4);
+ s = AssignDebug (s, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 1337, (const char *) "Mult", 4);
}
return s;
/* static analysis guarentees a RETURN statement will be used before here. */
AddDebugInfo (t->contents.next);
if (TraceOn)
{
- t->contents.next = AssignDebug (t->contents.next, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 1380, (const char *) "Slice", 5);
+ t->contents.next = AssignDebug (t->contents.next, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 1405, (const char *) "Slice", 5);
}
}
t = t->contents.next;
}
if (TraceOn)
{
- d = AssignDebug (d, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 1397, (const char *) "Slice", 5);
+ d = AssignDebug (d, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 1422, (const char *) "Slice", 5);
}
return d;
/* static analysis guarentees a RETURN statement will be used before here. */
}
if (TraceOn)
{
- s = AssignDebug (s, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 1509, (const char *) "RemoveComment", 13);
+ s = AssignDebug (s, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 1534, (const char *) "RemoveComment", 13);
}
return s;
/* static analysis guarentees a RETURN statement will be used before here. */
s = DynamicStrings_Slice (s, (int ) (i), 0);
if (TraceOn)
{
- s = AssignDebug (s, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 1621, (const char *) "RemoveWhitePrefix", 17);
+ s = AssignDebug (s, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 1646, (const char *) "RemoveWhitePrefix", 17);
}
return s;
/* static analysis guarentees a RETURN statement will be used before here. */
s = DynamicStrings_Slice (s, 0, i+1);
if (TraceOn)
{
- s = AssignDebug (s, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 1643, (const char *) "RemoveWhitePostfix", 18);
+ s = AssignDebug (s, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, 1668, (const char *) "RemoveWhitePostfix", 18);
}
return s;
/* static analysis guarentees a RETURN statement will be used before here. */
if (frameHead == NULL)
{
stop ();
- M2RTS_Halt ((const char *) "mismatched number of PopAllocation's compared to PushAllocation's", 65, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, (const char *) "PopAllocationExemption", 22, 174);
+ M2RTS_Halt ((const char *) "mismatched number of PopAllocation's compared to PushAllocation's", 65, (const char *) "../../gcc/m2/gm2-libs/DynamicStrings.mod", 40, (const char *) "PopAllocationExemption", 22, 174);
}
else
{
EXTERN DynamicStrings_String DynamicStrings_Assign (DynamicStrings_String a, DynamicStrings_String b);
+/*
+ ReplaceChar - returns string s after it has changed all
+ occurances of from to to.
+*/
+
+EXTERN DynamicStrings_String DynamicStrings_ReplaceChar (DynamicStrings_String s, char from, char to);
+
/*
Dup - duplicate a String, s, returning the copy of s.
*/
# include "GStorage.h"
# include "Gmcrts.h"
#include <unistd.h>
+# include <sys/types.h>
#if defined(__cplusplus)
# undef NULL
# define NULL 0
# include "GStrLib.h"
# include "GStorage.h"
# include "GNumberIO.h"
-# include "Glibc.h"
# include "GIndexing.h"
# include "GM2RTS.h"
+# include "Glibc.h"
+# include "Gwrapc.h"
typedef unsigned int FIO_File;
FIO_File FIO_StdErr;
FIO_File FIO_StdOut;
FIO_File FIO_StdIn;
-# define SEEK_SET 0
-# define SEEK_END 2
-# define UNIXREADONLY 0
-# define UNIXWRITEONLY 1
-# define CreatePermissions 0666
# define MaxBufferLength (1024*16)
# define MaxErrorString (1024*8)
+# define CreatePermissions 0666
typedef struct FIO_NameInfo_r FIO_NameInfo;
typedef struct FIO_buf_r FIO_buf;
extern "C" unsigned int FIO_ReadNBytes (FIO_File f, unsigned int nBytes, void * dest);
/*
- ReadAny - reads HIGH(a) bytes into, a. All input
+ ReadAny - reads HIGH (a) + 1 bytes into, a. All input
is fully buffered, unlike ReadNBytes and thus is more
suited to small reads.
*/
extern "C" unsigned int FIO_WriteNBytes (FIO_File f, unsigned int nBytes, void * src);
/*
- WriteAny - writes HIGH(a) bytes onto, file, f. All output
+ WriteAny - writes HIGH (a) + 1 bytes onto, file, f. All output
is fully buffered, unlike WriteNBytes and thus is more
suited to small writes.
*/
Useful when performing small reads.
*/
-static int BufferedRead (FIO_File f, unsigned int nBytes, void * a);
+static int BufferedRead (FIO_File f, unsigned int nBytes, void * dest);
/*
HandleEscape - translates
Useful when performing small writes.
*/
-static int BufferedWrite (FIO_File f, unsigned int nBytes, void * a);
+static int BufferedWrite (FIO_File f, unsigned int nBytes, void * src);
/*
PreInitialize - preinitialize the file descriptor.
return f; /* create new slot */
}
}
- ReturnException ("../../gcc-read-write/gcc/m2/gm2-libs/FIO.def", 25, 1);
+ ReturnException ("../../gcc/m2/gm2-libs/FIO.def", 25, 1);
__builtin_unreachable ();
}
}
else
{
- fd->unixfd = libc_open (fd->name.address, UNIXWRITEONLY, 0);
+ fd->unixfd = libc_open (fd->name.address, (int ) (wrapc_WriteOnly ()), 0);
}
}
else
{
- fd->unixfd = libc_open (fd->name.address, UNIXREADONLY, 0);
+ fd->unixfd = libc_open (fd->name.address, (int ) (wrapc_ReadOnly ()), 0);
}
if (fd->unixfd < 0)
{
Useful when performing small reads.
*/
-static int BufferedRead (FIO_File f, unsigned int nBytes, void * a)
+static int BufferedRead (FIO_File f, unsigned int nBytes, void * dest)
{
typedef unsigned char *BufferedRead__T3;
- void * t;
+ void * src;
int total;
int n;
BufferedRead__T3 p;
if (nBytes == 1)
{
/* too expensive to call memcpy for 1 character */
- p = static_cast<BufferedRead__T3> (a);
+ p = static_cast<BufferedRead__T3> (dest);
(*p) = static_cast<unsigned char> ((*fd->buffer->contents).array[fd->buffer->position]);
fd->buffer->left -= 1; /* remove consumed byte */
fd->buffer->position += 1; /* move onwards n byte */
else
{
n = Min (fd->buffer->left, nBytes);
- t = fd->buffer->address;
- t = reinterpret_cast<void *> (reinterpret_cast<char *> (t)+fd->buffer->position);
- p = static_cast<BufferedRead__T3> (libc_memcpy (a, t, static_cast<size_t> (n)));
+ src = fd->buffer->address;
+ src = reinterpret_cast<void *> (reinterpret_cast<char *> (src)+fd->buffer->position);
+ p = static_cast<BufferedRead__T3> (libc_memcpy (dest, src, static_cast<size_t> (n)));
fd->buffer->left -= n; /* remove consumed bytes */
fd->buffer->position += n; /* move onwards n bytes */
/* move onwards ready for direct reads */
- a = reinterpret_cast<void *> (reinterpret_cast<char *> (a)+n);
+ dest = reinterpret_cast<void *> (reinterpret_cast<char *> (dest)+n);
nBytes -= n; /* reduce the amount for future direct */
/* read */
total += n;
Useful when performing small writes.
*/
-static int BufferedWrite (FIO_File f, unsigned int nBytes, void * a)
+static int BufferedWrite (FIO_File f, unsigned int nBytes, void * src)
{
typedef unsigned char *BufferedWrite__T5;
- void * t;
+ void * dest;
int total;
int n;
BufferedWrite__T5 p;
if (nBytes == 1)
{
/* too expensive to call memcpy for 1 character */
- p = static_cast<BufferedWrite__T5> (a);
+ p = static_cast<BufferedWrite__T5> (src);
(*fd->buffer->contents).array[fd->buffer->position] = static_cast<char> ((*p));
fd->buffer->left -= 1; /* reduce space */
fd->buffer->position += 1; /* move onwards n byte */
else
{
n = Min (fd->buffer->left, nBytes);
- t = fd->buffer->address;
- t = reinterpret_cast<void *> (reinterpret_cast<char *> (t)+fd->buffer->position);
- p = static_cast<BufferedWrite__T5> (libc_memcpy (a, t, static_cast<size_t> ((unsigned int ) (n))));
+ dest = fd->buffer->address;
+ dest = reinterpret_cast<void *> (reinterpret_cast<char *> (dest)+fd->buffer->position);
+ p = static_cast<BufferedWrite__T5> (libc_memcpy (dest, src, static_cast<size_t> ((unsigned int ) (n))));
fd->buffer->left -= n; /* remove consumed bytes */
fd->buffer->position += n; /* move onwards n bytes */
/* move ready for further writes */
- a = reinterpret_cast<void *> (reinterpret_cast<char *> (a)+n);
+ src = reinterpret_cast<void *> (reinterpret_cast<char *> (src)+n);
nBytes -= n; /* reduce the amount for future writes */
total += n; /* reduce the amount for future writes */
}
/*
- ReadAny - reads HIGH(a) bytes into, a. All input
+ ReadAny - reads HIGH (a) + 1 bytes into, a. All input
is fully buffered, unlike ReadNBytes and thus is more
suited to small reads.
*/
extern "C" void FIO_ReadAny (FIO_File f, unsigned char *a, unsigned int _a_high)
{
CheckAccess (f, FIO_openedforread, false);
- if ((BufferedRead (f, _a_high, a)) == ((int ) (_a_high)))
+ if ((BufferedRead (f, _a_high+1, a)) == ((int ) (_a_high+1)))
{
SetEndOfLine (f, static_cast<char> (a[_a_high]));
}
/*
- WriteAny - writes HIGH(a) bytes onto, file, f. All output
+ WriteAny - writes HIGH (a) + 1 bytes onto, file, f. All output
is fully buffered, unlike WriteNBytes and thus is more
suited to small writes.
*/
extern "C" void FIO_WriteAny (FIO_File f, unsigned char *a, unsigned int _a_high)
{
CheckAccess (f, FIO_openedforwrite, true);
- if ((BufferedWrite (f, _a_high, a)) == ((int ) (_a_high)))
+ if ((BufferedWrite (f, _a_high+1, a)) == ((int ) (_a_high+1)))
{} /* empty. */
}
fd->buffer->position = 0;
fd->buffer->filled = 0;
}
- offset = libc_lseek (fd->unixfd, pos, SEEK_SET);
+ offset = static_cast<long int> (libc_lseek (fd->unixfd, (ssize_t ) (pos), wrapc_SeekSet ()));
if ((offset >= 0) && (pos == offset))
{
fd->abspos = pos;
fd->buffer->position = 0;
fd->buffer->filled = 0;
}
- offset = libc_lseek (fd->unixfd, pos, SEEK_END);
+ offset = static_cast<long int> (libc_lseek (fd->unixfd, (ssize_t ) (pos), wrapc_SeekEnd ()));
if (offset >= 0)
{
fd->abspos = offset;
EXTERN unsigned int FIO_ReadNBytes (FIO_File f, unsigned int nBytes, void * dest);
/*
- ReadAny - reads HIGH(a) bytes into, a. All input
+ ReadAny - reads HIGH (a) + 1 bytes into, a. All input
is fully buffered, unlike ReadNBytes and thus is more
suited to small reads.
*/
EXTERN unsigned int FIO_WriteNBytes (FIO_File f, unsigned int nBytes, void * src);
/*
- WriteAny - writes HIGH(a) bytes onto, file, f. All output
+ WriteAny - writes HIGH (a) + 1 bytes onto, file, f. All output
is fully buffered, unlike WriteNBytes and thus is more
suited to small writes.
*/
static void Init (void)
{
- fdState.array[0].IsEof = false;
- fdState.array[0].IsRaw = false;
- fdState.array[1].IsEof = false;
- fdState.array[1].IsRaw = false;
- fdState.array[2].IsEof = false;
- fdState.array[2].IsRaw = false;
+ unsigned int fdi;
+
+ for (fdi=0; fdi<=MaxDefaultFd; fdi++)
+ {
+ fdState.array[fdi].IsEof = false;
+ fdState.array[fdi].IsRaw = false;
+ }
}
{
return (n >= i->Low) && (n <= i->High);
}
- ReturnException ("../../gcc-read-write/gcc/m2/gm2-libs/Indexing.def", 25, 1);
+ ReturnException ("../../gcc/m2/gm2-libs/Indexing.def", 25, 1);
__builtin_unreachable ();
}
{
return i->High;
}
- ReturnException ("../../gcc-read-write/gcc/m2/gm2-libs/Indexing.def", 25, 1);
+ ReturnException ("../../gcc/m2/gm2-libs/Indexing.def", 25, 1);
__builtin_unreachable ();
}
{
return i->Low;
}
- ReturnException ("../../gcc-read-write/gcc/m2/gm2-libs/Indexing.def", 25, 1);
+ ReturnException ("../../gcc/m2/gm2-libs/Indexing.def", 25, 1);
__builtin_unreachable ();
}
extern "C" void M2Dependent_RequestDependant (void * modulename, void * libname, void * dependantmodule, void * dependantlibname);
+/*
+ InitDependencyList - initialize all fields of DependencyList.
+*/
+
+static void InitDependencyList (M2Dependent_DependencyList *depList, PROC proc, M2Dependent_DependencyState state);
+
/*
CreateModule - creates a new module entry and returns the
ModuleChain.
static void CheckInitialized (void);
+/*
+ InitDependencyList - initialize all fields of DependencyList.
+*/
+
+static void InitDependencyList (M2Dependent_DependencyList *depList, PROC proc, M2Dependent_DependencyState state)
+{
+ (*depList).proc = proc;
+ (*depList).forced = false;
+ (*depList).forc = false;
+ (*depList).appl = false;
+ (*depList).state = state;
+}
+
+
/*
CreateModule - creates a new module entry and returns the
ModuleChain.
mptr->libname = libname;
mptr->init = init;
mptr->fini = fini;
- mptr->dependency.proc = dependencies;
- mptr->dependency.state = M2Dependent_unregistered;
+ InitDependencyList (&mptr->dependency, dependencies, M2Dependent_unregistered);
mptr->prev = NULL;
mptr->next = NULL;
if (HexTrace)
n = RTExceptions_GetNumber (e);
if (n == (UINT_MAX))
{
- RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_exException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/M2EXCEPTION.mod")), 47, 6, const_cast<void*> (reinterpret_cast<const void*>("M2Exception")), const_cast<void*> (reinterpret_cast<const void*>("current coroutine is not in the exceptional execution state")));
+ RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_exException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc/m2/gm2-libs/M2EXCEPTION.mod")), 47, 6, const_cast<void*> (reinterpret_cast<const void*>("M2Exception")), const_cast<void*> (reinterpret_cast<const void*>("current coroutine is not in the exceptional execution state")));
}
else
{
return (M2EXCEPTION_M2Exceptions) (n);
}
- ReturnException ("../../gcc-read-write/gcc/m2/gm2-libs/M2EXCEPTION.def", 25, 1);
+ ReturnException ("../../gcc/m2/gm2-libs/M2EXCEPTION.def", 25, 1);
__builtin_unreachable ();
}
(*p) = ASCII_nul;
return DoMakeKey (n, higha);
}
- ReturnException ("../../gcc-read-write/gcc/m2/gm2-compiler/NameKey.def", 20, 1);
+ ReturnException ("../../gcc/m2/gm2-compiler/NameKey.def", 20, 1);
__builtin_unreachable ();
}
return DoMakeKey (n, higha);
}
}
- ReturnException ("../../gcc-read-write/gcc/m2/gm2-compiler/NameKey.def", 20, 1);
+ ReturnException ("../../gcc/m2/gm2-compiler/NameKey.def", 20, 1);
__builtin_unreachable ();
}
unsigned int i;
NameKey_PtrToChar p;
- p = static_cast<NameKey_PtrToChar> (NameKey_KeyToCharStar (Key));
i = 0;
- while ((*p) != ASCII_nul)
+ if (Key != NameKey_NulName)
{
- i += 1;
- p += 1;
+ p = static_cast<NameKey_PtrToChar> (NameKey_KeyToCharStar (Key));
+ while ((*p) != ASCII_nul)
+ {
+ i += 1;
+ p += 1;
+ }
}
return i;
/* static analysis guarentees a RETURN statement will be used before here. */
}
else
{
- Debug_Halt ((const char *) "max push back stack exceeded, increase MaxPushBackStack", 55, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/PushBackInput.mod", 54, (const char *) "PutCh", 5, 151);
+ Debug_Halt ((const char *) "max push back stack exceeded, increase MaxPushBackStack", 55, (const char *) "../../gcc/m2/gm2-libs/PushBackInput.mod", 39, (const char *) "PutCh", 5, 151);
}
return ch;
/* static analysis guarentees a RETURN statement will be used before here. */
l -= 1;
if ((PushBackInput_PutCh (a[l])) != a[l])
{
- Debug_Halt ((const char *) "assert failed", 13, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/PushBackInput.mod", 54, (const char *) "PutString", 9, 132);
+ Debug_Halt ((const char *) "assert failed", 13, (const char *) "../../gcc/m2/gm2-libs/PushBackInput.mod", 39, (const char *) "PutString", 9, 132);
}
}
}
i -= 1;
if ((PushBackInput_PutCh (DynamicStrings_char (s, static_cast<int> (i)))) != (DynamicStrings_char (s, static_cast<int> (i))))
{
- Debug_Halt ((const char *) "assert failed", 13, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/PushBackInput.mod", 54, (const char *) "PutStr", 6, 113);
+ Debug_Halt ((const char *) "assert failed", 13, (const char *) "../../gcc/m2/gm2-libs/PushBackInput.mod", 39, (const char *) "PutStr", 6, 113);
}
}
}
static void indexf (void * a)
{
- RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_indexException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 614, 9, const_cast<void*> (reinterpret_cast<const void*>("indexf")), const_cast<void*> (reinterpret_cast<const void*>("array index out of bounds")));
+ RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_indexException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc/m2/gm2-libs/RTExceptions.mod")), 614, 9, const_cast<void*> (reinterpret_cast<const void*>("indexf")), const_cast<void*> (reinterpret_cast<const void*>("array index out of bounds")));
}
static void range (void * a)
{
- RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_rangeException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 626, 9, const_cast<void*> (reinterpret_cast<const void*>("range")), const_cast<void*> (reinterpret_cast<const void*>("assignment out of range")));
+ RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_rangeException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc/m2/gm2-libs/RTExceptions.mod")), 626, 9, const_cast<void*> (reinterpret_cast<const void*>("range")), const_cast<void*> (reinterpret_cast<const void*>("assignment out of range")));
}
static void casef (void * a)
{
- RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_caseSelectException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 638, 9, const_cast<void*> (reinterpret_cast<const void*>("casef")), const_cast<void*> (reinterpret_cast<const void*>("case selector out of range")));
+ RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_caseSelectException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc/m2/gm2-libs/RTExceptions.mod")), 638, 9, const_cast<void*> (reinterpret_cast<const void*>("casef")), const_cast<void*> (reinterpret_cast<const void*>("case selector out of range")));
}
static void invalidloc (void * a)
{
- RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_invalidLocation)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 650, 9, const_cast<void*> (reinterpret_cast<const void*>("invalidloc")), const_cast<void*> (reinterpret_cast<const void*>("invalid address referenced")));
+ RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_invalidLocation)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc/m2/gm2-libs/RTExceptions.mod")), 650, 9, const_cast<void*> (reinterpret_cast<const void*>("invalidloc")), const_cast<void*> (reinterpret_cast<const void*>("invalid address referenced")));
}
static void function (void * a)
{
- RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_functionException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 662, 9, const_cast<void*> (reinterpret_cast<const void*>("function")), const_cast<void*> (reinterpret_cast<const void*>("... function ... "))); /* --fixme-- what has happened ? */
+ RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_functionException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc/m2/gm2-libs/RTExceptions.mod")), 662, 9, const_cast<void*> (reinterpret_cast<const void*>("function")), const_cast<void*> (reinterpret_cast<const void*>("... function ... "))); /* --fixme-- what has happened ? */
}
static void wholevalue (void * a)
{
- RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_wholeValueException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 674, 9, const_cast<void*> (reinterpret_cast<const void*>("wholevalue")), const_cast<void*> (reinterpret_cast<const void*>("illegal whole value exception")));
+ RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_wholeValueException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc/m2/gm2-libs/RTExceptions.mod")), 674, 9, const_cast<void*> (reinterpret_cast<const void*>("wholevalue")), const_cast<void*> (reinterpret_cast<const void*>("illegal whole value exception")));
}
static void wholediv (void * a)
{
- RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_wholeDivException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 686, 9, const_cast<void*> (reinterpret_cast<const void*>("wholediv")), const_cast<void*> (reinterpret_cast<const void*>("illegal whole value exception")));
+ RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_wholeDivException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc/m2/gm2-libs/RTExceptions.mod")), 686, 9, const_cast<void*> (reinterpret_cast<const void*>("wholediv")), const_cast<void*> (reinterpret_cast<const void*>("illegal whole value exception")));
}
static void realvalue (void * a)
{
- RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_realValueException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 698, 9, const_cast<void*> (reinterpret_cast<const void*>("realvalue")), const_cast<void*> (reinterpret_cast<const void*>("illegal real value exception")));
+ RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_realValueException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc/m2/gm2-libs/RTExceptions.mod")), 698, 9, const_cast<void*> (reinterpret_cast<const void*>("realvalue")), const_cast<void*> (reinterpret_cast<const void*>("illegal real value exception")));
}
static void realdiv (void * a)
{
- RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_realDivException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 710, 9, const_cast<void*> (reinterpret_cast<const void*>("realdiv")), const_cast<void*> (reinterpret_cast<const void*>("real number division by zero exception")));
+ RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_realDivException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc/m2/gm2-libs/RTExceptions.mod")), 710, 9, const_cast<void*> (reinterpret_cast<const void*>("realdiv")), const_cast<void*> (reinterpret_cast<const void*>("real number division by zero exception")));
}
static void complexvalue (void * a)
{
- RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_complexValueException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 722, 9, const_cast<void*> (reinterpret_cast<const void*>("complexvalue")), const_cast<void*> (reinterpret_cast<const void*>("illegal complex value exception")));
+ RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_complexValueException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc/m2/gm2-libs/RTExceptions.mod")), 722, 9, const_cast<void*> (reinterpret_cast<const void*>("complexvalue")), const_cast<void*> (reinterpret_cast<const void*>("illegal complex value exception")));
}
static void complexdiv (void * a)
{
- RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_complexDivException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 734, 9, const_cast<void*> (reinterpret_cast<const void*>("complexdiv")), const_cast<void*> (reinterpret_cast<const void*>("complex number division by zero exception")));
+ RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_complexDivException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc/m2/gm2-libs/RTExceptions.mod")), 734, 9, const_cast<void*> (reinterpret_cast<const void*>("complexdiv")), const_cast<void*> (reinterpret_cast<const void*>("complex number division by zero exception")));
}
static void protection (void * a)
{
- RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_protException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 746, 9, const_cast<void*> (reinterpret_cast<const void*>("protection")), const_cast<void*> (reinterpret_cast<const void*>("protection exception")));
+ RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_protException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc/m2/gm2-libs/RTExceptions.mod")), 746, 9, const_cast<void*> (reinterpret_cast<const void*>("protection")), const_cast<void*> (reinterpret_cast<const void*>("protection exception")));
}
static void systemf (void * a)
{
- RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_sysException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 758, 9, const_cast<void*> (reinterpret_cast<const void*>("systemf")), const_cast<void*> (reinterpret_cast<const void*>("system exception")));
+ RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_sysException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc/m2/gm2-libs/RTExceptions.mod")), 758, 9, const_cast<void*> (reinterpret_cast<const void*>("systemf")), const_cast<void*> (reinterpret_cast<const void*>("system exception")));
}
static void coroutine (void * a)
{
- RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_coException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 770, 9, const_cast<void*> (reinterpret_cast<const void*>("coroutine")), const_cast<void*> (reinterpret_cast<const void*>("coroutine exception")));
+ RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_coException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc/m2/gm2-libs/RTExceptions.mod")), 770, 9, const_cast<void*> (reinterpret_cast<const void*>("coroutine")), const_cast<void*> (reinterpret_cast<const void*>("coroutine exception")));
}
static void exception (void * a)
{
- RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_exException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 782, 9, const_cast<void*> (reinterpret_cast<const void*>("exception")), const_cast<void*> (reinterpret_cast<const void*>("exception exception")));
+ RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_exException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc/m2/gm2-libs/RTExceptions.mod")), 782, 9, const_cast<void*> (reinterpret_cast<const void*>("exception")), const_cast<void*> (reinterpret_cast<const void*>("exception exception")));
}
{
if (currentEHB == NULL)
{
- M2RTS_Halt ((const char *) "currentEHB has not been initialized yet", 39, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod", 53, (const char *) "GetBaseExceptionBlock", 21, 600);
+ M2RTS_Halt ((const char *) "currentEHB has not been initialized yet", 39, (const char *) "../../gcc/m2/gm2-libs/RTExceptions.mod", 38, (const char *) "GetBaseExceptionBlock", 21, 600);
}
else
{
return currentEHB;
}
- ReturnException ("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.def", 25, 1);
+ ReturnException ("../../gcc/m2/gm2-libs/RTExceptions.def", 25, 1);
__builtin_unreachable ();
}
M2RTS_HALT (-1);
__builtin_unreachable ();
}
- ReturnException ("../../gcc-read-write/gcc/m2/gm2-libs/StdIO.def", 25, 1);
+ ReturnException ("../../gcc/m2/gm2-libs/StdIO.def", 25, 1);
__builtin_unreachable ();
}
M2RTS_HALT (-1);
__builtin_unreachable ();
}
- ReturnException ("../../gcc-read-write/gcc/m2/gm2-libs/StdIO.def", 25, 1);
+ ReturnException ("../../gcc/m2/gm2-libs/StdIO.def", 25, 1);
__builtin_unreachable ();
}
(*parent) = t;
if (t == NULL)
{
- Debug_Halt ((const char *) "parameter t should never be NIL", 31, (const char *) "../../gcc-read-write/gcc/m2/gm2-compiler/SymbolKey.mod", 54, (const char *) "FindNodeParentInTree", 20, 241);
+ Debug_Halt ((const char *) "parameter t should never be NIL", 31, (const char *) "../../gcc/m2/gm2-compiler/SymbolKey.mod", 39, (const char *) "FindNodeParentInTree", 20, 241);
}
Assertion_Assert (t->Right == NULL);
(*child) = t->Left;
}
else
{
- Debug_Halt ((const char *) "symbol already stored", 21, (const char *) "../../gcc-read-write/gcc/m2/gm2-compiler/SymbolKey.mod", 54, (const char *) "PutSymKey", 9, 156);
+ Debug_Halt ((const char *) "symbol already stored", 21, (const char *) "../../gcc/m2/gm2-compiler/SymbolKey.mod", 39, (const char *) "PutSymKey", 9, 156);
}
}
}
else
{
- Debug_Halt ((const char *) "trying to delete a symbol that is not in the tree - the compiler never expects this to occur", 92, (const char *) "../../gcc-read-write/gcc/m2/gm2-compiler/SymbolKey.mod", 54, (const char *) "DelSymKey", 9, 223);
+ Debug_Halt ((const char *) "trying to delete a symbol that is not in the tree - the compiler never expects this to occur", 92, (const char *) "../../gcc/m2/gm2-compiler/SymbolKey.mod", 39, (const char *) "DelSymKey", 9, 223);
}
}
(*a) = libc_malloc (static_cast<size_t> (size));
if ((*a) == NULL)
{
- Debug_Halt ((const char *) "out of memory error", 19, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/SysStorage.mod", 51, (const char *) "ALLOCATE", 8, 51);
+ Debug_Halt ((const char *) "out of memory error", 19, (const char *) "../../gcc/m2/gm2-libs/SysStorage.mod", 36, (const char *) "ALLOCATE", 8, 51);
}
if (enableTrace && trace)
{
}
if ((libc_memset ((*a), 0, static_cast<size_t> (size))) != (*a))
{
- Debug_Halt ((const char *) "memset should have returned the first parameter", 47, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/SysStorage.mod", 51, (const char *) "DEALLOCATE", 10, 78);
+ Debug_Halt ((const char *) "memset should have returned the first parameter", 47, (const char *) "../../gcc/m2/gm2-libs/SysStorage.mod", 36, (const char *) "DEALLOCATE", 10, 78);
}
}
if (enableDeallocation)
(*a) = libc_realloc ((*a), static_cast<size_t> (size));
if ((*a) == NULL)
{
- Debug_Halt ((const char *) "out of memory error", 19, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/SysStorage.mod", 51, (const char *) "REALLOCATE", 10, 122);
+ Debug_Halt ((const char *) "out of memory error", 19, (const char *) "../../gcc/m2/gm2-libs/SysStorage.mod", 36, (const char *) "REALLOCATE", 10, 122);
}
if (enableTrace && trace)
{
off_t lseek(int fildes, off_t offset, int whence);
*/
-EXTERN long int libc_lseek (int fd, long int offset, int whence);
+EXTERN ssize_t libc_lseek (int fd, ssize_t offset, int whence);
/*
perror - writes errno and string. (ARRAY OF CHAR is translated onto ADDRESS).
#endif
}
+/* SeekSet return the system libc SEEK_SET value. */
+
+int
+wrapc_SeekSet (void)
+{
+ return SEEK_SET;
+}
+
+/* SeekEnd return the system libc SEEK_END value. */
+
+int
+wrapc_SeekEnd (void)
+{
+ return SEEK_END;
+}
+
+/* ReadOnly return the system value of O_RDONLY. */
+
+int
+wrapc_ReadOnly (void)
+{
+ return O_RDONLY;
+}
+
+/* WriteOnly return the system value of O_WRONLY. */
+
+int
+wrapc_WriteOnly (void)
+{
+ return O_WRONLY;
+}
+
/* init constructor for the module. */
void
*/
EXTERN int wrapc_isfinitel (long double x);
+
+/*
+ isnan - provide non builtin alternative to the gcc builtin isnan.
+ Returns 1 if x is a NaN otherwise return 0.
+*/
+
+EXTERN int wrapc_isnan (double x);
+
+/*
+ isnanf - provide non builtin alternative to the gcc builtin isnanf.
+ Returns 1 if x is a NaN otherwise return 0.
+*/
+
+EXTERN int wrapc_isnanf (float x);
+
+/*
+ isnanl - provide non builtin alternative to the gcc builtin isnanl.
+ Returns 1 if x is a NaN otherwise return 0.
+*/
+
+EXTERN int wrapc_isnanl (long double x);
+
+/*
+ SeekSet - return the system libc SEEK_SET value.
+*/
+
+EXTERN int wrapc_SeekSet (void);
+
+/*
+ SeekEnd - return the system libc SEEK_END value.
+*/
+
+EXTERN int wrapc_SeekEnd (void);
+
+/*
+ ReadOnly - return the system value of O_RDONLY.
+*/
+
+EXTERN unsigned int wrapc_ReadOnly (void);
+
+/*
+ WriteOnly - return the system value of O_WRONLY.
+*/
+
+EXTERN unsigned int wrapc_WriteOnly (void);
# ifdef __cplusplus
}
# endif
#include <time.h>
#endif
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+
/* Define a generic NULL if one hasn't already been defined. */
#if !defined(NULL)
#endif
}
+/* SeekSet return the system libc SEEK_SET value. */
+
+extern "C" int
+EXPORT(SeekSet) (void)
+{
+ return SEEK_SET;
+}
+
+/* SeekEnd return the system libc SEEK_END value. */
+
+extern "C" int
+EXPORT(SeekEnd) (void)
+{
+ return SEEK_END;
+}
+
+/* ReadOnly return the system value of O_RDONLY. */
+
+extern "C" int
+EXPORT(ReadOnly) (void)
+{
+ return O_RDONLY;
+}
+
+/* WriteOnly return the system value of O_WRONLY. */
+
+extern "C" int
+EXPORT(WriteOnly) (void)
+{
+ return O_WRONLY;
+}
+
+
/* GNU Modula-2 linking hooks. */
extern "C" void