The following changes were made by the GCCSDK developers against the official CMunge version v0.52 :


Index: !Mk,fd7
===================================================================
RCS file: !Mk,fd7
diff -N !Mk,fd7
--- !Mk,fd7	4 Jul 2005 23:48:10 -0000	1.1.1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,5 +0,0 @@
-Dir <Obey$Dir>
-CDir o
-CDir aif
-amu THROWBACK=-throwback RELEASE=Release Most
-echo [Complete]
Index: !MkClean,fd7
===================================================================
RCS file: !MkClean,fd7
diff -N !MkClean,fd7
--- !MkClean,fd7	4 Jul 2005 23:48:10 -0000	1.1.1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,3 +0,0 @@
-Dir <Obey$Dir>
-amu clean RELEASE=Release
-echo [Cleaned]
Index: !MkExamples,fd7
===================================================================
RCS file: !MkExamples,fd7
diff -N !MkExamples,fd7
--- !MkExamples,fd7	4 Jul 2005 23:48:10 -0000	1.1.1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,5 +0,0 @@
-Dir <Obey$Dir>
-CDir o
-CDir aif
-amu examples RELEASE=Release THROWBACK=-throwback
-echo [Complete]
Index: !MkRelease,fd7
===================================================================
RCS file: !MkRelease,fd7
diff -N !MkRelease,fd7
--- !MkRelease,fd7	4 Jul 2005 23:48:10 -0000	1.1.1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,5 +0,0 @@
-Dir <Obey$Dir>
-CDir o
-CDir aif
-amu release RELEASE=Release THROWBACK=-throwback
-echo [Complete]
Index: Makefile
===================================================================
RCS file: Makefile
diff -N Makefile
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ Makefile	5 Jul 2005 01:44:17 -0000	1.2
@@ -0,0 +1,84 @@
+# Makefile for "A free alternative to CMHG" - CMunge
+# Copyright (c) 2005 GCCSDK Developers
+
+ifeq (${STAGE},stage1)
+prefix = $(unix_prefix)
+CFLAGS += -DCROSS_COMPILE
+exesfx =
+else
+prefix = $(riscos_prefix)
+CC = $(CROSS_CC)
+CFLAGS = $(CROSS_CFLAGS)
+endif
+
+INCLUDES = -I. -I../../
+CFLAGS += -Wall
+
+cmungeobjdir = $(objdir)/riscos-aof/cmunge/$(STAGE)
+
+all:	$(bin_dir)/cmunge$(exesfx)
+
+SRCS =	assemble.c \
+	blank.c \
+	comments.c \
+	datestamp.c \
+	error.c \
+	format.c \
+	gfile.c \
+	main.c \
+	mem.c \
+	options.c \
+	readfile.c \
+	str.c \
+	throwback.c \
+	writeexport.c \
+	writefile.c \
+	writeheader.c
+
+HDRS =	../../sdk-config.h \
+	assemble.h \
+	blank.h \
+	comments.h \
+	copyright.h \
+	datestamp.h \
+	error.h \
+	format.h \
+	gfile.h \
+	mem.h \
+	options.h \
+	readfile.h \
+	str.h \
+	throwback.h \
+	writeexport.h \
+	writefile.h \
+	writeheader.h
+
+ifeq (${STAGE},stage1)
+# This funky line tells make to change all '.c' suffixes to '.o' and add
+# '$(cmungeobjdir)/' to each object.
+OBJS = $(addprefix $(cmungeobjdir)/, $(SRCS:.c=.o))
+
+$(cmungeobjdir)/%.o: %.c
+	$(CC) $(CFLAGS) -o $@ -c $< $(INCLUDES) \
+	-DGCC_BIN_DIR=\"$(prefix)$(gn_gcc_bin_dir)\"
+
+$(bin_dir)/cmunge$(exesfx): $(OBJS) $(DEPS)
+	$(CC) -o $@ $(OBJS)
+endif
+
+ifeq (${STAGE},stage2)
+# Since we know that we are compiling with GCC 3.4, we can compile the
+# application using inter-module analysis, effectivly building as if all
+# functions are contained within one source file.
+	DEPS += $(gcc_bin_dir)/$(TRG)/o/unixlib
+
+$(cmungeobjdir)/cmunge.o:	$(SRCS) $(DEPS) $(HDRS)
+	$(CC) $(CFLAGS) -o $@ -c $(SRCS) $(INCLUDES) \
+	-DGCC_BIN_DIR=\"$(prefix)$(gn_gcc_bin_dir)\"
+
+$(bin_dir)/cmunge$(exesfx): $(cmungeobjdir)/cmunge.o $(DEPS)
+	$(CC) -o $@ $(cmungeobjdir)/cmunge.o
+	# In order to comply with the CMunge license when distributing modified copies:
+	echo -e The following changes were made by the GCCSDK developers against the official CMunge version v`grep Module_MajorVersion_CMHG VersionNum | tac -s ' ' | head -n 1` :\\n\\n > Docs/GCCSDKModifications
+	-cvs -z9 -q diff -N -u -r CMunge-`grep Module_MajorVersion_CMHG VersionNum | tac -s ' ' | head -n 1 | sed "s/\./_/"` >> Docs/GCCSDKModifications
+endif
Index: Makefile,fe1
===================================================================
RCS file: Makefile,fe1
diff -N Makefile,fe1
--- Makefile,fe1	4 Jul 2005 23:48:11 -0000	1.1.1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,189 +0,0 @@
-# Project:   CMunge Makefile
-
-# MakeDir:
-#  o
-#  o32
-#  aif
-#  aif32
-
-# Toolflags:
-
-INCLUDE = C:,
-
-CCflags = -c -fa -depend !Depend -I$(INCLUDE) -throwback
-CCflags32 = -apcs 3/32 -c -fa -depend !Depend -I$(INCLUDE) -throwback
-CCflagsM = -c -g -fa -depend !Depend -I$(INCLUDE) -throwback
-
-WIPE = wipe
-WIPEFLAGS = F~C~R~V
-
-CDIR = c
-ODIR = o
-HDIR = h
-C++flags = -c -g -depend !Depend -I$(INCLUDE) -throwback
-LinkflagsD = -aif -d -c++ -o $@
-Linkflags = -aif -c++ -o $@
-PartLinkflags = -aof -c++ -o $@
-
-#ObjAsmflags = -g -throwback -NoCache -depend !Depend
-ObjAsmflags = -throwback -NoCache -depend !Depend
-
-CMHGflags =
-LibFileflags = -c -o $@
-Squeezeflags = -o $@
-
-.SUFFIXES:      .o .om .o32 .c
-
-.c.o:;   cc $(CCflags) -o $@ $<
-.c.o32:; cc $(ccflags32) -o $@ $<
-
-.c.om:; MemCheck.CC cc $(ccflagsM) -o $@ $<
-
-OS_FILES =
-
-OC_FILES = \
-        o.assemble      \
-        o.datestamp     \
-        o.error         \
-        o.main          \
-        o.mem           \
-        o.options       \
-        o.readfile      \
-        o.str           \
-        o.gfile         \
-        o.throwback     \
-        o.writeheader   \
-        o.writeexport   \
-        o.writefile     \
-        o.blank         \
-        o.format        \
-        o.comments
-
-OC32_FILES = \
-        o32.assemble      \
-        o32.datestamp     \
-        o32.error         \
-        o32.main          \
-        o32.mem           \
-        o32.options       \
-        o32.readfile      \
-        o32.str           \
-        o32.gfile         \
-        o32.throwback     \
-        o32.writeheader   \
-        o32.writeexport   \
-        o32.writefile     \
-        o32.blank         \
-        o32.format        \
-        o32.comments
-
-OMC_FILES = \
-        om.assemble     \
-        om.datestamp    \
-        om.error        \
-        om.main         \
-        om.mem          \
-        om.options      \
-        om.readfile     \
-        om.str          \
-        om.gfile        \
-        om.throwback    \
-        om.writeheader  \
-        om.writeexport  \
-        om.writefile    \
-        om.blank        \
-        om.format       \
-        om.comments
-
-LIBS = C:o.stubs
-LIBS32 = C:o.stubsG
-
-# Final targets:
-# We still generate the 26 bit version so that we can compare the output
-Most: aif.cmunge aif32.cmunge
-
-All: aif.cmunge aif32.cmunge aif.cmungeM
-
-Examples: aif.cmunge aif32.cmunge
-        -examples.!Make
-        dir ^
-
-aif.cmunge: aif.cmungeU
-        Squeeze aif.cmungeU aif.cmunge
-aif32.cmunge: aif32.cmungeU
-        Squeeze aif32.cmungeU aif32.cmunge
-
-aif.cmungeU: $(OC_FILES) $(OS_FILES)
-        link $(linkflags) $(OC_FILES) $(OS_FILES) $(LIBS)
-
-aif32.cmungeU: $(OC32_FILES) $(OS32_FILES)
-        link $(linkflags) $(OC32_FILES) $(OS32_FILES) $(LIBS32)
-
-aif.cmungeM: $(OMC_FILES) $(OS_FILES)
-        link $(linkflagsD) $(OMC_FILES) $(OS_FILES) $(LIBS) \
-        MemCheck:o.MC
-
-clean:
-        -wipe aif ~C ~V R F
-        -wipe aif32 ~C ~V R F
-        -wipe o ~C ~V R F
-        -wipe o32 ~C ~V R F
-        -wipe om ~C ~V R F
-        -if "$(RELEASE)" <> "" Then wipe $(RELEASE) ~C ~V R F
-        -wipe Release ~C ~V R F
-        dir Examples
-        /!Clean
-        dir ^
-
-release: aif32.cmunge
-        @echo -- Source $(RELEASE)
-        cdir $(RELEASE)
-        cdir $(RELEASE).Source
-        wipe $(RELEASE).Source ~C~VR
-        cdir $(RELEASE).Source
-        cdir $(RELEASE).Source.Examples
-        cdir $(RELEASE).Source.Examples.cmhg
-        cdir $(RELEASE).Source.Examples.h
-        cdir $(RELEASE).Source.Examples.hdr
-        cdir $(RELEASE).Source.Examples.inc
-        cdir $(RELEASE).Source.Examples.o
-        cdir $(RELEASE).Source.Examples.s
-        copy Docs          $(RELEASE).Source.Docs ~C~VR
-        IfThere VersionLog Then copy VersionLog $(RELEASE).Source.Docs.History ~C~VR
-        copy Examples.!*   $(RELEASE).Source.Examples.* ~C~VR
-        copy Examples.inc  $(RELEASE).Source.Examples.inc ~C~VR
-        copy Examples.cmhg $(RELEASE).Source.Examples.cmhg ~C~VR
-        copy c             $(RELEASE).Source.c ~C~VR
-        copy h             $(RELEASE).Source.h ~C~VR
-        copy Makefile      $(RELEASE).Source.Makefile ~C~VR
-        IfThere Resources Then Copy Resources.!Mk* $(RELEASE).Source.* ~C~VR Else Copy !Mk* $(RELEASE).Source.* ~C~VR
-        copy VersionNum    $(RELEASE).Source.VersionNum ~C~VR
-        @echo -- Binary $(RELEASE)
-        cdir $(RELEASE).Binary
-        wipe $(RELEASE).Binary ~C~VR
-        cdir $(RELEASE).Binary
-        copy Docs          $(RELEASE).Binary.Docs ~C~VR
-        IfThere VersionLog Then copy VersionLog $(RELEASE).Binary.Docs.History ~C~VR
-        copy aif32.cmunge  $(RELEASE).Binary.cmunge ~C~VR
-        @echo -- Archive
-        IfThere Run:losecvs Then losecvs $(RELEASE)
-
-export:
-        @echo [No export of CMunge]
-
-# User-editable dependencies:
-
-# Static dependencies:
-
-# Dynamic dependencies:
-o32.assemble: c.assemble C:h.kernel h.datestamp h.error h.mem h.options
-o32.main: c.main h.MemCheck h.gfile h.options h.readfile h.writefile h.writeheader h.writeexport h.assemble h.datestamp h.blank h.format h.copyright VersionNum
-o32.mem: c.mem h.error
-o32.options: c.options h.gfile h.error h.options h.str h.mem h.format
-o32.readfile: c.readfile h.gfile h.error h.mem h.options h.str h.readfile
-o32.gfile: c.gfile h.gfile h.str
-o32.throwback: c.throwback C:h.kernel h.throwback
-o32.writeheader: c.writeheader h.gfile h.error h.options h.format h.comments h.copyright VersionNum
-o32.writeexport: c.writeexport h.gfile h.error h.options h.comments h.copyright VersionNum
-o32.writefile: c.writefile h.gfile h.error h.options h.copyright VersionNum
-o32.blank: c.blank C:h.kernel h.error h.options h.format h.readfile VersionNum
Index: MemCheck.h
===================================================================
RCS file: MemCheck.h
diff -N MemCheck.h
--- MemCheck.h	4 Jul 2005 23:48:11 -0000	1.1.1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,740 +0,0 @@
-/*
-
-	#   #              ###  #                 #
-	## ##             #   # #                 #
-	# # #  ###  ## #  #     ####   ###   ###  ####
-	#   # #   # # # # #     #   # #   # #   # #   #
-	#   # ##### # # # #     #   # ##### #     ####
-	#   # #     #   # #   # #   # #     #   # #  #
-	#   #  ###  #   #  ###  #   #  ###   ###  #   #
-	_______________________________________________
-
-Author:		Copyright  1995, 1996 Julian Smith, Warm
-		Silence Software.
-
-Purpose:	Checking of memory accesses.
-*/
-
-/*
-$Id: MemCheck.h,v 1.1.1.1 2005/07/04 23:48:11 joty Exp $
-*/
-
-#ifndef __MemCheck_MemCheck_h
-#define __MemCheck_MemCheck_h
-
-
-#ifdef __cplusplus
-	extern "C"	{
-#endif
-
-#include <stddef.h>
-#include <stdio.h>
-#include <stdarg.h>
-
-
-
-typedef int	MemCheck_checking;
-/*
-Used to store old checking status. Has to be always defined so that user
-code which stores old checking will compile in non-MemCheck builds.
- */
-
-
-typedef int (*MemCheck_printfn)( void* reference, const char* format, va_list args);
-/*
-Defines type of function to be passed to MemCheck_RedirectToFunction().
- */
-
-
-#if defined( MemCheck_MEMCHECK)
-	
-	#if !defined( __CC_NORCROFT) || !defined( __arm) || !defined( __riscos) || !defined( __acorn)
-		#error MemCheck will only work with the Acorn C compiler.
-	#endif
-	
-	
-	#pragma	check_memory_accesses
-/*
-Makes Acorn's compiler generate special instructions before each read or
-write of memory.
- */
-	
-	
-	void	MemCheck_Init( void);
-/*
-This (or MemCheck_InitNoDebug) should be called at the start of main().
-
-MemCheck_Init will try to load debug data if possible.
-
-If your main uses argc and argv, call MemCheck_RegisterArgs also.
- */
-	
-	
-	void	MemCheck_InitNoDebug( void);
-/*
-This should be used instead of MemCheck_Init if you don't want MemCheck
-to try to load the debug data in the program image.
- */
-	
-	
-	void	MemCheck_Finalise( void);
-/*
-Call this in modules' finalise code. Does nothing in non-module version
-of MemCheck. In module version, this closes MemChecks's output file and
-also frees all memory claimed from the the RMA by MemCheck.
- */
-	
-	
-	void	MemCheck_RegisterArgs( int argc, char* argv[]);
-/*
-Call this function to register the parameters given to main() with
-MemCheck. Each argument string is registered as a read-only.
- */
-	
-	
-void	MemCheck_InterceptSCLStringFunctions( void);
-/*
-Intercepts calls to various ANSI str/mem functions in the shared C
-library, and checks the array parameters for read/write access.
- */
-	
-	
-	void	MemCheck_CheckMallocHeap( void);
-/*
-Checks whether the malloc heap is consistant. This is called whenever
-malloc, realloc and free is called, so you won't usually need to call it
-yourself.
- */
-	
-	
-	void	MemCheck_SetMallocHeapChecking( int check);
-/*
-If 'check' is 0, then MemCheck_CheckMallocHeap is not called
-automatically when malloc, realloc and free are called.
-
-If 'check' is 1, MemCheck_CheckMallocHeap is called automatically when
-malloc, realloc and free are called.
-
-The default is as though MemCheck_SetMallocHeapChecking( 1) was called.
- */
-	
-	
-	MemCheck_checking	MemCheck_SetReadChecking( int checkreads);
-/*
-checkreads=1 - turns on checking of memory-reads.
-
-checkreads=0 - turns off checking of memory-reads.
-
-Also see MemCheck_SetWriteChecking, MemCheck_SetChecking.
- */
-	
-	
-	MemCheck_checking	MemCheck_SetWriteChecking( int checkwrites);
-/*
-checkwrites=1 - turns on checking of memory-writes.
-
-checkwrites=0 - turns off checking of memory-writes.
-
-Also see MemCheck_SetReadChecking, MemCheck_SetChecking.
- */
-	
-	
-	MemCheck_checking	MemCheck_SetChecking( int checkreads, int checkwrites);
-/*
-Sets whether to check reads or writes. These are initially both set to 1
-- ie reads and writes are both checked.
-
-This simply calls MemCheck_SetReadChecking and
-MemCheck_SetWriteChecking.
- */
-	
-	
-	void	MemCheck_RestoreChecking( MemCheck_checking checking);
-/*
-Restores checking status returned by a previous call to
-MemCheck_SetReadChecking, MemCheck_SetWriteChecking or
-MemCheck_SetChecking.
- */
-	
-	
-	void	MemCheck_SetReadQuitting( int quitread);
-/*
-quitread=1 - quit after an illegal read of memory.
-
-Also see MemCheck_SetWriteQuitting, MemCheck_SetQuitting.
- */
-	
-	
-	void	MemCheck_SetWriteQuitting( int quitwrite);
-/*
-quitwrite=1 - quit program after an illegal write of memory.
-
-Also see MemCheck_SetReadQuitting, MemCheck_SetQuitting.
- */
-	
-	
-	void	MemCheck_SetQuitting( int quitread, int quitwrite);
-/*
-Sets whether to terminate program after a read or write error has been
-detected. Initially, quitwrite is 1, quitread is 0 (ie program is
-quitted only after a write error).
-
-This simply calls MemCheck_SetReadQuitting and
-MemCheck_SetWriteQuitting.
- */
-	
-	
-	void	MemCheck_SetDefaultMallocReadAccess( int readaccess);
-/*
-readaccess=1	- Subsequent malloc blocks are readable.
-
-readaccess=0	- Subsequent malloc blocks are not readable.
-
-Default read-access is initially 1 (ie reads from malloc blocks are
-allowed).
-
-Also see MemCheck_SetDefaultMallocWriteAccess,
-MemCheck_SetDefaultMallocAccess.
- */
-	
-	
-	void	MemCheck_SetDefaultMallocWriteAccess( int writeaccess);
-/*
-writeaccess=1	- Subsequent malloc blocks are writable.
-writeaccess=0	- Subsequent malloc blocks are not writable.
-
-Default write-access is initially 1 (ie writes to malloc blocks are
-allowed).
-
-Also see MemCheck_SetDefaultMallocReadAccess,
-MemCheck_SetDefaultMallocAccess.
- */
-	
-	
-	void	MemCheck_SetDefaultMallocAccess( int readaccess, int writeaccess);
-/*
-Simply calls MemCheck_SetDefaultMallocReadAccess and
-MemCheck_SetDefaultMallocWriteAccess.
- */
-	
-	
-	void	MemCheck_SetDefaultMiscReadAccess( int readaccess);
-/*
-readaccess=1	- Subsequent misc blocks are readable.
-
-readaccess=0	- Subsequent misc blocks are not readable.
-
-Read-access is initially 1 (ie reads from misc blocks are allowed).
-
-Also see MemCheck_SetDefaultMiscWriteAccess,
-MemCheck_SetDefaultMiscAccess.
- */
-	
-	
-	void	MemCheck_SetDefaultMiscWriteAccess( int writeaccess);
-/*
-writeaccess=1	- Subsequent misc blocks are writable.
-
-writeaccess=0	- Subsequent misc blocks are not writable.
-
-Write-access is initially 1 (ie writes to misc blocks are allowed).
-
-Also see MemCheck_SetDefaultMiscReadAccess,
-MemCheck_SetDefaultMiscAccess.
- */
-	
-	
-	void	MemCheck_SetDefaultMiscAccess( int readaccess, int writeaccess);
-/*
-Simply calls MemCheck_SetDefaultMiscReadAccess and
-MemCheck_SetDefaultMiscWriteAccess.
- */
-	
-	
-	void	MemCheck_SetDefaultFlexReadAccess( int readaccess);
-/*
-readaccess=1	- Subsequent flex blocks are readable.
-
-readaccess=0	- Subsequent flex blocks are not readable.
-
-Read-access is initially 1 (ie reads from flex blocks are allowed).
-
-Also see MemCheck_SetDefaultFlexWriteAccess,
-MemCheck_SetDefaultFlexAccess.
- */
-	
-	
-	void	MemCheck_SetDefaultFlexWriteAccess( int writeaccess);
-/*
-writeaccess=1	- Subsequent flex blocks are writable.
-
-writeaccess=0	- Subsequent flex blocks are not writable.
-
-Write-access is initially 1 (ie writes to flex blocks are allowed).
-
-Also see MemCheck_SetDefaultFlexReadAccess,
-MemCheck_SetDefaultFlexAccess.
- */
-	
-	
-	void	MemCheck_SetDefaultFlexAccess( int readaccess, int writeaccess);
-/*
-Simply calls MemCheck_SetDefaultFlexReadAccess and
-MemCheck_SetDefaultFlexWriteAccess.
- */
-	
-	
-	void	MemCheck_SetReadAccessQuitting( int quitreadaccesserror);
-/*
-quitreadaccesserror=1 - quit program after read of memory set to be
-unreadable.
-
-quitreadaccesserror=0 - don't quit program after read of memory set to
-be unreadable.
-
-Also see MemCheck_SetWriteAccessQuitting, MemCheck_SetAccessQuitting.
- */
-	
-	
-	void	MemCheck_SetWriteAccessQuitting( int quitwriteaccesserror);
-/*
-quitwriteaccesserror=1 - quit after write to memory set to be
-unwriteable.
-
-quitwriteaccesserror=0 - don't quit program after write of memory set to
-be unwriteable.
-
-Also see MemCheck_SetReadAccessQuitting, MemCheck_SetAccessQuitting.
- */
-	
-	
-	void	MemCheck_SetAccessQuitting( int quitreadaccesserror, int quitwriteaccesserror);
-/*
-Simply calls MemCheck_SetReadAccessQuitting and
-MemCheck_SetWriteAccessQuitting.
- */
-	
-	
-	void	MemCheck_SetStoreMallocFunctions( int yes);
-/*
-Sets whether function nesting is stored for each subsequent malloc
-block.
-
-yesno=1 - store function nesting.
-
-yesno=0 - don't store functio nesting.
-
-Initially, function-nesting is /not/ stored.
- */
-	
-	
-	void	MemCheck_SetReportFrees( int yes);
-/*
-'yes'=1 - Makes MemCheck report info on every malloc block passed to free().
-
-'yes'=0 - Turns off report of calls to free().
- */
- 	
- 	
-	void	MemCheck_RegisterMiscBlock( const void* ptr, size_t size);
-/*
-This will add the specified block to MemCheck's list of read and
-writeable blocks of memory.
-
-Useful if (for eg) your program uses RMA memory.
-
-Also see MemCheck_ResizeMiscBlock, MemCheck_UnRegisterMiscBlock,
-MemCheck_RegisterFlexBlock.
- */
-	
-	
-	void	MemCheck_RegisterMiscBlock_String( const char* string);
-/*
-Registers the specified string as a misc block, including the '\0'
-terminator.
-
-This function is provided because the obvious way of registering a
-string 'MemCheck_RegisterMiscBlock( string, 1 + strlen( string));'
-causes MemCheck to report a read error in the call to strlen(). Thus one
-has to turn off checking around the call to strlen(), which is clumsy.
- */
-	
-	
-	void	MemCheck_RegisterMiscBlock_StringCR( const char* stringcr);
-/*
-As MemCheck_RegisterMiscBlock_String, except that the string is
-terminated by any control character.
- */
-	
-	
-	#define	MemCheck_RegisterMiscBlock_Ptr( ptr)	MemCheck_RegisterMiscBlock( ptr, sizeof( *(ptr)))
-/*
-Registers block of memory pointed to by ptr, with the size being the
-size of the deferenced pointer.
- */
-	
-	
-	void	MemCheck_ResizeMiscBlock( const void* ptr, size_t newsize);
-/*
-Informs MemCheck of new size of specified block. 'ptr' should be
-identical to the 'ptr' in a previous call to MemCheck_RegisterMiscBlock.
-
-Also see MemCheck_RegisterMiscBlock, MemCheck_UnRegisterMiscBlock,
-MemCheck_RegisterFlexBlock.
- */
-	
-	
-	void	MemCheck_UnRegisterMiscBlock( const void* ptr);
-/*
-Call when a block of memory is freed. 'ptr' should be identical to the
-'ptr' in a previous call to MemCheck_RegisterMiscBlock.
-
-Also see MemCheck_RegisterMiscBlock, MemCheck_ResizeMiscBlock,
-MemCheck_UnRegisterFlexBlock.
- */
-	
-	
-	void	MemCheck_RegisterFlexBlock( void** anchor, size_t size);
-/*
-This will add the specified shifting-heap block to MemCheck's list of
-read and writeable blocks of memory.
-
-'*anchor' is assumed to point to the block of memory, and can change
-during program execution.
-
-This is for use with shifting-heap memory allocators such as Acorn's
-flex library.
-
-Example usage:
-
-{
-void*	anchor;
-
-flex_alloc( &anchor, 320);
-MemCheck_RegisterFlexBlock( &anchor, 320);
-...
-flex_extend( &anchor, 400);
-MemCheck_ResizeFlexBlock( &anchor, 400);
-...
-flex_midextend( &anchor, 20, 8);
-MemCheck_ResizeFlexBlock( &anchor, 408);
-...
-flex_free( &anchor);
-MemCheck_UnRegisterFlexBlock( &anchor);
-}
-
-It is recommended that you use a central set of wrapper-functions for
-flex_* functions which call the MemCheck flex-block functions. This will
-ensure that MemCheck is always informed of changes to flex blocks.
-
-Also see MemCheck_UnRegisterFlexBlock, MemCheck_RegisterMiscBlock.
- */
-	
-	
-	void	MemCheck_UnRegisterFlexBlock( void** anchor);
-/*
-Call when a block of memory is freed. 'anchor' should be identical to
-the 'anchor' in a previous call to MemCheck_RegisterFlexBlock.
-
-Also see MemCheck_RegisterFlexBlock, MemCheck_ResizeFlexBlock.
- */
-	
-	
-	void	MemCheck_ResizeFlexBlock( void** anchor, size_t newsize);
-/*
-Call this function when a flex block is resized.
-
-Also see MemCheck_RegisterFlexBlock, MemCheck_UnRegisterFlexBlock.
- */
-	
-	
-	void	MemCheck_SetBlockReadable( const void* ptr, int readable);
-/*
-'ptr' should be pointer to a malloc, misc or flex block known to
-MemCheck.
-
-readable=0:	Block is made unreadable (ie attempts to read
-		within block are faulted).
-		
-readable=1:	Makes block readable.
-
-The default read-access for blocks can be set with
-MemCheck_SetDefaultMallocReadAccess, MemCheck_SetDefaultMiscReadAccess
-and MemCheck_SetDefaultFlexReadAccess.
-
-Also see MemCheck_SetBlockAccess.
- */
-	
-	
-	void	MemCheck_SetBlockWritable( const void* ptr, int readable);
-/*
-'ptr' should be pointer to a malloc, misc or flex block known to
-MemCheck.
-
-writable=0:	Block is made unwritable (ie attempts to write
-		within block are faulted).
-
-writable=1:	Makes block writableable.
-
-The default write-access for blocks can be set with
-MemCheck_SetDefaultMallocWriteAccess, MemCheck_SetDefaultMiscWriteAccess
-and MemCheck_SetDefaultFlexWriteAccess.
-
-Also see MemCheck_SetBlockReadable.
- */
- 	
- 	
- 	
- 	void	MemCheck_SetBlockAccess( const void* ptr, int readaccess, int writeaccess);
-/*
-'ptr' should be pointer to a malloc, misc or flex block known to
-MemCheck.
-
-readable=0:	Block is made unreadable (ie attempts to read
-		from within the block are faulted).
-
-readable=1:	Makes block readable.
-
-writable=0:	Block is made unwritable (ie attempts to write
-		within block are faulted).
-
-writable=1:	Makes block writable.
-
-The default access permissions for blocks can be set with
-MemCheck_SetDefaultMallocAccess, MemCheck_SetDefaultMiscAccess
-and MemCheck_SetDefaultFlexAccess.
-
-Also see MemCheck_SetBlockReadable, MemCheck_SetBlockWritable.
- */
-
-	
-	
-	void	MemCheck_OutputBlocksInfo( void);
-/*
-Sends information about all known blocks to MemCheck output.
- */
-	
-	
-	void	MemCheck_SetAutoOutputBlocksInfo( int yes);
-/*
-yes = 1:	Info on all known blocks are output after each MemCheck
-		diagnostic, using MemCheck_OutputBlocksInfo.
-yes = 0:	Block info not output.
-
-MemCheck initially behaves as though 
-MemCheck_SetAutoOutputBlocksInfo( 1) was called - information on all
-known blocks /is/ shown after each diagnostic.
-
-This function is provided because the blocks information can make
-MemCheck's output very large.
- */
-	
-	
-	void	MemCheck_SetOSBuffersLifetime( int lifetime);
-/*
-This effects the lifetime that MemCheck assigns to the static buffers
-returned by OS functions such as getenv, _kernel_last_oserror,
-_kernel_swi etc.
-
-Most of the time, you shouldn't have to worry about using this function.
-
-Consider the following code, run with the system variables <Foo> set,
-and <Bar> unset:
-	{
-	char*	f = getenv( "Foo");	|* non-NULL	*|
-	char*	b = getenv( "Bar");	|* NULL		*|
-	if ( f[0])	{...}
-	}
-
-Initially, the access of the buffer pointed to by f[0] will be allowed,
-because MemCheck only unregisters an old static buffer when a non-NULL
-buffer is returned.
-
-However, after MemCheck_SetOSBuffersLifetime( 0) is called, MemCheck is
-stricter. It will unregister buffers immediately, even if the
-replacement buffer is NULL. The documentation for getenv et al is vague
-about the precise nature of the lifetime of the returned buffers, so it
-might be useful to ensure code works after
-MemCheck_SetOSBuffersLifetime( 0).
-
-life = 0:	Old OS buffers are unregistered even if the new 
-		buffer is NULL.
-
-life = 1:	Old OS buffers are only unregistered when a 
-		non-NULL replacement is returned.
-
-Note that the wrappers for getenv, _kernel_last_oserror etc are
-completely independent - calling _kernel_last_oserror will never
-unregister a buffer previously returned by getenv, for example.
- */
-	
-	
-	int	MemCheck_Printf( const char *fmt, ...);
-/*
-Behaves exactly like printf, except that sends output to wherever
-MemCheck diagnostics are going.
-
-Also see MemCheck_RedirectToStream, MemCheck_RedirectToFilename and
-MemCheck_RedirectToFilenamef.
- */
-	
-	
-	void	MemCheck_RedirectToStream( FILE* stream);
-/*
-Makes subsequent MemCheck diagnostics go to 'stream'.
-
-Also see MemCheck_RedirectToFilename, MemCheck_RedirectToFilenamef.
- */
-	
-	
-	void	MemCheck_RedirectToFilename( const char* filename);
-/*
-Makes subsequent MemCheck diagnostics go to 'filename'.
-
-Also see MemCheck_RedirectToFilenamef, MemCheck_RedirectToStream.
- */
-	
-	
-	void	MemCheck_RedirectToFilenamef( const char* fmt, ...);
-/*
-Makes subsequent MemCheck diagnostics go to 'fmt, ...', using
-printf-style specification of the filename.
-
-Also see MemCheck_RedirectToFilename, MemCheck_RedirectToStream.
- */
-	
-	
-	void	MemCheck_RedirectToFunction( MemCheck_printfn fn, void* reference);
-/*
-Sends subsequent MemCheck diagnostics to the specified function.
- */
- 	
- 	
-	void	MemCheck_RegisterMiscStack( void* bottom, void* top);
-/*
-Registers an area of memory which MemCheck should treat as a single
-non-extensible stack.
-
-This is for situations where there is no valid _kernel_stack_chunk
-structure below the stack.
-
-Note that MemCheck already knows about the SVC stack.
-
-MemCheck only stores the most recent stack given to
-MemCheck_RegisterMiscStack.
-
-When examining the stack, MemCheck first checks for the sl being from
-the SVC stack (8k stack at 0xC00000), then for sl being within the last
-stack passed to MemCheck_RegisterMiscStack.
-
-If neither of these is true, the stack is assumed to be as described in
-PRMs 4-239, ie each stack chunk has a valid _kernel_stackchunk at
-sl-560, with possibly multiple stack chunks.
-
-Thus a stack passed to MemCheck_RegisterMiscStack is used in preference
-to the normal multiple-stackchunks stack.
-
-Also see MemCheck_UnRegisterMiscStack.
- */
-	
-	
-	void	MemCheck_UnRegisterMiscStack( void* bottom);
-/*
-Guess...
-
-Also see MemCheck_RegisterMiscStack.
- */
-	
-	
-	extern int	MemCheck_threaddepth;
-/*
-This is non-zero if MemCheck is currently threaded. This is for use by
-preemtive threads packages, so that they can refuse to switch threads
-when MemCheck is threaded - MemCheck uses a lot of internal static data,
-so isn't reenterant.
- */
-
-#else
-
-/*
-when compilation is without MemCheck_MEMCHECK defined, all MemCheck
-calls are removed using the following macros:
- */
-
-	#define	MemCheck_Init()
-	#define	MemCheck_InitNoDebug()
-	#define	MemCheck_Finalise()
-	
-	#define	MemCheck_RegisterArgs( argc, argv)
-	#define	MemCheck_InterceptSCLStringFunctions()
-	
-	#define	MemCheck_CheckMallocHeap()
-	#define	MemCheck_SetMallocHeapChecking( check)
-	
-	#define	MemCheck_SetReadChecking( checkreads)	0
-	#define	MemCheck_SetWriteChecking( checkwrites)	0
-	#define	MemCheck_SetChecking( checkreads, checkwrites)	0
-	#define	MemCheck_RestoreChecking( checking)	(checking)=(checking)
-	
-	#define	MemCheck_SetReadQuitting( quitread)
-	#define	MemCheck_SetWriteQuitting( quitwrite)
-	#define	MemCheck_SetQuitting( quitread, quitwrite)
-	
-	#define	MemCheck_SetDefaultMallocReadAccess( readaccess)
-	#define	MemCheck_SetDefaultMallocWriteAccess( writeaccess)
-	#define	MemCheck_SetDefaultMallocAccess( readaccess, writeaccess)
-	#define	MemCheck_SetDefaultMiscReadAccess( readaccess)
-	#define	MemCheck_SetDefaultMiscWriteAccess( writeaccess)
-	#define	MemCheck_SetDefaultMiscAccess( readaccess, writeaccess)
-	#define	MemCheck_SetDefaultFlexReadAccess( readaccess)
-	#define	MemCheck_SetDefaultFlexWriteAccess( writeaccess)
-	#define	MemCheck_SetDefaultFlexAccess( readaccess, writeaccess)
-	
-	#define	MemCheck_SetReadAccessQuitting( quitreadaccesserror)
-	#define	MemCheck_SetWriteAccessQuitting( quitwriteaccesserror)
-	#define	MemCheck_SetAccessQuitting( quitreadaccesserror, quitwriteaccesserror)
-	
-	#define	MemCheck_SetStoreMallocFunctions( yesno)
-	#define	MemCheck_SetReportFrees( yes)
-	
-	#define	MemCheck_RegisterMiscBlock( ptr, size)
-	#define	MemCheck_RegisterMiscBlock_String( string)
-	#define	MemCheck_RegisterMiscBlock_StringCR( stringcr)
-	#define	MemCheck_RegisterMiscBlock_Ptr( ptr)
-	#define	MemCheck_ResizeMiscBlock( ptr, newsize)
-	#define	MemCheck_UnRegisterMiscBlock( ptr)
-	
-	#define	MemCheck_RegisterFlexBlock( anchor, size)
-	#define	MemCheck_UnRegisterFlexBlock( anchor)
-	#define	MemCheck_ResizeFlexBlock( anchor, newsize)
-	
-	#define	MemCheck_SetBlockReadable( ptr, readable)
-	#define	MemCheck_SetBlockWritable( ptr, writable)
-	#define	MemCheck_SetBlockAccess( ptr, readable, writable)
-	
-	#define	MemCheck_OutputBlocksInfo()
-	#define	MemCheck_SetAutoOutputBlocksInfo( yes)
-	
-	#define	MemCheck_SetOSBuffersLifetime(lifetime)
-	
-	#define	MemCheck_Printf (1) ? 0 : printf
-	
-	#define	MemCheck_RedirectToStream( stream)
-	#define	MemCheck_RedirectToFilename( filename)
-	#define	MemCheck_RedirectToFilenamef (1) ? 0 : printf
-	#define	MemCheck_RedirectToFunction( fn, reference)
-	
-	#define	MemCheck_RegisterMiscStack( bottom, top)
-	#define	MemCheck_UnRegisterMiscStack( bottom)
-	
-	#define	MemCheck_threaddepth	0
-
-#endif
-
-
-
-#ifdef __cplusplus
-	}
-#endif
-
-#endif
Index: README
===================================================================
RCS file: README
diff -N README
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ README	5 Jul 2005 00:31:21 -0000	1.1
@@ -0,0 +1,24 @@
+This is a modified version of CMunge for use in the GCCSDK project.  The
+original sources are and should be stored and tagged in the
+'CMungeImportBranch' CVS branch. Then they are merged to one of the GCCSDK
+development/stable branches where all the GCCSDK specific changes & bug
+fixes are done.
+
+Do not do any bug fixes or changes in the 'CMungeImportBranch' branch
+except for importing newer offical CMunge source releases.
+
+The official sources in the 'CMungeImportBranch' CVS branch are labeled
+using 'CMunge-X_YZ' tags where 'X_YZ' is the 'Module_MajorVersion_CMHG'
+#define value in the 'VersionNum' file but having its dot character
+changed into a underscore character.
+
+The GCCSDK build system will automatically create an unified difference
+file based on the 'CMunge-X_YZ' tag (derived from the 'VersionNum' file
+in the current sandbox) during stage2 building and store that difference
+file as 'Docs/GCCSDKModifications'.  All the files inside the 'Docs'
+directory (including the generated 'Docs/GCCSDKModifications' file) should
+be distributed together with the binary cmunge version in our GCCSDK
+binary releases if we want to be compliant with CMunge license outlined
+in its 'Docs/Copyright' file.
+
+-EOF-
Index: assemble.c
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/riscos-aof/cmunge/assemble.c,v
retrieving revision 1.1.1.1
retrieving revision 1.3
diff -u -r1.1.1.1 -r1.3
--- assemble.c	4 Jul 2005 23:48:10 -0000	1.1.1.1
+++ assemble.c	6 Jul 2005 00:03:10 -0000	1.3
@@ -7,13 +7,18 @@
 #include <ctype.h>
 #include <string.h>
 
-#include "kernel.h"
-
 #include "datestamp.h"
 #include "error.h"
 #include "mem.h"
 #include "options.h"
 
+#ifndef GCC_BIN_DIR
+#define GCC_BIN_DIR ""
+#endif
+
+#define OBJASM "objasm"
+#define AS GCC_BIN_DIR "/as"
+
 static char buf[2048];
 
 void AssembleFile(void) {
@@ -21,6 +26,12 @@
   int rc;
 
   if (opt.ofile) {
+    int throwback;
+#ifdef CROSS_COMPILE
+    throwback = 0;
+#else
+    throwback = opt.throwback;
+#endif
     switch (opt.toolchain)
     {
       case tc_norcroft:
@@ -28,12 +39,11 @@
           unsigned long flags = opt.apcs;
           apcsoptions_t *aarg;
           char *bufend;
-          bufend = buf + sprintf(buf, "objasm -nowarn %s %s -o %s -apcs 3",
-                                 opt.throwback ? "-throwback " : "",
+          bufend = buf + sprintf(buf, OBJASM " -nowarn %s %s -o %s -apcs 3",
+                                 throwback ? "-throwback " : "",
                                  opt.sfile, opt.ofile);
 
-          aarg = apcsoptions;
-          while (aarg->name!=NULL)
+          for (aarg = apcsoptions; aarg->name!=NULL; ++aarg)
           {
             if (aarg->bic & (APCS_32BIT | APCS_SWSTACKCHECK | APCS_FPREGARGS))
             {
@@ -41,16 +51,14 @@
               if ((flags & aarg->bic) == aarg->orr)
                 bufend += sprintf(bufend, "/%s", aarg->name);
             }
-            aarg++;
           }
         }
         break;
       case tc_gcc:
       case tc_lcc:
-        sprintf(buf, "as %s -objasm -gcc %s %s -o %s",
-                          (CODE32) ? "-apcs32 -apcsfpv3" :
-                                                        "",
-                          opt.throwback ? "-throwback " : "",
+        sprintf(buf, AS " %s -objasm -module %s %s -o %s",
+                          (CODE32) ? "-apcs32 -apcsfpv3 -t ARM6" : "",
+                          throwback ? "-throwback " : "",
                           opt.sfile, opt.ofile);
         break;
     }
@@ -72,6 +80,7 @@
         /* They returned something icky. Obviously that's a fault; they
            should have already displayed an error as to the fault though.
          */
+        fprintf(stderr,"Assembling: %s\n",buf);
         fprintf(stderr,"Assembler returned %i unexpectedly; aborting\n",rc);
         exit(rc);
     }
Index: blank.c
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/riscos-aof/cmunge/blank.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- blank.c	4 Jul 2005 23:48:10 -0000	1.1.1.1
+++ blank.c	5 Jul 2005 00:31:21 -0000	1.2
@@ -7,8 +7,6 @@
 #include <ctype.h>
 #include <string.h>
 
-#include "kernel.h"
-
 #include "error.h"
 #include "options.h"
 #include "format.h"
@@ -60,5 +58,5 @@
     field++;
   }
   fclose(file);
-  exit(0); /* And exit NOW because we can't do any more processing */
+  exit(EXIT_SUCCESS); /* And exit NOW because we can't do any more processing */
 }
Index: config.h
===================================================================
RCS file: config.h
diff -N config.h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ config.h	5 Jul 2005 00:31:21 -0000	1.1
@@ -0,0 +1,123 @@
+/* This file is used when building 'cmunge' natively for RISC OS.  */
+
+#ifdef CROSS_COMPILE
+#include "sdk-config.h"
+#else
+
+/* Global defines that are common to both target libraries.  */
+
+/* Define if the linker should append ,ff8 to all executables in the
+   cross-compiler */
+#define ENABLE_FILETYPE_FF8 1
+
+/* Program name */
+#define PACKAGE "cmunge"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT ""
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME ""
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING ""
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME ""
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION ""
+
+/* Program version */
+#define VERSION "3.4.0"
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+
+#ifdef __TARGET_SCL__
+/* libscl specific defines.  */
+
+#define HAVE_BSEARCH 1
+#define HAVE_CPP_STRINGIFY 1
+#define HAVE_DECL_SYS_SIGLIST 1
+#define HAVE_ENDIAN_H 1
+#define HAVE_ISASCII 1
+#define HAVE_STDINT_H 1
+#define HAVE_LIMITS_H 1
+#define HAVE_STDDEF_H 1
+#define HAVE_STDLIB_H 1
+#define HAVE_STDINT_H 1
+#define HAVE_STRCHR 1
+#define HAVE_STRDUP 1
+#define HAVE_STRERROR 1
+#define HAVE_STRING_H 1
+#define HAVE_STRRCHR 1
+#define HAVE_STRSIGNAL 1
+#define HAVE_STRTOUL 1
+#define HAVE_SYS_TYPES_H 1
+#define HAVE_TIME_H 1
+#define HAVE_UNISTD_H 1
+#define TIME_WITH_SYS_TIME 1
+
+#else /* ! __TARGET_SCL__ */
+
+#define HAVE_ATOLL 1
+#define HAVE_BCMP 1
+#define HAVE_BCOPY 1
+#define HAVE_BSEARCH 1
+#define HAVE_BZERO 1
+#define HAVE_CPP_STRINGIFY 1
+#define HAVE_DECL_SYS_SIGLIST 1
+#define HAVE_ENDIAN_H 1
+#define HAVE_FCNTL_H 1
+#define HAVE_FORK 1
+#define HAVE_FPUTC_UNLOCKED 1
+#define HAVE_FPUTS_UNLOCKED 1
+#define HAVE_GETRLIMIT 1
+#define HAVE_GETTIMEOFDAY 1
+#define HAVE_INDEX 1
+#define HAVE_INTTYPES_H 1
+#define HAVE_ISASCII 1
+#define HAVE_KILL 1
+#define HAVE_LIMITS_H 1
+#define HAVE_MEMORY_H 1
+#define HAVE_POPEN 1
+#define HAVE_PUTC_UNLOCKED 1
+#define HAVE_PUTENV 1
+#define HAVE_SETRLIMIT 1
+#define HAVE_STAB_H 1
+#define HAVE_STDDEF_H 1
+#define HAVE_STDINT_H 1
+#define HAVE_STDLIB_H 1
+#define HAVE_STPCPY 1
+#define HAVE_STRCHR 1
+#define HAVE_STRDUP 1
+#define HAVE_STRERROR 1
+#define HAVE_STRICMP 1
+#define HAVE_STRINGS_H 1
+#define HAVE_STRING_H 1
+#define HAVE_STRNCASECMP 1
+#define HAVE_STRNDUP 1
+#define HAVE_STRRCHR 1
+#define HAVE_STRSIGNAL 1
+#define HAVE_STRTOUL 1
+#define HAVE_SYSCONF 1
+#define HAVE_SYS_FILE_H 1
+#define HAVE_SYS_PARAM_H 1
+#define HAVE_SYS_RESOURCE_H 1
+#define HAVE_SYS_STAT_H 1
+#define HAVE_SYS_TIMES_H 1
+#define HAVE_SYS_TIME_H 1
+#define HAVE_SYS_TYPES_H 1
+#define HAVE_SYS_WAIT_H 1
+#define HAVE_TIME_H 1
+#define HAVE_UNISTD_H 1
+#define HAVE_VFORK 1
+#define HAVE_WORKING_FORK 1
+#define HAVE_WORKING_VFORK 1
+#define TIME_WITH_SYS_TIME 1
+
+#endif /* ! __TARGET_SCL__ */
+
+#endif /* !CROSS_COMPILE */
Index: datestamp.c
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/riscos-aof/cmunge/datestamp.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- datestamp.c	4 Jul 2005 23:48:10 -0000	1.1.1.1
+++ datestamp.c	5 Jul 2005 00:31:21 -0000	1.2
@@ -5,8 +5,7 @@
 #include <stdio.h>
 #include <ctype.h>
 #include <string.h>
-
-#include "kernel.h"
+#include <time.h>
 
 #include "datestamp.h"
 #include "error.h"
@@ -18,9 +17,7 @@
   char *date, *date0;
   char *s;
   char datebuf[24];
-  char osword[5];
   int i;
-  _kernel_swi_regs regs;
 
   if (opt.mode_errors)
     return; /* No work is required if we're only generating error blocks */
@@ -80,17 +77,11 @@
   if (opt.datestring) {
     sprintf(datebuf, " (%s)", opt.datestring);
   } else {
-    /* OS_Word 14, 3 */
-    osword[0] = 3;
-    regs.r[0] = 14;
-    regs.r[1] = (int)osword;
-    _kernel_swi(0x07, &regs, &regs);
-    /* OS_ConvertDateAndTime */
-    regs.r[0] = (int)osword;
-    regs.r[1] = (int)datebuf;
-    regs.r[2] = 24;
-    regs.r[3] = (int)" (%DY %M3 %CE%YR)";
-    _kernel_swi(0xC1, &regs, &regs);
+    time_t curtime = time(NULL);
+    if (curtime == (time_t)-1)
+      ErrorFatal("Failed to retrieve the current time");
+    if (strftime(datebuf, sizeof(datebuf), " (%d %b %G)", gmtime(&curtime)) == 0)
+      ErrorFatal("Failed to convert time indication in readable format");
   }
 
   sprintf(date,  datebuf);
Index: format.c
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/riscos-aof/cmunge/format.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- format.c	4 Jul 2005 23:48:10 -0000	1.1.1.1
+++ format.c	5 Jul 2005 00:31:21 -0000	1.2
@@ -45,7 +45,7 @@
   int lastbreak=0;
   int pos;
   int start=strlen(lead1);
-  fprintf(file,"%s",lead1);
+  fputs(lead1,file);
   pos=start;
   while (*text)
   {
@@ -71,58 +71,49 @@
       pos+=wordlen;
       needspace=1;
     }
-    switch (*text)
+    switch (*text++)
     {
       case '\t':
-        text++;
         do {
           fputc(' ',file);
-          pos+=1;
+          pos++;
         } while (((pos-start)%2) != 0);
         indent=pos-start;
         needspace=0;
         break;
 
       case '\b':
-        text++;
-
         /* Put a single space separator */
         fputc(' ',file);
         pos++;
 
         if (lastbreak==0)
         {
-          const char *search=text;
+          const char *search;
 
           lastbreak=pos-start;
 
           /* Work out what the furthest along a break is */
-          do {
-            search = strchr(search, '\n');
-            if (search)
+          for (search = strchr(text, '\n'); search; search = strchr(search, '\n'))
+          {
+            int searchpos=0;
+            int foundpos=0;
+            for (++search; *search && *search!='\n'; ++search)
             {
-              int searchpos;
-              int foundpos=0;
-              searchpos = 0;
-              search++;
-              while (*search && *search!='\n')
+              if (*search=='\t')
+                searchpos+=2-(pos%2);
+              else
               {
-                if (*search=='\t')
-                  searchpos+=2-(pos%2);
-                else
-                {
-                  searchpos++;
-                  if (*search=='\b')
-                    foundpos=searchpos;
-                }
-                search++;
+                searchpos++;
+                if (*search=='\b')
+                  foundpos=searchpos;
               }
-              if (foundpos==0)
-                search=NULL;
-              if (foundpos+1>lastbreak)
-                lastbreak=foundpos+1;
             }
-          } while (search);
+            if (foundpos==0)
+              break;
+            if (foundpos+1>lastbreak)
+              lastbreak=foundpos+1;
+          }
         }
         indent=lastbreak;
 
@@ -138,17 +129,15 @@
         break;
 
       case ' ':
-        text++;
         break;
 
       case '\n':
-        text++;
-        fprintf(file,"\n%s",lead2);
+        fputc('\n',file); fputs(lead2,file);
         pos=start;
         needspace=0;
         indent=0;
         break;
     }
   }
-  fprintf(file,"%s\n",trailer);
+  fputs(trailer,file); fputc('\n',file);
 }
Index: gfile.c
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/riscos-aof/cmunge/gfile.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- gfile.c	4 Jul 2005 23:48:11 -0000	1.1.1.1
+++ gfile.c	5 Jul 2005 00:31:21 -0000	1.2
@@ -156,7 +156,7 @@
       remove(filename);
       return NULL;
     }
-    ptr->filename=strdup(filename);
+    ptr->filename=strdup_strip(filename);
     ptr->remove=removewhen;
     ptr->next=list;
     list=ptr;
@@ -192,7 +192,7 @@
       remove(filename);
       return NULL;
     }
-    ptr->filename=strdup(filename);
+    ptr->filename=strdup_strip(filename);
     ptr->remove=removewhen;
     ptr->next=list;
     list=ptr;
@@ -218,7 +218,7 @@
   ptr=malloc(sizeof(filelist));
   if (ptr==NULL)
     return NULL;
-  ptr->filename=strdup(tmpnam(NULL));
+  ptr->filename=strdup_strip(tmpnam(NULL));
 #ifdef DEBUG
   printf("file_temp: %s\n",ptr->filename);
 #endif
Index: main.c
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/riscos-aof/cmunge/main.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- main.c	4 Jul 2005 23:48:11 -0000	1.1.1.1
+++ main.c	5 Jul 2005 00:31:21 -0000	1.2
@@ -4,8 +4,6 @@
 
 #include <stdio.h>
 
-#include "MemCheck.h"
-
 #include "gfile.h"
 #include "options.h"
 #include "readfile.h"
@@ -23,9 +21,6 @@
 
 int main(int argc, char *argv[]) {
 
-  MemCheck_Init();
-  MemCheck_RegisterArgs(argc, argv);
-
   file_init(); /* Initialise file tidy up library */
 
   printf("CMunge " Module_FullVersionAndDate "\n" Copyright_CMunge "\n");
@@ -59,17 +54,25 @@
                      "\t*\bAdded vector-traps support\n"
                      "\t*\bGeneric-veneers can have private-word registers\n"
                      "\t*\bHeader files are now a little more neatly "
-                         "generated",
+                         "generated\n"
                      "\t*\bSupport for experimental 32-bit header generation\n"
-                     "\t*\bSupport for GCC and LCC toolchains (tentative)\n"
-                     "\n");
+                     "\t*\bSupport for GCC and LCC toolchains (tentative)\n",
+                     "");
   /* ... and writeheader is structured quite a bit differently internally */
   format_wrap(stdout,"","",
                      "The following modifications made by John Tytgat :\n"
                      "\t*\bFixes for OSLib includes\n"
                      "\t*\bSupport for building using 32-bit compatible tools\n",
-                     "\n");
+                     "");
+#endif
+  format_wrap(stdout,"","",
+                     "The following modifications were made by GCCSDK Developers :\n"
+#ifdef CROSS_COMPILE
+                     "\t*\bSee Docs/GCCSDKModifications\n",
+#else
+                     "\t*\bSee Docs.GCCSDKModifications\n",
 #endif
+                     "");
   Options_Init();
   Options_CL(argc, argv);
   Options_CheckSanity();
Index: options.c
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/riscos-aof/cmunge/options.c,v
retrieving revision 1.1.1.1
retrieving revision 1.3
diff -u -r1.1.1.1 -r1.3
--- options.c	4 Jul 2005 23:48:12 -0000	1.1.1.1
+++ options.c	6 Jul 2005 00:03:10 -0000	1.3
@@ -16,7 +16,7 @@
 /* Instantiate the global options struct here */
 options opt;
 
-void Options_Init() {
+void Options_Init(void) {
 
   opt.runnable    = run_none;
   opt.reentrant   = 1;
@@ -64,7 +64,8 @@
   /* Export files */
   opt.x_hdr       = NULL;
   opt.x_h         = NULL;
-  opt.apcs        = APCS_SWSTACKCHECK |
+  opt.apcs        = APCS_32BIT |
+                    APCS_SWSTACKCHECK |
                     APCS_FP;
   opt.toolchain   = tc_norcroft;
   opt.apcs_used   = 0;
@@ -147,7 +148,7 @@
 
   format_wrap(stdout,"","",
 "\n"
-"Make a RISC OS module header for a module written in C.\n"
+"Make a RISC OS module header for a module written in C/C++.\n"
 "\n"
 "Usage: cmunge [options] infile\n"
 "\n"
@@ -175,9 +176,9 @@
 "\t-cmhg         \bGive warnings for non CMHG values.\n"
 "\t-tgcc         \bUse GCC tool chain to generate output.\n"
 "\t-tlcc         \bUse LCC tool chain to generate output.\n"
-"\t-tnorcroft    \bUse GCC tool chain to generate output (default).\n"
-"\t-32bit        \bGenerate 32-bit compatible code.\n"
-"\t-26bit        \bGenerate 26-bit only code (default).\n"
+"\t-tnorcroft    \bUse Norcroft tool chain to generate output (default).\n"
+"\t-32bit        \bGenerate 32-bit compatible code (default).\n"
+"\t-26bit        \bGenerate 26-bit only code.\n"
 "\t-apcs 3/<flags>\bSpecify APCS variant to use.\n",
 "");
 
@@ -224,15 +225,15 @@
 
   inc_tail = &opt.includes;
   for (i = 1; i < argc; i++) {
-    if (stricmp("-throwback", argv[i])) {
+    if (!stricmp("-throwback", argv[i])) {
       opt.throwback=1;
     } else if (strncmp("-t", argv[i], sizeof("-t")-1)==0) {
       char *arg = &argv[i][2];
-      if (stricmp("norcroft", arg)) {
+      if (!stricmp("norcroft", arg)) {
         opt.toolchain = tc_norcroft;
-      } else if (stricmp("gcc", arg)) {
+      } else if (!stricmp("gcc", arg)) {
         opt.toolchain = tc_gcc;
-      } else if (stricmp("lcc", arg)) {
+      } else if (!stricmp("lcc", arg)) {
         opt.toolchain = tc_lcc;
       }
       else
@@ -241,9 +242,9 @@
     } else if (strncmp("-x", argv[i], sizeof("-x")-1)==0) {
       char *arg = &argv[i][2];
       char **file = NULL; /* Couldn't find opt */
-      if (stricmp("hdr", arg)) {
+      if (!stricmp("hdr", arg)) {
         file=&opt.x_hdr;
-      } else if (stricmp("h", arg)) {
+      } else if (!stricmp("h", arg)) {
         file=&opt.x_h;
       }
       if (file==NULL)
@@ -252,59 +253,59 @@
         ErrorFatal("Export flag %s used twice!",arg);
       i++;
       if (i < argc) {
-        *file = strdup(argv[i]);
+        *file = strdup_strip(argv[i]);
       } else {
         ErrorFatal("No filename passed with export flag %s flag!",arg);
       }
-    } else if (stricmp("-h", argv[i]) || stricmp("-help", argv[i])) {
+    } else if (!stricmp("-h", argv[i]) || !stricmp("-help", argv[i])) {
       help_text();
       exit(EXIT_FAILURE);
-    } else if (stricmp("-p", argv[i])) {
+    } else if (!stricmp("-p", argv[i])) {
       if (opt.pfile) {
         ErrorFatal("-p flag used twice!");
       }
       opt.pfile=file_temp();
       if (opt.pfile==NULL)
         ErrorFatal("Failed to find a temporary file for preprocessor");
-    } else if (stricmp("-cmhg", argv[i])) {
+    } else if (!stricmp("-cmhg", argv[i])) {
       if (opt.cmhg) {
         ErrorFatal("-cmhg flag used twice!");
       }
       opt.cmhg=1;
-    } else if (stricmp("-s", argv[i])) {
+    } else if (!stricmp("-s", argv[i])) {
       if (opt.sfile) {
         ErrorFatal("-s flag used twice!");
       }
       i++;
       if (i < argc) {
-        opt.sfile = strdup(argv[i]);
+        opt.sfile = strdup_strip(argv[i]);
       } else {
         ErrorFatal("No filename passed with -s flag!");
       }
-    } else if (stricmp("-o", argv[i])) {
+    } else if (!stricmp("-o", argv[i])) {
       if (opt.ofile) {
         ErrorFatal("-o flag used twice!");
       }
       i++;
       if (i < argc) {
-        opt.ofile = strdup(argv[i]);
+        opt.ofile = strdup_strip(argv[i]);
       } else {
         ErrorFatal("No filename passed with -o flag!");
       }
-    } else if (stricmp("-blank", argv[i])) {
+    } else if (!stricmp("-blank", argv[i])) {
       opt.blank=1;
-    } else if (stricmp("-b", argv[i])) {
+    } else if (!stricmp("-b", argv[i])) {
       if (opt.runnable) {
         ErrorFatal("-b flag used twice!");
       }
       opt.runnable=run_blib;
-    } else if (stricmp("-depend", argv[i])) {
+    } else if (!stricmp("-depend", argv[i])) {
       if (opt.dfile) {
         ErrorFatal("-depend flag used twice!");
       }
       i++;
       if (i < argc) {
-        opt.dfile = strdup(argv[i]);
+        opt.dfile = strdup_strip(argv[i]);
       } else {
         ErrorFatal("No filename passed with -depend flag!");
       }
@@ -313,7 +314,7 @@
       arg = &argv[i][2];
       if (*arg) {
         inc = Malloc(sizeof(*inc));
-        inc->path = strdup(arg);
+        inc->path = strdup_strip(arg);
         inc->next = NULL;
         *inc_tail = inc;
         inc_tail  = &inc->next;
@@ -330,7 +331,7 @@
           ErrorFatal("No definition variable given with -D");
         }
       }
-      arg = strdup(arg);
+      arg = strdup_strip(arg);
       val = strchr(arg,'=');
       if (val != NULL)
         *val++ = 0;
@@ -351,7 +352,7 @@
           ErrorFatal("No (un)definition variable given with -U");
         }
       }
-      arg = strdup(arg);
+      arg = strdup_strip(arg);
       val = strchr(arg, '=');
       if (val != NULL) {
         ErrorFatal("How can you undefine something to be something? %s", arg);
@@ -369,17 +370,17 @@
       }
       i++;
       if (i < argc) {
-        opt.hfile = strdup(argv[i]);
+        opt.hfile = strdup_strip(argv[i]);
       } else {
         ErrorFatal("No filename passed with -d flag!");
       }
     } else if (strncmp("-z", argv[i], sizeof("-z")-1)==0) { /* case sensitive */
       arg = &argv[i][sizeof("-z")-1];
-      if (stricmp("oslib", arg)) {
+      if (!stricmp("oslib", arg)) {
         opt.oslib = 1;
-      } else if (stricmp("base", arg)) {
+      } else if (!stricmp("base", arg)) {
         opt.base = 1;
-      } else if (stricmp("errors", arg)) {
+      } else if (!stricmp("errors", arg)) {
         opt.mode_errors = 1;
       } else {
         ErrorFatal("Unknown tweak option -z");
@@ -399,7 +400,7 @@
       if (opt.infile) {
         ErrorFatal("Unknown flag/Only specify one input file: %s", argv[i]);
       }
-      opt.infile = strdup(argv[i]);
+      opt.infile = strdup_strip(argv[i]);
     }
   }
 }
Index: readfile.c
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/riscos-aof/cmunge/readfile.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- readfile.c	4 Jul 2005 23:48:13 -0000	1.1.1.1
+++ readfile.c	5 Jul 2005 00:31:21 -0000	1.2
@@ -117,18 +117,18 @@
   if (sscanf(prelinebuf," %i \"%[^\"]\"",&line,&filename)==2) {
     opt.atline = line-1; /* GCC style */
     Free(opt.infile);
-    opt.infile = strdup(filename);
+    opt.infile = strdup_strip(filename);
   }
   else if (sscanf(prelinebuf,"line %i \"%[^\"]\"",&line,&filename)==2) {
     opt.atline = line-1; /* Norcroft style */
     Free(opt.infile);
-    opt.infile = strdup(filename);
+    opt.infile = strdup_strip(filename);
   } else {
     ErrorFatal("Unknown preprocessor command encountered: #%s", prelinebuf);
   }
 }
 
-static char *getline(FILE *file) {
+static char *getcmhgline(FILE *file) {
 
   char c;
   int comma, discarding, whitespace;
@@ -317,8 +317,8 @@
 
 /*****************************************************************************
  * Starts to get cleaner from here :-)
- * parse_line calls getline and then deals with the returned string, setting
- * up the 'options' structure as required.
+ * parse_line calls getcmghline and then deals with the returned string,
+ * setting up the 'options' structure as required.
  *****************************************************************************/
 
 static void read_services(const char *s, FILE *file) {
@@ -328,7 +328,7 @@
   UNUSED(file);
 
   if (opt.service)
-    ErrorFatal("Only supply one service-handler!");
+    ErrorFatal("Only supply one service-call-handler!");
   s = strduptok(s, &opt.service);
   if (*s == ',')
     while (isspace(*s))
@@ -456,7 +456,7 @@
         s = strstring(s, &(*l)->message);
       } else if (*s == 0) {
         while ((*s == 0) && !Feof(file)) {
-          s = getline(file);
+          s = getcmhgline(file);
           while (isspace(*s) && (!Feof(file)))
             s++;
         }
@@ -493,7 +493,7 @@
   s = strduptok(s, &opt.helpfn);
   s = strcomma(s);
   while ((*s == 0) && !Feof(file)) {
-    s = getline(file);
+    s = getcmhgline(file);
     while (isspace(*s) && (!Feof(file)))
       s++;
   }
@@ -585,7 +585,7 @@
         break;
       } else if (*s == 0) {
         while ((*s == 0) && !Feof(file)) {
-          s = getline(file);
+          s = getcmhgline(file);
           while (isspace(*s) && (!Feof(file)))
             s++;
         }
@@ -673,7 +673,7 @@
           break;
         } else if (*s == 0) {
           while ((*s == 0) && !Feof(file)) {
-            s = getline(file);
+            s = getcmhgline(file);
             while (isspace(*s) && (!Feof(file)))
               s++;
           }
@@ -826,7 +826,7 @@
       break;
     } else if (*s == 0) {
       while ((*s == 0) && !Feof(file)) {
-        s = getline(file);
+        s = getcmhgline(file);
         while (isspace(*s) && (!Feof(file)))
           s++;
       }
@@ -1075,7 +1075,7 @@
 
   char *line;
 
-  line = getline(file);
+  line = getcmhgline(file);
 
   while (isspace(*line))
     line++;
@@ -1101,7 +1101,7 @@
 
     do {
       field=fields;
-      while (field->name && !stricmp(field->name,line))
+      while (field->name && stricmp(field->name,line))
         field++;
       if (field->name==NULL)
         ErrorFatal("Unknown field: '%s'", line);
@@ -1205,7 +1205,7 @@
           if (*value!=NULL)
             ErrorFatal("Only supply one %s field!",field->name);
 
-          *value=strdup(tail);
+          *value=strdup_strip(tail);
         }
         break;
 
Index: str.c
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/riscos-aof/cmunge/str.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- str.c	4 Jul 2005 23:48:13 -0000	1.1.1.1
+++ str.c	5 Jul 2005 00:31:21 -0000	1.2
@@ -6,25 +6,33 @@
 #include <string.h>
 #include <ctype.h>
 
+#include "config.h"
 #include "error.h"
 #include "mem.h"
+#include "str.h"
 
-int stricmp(const char *p, const char *q) {
+#ifndef HAVE_STRICMP
+int stricmp (const char *s1, const char *s2)
+{
+  const unsigned char *p1 = (const unsigned char *) s1;
+  const unsigned char *p2 = (const unsigned char *) s2;
+  int result;
 
-  char a, b;
+  if (p1 == p2)
+    return 0;
 
-  while (1) {
-    a = toupper(*p++);
-    b = toupper(*q++);
-    if (a == b) {
-      if (a == 0)
-        return 1;
-    } else
-      return 0;
-  }
+  while ((result = tolower (*p1) - tolower (*p2)) == 0)
+    {
+      if (*p1++ == '\0')
+        break;
+      p2++;
+    }
+
+  return result;
 }
+#endif
 
-char *strdup(char *p) {
+char *strdup_strip(const char *p) {
 
   char *res;
   int s;
Index: str.h
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/riscos-aof/cmunge/str.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- str.h	4 Jul 2005 23:48:13 -0000	1.1.1.1
+++ str.h	5 Jul 2005 00:31:21 -0000	1.2
@@ -3,12 +3,15 @@
  */
 
 #ifndef STR_H
-
 #define STR_H
 
+#include "config.h"
+
+#ifndef HAVE_STRICMP
 int stricmp(const char *p, const char *q);
+#endif
 
-char *strdup(const char *p);
+char *strdup_strip(const char *p);
 
 const char *strduptok(const char *p, char **res);
 
Index: throwback.c
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/riscos-aof/cmunge/throwback.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- throwback.c	4 Jul 2005 23:48:13 -0000	1.1.1.1
+++ throwback.c	5 Jul 2005 00:31:21 -0000	1.2
@@ -2,18 +2,23 @@
  * Copyright (C) 1999-2000 Robin Watts/Justin Fletcher
  */
 
-#ifdef __riscos
+#ifndef CROSS_COMPILE
 #include <stdlib.h>
 #include <stdarg.h>
 #include <string.h>
 #include <stdio.h>
+
 #include "kernel.h"
 #include "throwback.h"
+
 #define DDEUtils_ThrowbackSend (0x42588)
 #define DDEUtils_ThrowbackStart (0x42587)
 #define DDEUtils_ThrowbackEnd (0x42589)
 
-void Throwback_Shutdown(void)
+static void Throwback_Shutdown(void);
+static void Throwback(seriousness_t seriousness,char *file,int line,char *message);
+
+static void Throwback_Shutdown(void)
 {
   _kernel_swi_regs ARM;
   _kernel_swi(DDEUtils_ThrowbackEnd,&ARM,&ARM);
@@ -22,22 +27,23 @@
 void vThrowbackf(seriousness_t seriousness,char *file,int line,char *format,va_list args)
 {
   char buf[1024];
+
+  if (file==NULL)
+    return;
+
+  if (line<1) line=0; /* Prevent silly values */
+
   vsprintf(buf,format,args);
   Throwback(seriousness,file,line,buf);
 }
 
-void Throwback(seriousness_t seriousness,char *file,int line,char *message)
+static void Throwback(seriousness_t seriousness,char *file,int line,char *message)
 {
   static int registered=0;
   _kernel_swi_regs ARM;
   enum {
     /*t_processing=0,*/ t_warning=1, t_informational
-  } type=t_informational;
-
-  if (file==NULL)
-    return;
-
-  if (line<1) line=0; /* Prevent silly values */
+  } type;
 
   if (!registered)
   {
@@ -47,10 +53,7 @@
     registered=1;
   }
 
-  if (seriousness==s_information)
-    type=t_informational;
-  else
-    type=t_warning;
+  type=(seriousness==s_information) ? t_informational : t_warning;
 
   ARM.r[0]=(int)type; /* message type */
   ARM.r[2]=(int)file;
@@ -63,8 +66,14 @@
 
 #else
 
-void Throwback(char *file,int line,int column,char *message)
+#include <stdio.h>
+
+#include "throwback.h"
+
+void vThrowbackf(seriousness_t seriousness,char *file,int line,char *format,va_list args)
 {
-  /* Implement your own throwback mechanisms here */
+fprintf(stderr, "%s:%d: %s: ", file, line, (seriousness==s_information) ? "info" : "warning");
+vfprintf(stderr, format, args);
+fputc('\n', stderr);
 }
 #endif
Index: throwback.h
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/riscos-aof/cmunge/throwback.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- throwback.h	4 Jul 2005 23:48:13 -0000	1.1.1.1
+++ throwback.h	5 Jul 2005 00:31:21 -0000	1.2
@@ -5,7 +5,6 @@
 */
 
 #ifndef THROWBACK_H
-
 #define THROWBACK_H
 
 /*
@@ -21,6 +20,4 @@
 
 void vThrowbackf(seriousness_t seriousness,char *file,int line,char *format,va_list args);
 
-void Throwback(seriousness_t seriousness,char *file,int line,char *message);
-
 #endif
Index: writefile.c
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/riscos-aof/cmunge/writefile.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- writefile.c	4 Jul 2005 23:48:15 -0000	1.1.1.1
+++ writefile.c	5 Jul 2005 00:31:21 -0000	1.2
@@ -415,7 +415,7 @@
 static void service(void) {
 
 /* JRF: 32bit */
-  unsigned int n, m, found;
+  unsigned int n, m;
   int_list l;
   int big;
   int first;
@@ -424,19 +424,19 @@
     return;
   fprintf(file, "\tALIGN\n");
   if (opt.services) {
-    int min = 0;
+    unsigned int min = 0;
+    unsigned int found;
+
     fprintf(file, "_CMUNGE_service_fast\n");
     fprintf(file, "\tDCD\t0\n");
     fprintf(file, "\tDCD\t_CMUNGE_service_fast_entry\t- _CMUNGE_origin\n");
     /* List services in ascending order */
     do {
       found = 0;
-      l = opt.services;
-      while (l) {
-        if (l->val > min)
-          if ((l->val < found) || (found == 0))
-            found = l->val;
-        l = l->next;
+      for (l = opt.services; l; l = l->next)
+      {
+        if (l->val > min && ((l->val < found) || (found == 0)))
+          found = l->val;
       }
       fprintf(file, "\tDCD\t0x%08x\n", found);
       min = found;
Index: writeheader.c
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/riscos-aof/cmunge/writeheader.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- writeheader.c	4 Jul 2005 23:48:16 -0000	1.1.1.1
+++ writeheader.c	5 Jul 2005 00:31:21 -0000	1.2
@@ -727,7 +727,7 @@
     "This name should be used as an argument to OS_Claim/OS_Release as "
     "required, but should never be called from C.",
     NULL, /* No note */
-    NULL, /* NO Entry parameters */
+    { { NULL } }, /* NO Entry parameters */
     NULL
   };
 
@@ -784,7 +784,7 @@
     "This name should be used as an argument to OS_Claim/OS_Release as "
     "required, but should never be called from C.",
     NULL, /* Note will be updated */
-    NULL, /* NO Entry parameters */
+    { { NULL } }, /* NO Entry parameters */
     NULL
   };
 
Index: Docs/.cvsignore
===================================================================
RCS file: Docs/.cvsignore
diff -N Docs/.cvsignore
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ Docs/.cvsignore	5 Jul 2005 00:48:57 -0000	1.1
@@ -0,0 +1 @@
+GCCSDKModifications
Index: Docs/Copyright
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/riscos-aof/cmunge/Docs/Copyright,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- Docs/Copyright	4 Jul 2005 23:48:16 -0000	1.1.1.1
+++ Docs/Copyright	5 Jul 2005 00:31:21 -0000	1.2
@@ -1,3 +1,12 @@
+This is a modified version of CMunge for the GCCSDK project.  You can find
+the original CMunge "Copyright" statement below.  In order to be compliant
+when distributing a modified version (see point 2 of the section specifying
+the conditions of distributing changed versions) all changes made by the
+GCCSDK developers are listed as an unified diff file 'GCCSDKModifications'
+and all those changes are copyright (c) 2005 GCCSDK Developers.
+
+--------------------------------------------------------------------------
+
 Copyright
 ---------
 
Index: Docs/History
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/riscos-aof/cmunge/Docs/History,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- Docs/History	4 Jul 2005 23:48:17 -0000	1.1.1.1
+++ Docs/History	5 Jul 2005 00:31:21 -0000	1.2
@@ -4,10 +4,6 @@
 ------------------------------------------------------------------------
     Version 0.52 21:01:58 6/10/2003
 ------------------------------------------------------------------------
-$Log: History,v $
-Revision 1.1.1.1  2005/07/04 23:48:17  joty
-Import of the official CMunge v0.52 release.
-
 Revision 1.41  2003/10/06 21:12:01  justin
 Summary:
   Added explicit support for C++ modules.
Index: Docs/Manual
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/riscos-aof/cmunge/Docs/Manual,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- Docs/Manual	4 Jul 2005 23:48:18 -0000	1.1.1.1
+++ Docs/Manual	5 Jul 2005 00:31:21 -0000	1.2
@@ -657,8 +657,8 @@
   *CMunge -help
 
 
-GCC and Norcroft Toolchains:
-----------------------------
+GCC, LCC and Norcroft Toolchains:
+--------------------------------
 
 Because CMunge is intended to be a free replacement for CMHG, it can be used
 with the freely available GCC toolchain as well as the commercial Norcroft
