diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-04-13 17:12:02 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-04-13 17:12:02 -0600 |
commit | 2a815aa47083c49b9a809056004bd9a01e87221c (patch) | |
tree | e41801257e0cd4e27dc3516d8fd8216104a4c648 | |
parent | 638c1a6dc07b438efa220c5345e94c3a963505ca (diff) | |
download | px4-nuttx-2a815aa47083c49b9a809056004bd9a01e87221c.tar.gz px4-nuttx-2a815aa47083c49b9a809056004bd9a01e87221c.tar.bz2 px4-nuttx-2a815aa47083c49b9a809056004bd9a01e87221c.zip |
Restore trainling whitespace in .patch and .diff files wehre required
128 files changed, 2204 insertions, 2204 deletions
diff --git a/misc/drivers/rtl8187x/INSTALL.sh b/misc/drivers/rtl8187x/INSTALL.sh index 839fb7768..29a7a7784 100755 --- a/misc/drivers/rtl8187x/INSTALL.sh +++ b/misc/drivers/rtl8187x/INSTALL.sh @@ -79,7 +79,7 @@ while [ ! -z "$1" ]; do shift done -# Sanity checking +# Sanity checking if [ -z "${nuttxdir}" ]; then echo "Path to the top-level NuttX directory not provided" diff --git a/misc/drivers/rtl8187x/rtl8187x.c b/misc/drivers/rtl8187x/rtl8187x.c index d8fe14740..20d66e239 100644 --- a/misc/drivers/rtl8187x/rtl8187x.c +++ b/misc/drivers/rtl8187x/rtl8187x.c @@ -30,7 +30,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * There are probably also pieces from the Linux RTL8187x driver - * + * * Copyright 2007 Michael Wu <flamingice@sourmilk.net> * Copyright 2007 Andrea Merello <andreamrl@tiscali.it> * @@ -282,7 +282,7 @@ static inline int rtl8187x_allocbuffers(FAR struct rtl8187x_state_s *priv); static inline int rtl8187x_freebuffers(FAR struct rtl8187x_state_s *priv); /* struct usbhost_registry_s methods */ - + static struct usbhost_class_s *rtl8187x_create(FAR struct usbhost_driver_s *hcd, FAR const struct usbhost_id_s *id); @@ -386,7 +386,7 @@ static int rtl8187x_netuninitialize(FAR struct rtl8187x_state_s *priv); * Private Data ****************************************************************************/ -/* This structure provides the registry entry ID informatino that will be +/* This structure provides the registry entry ID informatino that will be * used to associate the USB class driver to a connected USB device. */ @@ -404,7 +404,7 @@ static const const struct usbhost_id_s g_id[2] = 0, /* subclass */ 0, /* proto */ CONFIG_USB_WLAN_VID, /* vid */ - CONFIG_USB_WLAN_PID /* pid */ + CONFIG_USB_WLAN_PID /* pid */ } }; @@ -682,7 +682,7 @@ static void rtl8187x_destroy(FAR void *arg) DEBUGASSERT(priv != NULL); uvdbg("crefs: %d\n", priv->crefs); - + /* Unregister WLAN network interface */ rtl8187x_netuninitialize(priv); @@ -704,7 +704,7 @@ static void rtl8187x_destroy(FAR void *arg) rtl8187x_freebuffers(priv); /* Destroy the semaphores */ - + sem_destroy(&priv->exclsem); /* Disconnect the USB host device */ @@ -758,10 +758,10 @@ static inline int rtl8187x_cfgdesc(FAR struct rtl8187x_state_s *priv, int ret; uvdbg("desclen:%d funcaddr:%d\n", desclen, funcaddr); - DEBUGASSERT(priv != NULL && + DEBUGASSERT(priv != NULL && configdesc != NULL && desclen >= sizeof(struct usb_cfgdesc_s)); - + /* Verify that we were passed a configuration descriptor */ cfgdesc = (FAR struct usb_cfgdesc_s *)configdesc; @@ -797,7 +797,7 @@ static inline int rtl8187x_cfgdesc(FAR struct rtl8187x_state_s *priv, case USB_DESC_TYPE_INTERFACE: { FAR struct usb_ifdesc_s *ifdesc = (FAR struct usb_ifdesc_s *)configdesc; - + uvdbg("Interface descriptor\n"); DEBUGASSERT(remaining >= USB_SIZEOF_IFDESC); @@ -873,7 +873,7 @@ static inline int rtl8187x_cfgdesc(FAR struct rtl8187x_state_s *priv, found |= USBHOST_BINFOUND; /* Save the bulk IN endpoint information */ - + bindesc.addr = epdesc->addr & USB_EP_ADDR_NUMBER_MASK; bindesc.in = 1; bindesc.funcaddr = funcaddr; @@ -903,13 +903,13 @@ static inline int rtl8187x_cfgdesc(FAR struct rtl8187x_state_s *priv, } /* Increment the address of the next descriptor */ - + configdesc += desc->len; remaining -= desc->len; } /* Sanity checking... did we find all of things that we need? */ - + if (found != USBHOST_ALLFOUND) { udbg("ERROR: Found IF:%s BIN:%s BOUT:%s\n", @@ -1231,7 +1231,7 @@ static inline int rtl8187x_freebuffers(FAR struct rtl8187x_state_s *priv) (void)DRVR_FREE(priv->hcd, (FAR uint8_t *)priv->ctrlreq); priv->ctrlreq = NULL; - + /* Free the allocated buffer */ (void)DRVR_FREE(priv->hcd, priv->tbuffer); @@ -1249,7 +1249,7 @@ static inline int rtl8187x_freebuffers(FAR struct rtl8187x_state_s *priv) * Name: rtl8187x_create * * Description: - * This function implements the create() method of struct usbhost_registry_s. + * This function implements the create() method of struct usbhost_registry_s. * The create() method is a callback into the class implementation. It is * used to (1) create a new instance of the USB host class state and to (2) * bind a USB host driver "session" to the class instance. Use of this @@ -1335,7 +1335,7 @@ static FAR struct usbhost_class_s *rtl8187x_create(FAR struct usbhost_driver_s * sem_init(&priv->exclsem, 0, 1); /* Return the instance of the USB class driver */ - + return &priv->class; } @@ -1390,7 +1390,7 @@ static int rtl8187x_connect(FAR struct usbhost_class_s *class, FAR struct rtl8187x_state_s *priv = (FAR struct rtl8187x_state_s *)class; int ret; - DEBUGASSERT(priv != NULL && + DEBUGASSERT(priv != NULL && configdesc != NULL && desclen >= sizeof(struct usb_cfgdesc_s)); @@ -1411,7 +1411,7 @@ static int rtl8187x_connect(FAR struct usbhost_class_s *class, udbg("rtl8187x_devinit() failed: %d\n", ret); } } - + return ret; } @@ -1469,7 +1469,7 @@ static int rtl8187x_disconnected(struct usbhost_class_s *class) (void)work_queue(&priv->wkdisconn, rtl8187x_destroy, priv, 0); } - irqrestore(flags); + irqrestore(flags); return OK; } @@ -1993,7 +1993,7 @@ static int rtl8187x_uiptxpoll(struct uip_driver_s *dev) static void rtl8187x_txpollwork(FAR void *arg) { FAR struct rtl8187x_state_s *priv = (FAR struct rtl8187x_state_s *)arg; - + /* Verify that the RTL8187 is still connected and that the interface is up */ if (!priv->disconnected && priv->bifup) @@ -2256,7 +2256,7 @@ static inline void rtl8187x_rxdispatch(FAR struct rtl8187x_state_s *priv, } else if (ethhdr->type == htons(UIP_ETHTYPE_ARP)) { - RTL8187X_STATS(priv, rxarppackets); + RTL8187X_STATS(priv, rxarppackets); uip_arp_arpin(&priv->ethdev); /* If the above function invocation resulted in data that should be @@ -2299,7 +2299,7 @@ static inline void rtl8187x_rxdispatch(FAR struct rtl8187x_state_s *priv, static void rtl8187x_rxpollwork(FAR void *arg) { FAR struct rtl8187x_state_s *priv = (FAR struct rtl8187x_state_s *)arg; - + /* Get exclusive access to the USB controller interface and the device * structure */ @@ -3436,7 +3436,7 @@ static void rtl8187x_anaparamoff(FAR struct rtl8187x_state_s *priv) } /**************************************************************************** - * Function: rtl8225_settxpower and + * Function: rtl8225_settxpower and * * Description: * Chip-specific TX power configuration @@ -3829,7 +3829,7 @@ static void rtl8187x_setchannel(FAR struct rtl8187x_state_s *priv, int channel) regval = rtl8187x_ioread32(priv, RTL8187X_ADDR_TXCONF); /* Enable TX loopback on MAC level to avoid TX during channel changes, as - * this has be seen to causes problems and the card will stop work until next + * this has be seen to causes problems and the card will stop work until next * reset */ @@ -4081,7 +4081,7 @@ static int rtl8187x_setup(FAR struct rtl8187x_state_s *priv) } rtl8187x_write(priv, 0, 0x0b7); - + /* Save the MAC address in the device structure */ priv->ethdev.d_mac.ether_addr_octet[0] = permaddr[0] & 0xff; diff --git a/misc/drivers/rtl8187x/rtl8187x.h b/misc/drivers/rtl8187x/rtl8187x.h index 8783f1e92..d51acf1fd 100644 --- a/misc/drivers/rtl8187x/rtl8187x.h +++ b/misc/drivers/rtl8187x/rtl8187x.h @@ -33,7 +33,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * There are probably also pieces from the Linux RTL8187x driver - * + * * Copyright 2007 Michael Wu <flamingice@sourmilk.net> * Copyright 2007 Andrea Merello <andreamrl@tiscali.it> * @@ -178,7 +178,7 @@ #define RTL8187X_TXDESC_FLAG_NOENC (1 << 15) /* Disable hardware based encryption */ #define RTL8187X_TXDESC_FLAG_TXOK (1 << 15) /* TX frame was ACKed */ #define RTL8187X_TXDESC_FLAG_SPLCP (1 << 16) /* Use short preamble */ -#define RTL8187X_TXDESC_FLAG_RXUNDER (1 << 16) +#define RTL8187X_TXDESC_FLAG_RXUNDER (1 << 16) #define RTL8187X_TXDESC_FLAG_MOREFRAG (1 << 17) /* More fragments follow */ #define RTL8187X_TXDESC_FLAG_CTS (1 << 18) /* Use CTS-to-self protection */ #define RTL8187X_TXDESC_FLAG_RTS (1 << 23) /* Use RTS/CTS protection */ @@ -334,7 +334,7 @@ * See the RTL8187x_ADDR_* definitions above. */ -struct rtl8187x_csr_s +struct rtl8187x_csr_s { uint8_t mac[6]; /* 0xff00-0xff05 */ uint8_t reserved_0[2]; /* 0xff06-0xff07 */ diff --git a/misc/pascal/ChangeLog b/misc/pascal/ChangeLog index 39d9c413c..8f081d012 100644 --- a/misc/pascal/ChangeLog +++ b/misc/pascal/ChangeLog @@ -26,7 +26,7 @@ pascal-3.0 2010-05-15 Gregory Nutt <gnutt@nuttx.org> * nuttx/: The Pascal add-on module now installs and builds under the apps/interpreters directory. This means that the pascal-3.0 module is - incompatible with will all releases of NuttX prior to nuttx-6.0 where the + incompatible with will all releases of NuttX prior to nuttx-6.0 where the apps/ module was introduced. pascal-3.1 2012-xx-xx Gregory Nutt <gnutt@nuttx.org> diff --git a/misc/pascal/Make.defs b/misc/pascal/Make.defs index 0348bf4d3..a1115b3c7 100644 --- a/misc/pascal/Make.defs +++ b/misc/pascal/Make.defs @@ -43,7 +43,7 @@ AR = /usr/bin/ar RM = /bin/rm -f -DEFINES = +DEFINES = INCLUDES = -I. -I$(INCDIR) CFLAGS = -Wall -g $(DEFINES) $(INCLUDES) LDFLAGS = -L$(LIBDIR) diff --git a/misc/pascal/doc/PascalGrammar.txt b/misc/pascal/doc/PascalGrammar.txt index 8049f536f..54b1edf4b 100644 --- a/misc/pascal/doc/PascalGrammar.txt +++ b/misc/pascal/doc/PascalGrammar.txt @@ -82,7 +82,7 @@ The start symbol for this grammar is pascal. constant-definition-group | type-definition-group | variable-declaration-group | - function-declaration | + function-declaration | procedure-declaration digit = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' @@ -180,7 +180,7 @@ The start symbol for this grammar is pascal. goto-statement = 'goto' label hex-digit = digit | 'a' | 'b' | 'c' | 'd' | 'e' | 'f' - + hex-digit-sequence = hex-digit { hex-digit } hexadecimal-integer = '$' hex-digit-sequence diff --git a/misc/pascal/doc/PascalNotes.txt b/misc/pascal/doc/PascalNotes.txt index 360986c59..dc7ca8df4 100644 --- a/misc/pascal/doc/PascalNotes.txt +++ b/misc/pascal/doc/PascalNotes.txt @@ -1,135 +1,135 @@ - AS OF 1/18/04
-
-TYPES
-- Only types INT, BOOLEAN, CHAR, REAL, SCALAR, SUBRANGE, RECORD and SET
- implemented
- - No PACKED types (actually, types are always packed).
- - FILE OF and TEXT types partially supported
- - Not supported in TYPE block
- - TEXT is defined as FILE OF CHAR vs PACKED FILE OF CHAR
- - No function returning FILE OF; No FILE OF
- procedure/function arguments
- - Only PROGRAM arguments can be declared type FILE OF
- - Only one file identifier per FILE OF declaration in type
- block.
- - SET is limit to 16/32 (# bits in int) adjacent elements
- - Expressions are not strongly typed across different SCALAR types
- (see exprEnum in expr.h)
- - In RECORD CASE, there is no verification that the type of the tag
- is consistent with a case selector; the is check if the case selector
- constants are of the same type as the tag type identifier.
-
-- No range checks on array indices
-- Pointers
- - Can't pass pointers as VAR parameters
- - No pointer functions ??
- - No pointers to pointers
-
-STATEMENTS
-- The following statements not implemented:
- - No PROCEDURE call with PROCEDUREs or FUNCTIONs as parameters
-- The following statements are only partially implemented
- - WITH statements cannot be nested.
- - Cannot reference "up the chain" in WITH statements. Eg.
- suppose RECORD "a" contains RECORD "b" which contains "c" and
- that RECORD "a" also contains "d" so that we could write
- a.b.c OR a.d
- Then the following should work but is not yet supported:
- WITH a DO
- BEGIN
- WITH b DO
- BEGIN
- c := ..
- d := .. <== SHOULD WORK!!!
- - GOTO only partially implemented -- no stack corrections
- for GOTOs between loops, blocks, etc. Use is DANGEROUS.
-
-STANDARD PROCEDURES and FUNCTIONS
-- The following statement procedures/functions not implemented:
- - GET, PUT, PACK, UNPACK, NEW
- - TBD
-- No fieldwidth colon operator on WRITE arguments
-
-Extended Pascal Features
-- Type STRING is partially implemented.
-- PACKED ARRAY[..] OF CHAR is not a a string.
-
-NON-standard Pascal extensions/differences
-
-TYPES
-- ARRAY index type is integer constant specifying size of array
-- Hexadecimal constants.
-- INPUT and OUTPUT parameters in PROGRAM statement are
- predeclared and optional.
-
-OPERATORS
-- Binary shift operators -- << and >> like in C
-- '#', "<>", and "><" are all equivalent
-
-COMPILER PSEUDO-OPERATIONS
-- INCLUDE
-
-STATEMENTS
-- CASE statement expects integer expression for the switch
- variable
-- ELSE in CASE statement
-
-EXPRESSIONS
-
-- Assumes sizeof(pointer) == sizeof(integer)
-
-TODO LIST
-
-o BUGS
-- Implement PUT and GET.
-- In FUNC/PROC calls, if simpleExpression fails to find a parameter (eg.,
- proc (,,), no error is detected.
-- Type FILE OF is totally busted -- fix it
-- Need to get max string size into stack somehow. Runtime routines like
- strcat and strcatc need to know how big the string storage space is.
-- Need logic to release string stack used by actual parameters after
- function/procedure call.
-- Can't declare new parameters / variables with same name as another
- variable at higher stock. Tokenizer does not return tIDENT.
-- There are lots of cases where the string stack is not being managed
- correctly (e.g., usesSection()).
-- Redirection of input and output is not supported (e.g. see setting of
- input and output in CONST section of pageutils.pas).
-
-o IMPROVEMENTS
-- In PTKN, verify that string stack does not overflow when
- character added.
-- Option to turn on listing
-- Option to interleave assembly language with listing
-- Option to select string stack size (or let it grow dynamically)
-- Option to select symbol table size (or let it grow dynamically)
-- List file should only be produced if option provided.
-- Provide instrumentation to use the line number data in the
- object files. In debugger, display source line. Allow stepping
- from source line to source line.
-- Optimizer needs to be incorporated into compiler.
-- arrayIndex needs to conform with Pascal standard.
-- Need to have 32-bit integers and address
-- Translation to register model
-- Native code translator
-- Linker and support multiple source files
-- Runtime package
-- Full extended pascal string support
-- Other things from extended pascal: 'list of' 'uses' 'unit'
-- Need to optimize out JMP .+1
-- For compatibility, let 'packed array [n..m] of char;' be equivalent to
- string.
-- Need to review all uses of string stack for identifiers and strings
- that get discarded. Probably should get a get infrastructure.
-- Add 16-bit word type
-
-o ISSUES
-- What happens in TYPE block if type is sTYPE or sFILE_OF? Need
- to re-think all typing. Maybe replace sTYPE and sFILE_OF with
- sINT_TYPE, sINT_ARRAY_TYPE, ..., sFILE_OF_INT,
- sFILE_OF_INT_ARRAY, etc.
-- Is it really necessary or meaningful to allocate dstack for
- file buffers.
-- Revisit procedure call logic in pexec.c & pdbg.c. First stack parameter
- is calculated but never used.
-- Decide what to do about type filename in tests/src/cgimail.pas
+ AS OF 1/18/04 + +TYPES +- Only types INT, BOOLEAN, CHAR, REAL, SCALAR, SUBRANGE, RECORD and SET + implemented + - No PACKED types (actually, types are always packed). + - FILE OF and TEXT types partially supported + - Not supported in TYPE block + - TEXT is defined as FILE OF CHAR vs PACKED FILE OF CHAR + - No function returning FILE OF; No FILE OF + procedure/function arguments + - Only PROGRAM arguments can be declared type FILE OF + - Only one file identifier per FILE OF declaration in type + block. + - SET is limit to 16/32 (# bits in int) adjacent elements + - Expressions are not strongly typed across different SCALAR types + (see exprEnum in expr.h) + - In RECORD CASE, there is no verification that the type of the tag + is consistent with a case selector; the is check if the case selector + constants are of the same type as the tag type identifier. + +- No range checks on array indices +- Pointers + - Can't pass pointers as VAR parameters + - No pointer functions ?? + - No pointers to pointers + +STATEMENTS +- The following statements not implemented: + - No PROCEDURE call with PROCEDUREs or FUNCTIONs as parameters +- The following statements are only partially implemented + - WITH statements cannot be nested. + - Cannot reference "up the chain" in WITH statements. Eg. + suppose RECORD "a" contains RECORD "b" which contains "c" and + that RECORD "a" also contains "d" so that we could write + a.b.c OR a.d + Then the following should work but is not yet supported: + WITH a DO + BEGIN + WITH b DO + BEGIN + c := .. + d := .. <== SHOULD WORK!!! + - GOTO only partially implemented -- no stack corrections + for GOTOs between loops, blocks, etc. Use is DANGEROUS. + +STANDARD PROCEDURES and FUNCTIONS +- The following statement procedures/functions not implemented: + - GET, PUT, PACK, UNPACK, NEW + - TBD +- No fieldwidth colon operator on WRITE arguments + +Extended Pascal Features +- Type STRING is partially implemented. +- PACKED ARRAY[..] OF CHAR is not a a string. + +NON-standard Pascal extensions/differences + +TYPES +- ARRAY index type is integer constant specifying size of array +- Hexadecimal constants. +- INPUT and OUTPUT parameters in PROGRAM statement are + predeclared and optional. + +OPERATORS +- Binary shift operators -- << and >> like in C +- '#', "<>", and "><" are all equivalent + +COMPILER PSEUDO-OPERATIONS +- INCLUDE + +STATEMENTS +- CASE statement expects integer expression for the switch + variable +- ELSE in CASE statement + +EXPRESSIONS + +- Assumes sizeof(pointer) == sizeof(integer) + +TODO LIST + +o BUGS +- Implement PUT and GET. +- In FUNC/PROC calls, if simpleExpression fails to find a parameter (eg., + proc (,,), no error is detected. +- Type FILE OF is totally busted -- fix it +- Need to get max string size into stack somehow. Runtime routines like + strcat and strcatc need to know how big the string storage space is. +- Need logic to release string stack used by actual parameters after + function/procedure call. +- Can't declare new parameters / variables with same name as another + variable at higher stock. Tokenizer does not return tIDENT. +- There are lots of cases where the string stack is not being managed + correctly (e.g., usesSection()). +- Redirection of input and output is not supported (e.g. see setting of + input and output in CONST section of pageutils.pas). + +o IMPROVEMENTS +- In PTKN, verify that string stack does not overflow when + character added. +- Option to turn on listing +- Option to interleave assembly language with listing +- Option to select string stack size (or let it grow dynamically) +- Option to select symbol table size (or let it grow dynamically) +- List file should only be produced if option provided. +- Provide instrumentation to use the line number data in the + object files. In debugger, display source line. Allow stepping + from source line to source line. +- Optimizer needs to be incorporated into compiler. +- arrayIndex needs to conform with Pascal standard. +- Need to have 32-bit integers and address +- Translation to register model +- Native code translator +- Linker and support multiple source files +- Runtime package +- Full extended pascal string support +- Other things from extended pascal: 'list of' 'uses' 'unit' +- Need to optimize out JMP .+1 +- For compatibility, let 'packed array [n..m] of char;' be equivalent to + string. +- Need to review all uses of string stack for identifiers and strings + that get discarded. Probably should get a get infrastructure. +- Add 16-bit word type + +o ISSUES +- What happens in TYPE block if type is sTYPE or sFILE_OF? Need + to re-think all typing. Maybe replace sTYPE and sFILE_OF with + sINT_TYPE, sINT_ARRAY_TYPE, ..., sFILE_OF_INT, + sFILE_OF_INT_ARRAY, etc. +- Is it really necessary or meaningful to allocate dstack for + file buffers. +- Revisit procedure call logic in pexec.c & pdbg.c. First stack parameter + is calculated but never used. +- Decide what to do about type filename in tests/src/cgimail.pas diff --git a/misc/pascal/include/perr.h b/misc/pascal/include/perr.h index a272ce89c..1e3fe42dc 100644 --- a/misc/pascal/include/perr.h +++ b/misc/pascal/include/perr.h @@ -46,7 +46,7 @@ /*********************************************************************** * Public Function Prototypes ***********************************************************************/ - + extern void errmsg(char *fmt, ...); extern void warn(uint16_t errcode); extern void error(uint16_t errcode); diff --git a/misc/pascal/include/podefs.h b/misc/pascal/include/podefs.h index fc25d62a4..a301b7956 100644 --- a/misc/pascal/include/podefs.h +++ b/misc/pascal/include/podefs.h @@ -170,7 +170,7 @@ enum pcode_e /* Store: arg1 = level; arg2 = signed frame offset */ - opSTS, opSTSB, opSTSM, + opSTS, opSTSB, opSTSM, /* Load Indexed: arg1 = level; arg2 = signed frame offset */ diff --git a/misc/pascal/include/poff.h b/misc/pascal/include/poff.h index 7cc33b290..00cc5c8b0 100644 --- a/misc/pascal/include/poff.h +++ b/misc/pascal/include/poff.h @@ -256,7 +256,7 @@ struct poffSectionHeader_s /* sh_name is an offset into the string table section data. * It refers to a name associated with section. */ - + uint32_t sh_name; /* If the section is loaded into memory (SHF_ALLOC), then this @@ -330,7 +330,7 @@ struct poffSymbol_s /* st_name is an offset into the string table section data. * It refers to a name associated with symbol. */ - + uint32_t st_name; /* st_value is the value associated with symbol. For defined data diff --git a/misc/pascal/include/pofflib.h b/misc/pascal/include/pofflib.h index 3547fca60..0f547d9ae 100644 --- a/misc/pascal/include/pofflib.h +++ b/misc/pascal/include/pofflib.h @@ -90,7 +90,7 @@ struct poffLibSymbol_s /* name is a reference to the symbol name in the string table * section data. */ - + const char *name; /* value is the value associated with symbol. For defined data diff --git a/misc/pascal/include/pxdefs.h b/misc/pascal/include/pxdefs.h index 8c9ab834d..66eedd609 100644 --- a/misc/pascal/include/pxdefs.h +++ b/misc/pascal/include/pxdefs.h @@ -126,7 +126,7 @@ #define lbCSTR2RSTR (0x0004) /* Convert a string to a numeric value - * procedure val(const s : string; var v; var code : word); + * procedure val(const s : string; var v; var code : word); * * Description: * val() converts the value represented in the string S to a numerical @@ -222,7 +222,7 @@ * TOS(3)=length of string1 * TOS(4)=address of string1 data * ON OUTPUT - * TOS(0)=(-1=less than, 0=equal, 1=greater than} + * TOS(0)=(-1=less than, 0=equal, 1=greater than} */ #define lbSTRCMP (0x000b) diff --git a/misc/pascal/insn16/doc/PascalOptimizations.txt b/misc/pascal/insn16/doc/PascalOptimizations.txt index d197e73da..632b5f74f 100644 --- a/misc/pascal/insn16/doc/PascalOptimizations.txt +++ b/misc/pascal/insn16/doc/PascalOptimizations.txt @@ -1,6 +1,6 @@ P-Code optimizations: Let <push-ops> be oPUSH|oPUSHB - Let <load-ops> be oLOD|oLODB|PUSH|oLADR|oLCADR + Let <load-ops> be oLOD|oLODB|PUSH|oLADR|oLCADR pcopt.c:unaryOptimize STEP 1: @@ -211,7 +211,7 @@ pjopt.c: BranchOptimize oLTEZ + oNOT -> oGTZ oLTEZ + oJEQUZ -> oJGTZ oLTEZ + oJNEQZ -> oJLTEZ - + plopt.c:LoadOptimize() Eliminate duplicate loads oLOD arg1 + oLOAD arg1 -> oLOD arg1 + oDUP diff --git a/misc/pascal/insn16/include/pinsn16.h b/misc/pascal/insn16/include/pinsn16.h index 383ba6437..1a8a6ed4c 100644 --- a/misc/pascal/insn16/include/pinsn16.h +++ b/misc/pascal/insn16/include/pinsn16.h @@ -120,7 +120,7 @@ * xx11 1100 --- --- --- --- * xx11 1101 --- --- --- --- * xx11 1110 --- --- --- --- - * xx11 1111 END --- *LABEL ilbl *LINE fn,lineno + * xx11 1111 END --- *LABEL ilbl *LINE fn,lineno * * KEY: * n = 8-bit value (unsigned) diff --git a/misc/pascal/insn16/libinsn/paddopcode.c b/misc/pascal/insn16/libinsn/paddopcode.c index 1384577a9..b11c84201 100644 --- a/misc/pascal/insn16/libinsn/paddopcode.c +++ b/misc/pascal/insn16/libinsn/paddopcode.c @@ -76,7 +76,7 @@ void insn_AddOpCode(poffHandle_t handle, OPTYPE *ptr) /* Write the 8-bit argument if present */ - if (ptr->op & o8) + if (ptr->op & o8) { (void)poffAddProgByte(handle, ptr->arg1); } @@ -84,7 +84,7 @@ void insn_AddOpCode(poffHandle_t handle, OPTYPE *ptr) /* Write the 16-bit argument if present */ if (ptr->op & o16) - { + { (void)poffAddProgByte(handle, (ptr->arg2 >> 8)); (void)poffAddProgByte(handle, (ptr->arg2 & 0xff)); } diff --git a/misc/pascal/insn16/libinsn/paddtmpopcode.c b/misc/pascal/insn16/libinsn/paddtmpopcode.c index a04878d85..8b9f618f7 100644 --- a/misc/pascal/insn16/libinsn/paddtmpopcode.c +++ b/misc/pascal/insn16/libinsn/paddtmpopcode.c @@ -76,7 +76,7 @@ void insn_AddTmpOpCode(poffProgHandle_t progHandle, OPTYPE *ptr) /* Write the 8-bit argument if present */ - if (ptr->op & o8) + if (ptr->op & o8) { (void)poffAddTmpProgByte(progHandle, ptr->arg1); } @@ -84,7 +84,7 @@ void insn_AddTmpOpCode(poffProgHandle_t progHandle, OPTYPE *ptr) /* Write the 16-bit argument if present */ if (ptr->op & o16) - { + { (void)poffAddTmpProgByte(progHandle, (ptr->arg2 >> 8)); (void)poffAddTmpProgByte(progHandle, (ptr->arg2 & 0xff)); } diff --git a/misc/pascal/insn16/popt/pcopt.c b/misc/pascal/insn16/popt/pcopt.c index e37a2d367..0379c3b6a 100644 --- a/misc/pascal/insn16/popt/pcopt.c +++ b/misc/pascal/insn16/popt/pcopt.c @@ -419,7 +419,7 @@ int16_t unaryOptimize(void) pptr[i+1]->op = oJMP; deletePcode(i); } /* end if */ - else + else deletePcodePair(i, (i+1)); nchanges++; break; @@ -430,7 +430,7 @@ int16_t unaryOptimize(void) pptr[i+1]->op = oJMP; deletePcode(i); } /* end if */ - else + else deletePcodePair(i, (i+1)); nchanges++; break; @@ -441,7 +441,7 @@ int16_t unaryOptimize(void) pptr[i+1]->op = oJMP; deletePcode(i); } /* end if */ - else + else deletePcodePair(i, (i+1)); nchanges++; break; @@ -452,7 +452,7 @@ int16_t unaryOptimize(void) pptr[i+1]->op = oJMP; deletePcode(i); } /* end if */ - else + else deletePcodePair(i, (i+1)); nchanges++; break; @@ -463,7 +463,7 @@ int16_t unaryOptimize(void) pptr[i+1]->op = oJMP; deletePcode(i); } /* end if */ - else + else deletePcodePair(i, (i+1)); nchanges++; break; @@ -474,7 +474,7 @@ int16_t unaryOptimize(void) pptr[i+1]->op = oJMP; deletePcode(i); } /* end if */ - else + else deletePcodePair(i, (i+1)); nchanges++; break; diff --git a/misc/pascal/insn16/popt/plopt.c b/misc/pascal/insn16/popt/plopt.c index b01449f64..f9293bee3 100644 --- a/misc/pascal/insn16/popt/plopt.c +++ b/misc/pascal/insn16/popt/plopt.c @@ -102,7 +102,7 @@ int16_t LoadOptimize(void) * unindexed form. */ - if (pptr[i+1]->op == oLDSXH) + if (pptr[i+1]->op == oLDSXH) { pptr[i+1]->op = oLDSH; pptr[i+1]->arg2 += val; @@ -236,7 +236,7 @@ int16_t StoreOptimize (void) else i++; break; - default : + default : i++; break; } /* end switch */ diff --git a/misc/pascal/insn16/popt/polocal.c b/misc/pascal/insn16/popt/polocal.c index 9ef98c1ce..6d8c5303b 100644 --- a/misc/pascal/insn16/popt/polocal.c +++ b/misc/pascal/insn16/popt/polocal.c @@ -101,7 +101,7 @@ void localOptimization(poffHandle_t poffHandle, initPTable(); /* Outer loop traverse the file op-code by op-code until the oEND P-Code - * has been output. NOTE: it is assumed throughout that oEND is the + * has been output. NOTE: it is assumed throughout that oEND is the * final P-Code in the program data section. */ @@ -171,11 +171,11 @@ static void putPCodeFromTable(void) { (void)poffAddTmpProgByte(myPoffProgHandle, ptable[0].op); - if (ptable[0].op & o8) + if (ptable[0].op & o8) (void)poffAddTmpProgByte(myPoffProgHandle, ptable[0].arg1); if (ptable[0].op & o16) - { + { (void)poffAddTmpProgByte(myPoffProgHandle, (ptable[0].arg2 >> 8)); (void)poffAddTmpProgByte(myPoffProgHandle, @@ -213,7 +213,7 @@ static void setupPointer(void) for (pindex = 0; pindex < WINDOW; pindex++) pptr[pindex] = (OPTYPE *) NULL; - nops = 0; + nops = 0; for (pindex = 0; pindex < WINDOW; pindex++) { switch (ptable[pindex].op) @@ -276,13 +276,13 @@ static void initPTable(void) (void)poffAddTmpProgByte(myPoffProgHandle, ptable[0].op); - if (ptable[0].op & o8) + if (ptable[0].op & o8) { (void)poffAddTmpProgByte(myPoffProgHandle, ptable[0].arg1); } if (ptable[0].op & o16) - { + { (void)poffAddTmpProgByte(myPoffProgHandle, (ptable[0].arg2 >> 8)); (void)poffAddTmpProgByte(myPoffProgHandle, (ptable[0].arg2 & 0xff)); } /* end if */ diff --git a/misc/pascal/insn16/prun/pdbg.c b/misc/pascal/insn16/prun/pdbg.c index d941ebb6f..1865c571b 100644 --- a/misc/pascal/insn16/prun/pdbg.c +++ b/misc/pascal/insn16/prun/pdbg.c @@ -421,7 +421,7 @@ static int32_t pdbg_readdecimal(char *ptr) while (isspace(*ptr)) ptr++; for (; ((*ptr >= '0') && (*ptr <= '9')); ptr++) decimal = 10*decimal + (int32_t)*ptr - (int32_t)'0'; - + return decimal; } /* end pdbg_readdecimal */ @@ -495,7 +495,7 @@ static paddr_t pdbg_printpcode(struct pexec_s *st, paddr_t pc, int16_t nitems) printf("%02x", op.arg1); opsize++; } /* end if */ - else + else printf(".."); if ((op.op & o16) != 0) @@ -575,7 +575,7 @@ static void pdbg_printtracearray(struct pexec_s *st) for (nprinted = 0; nprinted < g_ntracepoints; nprinted++) { printf("SP:%04x %04x ", - g_tracearray[ index ].sp, g_tracearray[ index ].tos); + g_tracearray[ index ].sp, g_tracearray[ index ].tos); /* Print the instruction executed at this traced address */ (void)pdbg_printpcode(st, g_tracearray[ index ].pc, 1); @@ -627,7 +627,7 @@ static void pdbg_deletebreakpoint(int16_t bpno) for (; (bpno < g_nbreakpoints); bpno++) g_breakpoint[bpno-1] = g_breakpoint[bpno]; - + g_nbreakpoints--; } /* end if */ diff --git a/misc/pascal/insn16/prun/pexec.c b/misc/pascal/insn16/prun/pexec.c index b22e52835..07809f840 100644 --- a/misc/pascal/insn16/prun/pexec.c +++ b/misc/pascal/insn16/prun/pexec.c @@ -294,7 +294,7 @@ static uint16_t pexec_sysio(struct pexec_s *st, uint8_t fno, uint16_t subfunc) * Name: pexec_libcall * * Description: - * This function process a system I/O operation + * This function process a system I/O operation * ****************************************************************************/ @@ -327,7 +327,7 @@ static uint16_t pexec_libcall(struct pexec_s *st, uint16_t subfunc) case lbGETENV : len = TOS(st, 0); /* Number of bytes in string */ src = (uint8_t*)&GETSTACK(st, TOS(st, 1)); /* Pointer to string */ - + /* Make a C string out of the pascal string */ name = pexec_mkcstring(src, len); @@ -348,7 +348,7 @@ static uint16_t pexec_libcall(struct pexec_s *st, uint16_t subfunc) break; /* Copy pascal string to a pascal string - * + * * ON INPUT: * TOS(st, 0) = address of dest string hdr * TOS(st, 1) = length of source string @@ -408,7 +408,7 @@ static uint16_t pexec_libcall(struct pexec_s *st, uint16_t subfunc) break; /* Copy C string to a pascal string - * + * * ON INPUT: * TOS(st, 0) = address of dest hdr * TOS(st, 1) = MS 16-bits of 32-bit C string pointer @@ -571,7 +571,7 @@ static uint16_t pexec_libcall(struct pexec_s *st, uint16_t subfunc) break; /* Convert a string to a numeric value - * procedure val(const s : string; var v; var code : word); + * procedure val(const s : string; var v; var code : word); * * Description: * val() converts the value represented in the string S to a numerical @@ -668,7 +668,7 @@ static uint16_t pexec_libcall(struct pexec_s *st, uint16_t subfunc) uparm1 = TOS(st, 0); /* Original string size */ addr1 = TOS(st, 1); /* Original string data pointer */ - + /* Check if there is space on the string stack for the new string * FIXME: This logic does not handle strings with other than the * default size! @@ -842,7 +842,7 @@ static uint16_t pexec_libcall(struct pexec_s *st, uint16_t subfunc) * TOS(st, 3)=length of string1 * TOS(st, 4)=address of string1 data * ON OUTPUT - * TOS(st, 0)=(-1=less than, 0=equal, 1=greater than} + * TOS(st, 0)=(-1=less than, 0=equal, 1=greater than} */ case lbSTRCMP : diff --git a/misc/pascal/insn32/doc/insn32.txt b/misc/pascal/insn32/doc/insn32.txt index 3bb7bc700..cca44639d 100644 --- a/misc/pascal/insn32/doc/insn32.txt +++ b/misc/pascal/insn32/doc/insn32.txt @@ -57,7 +57,7 @@ xr01 0111 --- PUSH nn xr01 1000 EQU JEQU ilbl xr01 1001 NEQ JNEQ ilbl xr01 1010 LT JLT ilbl -xr01 1011 GTE JGTE ilbl +xr01 1011 GTE JGTE ilbl xr01 1100 GT JGT ilbl xr01 1101 LTE JLTE ilbl xr01 1110 --- --- @@ -80,7 +80,7 @@ xr10 1101 --- STSXH offs2 xr10 1110 --- STSXB offs xr10 1111 RET STSXM offs -xr11 0000 --- LA uoffs +xr11 0000 --- LA uoffs xr11 0001 --- LAS offs xr11 0010 --- LAC dlbl xr11 0011 --- --- @@ -95,7 +95,7 @@ xr11 1011 --- LIB lop xr11 1100 --- FLOAT fop xr11 1101 --- *LABEL ilbl xr11 1110 --- *INCLUDE fn -xr11 1111 END *LINE lineno +xr11 1111 END *LINE lineno KEY: r = Reserved bit (must be zero) diff --git a/misc/pascal/insn32/include/pinsn32.h b/misc/pascal/insn32/include/pinsn32.h index eaceeba7e..1b161b196 100644 --- a/misc/pascal/insn32/include/pinsn32.h +++ b/misc/pascal/insn32/include/pinsn32.h @@ -72,7 +72,7 @@ * | GT | 0 | 0 | * | LTE | 1 | 1 | * +=====+=====+=====+ - * + * * Opcode Encoding Summary: * * 0rxx xxxx 1rxxx xxxx @@ -104,7 +104,7 @@ * xr01 1000 EQU JEQU ilbl * xr01 1001 NEQ JNEQ ilbl * xr01 1010 LT JLT ilbl - * xr01 1011 GTE JGTE ilbl + * xr01 1011 GTE JGTE ilbl * xr01 1100 GT JGT ilbl * xr01 1101 LTE JLTE ilbl * xr01 1110 --- --- @@ -127,7 +127,7 @@ * xr10 1110 --- STSXB offs * xr10 1111 RET STSXM offs * - * xr11 0000 --- LA uoffs + * xr11 0000 --- LA uoffs * xr11 0001 --- LAS offs * xr11 0010 --- LAC dlbl * xr11 0011 --- --- @@ -142,7 +142,7 @@ * xr11 1100 --- FLOAT fop * xr11 1101 --- *LABEL ilbl * xr11 1110 --- *INCLUDE fn - * xr11 1111 END *LINE lineno + * xr11 1111 END *LINE lineno * * KEY: * r = Reserved bit (must be zero) diff --git a/misc/pascal/insn32/libinsn/paddopcode.c b/misc/pascal/insn32/libinsn/paddopcode.c index 6799fdbc6..f3e6dd80e 100644 --- a/misc/pascal/insn32/libinsn/paddopcode.c +++ b/misc/pascal/insn32/libinsn/paddopcode.c @@ -78,7 +78,7 @@ void insn_AddOpCode(poffHandle_t hProg, OPTYPE *ptr) /* Write the 32-bit argument if present */ - if (ptr->op & o32) + if (ptr->op & o32) { uint8_t *pb = (uint8_t*)&ptr->arg; diff --git a/misc/pascal/insn32/libinsn/paddtmpopcode.c b/misc/pascal/insn32/libinsn/paddtmpopcode.c index e08cccc51..4b31ae2cb 100644 --- a/misc/pascal/insn32/libinsn/paddtmpopcode.c +++ b/misc/pascal/insn32/libinsn/paddtmpopcode.c @@ -78,7 +78,7 @@ void insn_AddTmpOpCode(poffProgHandle_t hProg, OPTYPE *ptr) /* Write the 32-bit argument if present */ - if (ptr->op & o32) + if (ptr->op & o32) { uint8_t *pb = (uint8_t*)&ptr->arg; diff --git a/misc/pascal/insn32/libinsn/presettmpopcodewrite.c b/misc/pascal/insn32/libinsn/presettmpopcodewrite.c index e08cccc51..4b31ae2cb 100644 --- a/misc/pascal/insn32/libinsn/presettmpopcodewrite.c +++ b/misc/pascal/insn32/libinsn/presettmpopcodewrite.c @@ -78,7 +78,7 @@ void insn_AddTmpOpCode(poffProgHandle_t hProg, OPTYPE *ptr) /* Write the 32-bit argument if present */ - if (ptr->op & o32) + if (ptr->op & o32) { uint8_t *pb = (uint8_t*)&ptr->arg; diff --git a/misc/pascal/insn32/popt/pcopt.c b/misc/pascal/insn32/popt/pcopt.c index a0c0a0226..91e60d845 100644 --- a/misc/pascal/insn32/popt/pcopt.c +++ b/misc/pascal/insn32/popt/pcopt.c @@ -235,7 +235,7 @@ int unaryOptimize(void) deletePcode(i+1); nchanges++; break; - + case oGTEZ : if ((int32_t)GETARG(pptr[i]) >= 0) PUTARG(pptr[i], -1); @@ -253,7 +253,7 @@ int unaryOptimize(void) deletePcode(i+1); nchanges++; break; - + case oLTEZ : if (GETARG(pptr[i]) <= 0) PUTARG(pptr[i], -1); @@ -417,7 +417,7 @@ int unaryOptimize(void) PUTOP(pptr[i+1], oJMP); deletePcode(i); } /* end if */ - else + else deletePcodePair(i, (i+1)); nchanges++; break; @@ -428,7 +428,7 @@ int unaryOptimize(void) PUTOP(pptr[i+1], oJMP); deletePcode(i); } /* end if */ - else + else deletePcodePair(i, (i+1)); nchanges++; break; @@ -439,7 +439,7 @@ int unaryOptimize(void) PUTOP(pptr[i+1], oJMP); deletePcode(i); } /* end if */ - else + else deletePcodePair(i, (i+1)); nchanges++; break; @@ -450,7 +450,7 @@ int unaryOptimize(void) PUTOP(pptr[i+1], oJMP); deletePcode(i); } /* end if */ - else + else deletePcodePair(i, (i+1)); nchanges++; break; @@ -461,7 +461,7 @@ int unaryOptimize(void) PUTOP(pptr[i+1], oJMP); deletePcode(i); } /* end if */ - else + else deletePcodePair(i, (i+1)); nchanges++; break; @@ -472,7 +472,7 @@ int unaryOptimize(void) PUTOP(pptr[i+1], oJMP); deletePcode(i); } /* end if */ - else + else deletePcodePair(i, (i+1)); nchanges++; break; diff --git a/misc/pascal/insn32/popt/plopt.c b/misc/pascal/insn32/popt/plopt.c index 05e8559ef..fdd25f308 100644 --- a/misc/pascal/insn32/popt/plopt.c +++ b/misc/pascal/insn32/popt/plopt.c @@ -92,7 +92,7 @@ int LoadOptimize(void) * unindexed form. */ - if (GETOP(pptr[i+1]) == oLDSXH) + if (GETOP(pptr[i+1]) == oLDSXH) { PUTOP(pptr[i+1], oLDSH); val += GETARG(pptr[i+1]); @@ -201,7 +201,7 @@ int StoreOptimize (void) else i++; break; - default : + default : i++; break; } /* end switch */ diff --git a/misc/pascal/insn32/popt/polocal.c b/misc/pascal/insn32/popt/polocal.c index 036182372..2af7f6f05 100644 --- a/misc/pascal/insn32/popt/polocal.c +++ b/misc/pascal/insn32/popt/polocal.c @@ -100,7 +100,7 @@ void localOptimization(poffHandle_t poffHandle, initPTable(); /* Outer loop traverse the file op-code by op-code until the oEND P-Code - * has been output. NOTE: it is assumed throughout that oEND is the + * has been output. NOTE: it is assumed throughout that oEND is the * final P-Code in the program data section. */ @@ -195,7 +195,7 @@ static void setupPointer(void) for (pindex = 0; pindex < WINDOW; pindex++) pptr[pindex] = (OPTYPE *) NULL; - nops = 0; + nops = 0; for (pindex = 0; pindex < WINDOW; pindex++) { switch (GETOP(&ptable[pindex])) diff --git a/misc/pascal/insn32/regm/regm_pass1.c b/misc/pascal/insn32/regm/regm_pass1.c index dcc7c572c..08194194c 100644 --- a/misc/pascal/insn32/regm/regm_pass1.c +++ b/misc/pascal/insn32/regm/regm_pass1.c @@ -104,7 +104,7 @@ static void regm_Pass1Child(poffHandle_t hPoff, struct procdata_s *pParent, pNode = regm_Pass1Node(hPoff, dwStartOffset, dwEndOffset, oRET); /* Put the func/proc body section into the tree */ - + regm_AddProgChild(pParent, pNode); /* Handle nested and child proc/func blocks */ @@ -127,7 +127,7 @@ static void regm_Pass1Peer(poffHandle_t hPoff, struct procdata_s *pPeer, pNode = regm_Pass1Node(hPoff, dwStartOffset, dwEndOffset, oRET); /* Put the func/proc body section into the tree */ - + regm_AddProgPeer(pPeer, pNode); /* Handle nested and child proc/func blocks */ @@ -266,7 +266,7 @@ void regm_Pass1(poffHandle_t hPoff) pNode = regm_Pass1Node(hPoff, dwEntryPoint, 0xffffffff, oEND); /* Put the main program section into the tree (at the root) */ - + regm_SetProgRoot(pNode); /* Then process any nested functions */ diff --git a/misc/pascal/insn32/regm/regm_pass2.c b/misc/pascal/insn32/regm/regm_pass2.c index 619d06501..e97be4325 100644 --- a/misc/pascal/insn32/regm/regm_pass2.c +++ b/misc/pascal/insn32/regm/regm_pass2.c @@ -210,7 +210,7 @@ int g_bRegisterCountValid = 0; * Private Variables **********************************************************************/ -static const struct regm_opmap_s vrgOpMap1[64] = +static const struct regm_opmap_s vrgOpMap1[64] = { /* 0x00: oNOP */ {0, 0, 0, regm_NoOperation}, /* 0x01: oNEG */ {rRSBI, 0, 0, regm_UnaryOperation}, @@ -281,7 +281,7 @@ static const struct regm_opmap_s vrgOpMap1[64] = /* 0x3f: oEND */ {0, 0, 0, regm_Return} }; -static const struct regm_opmap_s vrgOpMap2[64] = +static const struct regm_opmap_s vrgOpMap2[64] = { /* 0x80: oLD */ {rLD, 2, SPB, regm_LoadOffset}, /* 0x81: oLDH */ {rLDH, 1, SPB, regm_LoadOffset}, @@ -354,25 +354,25 @@ static const struct regm_opmap_s vrgOpMap2[64] = static const struct regm_builtin_s g_rgSysIoBuiltIns[MAX_XOP] = { - /* 0x00 */ ILLEGAL_BUILTIN_INIT, xEOF_INIT, - /* 0x02 */ xEOLN_INIT, xRESET_INIT, + /* 0x00 */ ILLEGAL_BUILTIN_INIT, xEOF_INIT, + /* 0x02 */ xEOLN_INIT, xRESET_INIT, /* 0x04 */ xREWRITE_INIT, ILLEGAL_BUILTIN_INIT, /* 0x06 */ ILLEGAL_BUILTIN_INIT, ILLEGAL_BUILTIN_INIT, /* 0x08 */ ILLEGAL_BUILTIN_INIT, ILLEGAL_BUILTIN_INIT, /* 0x0a */ ILLEGAL_BUILTIN_INIT, ILLEGAL_BUILTIN_INIT, /* 0x0c */ ILLEGAL_BUILTIN_INIT, ILLEGAL_BUILTIN_INIT, /* 0x0e */ ILLEGAL_BUILTIN_INIT, ILLEGAL_BUILTIN_INIT, - /* 0x10 */ xREADLN_INIT, xREAD_PAGE_INIT, - /* 0x12 */ xREAD_BINARY_INIT, xREAD_INT_INIT, - /* 0x14 */ xREAD_CHAR_INIT, xREAD_STRING_INIT, + /* 0x10 */ xREADLN_INIT, xREAD_PAGE_INIT, + /* 0x12 */ xREAD_BINARY_INIT, xREAD_INT_INIT, + /* 0x14 */ xREAD_CHAR_INIT, xREAD_STRING_INIT, /* 0x16 */ xREAD_REAL_INIT, ILLEGAL_BUILTIN_INIT, /* 0x18 */ ILLEGAL_BUILTIN_INIT, ILLEGAL_BUILTIN_INIT, /* 0x1a */ ILLEGAL_BUILTIN_INIT, ILLEGAL_BUILTIN_INIT, /* 0x1c */ ILLEGAL_BUILTIN_INIT, ILLEGAL_BUILTIN_INIT, /* 0x1e */ ILLEGAL_BUILTIN_INIT, ILLEGAL_BUILTIN_INIT, - /* 0x20 */ xWRITELN_INIT, xWRITE_PAGE_INIT, - /* 0x22 */ xWRITE_BINARY_INIT, xWRITE_INT_INIT, - /* 0x24 */ xWRITE_CHAR_INIT, xWRITE_STRING_INIT, + /* 0x20 */ xWRITELN_INIT, xWRITE_PAGE_INIT, + /* 0x22 */ xWRITE_BINARY_INIT, xWRITE_INT_INIT, + /* 0x24 */ xWRITE_CHAR_INIT, xWRITE_STRING_INIT, /* 0x25 */ xWRITE_REAL_INIT }; @@ -389,68 +389,68 @@ static const struct regm_builtin_s g_rgLibCallBuiltIns[MAX_LBOP] = static const struct regm_builtin_s g_rgRrFopBuiltIns[MAX_FOP] = { /* 0x00 */ ILLEGAL_BUILTIN_INIT, fpFLOAT_INIT, - /* 0x02 */ fpTRUNC_INIT, fpROUND_INIT, - /* 0x04 */ fpADD_RR_INIT, fpSUB_RR_INIT, - /* 0x06 */ fpMUL_RR_INIT, fpDIV_RR_INIT, + /* 0x02 */ fpTRUNC_INIT, fpROUND_INIT, + /* 0x04 */ fpADD_RR_INIT, fpSUB_RR_INIT, + /* 0x06 */ fpMUL_RR_INIT, fpDIV_RR_INIT, /* 0x00 */ fpMOD_RR_INIT, ILLEGAL_BUILTIN_INIT, - /* 0x0a */ fpEQU_RR_INIT, fpNEQ_RR_INIT, - /* 0x0c */ fpLT_RR_INIT, fpGTE_RR_INIT, - /* 0x0e */ fpGT_RR_INIT, fpLTE_RR_INIT, - /* 0x10 */ fpNEG_R_INIT, fpABS_R_INIT, - /* 0x12 */ fpSQR_R_INIT, fpSQRT_R_INIT, - /* 0x14 */ fpSIN_R_INIT, fpCOS_R_INIT, - /* 0x16 */ fpATAN_R_INIT, fpLN_R_INIT, + /* 0x0a */ fpEQU_RR_INIT, fpNEQ_RR_INIT, + /* 0x0c */ fpLT_RR_INIT, fpGTE_RR_INIT, + /* 0x0e */ fpGT_RR_INIT, fpLTE_RR_INIT, + /* 0x10 */ fpNEG_R_INIT, fpABS_R_INIT, + /* 0x12 */ fpSQR_R_INIT, fpSQRT_R_INIT, + /* 0x14 */ fpSIN_R_INIT, fpCOS_R_INIT, + /* 0x16 */ fpATAN_R_INIT, fpLN_R_INIT, /* 0x18 */ fpEXP_R_INIT }; static const struct regm_builtin_s g_rgRiFopBuiltIns[MAX_FOP] = { /* 0x00 */ ILLEGAL_BUILTIN_INIT, fpFLOAT_INIT, - /* 0x02 */ fpTRUNC_INIT, fpROUND_INIT, - /* 0x04 */ fpADD_RI_INIT, fpSUB_RI_INIT, - /* 0x06 */ fpMUL_RI_INIT, fpDIV_RI_INIT, + /* 0x02 */ fpTRUNC_INIT, fpROUND_INIT, + /* 0x04 */ fpADD_RI_INIT, fpSUB_RI_INIT, + /* 0x06 */ fpMUL_RI_INIT, fpDIV_RI_INIT, /* 0x00 */ fpMOD_RI_INIT, ILLEGAL_BUILTIN_INIT, - /* 0x0a */ fpEQU_RI_INIT, fpNEQ_RI_INIT, - /* 0x0c */ fpLT_RI_INIT, fpGTE_RI_INIT, - /* 0x0e */ fpGT_RI_INIT, fpLTE_RI_INIT, - /* 0x10 */ fpNEG_I_INIT, fpABS_I_INIT, - /* 0x12 */ fpSQR_I_INIT, fpSQRT_I_INIT, - /* 0x14 */ fpSIN_I_INIT, fpCOS_I_INIT, - /* 0x16 */ fpATAN_I_INIT, fpLN_I_INIT, + /* 0x0a */ fpEQU_RI_INIT, fpNEQ_RI_INIT, + /* 0x0c */ fpLT_RI_INIT, fpGTE_RI_INIT, + /* 0x0e */ fpGT_RI_INIT, fpLTE_RI_INIT, + /* 0x10 */ fpNEG_I_INIT, fpABS_I_INIT, + /* 0x12 */ fpSQR_I_INIT, fpSQRT_I_INIT, + /* 0x14 */ fpSIN_I_INIT, fpCOS_I_INIT, + /* 0x16 */ fpATAN_I_INIT, fpLN_I_INIT, /* 0x18 */ fpEXP_I_INIT }; static const struct regm_builtin_s g_rgIrFopBuiltIns[MAX_FOP] = { /* 0x00 */ ILLEGAL_BUILTIN_INIT, fpFLOAT_INIT, - /* 0x02 */ fpTRUNC_INIT, fpROUND_INIT, - /* 0x04 */ fpADD_IR_INIT, fpSUB_IR_INIT, - /* 0x06 */ fpMUL_IR_INIT, fpDIV_IR_INIT, + /* 0x02 */ fpTRUNC_INIT, fpROUND_INIT, + /* 0x04 */ fpADD_IR_INIT, fpSUB_IR_INIT, + /* 0x06 */ fpMUL_IR_INIT, fpDIV_IR_INIT, /* 0x00 */ fpMOD_IR_INIT, ILLEGAL_BUILTIN_INIT, - /* 0x0a */ fpEQU_IR_INIT, fpNEQ_IR_INIT, - /* 0x0c */ fpLT_IR_INIT, fpGTE_IR_INIT, - /* 0x0e */ fpGT_IR_INIT, fpLTE_IR_INIT, - /* 0x10 */ fpNEG_R_INIT, fpABS_R_INIT, - /* 0x12 */ fpSQR_R_INIT, fpSQRT_R_INIT, - /* 0x14 */ fpSIN_R_INIT, fpCOS_R_INIT, - /* 0x16 */ fpATAN_R_INIT, fpLN_R_INIT, + /* 0x0a */ fpEQU_IR_INIT, fpNEQ_IR_INIT, + /* 0x0c */ fpLT_IR_INIT, fpGTE_IR_INIT, + /* 0x0e */ fpGT_IR_INIT, fpLTE_IR_INIT, + /* 0x10 */ fpNEG_R_INIT, fpABS_R_INIT, + /* 0x12 */ fpSQR_R_INIT, fpSQRT_R_INIT, + /* 0x14 */ fpSIN_R_INIT, fpCOS_R_INIT, + /* 0x16 */ fpATAN_R_INIT, fpLN_R_INIT, /* 0x18 */ fpEXP_R_INIT }; static const struct regm_builtin_s g_rgIiFopBuiltIns[MAX_FOP] = { /* 0x00 */ ILLEGAL_BUILTIN_INIT, fpFLOAT_INIT, - /* 0x02 */ fpTRUNC_INIT, fpROUND_INIT, - /* 0x04 */ fpADD_II_INIT, fpSUB_II_INIT, - /* 0x06 */ fpMUL_II_INIT, fpDIV_II_INIT, + /* 0x02 */ fpTRUNC_INIT, fpROUND_INIT, + /* 0x04 */ fpADD_II_INIT, fpSUB_II_INIT, + /* 0x06 */ fpMUL_II_INIT, fpDIV_II_INIT, /* 0x00 */ fpMOD_II_INIT, ILLEGAL_BUILTIN_INIT, - /* 0x0a */ fpEQU_II_INIT, fpNEQ_II_INIT, - /* 0x0c */ fpLT_II_INIT, fpGTE_II_INIT, - /* 0x0e */ fpGT_II_INIT, fpLTE_II_INIT, - /* 0x10 */ fpNEG_I_INIT, fpABS_I_INIT, - /* 0x12 */ fpSQR_I_INIT, fpSQRT_I_INIT, - /* 0x14 */ fpSIN_I_INIT, fpCOS_I_INIT, - /* 0x16 */ fpATAN_I_INIT, fpLN_I_INIT, + /* 0x0a */ fpEQU_II_INIT, fpNEQ_II_INIT, + /* 0x0c */ fpLT_II_INIT, fpGTE_II_INIT, + /* 0x0e */ fpGT_II_INIT, fpLTE_II_INIT, + /* 0x10 */ fpNEG_I_INIT, fpABS_I_INIT, + /* 0x12 */ fpSQR_I_INIT, fpSQRT_I_INIT, + /* 0x14 */ fpSIN_I_INIT, fpCOS_I_INIT, + /* 0x16 */ fpATAN_I_INIT, fpLN_I_INIT, /* 0x18 */ fpEXP_I_INIT }; @@ -530,7 +530,7 @@ static void regm_BinaryOperation(const struct regm_opmap_s *pEntry, /* Generate the binary operation */ regm_GenerateForm3R(pEntry->chOpCode, dwRDest, dwROperand1, dwROperand2); - + /* Reduce stack */ g_dwStackOffset -= sINT_SIZE; @@ -608,7 +608,7 @@ static void regm_BinaryComparison(const struct regm_opmap_s *pEntry, regm_GenerateForm2I(rMOVI, dwRDest, 0); regm_GenerateForm4ICc(pEntry->chOpCode, 2, dwCcRegister); regm_GenerateForm2I(rMOVI, dwRDest, 1); - + /* Reduce stack */ g_dwStackOffset -= sINT_SIZE; @@ -699,7 +699,7 @@ static void regm_StoreImmediate(const struct regm_opmap_s *pEntry, regm_GenerateForm3R(pEntry->chOpCode, dwRSrc, dwROperand1, MKSPECIAL(pEntry->chSpecial)); - + /* Reduce stack */ g_dwStackOffset -= 2*sINT_SIZE; @@ -838,7 +838,7 @@ static void regm_PopSpecial(const struct regm_opmap_s *pEntry, /***********************************************************************/ /* Save the immediate value in the data count register */ -static void regm_SetDataCount(const struct regm_opmap_s *pEntry, +static void regm_SetDataCount(const struct regm_opmap_s *pEntry, OPTYPE *pOpCode, struct procdata_s *pNode) { @@ -878,7 +878,7 @@ static void regm_LoadOffset(const struct regm_opmap_s *pEntry, regm_GenerateForm3I(pEntry->chOpCode, dwRDest, MKSPECIAL(pEntry->chSpecial), GETARG(pOpCode) >> pEntry->chImmediate); - + /* Increment the stack */ g_dwStackOffset += sINT_SIZE; @@ -919,7 +919,7 @@ static void regm_StoreOffset(const struct regm_opmap_s *pEntry, regm_GenerateForm3I(pEntry->chOpCode, dwRSrc, MKSPECIAL(pEntry->chSpecial), GETARG(pOpCode) >> pEntry->chImmediate); - + /* Decrement the stack */ g_dwStackOffset -= sINT_SIZE; @@ -1098,7 +1098,7 @@ static void regm_ConditionalBranchBinary(const struct regm_opmap_s *pEntry, regm_GenerateForm1RCc(rCMP, dwROperand1, dwROperand2, dwCcRegister); regm_GenerateForm4ICc(pEntry->chOpCode, GETARG(pOpCode), dwCcRegister); - + /* Reduce stack */ g_dwStackOffset -= 2*sINT_SIZE; @@ -1160,7 +1160,7 @@ static void regm_LoadAddress(const struct regm_opmap_s *pEntry, regm_GenerateForm3I(rADD, dwRDest, MKSPECIAL(pEntry->chSpecial), GETARG(pOpCode)); - + /* Increment the stack */ g_dwStackOffset += sINT_SIZE; @@ -1201,7 +1201,7 @@ static void regm_SetupOutArgs(uint32_t nParms, const uint32_t *pwArgSize) } /* Emit move instructions to handle each */ - + dwOffset = g_dwStackOffset - sINT_SIZE; for (i = 0; i < nArgRegs; i++) { @@ -1427,7 +1427,7 @@ static void regm_GenerateRegm(struct procdata_s *pNode, void *pvArg) uint8_t chOpCode = GETOP(&pNode->pPCode[i]); /* Select the right decode table */ - + if ((chOpCode & o32) != 0) { rgOpMap = vrgOpMap2; @@ -1450,7 +1450,7 @@ static void regm_GenerateRegm(struct procdata_s *pNode, void *pvArg) rgOpMap->pMapper(rgOpMap, &pNode->pPCode[i], pNode); } - /* If a frame was obtained at the beginning, make sure that + /* If a frame was obtained at the beginning, make sure that * there is matching frame release logic at the end. */ @@ -1463,7 +1463,7 @@ static void regm_GenerateRegm(struct procdata_s *pNode, void *pvArg) } i++; } - + /* Analyze the proc/func epilogue */ if ((GETOP(&pNode->pPCode[i]) != oRET) && diff --git a/misc/pascal/libpas/Make.defs b/misc/pascal/libpas/Make.defs index 2a0fbed8c..436dce569 100644 --- a/misc/pascal/libpas/Make.defs +++ b/misc/pascal/libpas/Make.defs @@ -34,5 +34,5 @@ # ############################################################################ -PAS_ASRCS = +PAS_ASRCS = PAS_CSRCS = psignextend16.c pswap.c diff --git a/misc/pascal/libpoff/Make.defs b/misc/pascal/libpoff/Make.defs index 41f0a63f0..f7ce4236a 100644 --- a/misc/pascal/libpoff/Make.defs +++ b/misc/pascal/libpoff/Make.defs @@ -34,7 +34,7 @@ # ############################################################################ -POFF_ASRCS = +POFF_ASRCS = POFF_CSRCS = pfhandle.c pfproghandle.c pftprog.c \ pfsymhandle.c pftsymbol.c pofferr.c \ pfwhdr.c pfwrodata.c pfwsymbol.c pfwfname.c \ diff --git a/misc/pascal/libpoff/pflabel.c b/misc/pascal/libpoff/pflabel.c index 973366466..a124051e3 100644 --- a/misc/pascal/libpoff/pflabel.c +++ b/misc/pascal/libpoff/pflabel.c @@ -128,7 +128,7 @@ static void poffCheckDefinedLabelRealloc(void) { /* Check if there is room for the new data */ - if (((nDefinedLabelRefs + 1)*sizeof(optDefinedLabelRef_t)) > + if (((nDefinedLabelRefs + 1)*sizeof(optDefinedLabelRef_t)) > definedLabelRefAlloc) { uint32_t newAlloc = definedLabelRefAlloc + DEFINED_INCREMENT; diff --git a/misc/pascal/libpoff/pflineno.c b/misc/pascal/libpoff/pflineno.c index 983a74554..ea682f891 100644 --- a/misc/pascal/libpoff/pflineno.c +++ b/misc/pascal/libpoff/pflineno.c @@ -277,7 +277,7 @@ poffLibLineNumber_t *poffFindLineNumber(uint32_t offset) * for offset, then we can safely set the upper search index * to the midpoint. */ - + if (lineNumberTable[lineNumberIndex].offset > offset) lastLineNumberIndex = lineNumberIndex; diff --git a/misc/pascal/pascal/pas.c b/misc/pascal/pascal/pas.c index b0975c42f..c80002a2c 100644 --- a/misc/pascal/pascal/pas.c +++ b/misc/pascal/pascal/pas.c @@ -203,7 +203,7 @@ static void openOutputFiles(void) { fprintf(stderr, "Could not open output file '%s': %s\n", tmpname, strerror(errno)); - showUsage(); + showUsage(); } } } @@ -266,7 +266,7 @@ static void parseArguments(int argc, char **argv) if (argc < 2) { fprintf(stderr, "Invalid number of arguments\n"); - showUsage(); + showUsage(); } /* Parse any optional command line arguments */ @@ -282,7 +282,7 @@ static void parseArguments(int argc, char **argv) if (nIncPathes >= MAX_INCPATHES) { fprintf(stderr, "Unrecognized [option]\n"); - showUsage(); + showUsage(); } else { @@ -292,13 +292,13 @@ static void parseArguments(int argc, char **argv) break; default: fprintf(stderr, "Unrecognized [option]\n"); - showUsage(); + showUsage(); } } else { fprintf(stderr, "Unrecognized [option]\n"); - showUsage(); + showUsage(); } } @@ -338,9 +338,9 @@ int main(int argc, char *argv[]) { errmsg("Could not open source file '%s': %s\n", filename, strerror(errno)); - showUsage(); + showUsage(); } - + /* Initialization */ primeSignalHandlers(); @@ -387,7 +387,7 @@ int main(int argc, char *argv[]) getToken(); if (token == tPROGRAM) - { + { /* Compile a pascal program */ FP->kind = eIsProgram; diff --git a/misc/pascal/pascal/pasdefs.h b/misc/pascal/pascal/pasdefs.h index ade1b7ed0..95d9acf01 100644 --- a/misc/pascal/pascal/pasdefs.h +++ b/misc/pascal/pascal/pasdefs.h @@ -76,7 +76,7 @@ ***********************************************************************/ /* This enumeration identies what kind of binary object we are creating - * with the compilation. At present, we may be generating either a + * with the compilation. At present, we may be generating either a * program binary or a unit binary. */ diff --git a/misc/pascal/pascal/pblck.c b/misc/pascal/pascal/pblck.c index b32701cc7..87f3304b6 100644 --- a/misc/pascal/pascal/pblck.c +++ b/misc/pascal/pascal/pblck.c @@ -107,7 +107,7 @@ static bool pas_IntAlignRequired (STYPE *typePtr); ***************************************************************/ static int32_t g_nParms; -static int32_t g_dwVarSize; +static int32_t g_dwVarSize; /*************************************************************** * Public Functions @@ -190,7 +190,7 @@ void block() pas_GenerateDataOperation(opLABEL, (int32_t)beginLabel); /* Since we don't know for certain how we got here, invalidate - * the level stack pointer (LSP). This is, of course, only + * the level stack pointer (LSP). This is, of course, only * meaningful on architectures that implement an LSP. */ @@ -318,7 +318,7 @@ void declarationGroup(int32_t beginLabel) variableDeclarationGroup(); } - /* Process procedure/function-declaration(s) if present + /* Process procedure/function-declaration(s) if present * FORM: function-declaration = * function-heading ';' directive | * function-heading ';' function-block @@ -531,7 +531,7 @@ int16_t formalParameterList(STYPE *procPtr) { pointerType = 1; getToken(); - } + } else pointerType = 0; /* Process the common part of the variable-parameter-specification @@ -833,7 +833,7 @@ static STYPE *pas_DeclareVar(void) /* IMPORT the symbol; assign an offset relative to * the dstack at the beginning of this file */ - + pas_GenerateStackImport(varPtr); } else /* if (FP0->kind == eIsProgram) */ @@ -844,7 +844,7 @@ static STYPE *pas_DeclareVar(void) } } - /* In any event, bump the stack offset to include space for + /* In any event, bump the stack offset to include space for * this new symbol. The 'bumped' stack offset will be the * offset for the next variable that is declared. */ @@ -1564,7 +1564,7 @@ static STYPE *pas_NewComplexType(char *typeName) else typeIdPtr = pas_DeclareOrdinalType(NULL); - /* Verify that the ordinal-type is either a scalar or a + /* Verify that the ordinal-type is either a scalar or a * subrange type. These are the only valid types for 'set of' */ @@ -1605,7 +1605,7 @@ static STYPE *pas_NewComplexType(char *typeName) else error(eSET); break; - + /* File Types * FORM: file-type = 'file' 'of' type-denoter */ @@ -1858,7 +1858,7 @@ static STYPE *pas_DeclareRecord(char *recordName) recordOffset += recordPtr[symbolIndex].sParm.r.size; recordCount++; } - } + } /* Update the RECORD entry for the total size of all fields */ @@ -1883,7 +1883,7 @@ static STYPE *pas_DeclareRecord(char *recordName) if (token != tIDENT) error(eRECORDDECLARE); - /* Add a variant-selector to the fixed-part of the record */ + /* Add a variant-selector to the fixed-part of the record */ else { @@ -2088,7 +2088,7 @@ static STYPE *pas_DeclareRecord(char *recordName) if (recordOffset > maxRecordSize) maxRecordSize = recordOffset; - } + } /* Verify that the <field list> is enclosed in parentheses */ @@ -2175,7 +2175,7 @@ static STYPE *pas_DeclareField(STYPE *recordPtr) return typePtr; } - + /***************************************************************/ /* Process VAR/value Parameter Declaration */ /* NOTE: This function increments the global variable g_nParms */ diff --git a/misc/pascal/pascal/pcexpr.c b/misc/pascal/pascal/pcexpr.c index c14b6b1ee..2247e2bcf 100644 --- a/misc/pascal/pascal/pcexpr.c +++ b/misc/pascal/pascal/pcexpr.c @@ -441,7 +441,7 @@ void constantTerm(void) { constantReal = (double)constantInt; } - + /* Handle the case where the 1st argument is Integer and the * second is REAL. */ @@ -573,4 +573,4 @@ static void constantFactor(void) error(eINVFACTOR); break; } -} +} diff --git a/misc/pascal/pascal/pcfunc.c b/misc/pascal/pascal/pcfunc.c index c4188ca2b..a07f0e623 100644 --- a/misc/pascal/pascal/pcfunc.c +++ b/misc/pascal/pascal/pcfunc.c @@ -107,7 +107,7 @@ void builtInFunctionOfConstant(void) case txROUND : constantReal2IntFunc(fpROUND); - break; + break; case txTRUNC : constantReal2IntFunc(fpTRUNC); break; diff --git a/misc/pascal/pascal/pexpr.c b/misc/pascal/pascal/pexpr.c index 855e519f3..5f9fe0b10 100644 --- a/misc/pascal/pascal/pexpr.c +++ b/misc/pascal/pascal/pexpr.c @@ -112,7 +112,7 @@ static bool isStringReference (exprType testExprType); /* The abstract types - SETs, RECORDS, etc - require an exact */ /* match in type. This variable points to the symbol table */ /* sTYPE entry associated with the expression. */ - + static STYPE *abstractType; /***************************************************************/ @@ -178,14 +178,14 @@ exprType expression(exprType findExprType, STYPE *typePtr) break; case tIN : if ((!abstractType) || - ((abstractType->sParm.t.type != sSCALAR) && - (abstractType->sParm.t.type != sSUBRANGE))) - error(eEXPRTYPE); + ((abstractType->sParm.t.type != sSCALAR) && + (abstractType->sParm.t.type != sSUBRANGE))) + error(eEXPRTYPE); else if (abstractType->sParm.t.minValue) - { - pas_GenerateDataOperation(opPUSH, abstractType->sParm.t.minValue); - pas_GenerateSimple(opSUB); - } /* end else if */ + { + pas_GenerateDataOperation(opPUSH, abstractType->sParm.t.minValue); + pas_GenerateSimple(opSUB); + } /* end else if */ intOpCode = opBIT; fpOpCode = fpINVLD; strOpCode = opNOP; @@ -207,67 +207,67 @@ exprType expression(exprType findExprType, STYPE *typePtr) simple2Type = simpleExpression(findExprType); /* Perform automatic type conversion from INTEGER to REAL - * for integer vs. real comparisons. - */ + * for integer vs. real comparisons. + */ if (simple1Type != simple2Type) - { - /* Handle the case where the 1st argument is REAL and the - * second is INTEGER. */ - - if ((simple1Type == exprReal) && - (simple2Type == exprInteger) && - (fpOpCode != fpINVLD)) - { - fpOpCode |= fpARG2; - simple2Type = exprReal; - } /* end if */ - - /* Handle the case where the 1st argument is Integer and the - * second is REAL. */ - - else if ((simple1Type == exprInteger) && - (simple2Type == exprReal) && - (fpOpCode != fpINVLD)) - { - fpOpCode |= fpARG1; - simple1Type = exprReal; - } /* end else if */ - - /* Allow the case of <scalar type> IN <set type> */ - /* Otherwise, the two terms must agree in type */ - - else if ((operation != tIN) || (simple2Type != exprSet)) - { - error(eEXPRTYPE); - } - } /* end if */ + { + /* Handle the case where the 1st argument is REAL and the + * second is INTEGER. */ + + if ((simple1Type == exprReal) && + (simple2Type == exprInteger) && + (fpOpCode != fpINVLD)) + { + fpOpCode |= fpARG2; + simple2Type = exprReal; + } /* end if */ + + /* Handle the case where the 1st argument is Integer and the + * second is REAL. */ + + else if ((simple1Type == exprInteger) && + (simple2Type == exprReal) && + (fpOpCode != fpINVLD)) + { + fpOpCode |= fpARG1; + simple1Type = exprReal; + } /* end else if */ + + /* Allow the case of <scalar type> IN <set type> */ + /* Otherwise, the two terms must agree in type */ + + else if ((operation != tIN) || (simple2Type != exprSet)) + { + error(eEXPRTYPE); + } + } /* end if */ /* Generate the comparison */ if (simple1Type == exprReal) - { - if (fpOpCode == fpINVLD) - error(eEXPRTYPE); - else - pas_GenerateFpOperation(fpOpCode); - } /* end if */ + { + if (fpOpCode == fpINVLD) + error(eEXPRTYPE); + else + pas_GenerateFpOperation(fpOpCode); + } /* end if */ else if ((simple1Type == exprString) || (simple1Type == exprString)) - { - if (strOpCode != opNOP) - { - pas_BuiltInFunctionCall(lbSTRCMP); - pas_GenerateSimple(strOpCode); - } - else - { - error(eEXPRTYPE); - } - } + { + if (strOpCode != opNOP) + { + pas_BuiltInFunctionCall(lbSTRCMP); + pas_GenerateSimple(strOpCode); + } + else + { + error(eEXPRTYPE); + } + } else - { - pas_GenerateSimple(intOpCode); - } + { + pas_GenerateSimple(intOpCode); + } /* The type resulting from these operations becomes BOOLEAN */ @@ -312,28 +312,28 @@ exprType expression(exprType findExprType, STYPE *typePtr) (findExprType != simple1Type) && /* 2)NOT Matched expression */ ((findExprType != exprAnyOrdinal) || /* 3)NOT any ordinal type */ - (!isOrdinalType(simple1Type))) && /* OR type is not ordinal */ + (!isOrdinalType(simple1Type))) && /* OR type is not ordinal */ ((findExprType != exprAnyString) || /* 4)NOT any string type */ - (!isAnyStringType(simple1Type))) && /* OR type is not string */ + (!isAnyStringType(simple1Type))) && /* OR type is not string */ ((findExprType != exprString) || /* 5)Not looking for string ref */ - (!isStringReference(simple1Type)))) /* OR type is not string ref */ + (!isStringReference(simple1Type)))) /* OR type is not string ref */ { /* Automatic conversions from INTEGER to REAL will be performed */ if ((findExprType == exprReal) && (simple1Type == exprInteger)) - { - pas_GenerateFpOperation(fpFLOAT); - simple1Type = exprReal; - } + { + pas_GenerateFpOperation(fpFLOAT); + simple1Type = exprReal; + } /* Any other type mismatch is an error */ else - { - error(eEXPRTYPE); - } + { + error(eEXPRTYPE); + } } /* end if */ return simple1Type; @@ -367,7 +367,7 @@ exprType varParm (exprType varExprType, STYPE *typePtr) return factorType; } /* end varParm */ - + /**********************************************************************/ /* Process Array Index */ void arrayIndex (int32_t size) @@ -386,7 +386,7 @@ void arrayIndex (int32_t size) /* Correct for size of array element */ if (size > 1) { - pas_GenerateDataOperation(opPUSH, size); + pas_GenerateDataOperation(opPUSH, size); pas_GenerateSimple(opMUL); } /* end if */ @@ -411,74 +411,74 @@ exprType getExprType(STYPE *sType) if ((sType) && (sType->sKind == sTYPE)) { switch (sType->sParm.t.type) - { - case sINT : - factorType = exprInteger; - break; - case sBOOLEAN : - factorType = exprBoolean; - break; - case sCHAR : - factorType = exprChar; - break; - case sREAL : - factorType = exprReal; - break; - case sSCALAR : - factorType = exprScalar; - break; - case sSTRING : - case sRSTRING : - factorType = exprString; - break; - case sSUBRANGE : - switch (sType->sParm.t.subType) - { - case sINT : - factorType = exprInteger; - break; - case sCHAR : - factorType = exprChar; - break; - case sSCALAR : - factorType = exprScalar; - break; - default : - error(eSUBRANGETYPE); - break; - } /* end switch */ - break; - case sPOINTER : - sType = sType->sParm.t.parent; - if (sType) - { - switch (sType->sKind) - { - case sINT : - factorType = exprIntegerPtr; - break; - case sBOOLEAN : - factorType = exprBooleanPtr; - break; - case sCHAR : - factorType = exprCharPtr; - break; - case sREAL : - factorType = exprRealPtr; - break; - case sSCALAR : - factorType = exprScalarPtr; - break; - default : - error(eINVTYPE); - break; - } /* end switch */ - } /* end if */ - break; - default : - error(eINVTYPE); - break; - } /* end switch */ + { + case sINT : + factorType = exprInteger; + break; + case sBOOLEAN : + factorType = exprBoolean; + break; + case sCHAR : + factorType = exprChar; + break; + case sREAL : + factorType = exprReal; + break; + case sSCALAR : + factorType = exprScalar; + break; + case sSTRING : + case sRSTRING : + factorType = exprString; + break; + case sSUBRANGE : + switch (sType->sParm.t.subType) + { + case sINT : + factorType = exprInteger; + break; + case sCHAR : + factorType = exprChar; + break; + case sSCALAR : + factorType = exprScalar; + break; + default : + error(eSUBRANGETYPE); + break; + } /* end switch */ + break; + case sPOINTER : + sType = sType->sParm.t.parent; + if (sType) + { + switch (sType->sKind) + { + case sINT : + factorType = exprIntegerPtr; + break; + case sBOOLEAN : + factorType = exprBooleanPtr; + break; + case sCHAR : + factorType = exprCharPtr; + break; + case sREAL : + factorType = exprRealPtr; + break; + case sSCALAR : + factorType = exprScalarPtr; + break; + default : + error(eINVTYPE); + break; + } /* end switch */ + } /* end if */ + break; + default : + error(eINVTYPE); + break; + } /* end switch */ } /* end if */ return factorType; @@ -512,11 +512,11 @@ static exprType simpleExpression(exprType findExprType) if (operation == '-') { if (term1Type == exprInteger) - pas_GenerateSimple(opNEG); + pas_GenerateSimple(opNEG); else if (term1Type == exprReal) - pas_GenerateFpOperation(fpNEG); + pas_GenerateFpOperation(fpNEG); else - error(eTERMTYPE); + error(eTERMTYPE); } /* end if */ /* Process subsequent (optional) terms and binary operations */ @@ -526,41 +526,41 @@ static exprType simpleExpression(exprType findExprType) /* Check for binary operator */ if ((token == '+') || (token == '-') || (token == tOR)) - operation = token; + operation = token; else - break; + break; /* Special case for string types. So far, we have parsed - * '<string> +' At this point, it is safe to assume we - * going to modified string. So, if the string has not - * been copied to the string stack, we will have to do that - * now. - */ + * '<string> +' At this point, it is safe to assume we + * going to modified string. So, if the string has not + * been copied to the string stack, we will have to do that + * now. + */ if ((term1Type == exprString) && (operation == '+')) - { - /* Duplicate the string on the string stack. And - * change the expression type to reflect this. - */ + { + /* Duplicate the string on the string stack. And + * change the expression type to reflect this. + */ - pas_BuiltInFunctionCall(lbMKSTKSTR); - term1Type = exprStkString; - } + pas_BuiltInFunctionCall(lbMKSTKSTR); + term1Type = exprStkString; + } /* If we are going to add something to a char, then the - * result must be a string. We will similarly have to - * convert the character to a string. - */ + * result must be a string. We will similarly have to + * convert the character to a string. + */ else if ((term1Type == exprChar) && (operation == '+')) - { - /* Duplicate the string on the string stack. And - * change the expression type to reflect this. - */ + { + /* Duplicate the string on the string stack. And + * change the expression type to reflect this. + */ - pas_BuiltInFunctionCall(lbMKSTKC); - term1Type = exprStkString; - } + pas_BuiltInFunctionCall(lbMKSTKC); + term1Type = exprStkString; + } /* Get the 2nd term */ @@ -568,153 +568,153 @@ static exprType simpleExpression(exprType findExprType) term2Type = term(findExprType); /* Before generating the operation, verify that the types match. - * Perform automatic type conversion from INTEGER to REAL as - * necessary. - */ + * Perform automatic type conversion from INTEGER to REAL as + * necessary. + */ arg8FpBits = 0; /* Skip over string types. These will be handled below */ if (!isStringReference(term1Type)) - { - /* Handle the case where the type of the terms differ. */ - - if (term1Type != term2Type) - { - /* Handle the case where the 1st argument is REAL and the - * second is INTEGER. */ - - if ((term1Type == exprReal) && (term2Type == exprInteger)) - { - arg8FpBits = fpARG2; - term2Type = exprReal; - } /* end if */ - - /* Handle the case where the 1st argument is Integer and the - * second is REAL. */ - - else if ((term1Type == exprInteger) && (term2Type == exprReal)) - { - arg8FpBits = fpARG1; - term1Type = exprReal; - } /* end if */ - - /* Otherwise, the two terms must agree in type */ - - else - { - error(eTERMTYPE); - } - } /* end if */ - - /* We do not perform conversions for the cases where the two - * terms agree in type. There is only one interesting case: - * When the expected expression is real and both arguments are - * integer. Since addition an subtraction are exact, it would, - * in general, be more efficient to perform the conversion - * AFTER the operation (at the the risk of possible overflow - * conditions due to the limited range of integers). - */ - } + { + /* Handle the case where the type of the terms differ. */ + + if (term1Type != term2Type) + { + /* Handle the case where the 1st argument is REAL and the + * second is INTEGER. */ + + if ((term1Type == exprReal) && (term2Type == exprInteger)) + { + arg8FpBits = fpARG2; + term2Type = exprReal; + } /* end if */ + + /* Handle the case where the 1st argument is Integer and the + * second is REAL. */ + + else if ((term1Type == exprInteger) && (term2Type == exprReal)) + { + arg8FpBits = fpARG1; + term1Type = exprReal; + } /* end if */ + + /* Otherwise, the two terms must agree in type */ + + else + { + error(eTERMTYPE); + } + } /* end if */ + + /* We do not perform conversions for the cases where the two + * terms agree in type. There is only one interesting case: + * When the expected expression is real and both arguments are + * integer. Since addition an subtraction are exact, it would, + * in general, be more efficient to perform the conversion + * AFTER the operation (at the the risk of possible overflow + * conditions due to the limited range of integers). + */ + } /* Generate code to perform the selected binary operation */ switch (operation) - { - case '+' : - switch (term1Type) - { - /* Integer addition */ - - case exprInteger : - pas_GenerateSimple(opADD); - break; - - /* Floating point addition */ - - case exprReal : - pas_GenerateFpOperation(fpADD | arg8FpBits); - break; - - /* Set 'addition' */ - - case exprSet : - pas_GenerateSimple(opOR); - break; - - /* Handle the special cases where '+' indicates that we are - * concatenating a string or a character to the end of a - * string. Note that these operations can only be performed - * on stack copies of the strings. Logic above should have - * made the conversion for the case of exprString. - */ - - case exprStkString : - if ((term2Type == exprString) || (term2Type == exprStkString)) - { - /* We are concatenating one string with another.*/ - - pas_BuiltInFunctionCall(lbSTRCAT); - } - else if (term2Type == exprChar) - { - /* We are concatenating a character to the end of a string */ - - pas_BuiltInFunctionCall(lbSTRCATC); - } - else - { - error(eTERMTYPE); - } - break; - - /* Otherwise, the '+' operation is not permitted */ - - default : - error(eTERMTYPE); - break; - } - break; - - case '-' : - /* Integer subtraction */ - - if (term1Type == exprInteger) - pas_GenerateSimple(opSUB); - - /* Floating point subtraction */ - - else if (term1Type == exprReal) - pas_GenerateFpOperation(fpSUB | arg8FpBits); - - /* Set 'subtraction' */ - - else if (term1Type == exprSet) - { - pas_GenerateSimple(opNOT); - pas_GenerateSimple(opAND); - } /* end else if */ + { + case '+' : + switch (term1Type) + { + /* Integer addition */ + + case exprInteger : + pas_GenerateSimple(opADD); + break; + + /* Floating point addition */ + + case exprReal : + pas_GenerateFpOperation(fpADD | arg8FpBits); + break; + + /* Set 'addition' */ + + case exprSet : + pas_GenerateSimple(opOR); + break; + + /* Handle the special cases where '+' indicates that we are + * concatenating a string or a character to the end of a + * string. Note that these operations can only be performed + * on stack copies of the strings. Logic above should have + * made the conversion for the case of exprString. + */ + + case exprStkString : + if ((term2Type == exprString) || (term2Type == exprStkString)) + { + /* We are concatenating one string with another.*/ + + pas_BuiltInFunctionCall(lbSTRCAT); + } + else if (term2Type == exprChar) + { + /* We are concatenating a character to the end of a string */ + + pas_BuiltInFunctionCall(lbSTRCATC); + } + else + { + error(eTERMTYPE); + } + break; + + /* Otherwise, the '+' operation is not permitted */ + + default : + error(eTERMTYPE); + break; + } + break; + + case '-' : + /* Integer subtraction */ + + if (term1Type == exprInteger) + pas_GenerateSimple(opSUB); + + /* Floating point subtraction */ + + else if (term1Type == exprReal) + pas_GenerateFpOperation(fpSUB | arg8FpBits); + + /* Set 'subtraction' */ + + else if (term1Type == exprSet) + { + pas_GenerateSimple(opNOT); + pas_GenerateSimple(opAND); + } /* end else if */ - /* Otherwise, the '-' operation is not permitted */ + /* Otherwise, the '-' operation is not permitted */ - else - error(eTERMTYPE); - break; + else + error(eTERMTYPE); + break; - case tOR : - /* Integer/boolean 'OR' */ + case tOR : + /* Integer/boolean 'OR' */ - if ((term1Type == exprInteger) || (term1Type == exprBoolean)) - pas_GenerateSimple(opOR); + if ((term1Type == exprInteger) || (term1Type == exprBoolean)) + pas_GenerateSimple(opOR); - /* Otherwise, the 'OR' operation is not permitted */ + /* Otherwise, the 'OR' operation is not permitted */ - else - error(eTERMTYPE); - break; + else + error(eTERMTYPE); + break; - } /* end switch */ + } /* end switch */ } /* end for */ return term1Type; @@ -741,9 +741,9 @@ static exprType term(exprType findExprType) /* Check for binary operator */ if ((token == tMUL) || (token == tDIV) || - (token == tFDIV) || (token == tMOD) || - (token == tAND) || (token == tSHL) || - (token == tSHR)) + (token == tFDIV) || (token == tMOD) || + (token == tAND) || (token == tSHL) || + (token == tSHR)) operation = token; else break; @@ -764,29 +764,29 @@ static exprType term(exprType findExprType) if (factor1Type != factor2Type) { - /* Handle the case where the 1st argument is REAL and the - * second is INTEGER. */ - - if ((factor1Type == exprReal) && (factor2Type == exprInteger)) - { - arg8FpBits = fpARG2; - } /* end if */ - - /* Handle the case where the 1st argument is Integer and the - * second is REAL. */ - - else if ((factor1Type == exprInteger) && (factor2Type == exprReal)) - { - arg8FpBits = fpARG1; - factor1Type = exprReal; - } /* end if */ - - /* Otherwise, the two factors must agree in type */ - - else - { - error(eFACTORTYPE); - } + /* Handle the case where the 1st argument is REAL and the + * second is INTEGER. */ + + if ((factor1Type == exprReal) && (factor2Type == exprInteger)) + { + arg8FpBits = fpARG2; + } /* end if */ + + /* Handle the case where the 1st argument is Integer and the + * second is REAL. */ + + else if ((factor1Type == exprInteger) && (factor2Type == exprReal)) + { + arg8FpBits = fpARG1; + factor1Type = exprReal; + } /* end if */ + + /* Otherwise, the two factors must agree in type */ + + else + { + error(eFACTORTYPE); + } } /* end if */ /* Handle the cases for conversions when the two string @@ -795,35 +795,35 @@ static exprType term(exprType findExprType) else { - /* There is only one interesting case: When the - * expected expression is real and both arguments are - * integer. In this case, for example, 1/2 must yield - * 0.5, not 0. - */ - - if ((factor1Type == exprInteger) && (findExprType == exprReal)) - { - /* However, we will perform this conversin only for the - * arithmetic operations: tMUL, tDIV/tFDIV, and tMOD. - * The logical operations must be performed on integer - * types with the result converted to a real type afterward. - */ - - if ((operation == tMUL) || (operation == tDIV) || - (operation == tFDIV) || (operation == tMOD)) - { - /* Perform the conversion of both terms */ - - arg8FpBits = fpARG1 | fpARG2; - factor1Type = exprReal; - - /* We will also have to switch the operation in - * the case of tDIV: We'll have to used tFDIV. - */ - - if (operation == tDIV) operation = tFDIV; - } - } + /* There is only one interesting case: When the + * expected expression is real and both arguments are + * integer. In this case, for example, 1/2 must yield + * 0.5, not 0. + */ + + if ((factor1Type == exprInteger) && (findExprType == exprReal)) + { + /* However, we will perform this conversin only for the + * arithmetic operations: tMUL, tDIV/tFDIV, and tMOD. + * The logical operations must be performed on integer + * types with the result converted to a real type afterward. + */ + + if ((operation == tMUL) || (operation == tDIV) || + (operation == tFDIV) || (operation == tMOD)) + { + /* Perform the conversion of both terms */ + + arg8FpBits = fpARG1 | fpARG2; + factor1Type = exprReal; + + /* We will also have to switch the operation in + * the case of tDIV: We'll have to used tFDIV. + */ + + if (operation == tDIV) operation = tFDIV; + } + } } /* Generate code to perform the selected binary operation */ @@ -831,59 +831,59 @@ static exprType term(exprType findExprType) switch (operation) { case tMUL : - if (factor1Type == exprInteger) - pas_GenerateSimple(opMUL); - else if (factor1Type == exprReal) - pas_GenerateFpOperation(fpMUL | arg8FpBits); - else if (factor1Type == exprSet) - pas_GenerateSimple(opAND); + if (factor1Type == exprInteger) + pas_GenerateSimple(opMUL); + else if (factor1Type == exprReal) + pas_GenerateFpOperation(fpMUL | arg8FpBits); + else if (factor1Type == exprSet) + pas_GenerateSimple(opAND); else - error(eFACTORTYPE); + error(eFACTORTYPE); break; case tDIV : - if (factor1Type == exprInteger) - pas_GenerateSimple(opDIV); + if (factor1Type == exprInteger) + pas_GenerateSimple(opDIV); else - error(eFACTORTYPE); - break; + error(eFACTORTYPE); + break; case tFDIV : - if (factor1Type == exprReal) - pas_GenerateFpOperation(fpDIV | arg8FpBits); - else - error(eFACTORTYPE); + if (factor1Type == exprReal) + pas_GenerateFpOperation(fpDIV | arg8FpBits); + else + error(eFACTORTYPE); break; case tMOD : - if (factor1Type == exprInteger) - pas_GenerateSimple(opMOD); - else if (factor1Type == exprReal) - pas_GenerateFpOperation(fpMOD | arg8FpBits); - else - error(eFACTORTYPE); + if (factor1Type == exprInteger) + pas_GenerateSimple(opMOD); + else if (factor1Type == exprReal) + pas_GenerateFpOperation(fpMOD | arg8FpBits); + else + error(eFACTORTYPE); break; case tAND : - if ((factor1Type == exprInteger) || (factor1Type == exprBoolean)) - pas_GenerateSimple(opAND); + if ((factor1Type == exprInteger) || (factor1Type == exprBoolean)) + pas_GenerateSimple(opAND); else - error(eFACTORTYPE); + error(eFACTORTYPE); break; case tSHL : - if (factor1Type == exprInteger) - pas_GenerateSimple(opSLL); + if (factor1Type == exprInteger) + pas_GenerateSimple(opSLL); else - error(eFACTORTYPE); + error(eFACTORTYPE); break; case tSHR : - if (factor1Type == exprInteger) - pas_GenerateSimple(opSRA); + if (factor1Type == exprInteger) + pas_GenerateSimple(opSRA); else - error(eFACTORTYPE); - break; + error(eFACTORTYPE); + break; } /* end switch */ } /* end for */ @@ -944,11 +944,11 @@ static exprType factor(exprType findExprType) case sSCALAR_OBJECT : if (abstractType) - { - if (tknPtr->sParm.c.parent != abstractType) error(eSCALARTYPE); - } /* end if */ + { + if (tknPtr->sParm.c.parent != abstractType) error(eSCALARTYPE); + } /* end if */ else - abstractType = tknPtr->sParm.c.parent; + abstractType = tknPtr->sParm.c.parent; pas_GenerateDataOperation(opPUSH, tknPtr->sParm.c.val.i); getToken(); @@ -986,26 +986,26 @@ static exprType factor(exprType findExprType) case tSTRING_CONST : { - /* Final stack representation is: - * TOS(0) : size in bytes - * TOS(1) : pointer to string - * - * Add the string to the RO data section of the output - * and get the offset to the string location. - */ + /* Final stack representation is: + * TOS(0) : size in bytes + * TOS(1) : pointer to string + * + * Add the string to the RO data section of the output + * and get the offset to the string location. + */ - uint32_t offset = poffAddRoDataString(poffHandle, tkn_strt); + uint32_t offset = poffAddRoDataString(poffHandle, tkn_strt); - /* Get the offset then size of the string on the stack */ + /* Get the offset then size of the string on the stack */ - pas_GenerateDataOperation(opLAC, offset); - pas_GenerateDataOperation(opPUSH, strlen(tkn_strt)); + pas_GenerateDataOperation(opLAC, offset); + pas_GenerateDataOperation(opPUSH, strlen(tkn_strt)); - /* Release the tokenized string */ + /* Release the tokenized string */ - stringSP = tkn_strt; - getToken(); - factorType = exprString; + stringSP = tkn_strt; + getToken(); + factorType = exprString; } break; @@ -1050,11 +1050,11 @@ static exprType factor(exprType findExprType) case sSCALAR : if (abstractType) - { - if (tknPtr->sParm.v.parent != abstractType) error(eSCALARTYPE); - } /* end if */ + { + if (tknPtr->sParm.v.parent != abstractType) error(eSCALARTYPE); + } /* end if */ else - abstractType = tknPtr->sParm.v.parent; + abstractType = tknPtr->sParm.v.parent; pas_GenerateStackReference(opLDS, tknPtr); getToken(); @@ -1066,13 +1066,13 @@ static exprType factor(exprType findExprType) /* same SET OF <object> -OR- the same <object> */ if (abstractType) - { - if ((tknPtr->sParm.v.parent != abstractType) && - (tknPtr->sParm.v.parent->sParm.t.parent != abstractType)) - error(eSET); - } /* end if */ + { + if ((tknPtr->sParm.v.parent != abstractType) && + (tknPtr->sParm.v.parent->sParm.t.parent != abstractType)) + error(eSET); + } /* end if */ else - abstractType = tknPtr->sParm.v.parent; + abstractType = tknPtr->sParm.v.parent; pas_GenerateStackReference(opLDS, tknPtr); getToken(); @@ -1120,7 +1120,7 @@ static exprType factor(exprType findExprType) case '^' : getToken(); factorType = ptrFactor(); - break; + break; /* Highest Priority Operators */ @@ -1128,7 +1128,7 @@ static exprType factor(exprType findExprType) getToken(); factorType = factor(findExprType); if ((factorType != exprInteger) && (factorType != exprBoolean)) - error(eFACTORTYPE); + error(eFACTORTYPE); pas_GenerateSimple(opNOT); break; @@ -1192,258 +1192,258 @@ static exprType simpleFactor(STYPE *varPtr, uint8_t factorFlags) case sINT : if ((factorFlags & INDEXED_FACTOR) != 0) - { - if ((factorFlags & ADDRESS_DEREFERENCE) != 0) - { - pas_GenerateStackReference(opLDSX, varPtr); - pas_GenerateSimple(opLDI); - factorType = exprInteger; - } /* end if */ - else if ((factorFlags & ADDRESS_FACTOR) != 0) - { - pas_GenerateStackReference(opLDSX, varPtr); - factorType = exprIntegerPtr; - } /* end else if */ - else - { - pas_GenerateStackReference(opLDSX, varPtr); - factorType = exprInteger; - } /* end else */ - } /* end if */ + { + if ((factorFlags & ADDRESS_DEREFERENCE) != 0) + { + pas_GenerateStackReference(opLDSX, varPtr); + pas_GenerateSimple(opLDI); + factorType = exprInteger; + } /* end if */ + else if ((factorFlags & ADDRESS_FACTOR) != 0) + { + pas_GenerateStackReference(opLDSX, varPtr); + factorType = exprIntegerPtr; + } /* end else if */ + else + { + pas_GenerateStackReference(opLDSX, varPtr); + factorType = exprInteger; + } /* end else */ + } /* end if */ else - { - if ((factorFlags & ADDRESS_DEREFERENCE) != 0) - { - pas_GenerateStackReference(opLDS, varPtr); - pas_GenerateSimple(opLDI); - factorType = exprInteger; - } /* end if */ - else if ((factorFlags & ADDRESS_FACTOR) != 0) - { - pas_GenerateStackReference(opLDS, varPtr); - factorType = exprIntegerPtr; - } /* end else if */ - else - { - pas_GenerateStackReference(opLDS, varPtr); - factorType = exprInteger; - } /* end else */ - } /* end else */ + { + if ((factorFlags & ADDRESS_DEREFERENCE) != 0) + { + pas_GenerateStackReference(opLDS, varPtr); + pas_GenerateSimple(opLDI); + factorType = exprInteger; + } /* end if */ + else if ((factorFlags & ADDRESS_FACTOR) != 0) + { + pas_GenerateStackReference(opLDS, varPtr); + factorType = exprIntegerPtr; + } /* end else if */ + else + { + pas_GenerateStackReference(opLDS, varPtr); + factorType = exprInteger; + } /* end else */ + } /* end else */ break; case sCHAR : if ((factorFlags & INDEXED_FACTOR) != 0) - { - if ((factorFlags & ADDRESS_DEREFERENCE) != 0) - { - pas_GenerateStackReference(opLDSX, varPtr); - pas_GenerateSimple(opLDIB); - factorType = exprChar; - } /* end if */ - else if ((factorFlags & ADDRESS_FACTOR) != 0) - { - pas_GenerateStackReference(opLDSX, varPtr); - factorType = exprCharPtr; - } /* end else if */ - else - { - pas_GenerateStackReference(opLDSXB, varPtr); - factorType = exprChar; - } /* end else */ - } /* end if */ + { + if ((factorFlags & ADDRESS_DEREFERENCE) != 0) + { + pas_GenerateStackReference(opLDSX, varPtr); + pas_GenerateSimple(opLDIB); + factorType = exprChar; + } /* end if */ + else if ((factorFlags & ADDRESS_FACTOR) != 0) + { + pas_GenerateStackReference(opLDSX, varPtr); + factorType = exprCharPtr; + } /* end else if */ + else + { + pas_GenerateStackReference(opLDSXB, varPtr); + factorType = exprChar; + } /* end else */ + } /* end if */ else - { - if ((factorFlags & ADDRESS_DEREFERENCE) != 0) - { - pas_GenerateStackReference(opLDS, varPtr); - pas_GenerateSimple(opLDIB); - factorType = exprChar; - } /* end if */ - else if ((factorFlags & ADDRESS_FACTOR) != 0) - { - pas_GenerateStackReference(opLDS, varPtr); - factorType = exprCharPtr; - } /* end else if */ - else - { - pas_GenerateStackReference(opLDSB, varPtr); - factorType = exprChar; - } /* end else */ - } /* end else */ + { + if ((factorFlags & ADDRESS_DEREFERENCE) != 0) + { + pas_GenerateStackReference(opLDS, varPtr); + pas_GenerateSimple(opLDIB); + factorType = exprChar; + } /* end if */ + else if ((factorFlags & ADDRESS_FACTOR) != 0) + { + pas_GenerateStackReference(opLDS, varPtr); + factorType = exprCharPtr; + } /* end else if */ + else + { + pas_GenerateStackReference(opLDSB, varPtr); + factorType = exprChar; + } /* end else */ + } /* end else */ break; case sBOOLEAN : if ((factorFlags & INDEXED_FACTOR) != 0) - { - if ((factorFlags & ADDRESS_DEREFERENCE) != 0) - { - pas_GenerateStackReference(opLDSX, varPtr); - pas_GenerateSimple(opLDI); - factorType = exprBoolean; - } /* end if */ - else if ((factorFlags & ADDRESS_FACTOR) != 0) - { - pas_GenerateStackReference(opLDSX, varPtr); - factorType = exprBooleanPtr; - } /* end else if */ - else - { - pas_GenerateStackReference(opLDSX, varPtr); - factorType = exprBoolean; - } /* end else */ - } /* end if */ + { + if ((factorFlags & ADDRESS_DEREFERENCE) != 0) + { + pas_GenerateStackReference(opLDSX, varPtr); + pas_GenerateSimple(opLDI); + factorType = exprBoolean; + } /* end if */ + else if ((factorFlags & ADDRESS_FACTOR) != 0) + { + pas_GenerateStackReference(opLDSX, varPtr); + factorType = exprBooleanPtr; + } /* end else if */ + else + { + pas_GenerateStackReference(opLDSX, varPtr); + factorType = exprBoolean; + } /* end else */ + } /* end if */ else - { - if ((factorFlags & ADDRESS_DEREFERENCE) != 0) - { - pas_GenerateStackReference(opLDS, varPtr); - pas_GenerateSimple(opLDI); - factorType = exprBoolean; - } /* end if */ - else if ((factorFlags & ADDRESS_FACTOR) != 0) - { - pas_GenerateStackReference(opLDS, varPtr); - factorType = exprBooleanPtr; - } /* end else if */ - else - { - pas_GenerateStackReference(opLDS, varPtr); - factorType = exprBoolean; - } /* end else */ - } /* end else */ + { + if ((factorFlags & ADDRESS_DEREFERENCE) != 0) + { + pas_GenerateStackReference(opLDS, varPtr); + pas_GenerateSimple(opLDI); + factorType = exprBoolean; + } /* end if */ + else if ((factorFlags & ADDRESS_FACTOR) != 0) + { + pas_GenerateStackReference(opLDS, varPtr); + factorType = exprBooleanPtr; + } /* end else if */ + else + { + pas_GenerateStackReference(opLDS, varPtr); + factorType = exprBoolean; + } /* end else */ + } /* end else */ break; case sREAL : if ((factorFlags & INDEXED_FACTOR) != 0) - { - if ((factorFlags & ADDRESS_DEREFERENCE) != 0) - { - pas_GenerateStackReference(opLDSX, varPtr); - pas_GenerateDataSize(varPtr->sParm.v.size); - pas_GenerateSimple(opLDIM); - factorType = exprReal; - } /* end if */ - else if ((factorFlags & ADDRESS_FACTOR) != 0) - { - pas_GenerateStackReference(opLDSX, varPtr); - factorType = exprRealPtr; - } /* end else if */ - else - { - pas_GenerateDataSize(varPtr->sParm.v.size); - pas_GenerateStackReference(opLDSXM, varPtr); - factorType = exprReal; - } /* end else */ - } /* end if */ + { + if ((factorFlags & ADDRESS_DEREFERENCE) != 0) + { + pas_GenerateStackReference(opLDSX, varPtr); + pas_GenerateDataSize(varPtr->sParm.v.size); + pas_GenerateSimple(opLDIM); + factorType = exprReal; + } /* end if */ + else if ((factorFlags & ADDRESS_FACTOR) != 0) + { + pas_GenerateStackReference(opLDSX, varPtr); + factorType = exprRealPtr; + } /* end else if */ + else + { + pas_GenerateDataSize(varPtr->sParm.v.size); + pas_GenerateStackReference(opLDSXM, varPtr); + factorType = exprReal; + } /* end else */ + } /* end if */ else - { - if ((factorFlags & ADDRESS_DEREFERENCE) != 0) - { - pas_GenerateStackReference(opLDS, varPtr); - pas_GenerateDataSize(varPtr->sParm.v.size); - pas_GenerateSimple(opLDIM); - factorType = exprReal; - } /* end if */ - else if ((factorFlags & ADDRESS_FACTOR) != 0) - { - pas_GenerateStackReference(opLDS, varPtr); - factorType = exprRealPtr; - } /* end else if */ - else - { - pas_GenerateDataSize(varPtr->sParm.v.size); - pas_GenerateStackReference(opLDSM, varPtr); - factorType = exprReal; - } /* end else */ - } /* end else */ + { + if ((factorFlags & ADDRESS_DEREFERENCE) != 0) + { + pas_GenerateStackReference(opLDS, varPtr); + pas_GenerateDataSize(varPtr->sParm.v.size); + pas_GenerateSimple(opLDIM); + factorType = exprReal; + } /* end if */ + else if ((factorFlags & ADDRESS_FACTOR) != 0) + { + pas_GenerateStackReference(opLDS, varPtr); + factorType = exprRealPtr; + } /* end else if */ + else + { + pas_GenerateDataSize(varPtr->sParm.v.size); + pas_GenerateStackReference(opLDSM, varPtr); + factorType = exprReal; + } /* end else */ + } /* end else */ break; case sSCALAR : if (!abstractType) - abstractType = typePtr; + abstractType = typePtr; else if (typePtr != abstractType) - error(eSCALARTYPE); + error(eSCALARTYPE); if ((factorFlags & INDEXED_FACTOR) != 0) - { - if ((factorFlags & ADDRESS_DEREFERENCE) != 0) - { - pas_GenerateStackReference(opLDSX, varPtr); - pas_GenerateSimple(opLDI); - factorType = exprScalar; - } /* end if */ - else if ((factorFlags & ADDRESS_FACTOR) != 0) - { - pas_GenerateStackReference(opLDSX, varPtr); - factorType = exprScalarPtr; - } /* end else if */ - else - { - pas_GenerateStackReference(opLDSX, varPtr); - factorType = exprScalar; - } /* end else */ - } /* end if */ + { + if ((factorFlags & ADDRESS_DEREFERENCE) != 0) + { + pas_GenerateStackReference(opLDSX, varPtr); + pas_GenerateSimple(opLDI); + factorType = exprScalar; + } /* end if */ + else if ((factorFlags & ADDRESS_FACTOR) != 0) + { + pas_GenerateStackReference(opLDSX, varPtr); + factorType = exprScalarPtr; + } /* end else if */ + else + { + pas_GenerateStackReference(opLDSX, varPtr); + factorType = exprScalar; + } /* end else */ + } /* end if */ else - { - if ((factorFlags & ADDRESS_DEREFERENCE) != 0) - { - pas_GenerateStackReference(opLDS, varPtr); - pas_GenerateSimple(opLDI); - factorType = exprScalar; - } /* end if */ - else if ((factorFlags & ADDRESS_FACTOR) != 0) - { - pas_GenerateStackReference(opLDS, varPtr); - factorType = exprScalarPtr; - } /* end else if */ - else - { - pas_GenerateStackReference(opLDS, varPtr); - factorType = exprScalar; - } /* end else */ - } /* end else */ + { + if ((factorFlags & ADDRESS_DEREFERENCE) != 0) + { + pas_GenerateStackReference(opLDS, varPtr); + pas_GenerateSimple(opLDI); + factorType = exprScalar; + } /* end if */ + else if ((factorFlags & ADDRESS_FACTOR) != 0) + { + pas_GenerateStackReference(opLDS, varPtr); + factorType = exprScalarPtr; + } /* end else if */ + else + { + pas_GenerateStackReference(opLDS, varPtr); + factorType = exprScalar; + } /* end else */ + } /* end else */ break; case sSET_OF : if (!abstractType) - abstractType = typePtr; + abstractType = typePtr; else if ((typePtr != abstractType) && - (typePtr->sParm.v.parent != abstractType)) - error(eSCALARTYPE); + (typePtr->sParm.v.parent != abstractType)) + error(eSCALARTYPE); if ((factorFlags & INDEXED_FACTOR) != 0) - { - if ((factorFlags & ADDRESS_DEREFERENCE) != 0) - { - pas_GenerateStackReference(opLDSX, varPtr); - pas_GenerateSimple(opLDI); - factorType = exprSet; - } /* end if */ - else if ((factorFlags & ADDRESS_FACTOR) != 0) - { - pas_GenerateStackReference(opLDSX, varPtr); - factorType = exprSetPtr; - } /* end else if */ - else - { - pas_GenerateStackReference(opLDSX, varPtr); - factorType = exprSet; - } /* end else */ - } /* end if */ + { + if ((factorFlags & ADDRESS_DEREFERENCE) != 0) + { + pas_GenerateStackReference(opLDSX, varPtr); + pas_GenerateSimple(opLDI); + factorType = exprSet; + } /* end if */ + else if ((factorFlags & ADDRESS_FACTOR) != 0) + { + pas_GenerateStackReference(opLDSX, varPtr); + factorType = exprSetPtr; + } /* end else if */ + else + { + pas_GenerateStackReference(opLDSX, varPtr); + factorType = exprSet; + } /* end else */ + } /* end if */ else - { - if ((factorFlags & ADDRESS_DEREFERENCE) != 0) - { - pas_GenerateStackReference(opLDS, varPtr); - pas_GenerateSimple(opLDI); - factorType = exprSet; - } /* end if */ - else if ((factorFlags & ADDRESS_FACTOR) != 0) - { - pas_GenerateStackReference(opLDS, varPtr); - factorType = exprSetPtr; - } /* end else if */ - else - { - pas_GenerateStackReference(opLDS, varPtr); - factorType = exprSet; - } /* end else */ - } /* end else */ + { + if ((factorFlags & ADDRESS_DEREFERENCE) != 0) + { + pas_GenerateStackReference(opLDS, varPtr); + pas_GenerateSimple(opLDI); + factorType = exprSet; + } /* end if */ + else if ((factorFlags & ADDRESS_FACTOR) != 0) + { + pas_GenerateStackReference(opLDS, varPtr); + factorType = exprSetPtr; + } /* end else if */ + else + { + pas_GenerateStackReference(opLDS, varPtr); + factorType = exprSet; + } /* end else */ + } /* end else */ break; /* NOPE... recurse until it becomes a simple factor */ @@ -1458,85 +1458,85 @@ static exprType simpleFactor(STYPE *varPtr, uint8_t factorFlags) /* Check if this is a pointer to a record */ if ((factorFlags & ADDRESS_FACTOR) != 0) - { - if (token == '.') error(ePOINTERTYPE); + { + if (token == '.') error(ePOINTERTYPE); - if ((factorFlags & INDEXED_FACTOR) != 0) - pas_GenerateStackReference(opLDSX, varPtr); - else - pas_GenerateStackReference(opLDS, varPtr); + if ((factorFlags & INDEXED_FACTOR) != 0) + pas_GenerateStackReference(opLDSX, varPtr); + else + pas_GenerateStackReference(opLDS, varPtr); - factorType = exprRecordPtr; - } /* end if */ + factorType = exprRecordPtr; + } /* end if */ /* Verify that a period separates the RECORD identifier from the */ /* record field identifier */ else if (token == '.') - { - if (((factorFlags & ADDRESS_DEREFERENCE) != 0) && - ((factorFlags & VAR_PARM_FACTOR) == 0)) - error(ePOINTERTYPE); - - /* Skip over the period. */ - - getToken(); - - /* Verify that a field identifier associated with this record */ - /* follows the period. */ - - if ((token != sRECORD_OBJECT) || - (tknPtr->sParm.r.record != typePtr)) - { - error(eRECORDOBJECT); - factorType = exprInteger; - } /* end if */ - else - { - /* Modify the variable so that it has the characteristics of the */ - /* the field but with level and offset associated with the record */ - - typePtr = tknPtr->sParm.r.parent; - varPtr->sKind = typePtr->sParm.t.type; - varPtr->sParm.v.parent = typePtr; - - /* Special case: The record is a VAR parameter. */ - - if (factorFlags == (INDEXED_FACTOR | ADDRESS_DEREFERENCE | VAR_PARM_FACTOR)) - { - pas_GenerateDataOperation(opPUSH, tknPtr->sParm.r.offset); - pas_GenerateSimple(opADD); - } /* end if */ - else - varPtr->sParm.v.offset += tknPtr->sParm.r.offset; - - getToken(); - factorType = simpleFactor(varPtr, factorFlags); - } /* end else */ - } /* end else if */ + { + if (((factorFlags & ADDRESS_DEREFERENCE) != 0) && + ((factorFlags & VAR_PARM_FACTOR) == 0)) + error(ePOINTERTYPE); + + /* Skip over the period. */ + + getToken(); + + /* Verify that a field identifier associated with this record */ + /* follows the period. */ + + if ((token != sRECORD_OBJECT) || + (tknPtr->sParm.r.record != typePtr)) + { + error(eRECORDOBJECT); + factorType = exprInteger; + } /* end if */ + else + { + /* Modify the variable so that it has the characteristics of the */ + /* the field but with level and offset associated with the record */ + + typePtr = tknPtr->sParm.r.parent; + varPtr->sKind = typePtr->sParm.t.type; + varPtr->sParm.v.parent = typePtr; + + /* Special case: The record is a VAR parameter. */ + + if (factorFlags == (INDEXED_FACTOR | ADDRESS_DEREFERENCE | VAR_PARM_FACTOR)) + { + pas_GenerateDataOperation(opPUSH, tknPtr->sParm.r.offset); + pas_GenerateSimple(opADD); + } /* end if */ + else + varPtr->sParm.v.offset += tknPtr->sParm.r.offset; + + getToken(); + factorType = simpleFactor(varPtr, factorFlags); + } /* end else */ + } /* end else if */ /* A RECORD name name be a valid factor -- as the input */ /* parameter of a function or in an assignment */ else if (abstractType == typePtr) - { - /* Special case: The record is a VAR parameter. */ - - if (factorFlags == (INDEXED_FACTOR | ADDRESS_DEREFERENCE | VAR_PARM_FACTOR)) - { - pas_GenerateStackReference(opLDS, varPtr); - pas_GenerateSimple(opADD); - pas_GenerateDataSize(varPtr->sParm.v.size); - pas_GenerateSimple(opLDIM); - } /* end if */ - else - { - pas_GenerateDataSize(varPtr->sParm.v.size); - pas_GenerateStackReference(opLDSM, varPtr); - } /* end else */ - - factorType = exprRecord; - } /* end else if */ + { + /* Special case: The record is a VAR parameter. */ + + if (factorFlags == (INDEXED_FACTOR | ADDRESS_DEREFERENCE | VAR_PARM_FACTOR)) + { + pas_GenerateStackReference(opLDS, varPtr); + pas_GenerateSimple(opADD); + pas_GenerateDataSize(varPtr->sParm.v.size); + pas_GenerateSimple(opLDIM); + } /* end if */ + else + { + pas_GenerateDataSize(varPtr->sParm.v.size); + pas_GenerateStackReference(opLDSM, varPtr); + } /* end else */ + + factorType = exprRecord; + } /* end else if */ else error(ePERIOD); break; @@ -1545,69 +1545,69 @@ static exprType simpleFactor(STYPE *varPtr, uint8_t factorFlags) /* defining the RECORD type */ if (!withRecord.parent) - error(eINVTYPE); + error(eINVTYPE); else if ((factorFlags && (ADDRESS_DEREFERENCE | ADDRESS_FACTOR)) != 0) - error(ePOINTERTYPE); + error(ePOINTERTYPE); else if ((factorFlags && INDEXED_FACTOR) != 0) - error(eARRAYTYPE); + error(eARRAYTYPE); /* Verify that a field identifier is associated with the RECORD */ /* specified by the WITH statement. */ else if (varPtr->sParm.r.record != withRecord.parent) - error(eRECORDOBJECT); + error(eRECORDOBJECT); else - { - int16_t tempOffset; - - /* Now there are two cases to consider: (1) the withRecord is a */ - /* pointer to a RECORD, or (2) the withRecord is the RECOR itself */ - - if (withRecord.pointer) - { - /* If the pointer is really a VAR parameter, then other syntax */ - /* rules will apply */ - - if (withRecord.varParm) - factorFlags |= (INDEXED_FACTOR | ADDRESS_DEREFERENCE | VAR_PARM_FACTOR); - else - factorFlags |= (INDEXED_FACTOR | ADDRESS_DEREFERENCE); - - pas_GenerateDataOperation(opPUSH, (varPtr->sParm.r.offset + withRecord.index)); - tempOffset = withRecord.offset; - } /* end if */ - else - { - tempOffset = varPtr->sParm.r.offset + withRecord.offset; - } /* end else */ - - /* Modify the variable so that it has the characteristics of the */ - /* the field but with level and offset associated with the record */ - /* NOTE: We have to be careful here because the structure */ - /* associated with sRECORD_OBJECT is not the same as for */ - /* variables! */ - - typePtr = varPtr->sParm.r.parent; - tempOffset = varPtr->sParm.r.offset; - - varPtr->sKind = typePtr->sParm.t.type; - varPtr->sLevel = withRecord.level; - varPtr->sParm.v.size = typePtr->sParm.t.asize; - varPtr->sParm.v.offset = tempOffset + withRecord.offset; - varPtr->sParm.v.parent = typePtr; - - factorType = simpleFactor(varPtr, factorFlags); - } /* end else */ + { + int16_t tempOffset; + + /* Now there are two cases to consider: (1) the withRecord is a */ + /* pointer to a RECORD, or (2) the withRecord is the RECOR itself */ + + if (withRecord.pointer) + { + /* If the pointer is really a VAR parameter, then other syntax */ + /* rules will apply */ + + if (withRecord.varParm) + factorFlags |= (INDEXED_FACTOR | ADDRESS_DEREFERENCE | VAR_PARM_FACTOR); + else + factorFlags |= (INDEXED_FACTOR | ADDRESS_DEREFERENCE); + + pas_GenerateDataOperation(opPUSH, (varPtr->sParm.r.offset + withRecord.index)); + tempOffset = withRecord.offset; + } /* end if */ + else + { + tempOffset = varPtr->sParm.r.offset + withRecord.offset; + } /* end else */ + + /* Modify the variable so that it has the characteristics of the */ + /* the field but with level and offset associated with the record */ + /* NOTE: We have to be careful here because the structure */ + /* associated with sRECORD_OBJECT is not the same as for */ + /* variables! */ + + typePtr = varPtr->sParm.r.parent; + tempOffset = varPtr->sParm.r.offset; + + varPtr->sKind = typePtr->sParm.t.type; + varPtr->sLevel = withRecord.level; + varPtr->sParm.v.size = typePtr->sParm.t.asize; + varPtr->sParm.v.offset = tempOffset + withRecord.offset; + varPtr->sParm.v.parent = typePtr; + + factorType = simpleFactor(varPtr, factorFlags); + } /* end else */ break; case sPOINTER : if (token == '^') - { - getToken(); - factorFlags |= ADDRESS_DEREFERENCE; - } /* end if */ + { + getToken(); + factorFlags |= ADDRESS_DEREFERENCE; + } /* end if */ else - factorFlags |= ADDRESS_FACTOR; + factorFlags |= ADDRESS_FACTOR; varPtr->sKind = typePtr->sParm.t.type; factorType = simpleFactor(varPtr, factorFlags); @@ -1625,23 +1625,23 @@ static exprType simpleFactor(STYPE *varPtr, uint8_t factorFlags) if (factorFlags != 0) error(eARRAYTYPE); if (token == '[') - { - factorFlags |= INDEXED_FACTOR; - arrayIndex(typePtr->sParm.t.asize); - varPtr->sKind = typePtr->sParm.t.type; - varPtr->sParm.v.size = typePtr->sParm.t.asize; - factorType = simpleFactor(varPtr, factorFlags); - } /* end if */ + { + factorFlags |= INDEXED_FACTOR; + arrayIndex(typePtr->sParm.t.asize); + varPtr->sKind = typePtr->sParm.t.type; + varPtr->sParm.v.size = typePtr->sParm.t.asize; + factorType = simpleFactor(varPtr, factorFlags); + } /* end if */ /* An ARRAY name name be a valid factor -- only as the input */ /* parameter of a function */ else if (abstractType == varPtr) - { - pas_GenerateDataSize(varPtr->sParm.v.size); - pas_GenerateStackReference(opLDSM, varPtr); - factorType = exprArray; - } /* end else if */ + { + pas_GenerateDataSize(varPtr->sParm.v.size); + pas_GenerateStackReference(opLDSM, varPtr); + factorType = exprArray; + } /* end else if */ else error(eLBRACKET); break; @@ -1693,11 +1693,11 @@ static exprType ptrFactor(void) break; case sSCALAR : if (abstractType) - { - if (tknPtr->sParm.v.parent != abstractType) error(eSCALARTYPE); - } /* end if */ + { + if (tknPtr->sParm.v.parent != abstractType) error(eSCALARTYPE); + } /* end if */ else - abstractType = tknPtr->sParm.v.parent; + abstractType = tknPtr->sParm.v.parent; pas_GenerateStackReference(opLAS, tknPtr); getToken(); @@ -1708,12 +1708,12 @@ static exprType ptrFactor(void) /* same SET OF <object> -OR- the same <object> */ if (abstractType) { - if ((tknPtr->sParm.v.parent != abstractType) - && (tknPtr->sParm.v.parent->sParm.t.parent != abstractType)) - error(eSET); + if ((tknPtr->sParm.v.parent != abstractType) + && (tknPtr->sParm.v.parent->sParm.t.parent != abstractType)) + error(eSET); } /* end if */ else - abstractType = tknPtr->sParm.v.parent; + abstractType = tknPtr->sParm.v.parent; pas_GenerateStackReference(opLAS, tknPtr); getToken(); factorType = exprSetPtr; @@ -1736,7 +1736,7 @@ static exprType ptrFactor(void) error(eNOTYET); getToken(); factorType = ptrFactor(); - break; + break; case '(' : getToken(); @@ -1796,170 +1796,170 @@ static exprType simplePtrFactor(STYPE *varPtr, uint8_t factorFlags) /* Check if we have reduced the complex factor to a simple factor */ case sINT : if ((factorFlags & INDEXED_FACTOR) != 0) - { - if ((factorFlags & ADDRESS_DEREFERENCE) != 0) - { - pas_GenerateStackReference(opLDSX, varPtr); - } /* end if */ - else - { - pas_GenerateStackReference(opLASX, varPtr); - } /* end else */ - factorType = exprIntegerPtr; - } /* end if */ + { + if ((factorFlags & ADDRESS_DEREFERENCE) != 0) + { + pas_GenerateStackReference(opLDSX, varPtr); + } /* end if */ + else + { + pas_GenerateStackReference(opLASX, varPtr); + } /* end else */ + factorType = exprIntegerPtr; + } /* end if */ else - { - if ((factorFlags & ADDRESS_DEREFERENCE) != 0) - { - pas_GenerateStackReference(opLDS, varPtr); - } /* end if */ - else - { - pas_GenerateStackReference(opLAS, varPtr); - } /* end else */ - factorType = exprIntegerPtr; - } /* end else */ + { + if ((factorFlags & ADDRESS_DEREFERENCE) != 0) + { + pas_GenerateStackReference(opLDS, varPtr); + } /* end if */ + else + { + pas_GenerateStackReference(opLAS, varPtr); + } /* end else */ + factorType = exprIntegerPtr; + } /* end else */ break; case sCHAR : if ((factorFlags & INDEXED_FACTOR) != 0) - { - if ((factorFlags & ADDRESS_DEREFERENCE) != 0) - { - pas_GenerateStackReference(opLDSX, varPtr); - } /* end if */ - else - { - pas_GenerateStackReference(opLASX, varPtr); - } /* end else */ - factorType = exprCharPtr; - } /* end if */ + { + if ((factorFlags & ADDRESS_DEREFERENCE) != 0) + { + pas_GenerateStackReference(opLDSX, varPtr); + } /* end if */ + else + { + pas_GenerateStackReference(opLASX, varPtr); + } /* end else */ + factorType = exprCharPtr; + } /* end if */ else - { - if ((factorFlags & ADDRESS_DEREFERENCE) != 0) - { - pas_GenerateStackReference(opLDS, varPtr); - } /* end if */ - else - { - pas_GenerateStackReference(opLAS, varPtr); - } /* end else */ - factorType = exprCharPtr; - } /* end else */ + { + if ((factorFlags & ADDRESS_DEREFERENCE) != 0) + { + pas_GenerateStackReference(opLDS, varPtr); + } /* end if */ + else + { + pas_GenerateStackReference(opLAS, varPtr); + } /* end else */ + factorType = exprCharPtr; + } /* end else */ break; case sBOOLEAN : if ((factorFlags & INDEXED_FACTOR) != 0) - { - if ((factorFlags & ADDRESS_DEREFERENCE) != 0) - { - pas_GenerateStackReference(opLDSX, varPtr); - } /* end if */ - else - { - pas_GenerateStackReference(opLASX, varPtr); - } /* end else */ - factorType = exprBooleanPtr; - } /* end if */ + { + if ((factorFlags & ADDRESS_DEREFERENCE) != 0) + { + pas_GenerateStackReference(opLDSX, varPtr); + } /* end if */ + else + { + pas_GenerateStackReference(opLASX, varPtr); + } /* end else */ + factorType = exprBooleanPtr; + } /* end if */ else - { - if ((factorFlags & ADDRESS_DEREFERENCE) != 0) - { - pas_GenerateStackReference(opLDS, varPtr); - } /* end if */ - else - { - pas_GenerateStackReference(opLAS, varPtr); - } /* end else */ - factorType = exprBooleanPtr; - } /* end else */ + { + if ((factorFlags & ADDRESS_DEREFERENCE) != 0) + { + pas_GenerateStackReference(opLDS, varPtr); + } /* end if */ + else + { + pas_GenerateStackReference(opLAS, varPtr); + } /* end else */ + factorType = exprBooleanPtr; + } /* end else */ break; case sREAL : if ((factorFlags & INDEXED_FACTOR) != 0) - { - if ((factorFlags & ADDRESS_DEREFERENCE) != 0) - { - pas_GenerateStackReference(opLDSX, varPtr); - } /* end if */ - else - { - pas_GenerateStackReference(opLASX, varPtr); - } /* end else */ - factorType = exprRealPtr; - } /* end if */ + { + if ((factorFlags & ADDRESS_DEREFERENCE) != 0) + { + pas_GenerateStackReference(opLDSX, varPtr); + } /* end if */ + else + { + pas_GenerateStackReference(opLASX, varPtr); + } /* end else */ + factorType = exprRealPtr; + } /* end if */ else - { - if ((factorFlags & ADDRESS_DEREFERENCE) != 0) - { - pas_GenerateStackReference(opLDS, varPtr); - } /* end if */ - else - { - pas_GenerateStackReference(opLAS, varPtr); - } /* end else */ - factorType = exprRealPtr; - } /* end else */ + { + if ((factorFlags & ADDRESS_DEREFERENCE) != 0) + { + pas_GenerateStackReference(opLDS, varPtr); + } /* end if */ + else + { + pas_GenerateStackReference(opLAS, varPtr); + } /* end else */ + factorType = exprRealPtr; + } /* end else */ break; case sSCALAR : if (!abstractType) - abstractType = typePtr; + abstractType = typePtr; else if (typePtr != abstractType) - error(eSCALARTYPE); + error(eSCALARTYPE); if ((factorFlags & INDEXED_FACTOR) != 0) - { - if ((factorFlags & ADDRESS_DEREFERENCE) != 0) - { - pas_GenerateStackReference(opLDSX, varPtr); - } /* end if */ - else - { - pas_GenerateStackReference(opLASX, varPtr); - } /* end else */ - factorType = exprScalarPtr; - } /* end if */ + { + if ((factorFlags & ADDRESS_DEREFERENCE) != 0) + { + pas_GenerateStackReference(opLDSX, varPtr); + } /* end if */ + else + { + pas_GenerateStackReference(opLASX, varPtr); + } /* end else */ + factorType = exprScalarPtr; + } /* end if */ else - { - if ((factorFlags & ADDRESS_DEREFERENCE) != 0) - { - pas_GenerateStackReference(opLDS, varPtr); - } /* end if */ - else - { - pas_GenerateStackReference(opLAS, varPtr); - } /* end else */ - factorType = exprScalarPtr; - } /* end else */ + { + if ((factorFlags & ADDRESS_DEREFERENCE) != 0) + { + pas_GenerateStackReference(opLDS, varPtr); + } /* end if */ + else + { + pas_GenerateStackReference(opLAS, varPtr); + } /* end else */ + factorType = exprScalarPtr; + } /* end else */ break; case sSET_OF : if (!abstractType) - abstractType = typePtr; + abstractType = typePtr; else if ((typePtr != abstractType) && - (typePtr->sParm.v.parent != abstractType)) - error(eSCALARTYPE); + (typePtr->sParm.v.parent != abstractType)) + error(eSCALARTYPE); if ((factorFlags & INDEXED_FACTOR) != 0) - { - if ((factorFlags & ADDRESS_DEREFERENCE) != 0) - { - pas_GenerateStackReference(opLDSX, varPtr); - } /* end if */ - else - { - pas_GenerateStackReference(opLASX, varPtr); - } /* end else */ - factorType = exprSetPtr; - } /* end if */ + { + if ((factorFlags & ADDRESS_DEREFERENCE) != 0) + { + pas_GenerateStackReference(opLDSX, varPtr); + } /* end if */ + else + { + pas_GenerateStackReference(opLASX, varPtr); + } /* end else */ + factorType = exprSetPtr; + } /* end if */ else - { - if ((factorFlags & ADDRESS_DEREFERENCE) != 0) - { - pas_GenerateStackReference(opLDS, varPtr); - } /* end if */ - else - { - pas_GenerateStackReference(opLAS, varPtr); - } /* end else */ - factorType = exprSetPtr; - } /* end else */ + { + if ((factorFlags & ADDRESS_DEREFERENCE) != 0) + { + pas_GenerateStackReference(opLDS, varPtr); + } /* end if */ + else + { + pas_GenerateStackReference(opLAS, varPtr); + } /* end else */ + factorType = exprSetPtr; + } /* end else */ break; /* NOPE... recurse until it becomes a simple factor */ @@ -1974,53 +1974,53 @@ static exprType simplePtrFactor(STYPE *varPtr, uint8_t factorFlags) /* Check if this is a pointer to a record */ if (token != '.') - { - if ((factorFlags & ADDRESS_DEREFERENCE) != 0) - error(ePOINTERTYPE); + { + if ((factorFlags & ADDRESS_DEREFERENCE) != 0) + error(ePOINTERTYPE); - if ((factorFlags & INDEXED_FACTOR) != 0) - pas_GenerateStackReference(opLASX, varPtr); - else - pas_GenerateStackReference(opLAS, varPtr); + if ((factorFlags & INDEXED_FACTOR) != 0) + pas_GenerateStackReference(opLASX, varPtr); + else + pas_GenerateStackReference(opLAS, varPtr); - factorType = exprRecordPtr; - } /* end if */ + factorType = exprRecordPtr; + } /* end if */ else - { - /* Verify that a period separates the RECORD identifier from the - * record field identifier - */ - - if (token != '.') error(ePERIOD); - else getToken(); - - /* Verify that a field identifier associated with this record - * follows the period. - */ - - if ((token != sRECORD_OBJECT) || - (tknPtr->sParm.r.record != typePtr)) - { - error(eRECORDOBJECT); - factorType = exprInteger; - } /* end if */ - else - { - /* Modify the variable so that it has the characteristics - * of the field but with level and offset associated with - * the record - */ - - typePtr = tknPtr->sParm.r.parent; - varPtr->sKind = typePtr->sParm.t.type; - varPtr->sParm.v.offset += tknPtr->sParm.r.offset; - varPtr->sParm.v.parent = typePtr; - - getToken(); - factorType = simplePtrFactor(varPtr, factorFlags); - - } /* end else */ - } /* end else */ + { + /* Verify that a period separates the RECORD identifier from the + * record field identifier + */ + + if (token != '.') error(ePERIOD); + else getToken(); + + /* Verify that a field identifier associated with this record + * follows the period. + */ + + if ((token != sRECORD_OBJECT) || + (tknPtr->sParm.r.record != typePtr)) + { + error(eRECORDOBJECT); + factorType = exprInteger; + } /* end if */ + else + { + /* Modify the variable so that it has the characteristics + * of the field but with level and offset associated with + * the record + */ + + typePtr = tknPtr->sParm.r.parent; + varPtr->sKind = typePtr->sParm.t.type; + varPtr->sParm.v.offset += tknPtr->sParm.r.offset; + varPtr->sParm.v.parent = typePtr; + + getToken(); + factorType = simplePtrFactor(varPtr, factorFlags); + + } /* end else */ + } /* end else */ break; case sRECORD_OBJECT : @@ -2029,55 +2029,55 @@ static exprType simplePtrFactor(STYPE *varPtr, uint8_t factorFlags) */ if (!withRecord.parent) - error(eINVTYPE); + error(eINVTYPE); else if ((factorFlags && ADDRESS_DEREFERENCE) != 0) - error(ePOINTERTYPE); + error(ePOINTERTYPE); else if ((factorFlags && INDEXED_FACTOR) != 0) - error(eARRAYTYPE); + error(eARRAYTYPE); /* Verify that a field identifier is associated with the RECORD * specified by the WITH statement. */ else if (varPtr->sParm.r.record != withRecord.parent) - error(eRECORDOBJECT); + error(eRECORDOBJECT); else - { - int16_t tempOffset; - - /* Now there are two cases to consider: (1) the withRecord is a - * pointer to a RECORD, or (2) the withRecord is the RECOR itself - */ - - if (withRecord.pointer) - { - pas_GenerateDataOperation(opPUSH, (varPtr->sParm.r.offset + withRecord.index)); - factorFlags |= (INDEXED_FACTOR | ADDRESS_DEREFERENCE); - tempOffset = withRecord.offset; - } /* end if */ - else - { - tempOffset = varPtr->sParm.r.offset + withRecord.offset; - } /* end else */ - - /* Modify the variable so that it has the characteristics of the - * the field but with level and offset associated with the record - * NOTE: We have to be careful here because the structure - * associated with sRECORD_OBJECT is not the same as for - * variables! - */ - - typePtr = varPtr->sParm.r.parent; - tempOffset = varPtr->sParm.r.offset; - - varPtr->sKind = typePtr->sParm.t.type; - varPtr->sLevel = withRecord.level; - varPtr->sParm.v.size = typePtr->sParm.t.asize; - varPtr->sParm.v.offset = tempOffset + withRecord.offset; - varPtr->sParm.v.parent = typePtr; - - factorType = simplePtrFactor(varPtr, factorFlags); - } /* end else */ + { + int16_t tempOffset; + + /* Now there are two cases to consider: (1) the withRecord is a + * pointer to a RECORD, or (2) the withRecord is the RECOR itself + */ + + if (withRecord.pointer) + { + pas_GenerateDataOperation(opPUSH, (varPtr->sParm.r.offset + withRecord.index)); + factorFlags |= (INDEXED_FACTOR | ADDRESS_DEREFERENCE); + tempOffset = withRecord.offset; + } /* end if */ + else + { + tempOffset = varPtr->sParm.r.offset + withRecord.offset; + } /* end else */ + + /* Modify the variable so that it has the characteristics of the + * the field but with level and offset associated with the record + * NOTE: We have to be careful here because the structure + * associated with sRECORD_OBJECT is not the same as for + * variables! + */ + + typePtr = varPtr->sParm.r.parent; + tempOffset = varPtr->sParm.r.offset; + + varPtr->sKind = typePtr->sParm.t.type; + varPtr->sLevel = withRecord.level; + varPtr->sParm.v.size = typePtr->sParm.t.asize; + varPtr->sParm.v.offset = tempOffset + withRecord.offset; + varPtr->sParm.v.parent = typePtr; + + factorType = simplePtrFactor(varPtr, factorFlags); + } /* end else */ break; case sPOINTER : @@ -2100,19 +2100,19 @@ static exprType simplePtrFactor(STYPE *varPtr, uint8_t factorFlags) case sARRAY : if (factorFlags != 0) error(eARRAYTYPE); if (token == '[') - { - factorFlags |= INDEXED_FACTOR; - - arrayIndex(typePtr->sParm.t.asize); - varPtr->sKind = typePtr->sParm.t.type; - varPtr->sParm.v.size = typePtr->sParm.t.asize; - factorType = simplePtrFactor(varPtr, factorFlags); - } /* end if */ + { + factorFlags |= INDEXED_FACTOR; + + arrayIndex(typePtr->sParm.t.asize); + varPtr->sKind = typePtr->sParm.t.type; + varPtr->sParm.v.size = typePtr->sParm.t.asize; + factorType = simplePtrFactor(varPtr, factorFlags); + } /* end if */ else - { - pas_GenerateStackReference(opLAS, varPtr); - factorType = exprArrayPtr; - } /* end else */ + { + pas_GenerateStackReference(opLAS, varPtr); + factorType = exprArrayPtr; + } /* end else */ break; default : @@ -2205,34 +2205,34 @@ static void setAbstractType(STYPE *sType) if ((sType) && (sType->sKind == sTYPE) && (sType->sParm.t.type == sPOINTER)) sType = sType->sParm.t.parent; - + if ((sType) && (sType->sKind == sTYPE)) { switch (sType->sParm.t.type) { case sSCALAR : - if (abstractType) { + if (abstractType) { if (sType != abstractType) error(eSCALARTYPE); } /* end if */ else abstractType = sType; - break; + break; case sSUBRANGE : - if (!abstractType) - abstractType = sType; - else if ((abstractType->sParm.t.type != sSUBRANGE) + if (!abstractType) + abstractType = sType; + else if ((abstractType->sParm.t.type != sSUBRANGE) || (abstractType->sParm.t.subType != sType->sParm.t.subType)) error(eSUBRANGETYPE); - switch (sType->sParm.t.subType) { - case sINT : - case sCHAR : - break; - case sSCALAR : + switch (sType->sParm.t.subType) { + case sINT : + case sCHAR : + break; + case sSCALAR : if (abstractType != sType) error(eSUBRANGETYPE); - break; - default : - error(eSUBRANGETYPE); - break; - } /* end switch */ - break; + break; + default : + error(eSUBRANGETYPE); + break; + } /* end switch */ + break; } /* end switch */ } /* end if */ else error(eINVTYPE); @@ -2319,11 +2319,11 @@ static void getSetElement(setTypeStruct *s) case sSCALAR_OBJECT : /* A scalar or scalar subrange constant */ firstValue = tknPtr->sParm.c.val.i; if (!s->typeFound) { - s->typeFound = true; - s->typePtr = tknPtr->sParm.c.parent; - s->setType = sSCALAR; - s->minValue = s->typePtr->sParm.t.minValue; - s->maxValue = s->typePtr->sParm.t.maxValue; + s->typeFound = true; + s->typePtr = tknPtr->sParm.c.parent; + s->setType = sSCALAR; + s->minValue = s->typePtr->sParm.t.minValue; + s->maxValue = s->typePtr->sParm.t.maxValue; } /* end if */ else if ((s->setType != sSCALAR) || (s->typePtr != tknPtr->sParm.c.parent)) @@ -2333,8 +2333,8 @@ static void getSetElement(setTypeStruct *s) case tINT_CONST : /* An integer subrange constant ? */ firstValue = tknInt; if (!s->typeFound) { - s->typeFound = true; - s->setType = sINT; + s->typeFound = true; + s->setType = sINT; } /* end if */ else if (s->setType != sINT) error(eSET); @@ -2343,8 +2343,8 @@ static void getSetElement(setTypeStruct *s) case tCHAR_CONST : /* A character subrange constant */ firstValue = tknInt; if (!s->typeFound) { - s->typeFound = true; - s->setType = sCHAR; + s->typeFound = true; + s->setType = sCHAR; } /* end if */ else if (s->setType != sCHAR) error(eSET); @@ -2356,170 +2356,170 @@ static void getSetElement(setTypeStruct *s) getToken(); if (token != tSUBRANGE) { - /* Verify that the new value is in range */ + /* Verify that the new value is in range */ if ((firstValue < s->minValue) || (firstValue > s->maxValue)) { - error(eSETRANGE); - setValue = 0; + error(eSETRANGE); + setValue = 0; } /* end if */ else - setValue = (1 << (firstValue - s->minValue)); + setValue = (1 << (firstValue - s->minValue)); /* Now, generate P-Code to push the set value onto the stack */ - pas_GenerateDataOperation(opPUSH, setValue); + pas_GenerateDataOperation(opPUSH, setValue); } /* end if */ else { if (!s->typeFound) error(eSUBRANGETYPE); - /* Skip over the tSUBRANGE token */ + /* Skip over the tSUBRANGE token */ - getToken(); + getToken(); - /* TYPE check */ + /* TYPE check */ - switch (token) { + switch (token) { case sSCALAR_OBJECT : /* A scalar or scalar subrange constant */ - lastValue = tknPtr->sParm.c.val.i; - if ((s->setType != sSCALAR) - || (s->typePtr != tknPtr->sParm.c.parent)) - error(eSET); - goto addLottaBits; - - case tINT_CONST : /* An integer subrange constant ? */ - lastValue = tknInt; - if (s->setType != sINT) error(eSET); - goto addLottaBits; - - case tCHAR_CONST : /* A character subrange constant */ - lastValue = tknInt; - if (s->setType != sCHAR) error(eSET); - - addLottaBits : - /* Verify that the first value is in range */ - if (firstValue < s->minValue) { - error(eSETRANGE); - firstValue = s->minValue; + lastValue = tknPtr->sParm.c.val.i; + if ((s->setType != sSCALAR) + || (s->typePtr != tknPtr->sParm.c.parent)) + error(eSET); + goto addLottaBits; + + case tINT_CONST : /* An integer subrange constant ? */ + lastValue = tknInt; + if (s->setType != sINT) error(eSET); + goto addLottaBits; + + case tCHAR_CONST : /* A character subrange constant */ + lastValue = tknInt; + if (s->setType != sCHAR) error(eSET); + + addLottaBits : + /* Verify that the first value is in range */ + if (firstValue < s->minValue) { + error(eSETRANGE); + firstValue = s->minValue; } /* end if */ - else if (firstValue > s->maxValue) { - error(eSETRANGE); + else if (firstValue > s->maxValue) { + error(eSETRANGE); firstValue = s->maxValue; - } /* end else if */ + } /* end else if */ - /* Verify that the last value is in range */ - if (lastValue < firstValue) { + /* Verify that the last value is in range */ + if (lastValue < firstValue) { error(eSETRANGE); - lastValue = firstValue; + lastValue = firstValue; } /* end if */ - else if (lastValue > s->maxValue) { + else if (lastValue > s->maxValue) { error(eSETRANGE); - lastValue = s->maxValue; + lastValue = s->maxValue; } /* end else if */ - /* Set all bits from firstValue through lastValue */ + /* Set all bits from firstValue through lastValue */ - setValue = (0xffff << (firstValue - s->minValue)); - setValue &= (0xffff >> ((BITS_IN_INTEGER-1) - (lastValue - s->minValue))); + setValue = (0xffff << (firstValue - s->minValue)); + setValue &= (0xffff >> ((BITS_IN_INTEGER-1) - (lastValue - s->minValue))); /* Now, generate P-Code to push the set value onto the stack */ pas_GenerateDataOperation(opPUSH, setValue); - break; + break; case sSCALAR : - if ((!s->typePtr) - || (s->typePtr != tknPtr->sParm.v.parent)) { - error(eSET); + if ((!s->typePtr) + || (s->typePtr != tknPtr->sParm.v.parent)) { + error(eSET); if (!s->typePtr) { - s->typeFound = true; - s->typePtr = tknPtr->sParm.v.parent; - s->setType = sSCALAR; - s->minValue = s->typePtr->sParm.t.minValue; - s->maxValue = s->typePtr->sParm.t.maxValue; + s->typeFound = true; + s->typePtr = tknPtr->sParm.v.parent; + s->setType = sSCALAR; + s->minValue = s->typePtr->sParm.t.minValue; + s->maxValue = s->typePtr->sParm.t.maxValue; } /* end if */ - } /* end if */ + } /* end if */ goto addVarToBits; case sINT : /* An integer subrange variable ? */ - case sCHAR : /* A character subrange variable? */ - if (s->setType != token) error(eSET); + case sCHAR : /* A character subrange variable? */ + if (s->setType != token) error(eSET); goto addVarToBits; - case sSUBRANGE : - if ((!s->typePtr) - || (s->typePtr != tknPtr->sParm.v.parent)) { + case sSUBRANGE : + if ((!s->typePtr) + || (s->typePtr != tknPtr->sParm.v.parent)) { - if ((tknPtr->sParm.v.parent->sParm.t.subType == sSCALAR) - || (tknPtr->sParm.v.parent->sParm.t.subType != s->setType)) - error(eSET); + if ((tknPtr->sParm.v.parent->sParm.t.subType == sSCALAR) + || (tknPtr->sParm.v.parent->sParm.t.subType != s->setType)) + error(eSET); if (!s->typePtr) { - s->typeFound = true; - s->typePtr = tknPtr->sParm.v.parent; - s->setType = s->typePtr->sParm.t.subType; - s->minValue = s->typePtr->sParm.t.minValue; - s->maxValue = s->typePtr->sParm.t.maxValue; + s->typeFound = true; + s->typePtr = tknPtr->sParm.v.parent; + s->setType = s->typePtr->sParm.t.subType; + s->minValue = s->typePtr->sParm.t.minValue; + s->maxValue = s->typePtr->sParm.t.maxValue; } /* end if */ - } /* end if */ + } /* end if */ addVarToBits: - /* Verify that the first value is in range */ + /* Verify that the first value is in range */ - if (firstValue < s->minValue) { - error(eSETRANGE); - firstValue = s->minValue; + if (firstValue < s->minValue) { + error(eSETRANGE); + firstValue = s->minValue; } /* end if */ - else if (firstValue > s->maxValue) { - error(eSETRANGE); + else if (firstValue > s->maxValue) { + error(eSETRANGE); firstValue = s->maxValue; - } /* end else if */ + } /* end else if */ - /* Set all bits from firstValue through maxValue */ + /* Set all bits from firstValue through maxValue */ - setValue = (0xffff >> ((BITS_IN_INTEGER-1) - (s->maxValue - s->minValue))); - setValue &= (0xffff << (firstValue - s->minValue)); + setValue = (0xffff >> ((BITS_IN_INTEGER-1) - (s->maxValue - s->minValue))); + setValue &= (0xffff << (firstValue - s->minValue)); - /* Generate run-time logic to get all bits from firstValue */ - /* through last value, i.e., need to generate logic to get: */ - /* 0xffff >> ((BITS_IN_INTEGER-1)-(lastValue-minValue)) */ + /* Generate run-time logic to get all bits from firstValue */ + /* through last value, i.e., need to generate logic to get: */ + /* 0xffff >> ((BITS_IN_INTEGER-1)-(lastValue-minValue)) */ - pas_GenerateDataOperation(opPUSH, 0xffff); - pas_GenerateDataOperation(opPUSH, ((BITS_IN_INTEGER-1) + s->minValue)); - pas_GenerateStackReference(opLDS, tknPtr); - pas_GenerateSimple(opSUB); - pas_GenerateSimple(opSRL); + pas_GenerateDataOperation(opPUSH, 0xffff); + pas_GenerateDataOperation(opPUSH, ((BITS_IN_INTEGER-1) + s->minValue)); + pas_GenerateStackReference(opLDS, tknPtr); + pas_GenerateSimple(opSUB); + pas_GenerateSimple(opSRL); /* Then AND this with the setValue */ if (setValue != 0xffff) { - pas_GenerateDataOperation(opPUSH, setValue); - pas_GenerateSimple(opAND); + pas_GenerateDataOperation(opPUSH, setValue); + pas_GenerateSimple(opAND); } /* end if */ getToken(); break; - default : + default : error(eSET); - pas_GenerateDataOperation(opPUSH, 0); - break; + pas_GenerateDataOperation(opPUSH, 0); + break; - } /* end switch */ + } /* end switch */ } /* end else */ break; case sSCALAR : if (s->typeFound) { - if ((!s->typePtr) || (s->typePtr != tknPtr->sParm.v.parent)) + if ((!s->typePtr) || (s->typePtr != tknPtr->sParm.v.parent)) error(eSET); } /* end if */ else { s->typeFound = true; - s->typePtr = tknPtr->sParm.v.parent; - s->setType = sSCALAR; - s->minValue = s->typePtr->sParm.t.minValue; + s->typePtr = tknPtr->sParm.v.parent; + s->setType = sSCALAR; + s->minValue = s->typePtr->sParm.t.minValue; s->maxValue = s->typePtr->sParm.t.maxValue; } /* end if */ goto addVar; @@ -2527,8 +2527,8 @@ static void getSetElement(setTypeStruct *s) case sINT : /* An integer subrange variable ? */ case sCHAR : /* A character subrange variable? */ if (!s->typeFound) { - s->typeFound = true; - s->setType = token; + s->typeFound = true; + s->setType = token; } /* end if */ else if (s->setType != token) error(eSET); @@ -2536,14 +2536,14 @@ static void getSetElement(setTypeStruct *s) case sSUBRANGE : if (s->typeFound) { - if ((!s->typePtr) || (s->typePtr != tknPtr->sParm.v.parent)) + if ((!s->typePtr) || (s->typePtr != tknPtr->sParm.v.parent)) error(eSET); } /* end if */ else { s->typeFound = true; - s->typePtr = tknPtr->sParm.v.parent; - s->setType = s->typePtr->sParm.t.subType; - s->minValue = s->typePtr->sParm.t.minValue; + s->typePtr = tknPtr->sParm.v.parent; + s->setType = s->typePtr->sParm.t.subType; + s->minValue = s->typePtr->sParm.t.minValue; s->maxValue = s->typePtr->sParm.t.maxValue; } /* end if */ @@ -2555,130 +2555,130 @@ static void getSetElement(setTypeStruct *s) getToken(); if (token != tSUBRANGE) { - /* Generate P-Code to push the set value onto the stack */ + /* Generate P-Code to push the set value onto the stack */ /* FORM: 1 << (firstValue - minValue) */ pas_GenerateDataOperation(opPUSH, 1); - pas_GenerateStackReference(opLDS, setPtr); - pas_GenerateDataOperation(opPUSH, s->minValue); - pas_GenerateSimple(opSUB); - pas_GenerateSimple(opSLL); + pas_GenerateStackReference(opLDS, setPtr); + pas_GenerateDataOperation(opPUSH, s->minValue); + pas_GenerateSimple(opSUB); + pas_GenerateSimple(opSLL); } /* end if */ else { if (!s->typeFound) error(eSUBRANGETYPE); - /* Skip over the tSUBRANGE token */ + /* Skip over the tSUBRANGE token */ - getToken(); + getToken(); - /* TYPE check */ + /* TYPE check */ - switch (token) { + switch (token) { case sSCALAR_OBJECT : /* A scalar or scalar subrange constant */ - lastValue = tknPtr->sParm.c.val.i; - if ((s->setType != sSCALAR) - || (s->typePtr != tknPtr->sParm.c.parent)) - error(eSET); - goto addBitsToVar; + lastValue = tknPtr->sParm.c.val.i; + if ((s->setType != sSCALAR) + || (s->typePtr != tknPtr->sParm.c.parent)) + error(eSET); + goto addBitsToVar; - case tINT_CONST : /* An integer subrange constant ? */ - lastValue = tknInt; - if (s->setType != sINT) error(eSET); - goto addBitsToVar; + case tINT_CONST : /* An integer subrange constant ? */ + lastValue = tknInt; + if (s->setType != sINT) error(eSET); + goto addBitsToVar; - case tCHAR_CONST : /* A character subrange constant */ - lastValue = tknInt; - if (s->setType != sCHAR) error(eSET); + case tCHAR_CONST : /* A character subrange constant */ + lastValue = tknInt; + if (s->setType != sCHAR) error(eSET); - addBitsToVar : - /* Verify that the last value is in range */ + addBitsToVar : + /* Verify that the last value is in range */ - if (lastValue < s->minValue) { + if (lastValue < s->minValue) { error(eSETRANGE); - lastValue = s->minValue; + lastValue = s->minValue; } /* end if */ - else if (lastValue > s->maxValue) { + else if (lastValue > s->maxValue) { error(eSETRANGE); - lastValue = s->maxValue; + lastValue = s->maxValue; } /* end else if */ - /* Set all bits from minValue through lastValue */ + /* Set all bits from minValue through lastValue */ - setValue = (0xffff >> ((BITS_IN_INTEGER-1) - (lastValue - s->minValue))); + setValue = (0xffff >> ((BITS_IN_INTEGER-1) - (lastValue - s->minValue))); /* Now, generate P-Code to push the set value onto the stack */ - /* First generate: 0xffff << (firstValue-minValue) */ + /* First generate: 0xffff << (firstValue-minValue) */ - pas_GenerateDataOperation(opPUSH, 0xffff); - pas_GenerateStackReference(opLDS, setPtr); + pas_GenerateDataOperation(opPUSH, 0xffff); + pas_GenerateStackReference(opLDS, setPtr); if (s->minValue) { - pas_GenerateDataOperation(opPUSH, s->minValue); - pas_GenerateSimple(opSUB); + pas_GenerateDataOperation(opPUSH, s->minValue); + pas_GenerateSimple(opSUB); } /* end if */ - pas_GenerateSimple(opSLL); + pas_GenerateSimple(opSLL); /* Then and this with the pre-computed constant set value */ if (setValue != 0xffff) { - pas_GenerateDataOperation(opPUSH, setValue); - pas_GenerateSimple(opAND); + pas_GenerateDataOperation(opPUSH, setValue); + pas_GenerateSimple(opAND); } /* end if */ getToken(); - break; + break; case sINT : /* An integer subrange variable ? */ case sCHAR : /* A character subrange variable? */ if (s->setType != token) error(eSET); - goto addVarToVar; + goto addVarToVar; - case sSCALAR : - if (s->typePtr != tknPtr->sParm.v.parent) error(eSET); - goto addVarToVar; + case sSCALAR : + if (s->typePtr != tknPtr->sParm.v.parent) error(eSET); + goto addVarToVar; - case sSUBRANGE : - if ((s->typePtr != tknPtr->sParm.v.parent) - && ((tknPtr->sParm.v.parent->sParm.t.subType == sSCALAR) + case sSUBRANGE : + if ((s->typePtr != tknPtr->sParm.v.parent) + && ((tknPtr->sParm.v.parent->sParm.t.subType == sSCALAR) || (tknPtr->sParm.v.parent->sParm.t.subType != s->setType))) - error(eSET); + error(eSET); addVarToVar: - /* Generate run-time logic to get all bits from firstValue */ - /* through lastValue */ - /* First generate: 0xffff << (firstValue-minValue) */ + /* Generate run-time logic to get all bits from firstValue */ + /* through lastValue */ + /* First generate: 0xffff << (firstValue-minValue) */ - pas_GenerateDataOperation(opPUSH, 0xffff); - pas_GenerateStackReference(opLDS, setPtr); - if (s->minValue) { - pas_GenerateDataOperation(opPUSH, s->minValue); - pas_GenerateSimple(opSUB); + pas_GenerateDataOperation(opPUSH, 0xffff); + pas_GenerateStackReference(opLDS, setPtr); + if (s->minValue) { + pas_GenerateDataOperation(opPUSH, s->minValue); + pas_GenerateSimple(opSUB); } /* end if */ - pas_GenerateSimple(opSLL); + pas_GenerateSimple(opSLL); - /* Generate logic to get: */ - /* 0xffff >> ((BITS_IN_INTEGER-1)-(lastValue-minValue)) */ + /* Generate logic to get: */ + /* 0xffff >> ((BITS_IN_INTEGER-1)-(lastValue-minValue)) */ - pas_GenerateDataOperation(opPUSH, 0xffff); - pas_GenerateDataOperation(opPUSH, ((BITS_IN_INTEGER-1) + s->minValue)); - pas_GenerateStackReference(opLDS, tknPtr); - pas_GenerateSimple(opSUB); - pas_GenerateSimple(opSRL); + pas_GenerateDataOperation(opPUSH, 0xffff); + pas_GenerateDataOperation(opPUSH, ((BITS_IN_INTEGER-1) + s->minValue)); + pas_GenerateStackReference(opLDS, tknPtr); + pas_GenerateSimple(opSUB); + pas_GenerateSimple(opSRL); /* Then AND the two values */ - pas_GenerateSimple(opAND); + pas_GenerateSimple(opAND); - getToken(); + getToken(); break; - default : + default : error(eSET); - pas_GenerateDataOperation(opPUSH, 0); - break; + pas_GenerateDataOperation(opPUSH, 0); + break; - } /* end switch */ + } /* end switch */ } /* end else */ break; diff --git a/misc/pascal/pascal/pffunc.c b/misc/pascal/pascal/pffunc.c index 0820272ae..b2e985016 100644 --- a/misc/pascal/pascal/pffunc.c +++ b/misc/pascal/pascal/pffunc.c @@ -129,7 +129,7 @@ exprType builtInFunction(void) expression(exprReal, NULL); pas_GenerateFpOperation(fpROUND); funcType = exprInteger; - break; + break; case txTRUNC : getToken(); /* Skip over 'trunc' */ expression(exprReal, NULL); @@ -447,6 +447,6 @@ static exprType getenvFunc(void) pas_BuiltInFunctionCall(lbGETENV); checkRParen(); return exprCString; -} +} /***********************************************************************/ diff --git a/misc/pascal/pascal/pproc.c b/misc/pascal/pascal/pproc.c index df02e11a1..960b44a27 100644 --- a/misc/pascal/pascal/pproc.c +++ b/misc/pascal/pascal/pproc.c @@ -120,7 +120,7 @@ void builtInProcedure(void) fileProc(xWRITE_PAGE); break; - case txREAD : + case txREAD : getToken(); (void)readProc(); break; @@ -137,7 +137,7 @@ void builtInProcedure(void) fileProc(xREWRITE); break; - case txWRITE : + case txWRITE : getToken(); (void)writeProc(); break; @@ -146,11 +146,11 @@ void builtInProcedure(void) writelnProc(); break; - case txGET : - case txNEW : - case txPACK : - case txPUT : - case txUNPACK : + case txGET : + case txNEW : + case txPACK : + case txPUT : + case txUNPACK : error(eNOTYET); getToken(); break; @@ -161,7 +161,7 @@ void builtInProcedure(void) break; /* Its not a recognized procedure */ - + default : error(eINVALIDPROC); break; @@ -489,7 +489,7 @@ static void readlnProc(void) /* READLN procedure */ } /* end readlnProc */ /****************************************************************************/ -/* REWRITE/RESET/PAGE procedure call -- REWRITE sets the file pointer to the +/* REWRITE/RESET/PAGE procedure call -- REWRITE sets the file pointer to the * beginning of the file and prepares the file for write access; RESET is * similar except that it prepares the file for read access; PAGE simply * writes a form-feed to the file (no check is made, but is meaningful only @@ -698,7 +698,7 @@ static void valProc(void) /* VAL procedure */ TRACE(lstFile, "[valProc]"); /* Declaration: - * procedure val(const S : string; var V; var Code : word); + * procedure val(const S : string; var V; var Code : word); * * Description: * val() converts the value represented in the string S to a numerical @@ -713,7 +713,7 @@ static void valProc(void) /* VAL procedure */ * * Errors: * If the conversion doesn��t succeed, the value of Code indicates the - * position where the conversion went wrong. + * position where the conversion went wrong. */ /* Skip over the 'val' identifer */ diff --git a/misc/pascal/pascal/pstm.c b/misc/pascal/pascal/pstm.c index ee3730800..bac8a18fa 100644 --- a/misc/pascal/pascal/pstm.c +++ b/misc/pascal/pascal/pstm.c @@ -266,7 +266,7 @@ static void pas_SimpleAssignment(STYPE *varPtr, uint8_t assignFlags) } /* end if */ else if ((assignFlags & ADDRESS_ASSIGNMENT) != 0) pas_Assignment(opSTSX, exprIntegerPtr, varPtr, typePtr); - else + else pas_Assignment(opSTSX, exprInteger, varPtr, typePtr); } /* end if */ else @@ -292,7 +292,7 @@ static void pas_SimpleAssignment(STYPE *varPtr, uint8_t assignFlags) } /* end if */ else if ((assignFlags & ADDRESS_ASSIGNMENT) != 0) pas_Assignment(opSTSX, exprCharPtr, varPtr, typePtr); - else + else pas_Assignment(opSTSXB, exprChar, varPtr, typePtr); } /* end if */ else @@ -318,7 +318,7 @@ static void pas_SimpleAssignment(STYPE *varPtr, uint8_t assignFlags) } /* end if */ else if ((assignFlags & ADDRESS_ASSIGNMENT) != 0) pas_Assignment(opSTSX, exprBooleanPtr, varPtr, typePtr); - else + else pas_Assignment(opSTSX, exprBoolean, varPtr, NULL); } /* end if */ else @@ -344,7 +344,7 @@ static void pas_SimpleAssignment(STYPE *varPtr, uint8_t assignFlags) } /* end if */ else if ((assignFlags & ADDRESS_ASSIGNMENT) != 0) pas_Assignment(opSTSX, exprRealPtr, varPtr, typePtr); - else + else pas_LargeAssignment(opSTSXM, exprReal, varPtr, typePtr); } /* end if */ else @@ -370,7 +370,7 @@ static void pas_SimpleAssignment(STYPE *varPtr, uint8_t assignFlags) } /* end if */ else if ((assignFlags & ADDRESS_ASSIGNMENT) != 0) pas_Assignment(opSTSX, exprScalarPtr, varPtr, typePtr); - else + else pas_Assignment(opSTSX, exprScalar, varPtr, typePtr); } /* end if */ else @@ -396,7 +396,7 @@ static void pas_SimpleAssignment(STYPE *varPtr, uint8_t assignFlags) } /* end if */ else if ((assignFlags & ADDRESS_ASSIGNMENT) != 0) pas_Assignment(opSTSX, exprSetPtr, varPtr, typePtr); - else + else pas_Assignment(opSTSX, exprSet, varPtr, typePtr); } /* end if */ else @@ -888,7 +888,7 @@ static void pas_ProcStatement(void) /* Generate procedure call and stack adjustment (if required) * Upon return from the procedure, the level stack pointer (LSP) - * may also be invalid. However, we rely on level level logic in + * may also be invalid. However, we rely on level level logic in * pgen.c to manage this case (as well as the function call case). */ @@ -1143,7 +1143,7 @@ static void pas_WhileStatement(void) pas_GenerateDataOperation(opLABEL, endwhile_label); /* We always get here from the check at the top of the loop. - * Normally this will be from the branch from the bottom of + * Normally this will be from the branch from the bottom of * the loop to the top of the loop. Then from the conditional * branch at the top of the loop to here. * @@ -1290,7 +1290,7 @@ static void pas_CaseStatement(void) * NOTE: We accept any kind of constant for the case selector; there * really should be some check to assure that the constant is of the * same type as the expression! - */ + */ else { @@ -1518,7 +1518,7 @@ static void pas_ForStatement(void) pas_GenerateDataOperation(opINDS, -sINT_SIZE); /* We always get here from the check at the top of the loop. - * Normally this will be from the branch from the bottom of + * Normally this will be from the branch from the bottom of * the loop to the top of the loop. Then from the conditional * branch at the top of the loop to here. * diff --git a/misc/pascal/pascal/ptbl.c b/misc/pascal/pascal/ptbl.c index e77652aec..333feac99 100644 --- a/misc/pascal/pascal/ptbl.c +++ b/misc/pascal/pascal/ptbl.c @@ -175,7 +175,7 @@ const RTYPE *findReservedWord (char *name) return (RTYPE*)NULL; /* return NULL pointer if no match */ -} /* fnd findReservedWord */ +} /* fnd findReservedWord */ /***************************************************************/ @@ -681,7 +681,7 @@ void dumpTables(void) default : fprintf(lstFile, "Unknown sKind\n"); break; - + } /* end switch */ } /* end for */ diff --git a/misc/pascal/pascal/ptdefs.h b/misc/pascal/pascal/ptdefs.h index 7d3ce55c1..01f00079e 100644 --- a/misc/pascal/pascal/ptdefs.h +++ b/misc/pascal/pascal/ptdefs.h @@ -100,7 +100,7 @@ /* Token Values 0x80-0xef are for RESERVED WORDS */ -/* Standard constants (TRUE, FALSE, MAXINT) and standard files (INPUT, OUTPUT) +/* Standard constants (TRUE, FALSE, MAXINT) and standard files (INPUT, OUTPUT) * are hard initialized into the constant/symbol table and are transparent * to the compiler */ diff --git a/misc/pascal/pascal/ptkn.c b/misc/pascal/pascal/ptkn.c index 192f5f817..dad58fa23 100644 --- a/misc/pascal/pascal/ptkn.c +++ b/misc/pascal/pascal/ptkn.c @@ -178,7 +178,7 @@ char getNextCharacter(bool skipWhiteSpace) /* If it is a space and we have been told to skip spaces then consume * the input line until a non-space or the EOL is encountered. - */ + */ else if (skipWhiteSpace) { @@ -393,7 +393,7 @@ void getToken(void) DEBUG(lstFile,"[%02x]", token); -} /* End getToken */ +} /* End getToken */ /*************************************************************** * Private Functions @@ -452,7 +452,7 @@ static void identifier(void) } /* end else */ -} /* End identifier */ +} /* End identifier */ /***************************************************************/ /* Process string */ diff --git a/misc/pascal/pascal/punit.c b/misc/pascal/pascal/punit.c index 00b74e18b..a131d9540 100644 --- a/misc/pascal/pascal/punit.c +++ b/misc/pascal/pascal/punit.c @@ -355,7 +355,7 @@ static void interfaceSection(void) /* Process the exported-heading * - * FORM: exported-heading = + * FORM: exported-heading = * procedure-heading ';' [ directive ] | * function-heading ';' [ directive ] */ @@ -458,8 +458,8 @@ static void exportedProcedureHeading(void) if (token != ';') error (eSEMICOLON); else getToken(); - /* If we are compiling a program or unit that "imports" the - * procedure then generate the appropriate symbol table entries + /* If we are compiling a program or unit that "imports" the + * procedure then generate the appropriate symbol table entries * in the output file to support relocation when the external * procedure is called. */ @@ -573,8 +573,8 @@ static void exportedFunctionHeading(void) if (token != ';') error (eSEMICOLON); else getToken(); - /* If we are compiling a program or unit that "imports" the - * function then generate the appropriate symbol table entries + /* If we are compiling a program or unit that "imports" the + * function then generate the appropriate symbol table entries * in the output file to support relocation when the external * function is called. */ diff --git a/misc/pascal/plink/plink.c b/misc/pascal/plink/plink.c index 0e9c15078..e4c2c69e0 100644 --- a/misc/pascal/plink/plink.c +++ b/misc/pascal/plink/plink.c @@ -401,7 +401,7 @@ static uint32_t mergeRoData(poffHandle_t inHandle, poffHandle_t outHandle) return oldRoDataSize; } - + /***********************************************************************/ /* This function merges the program data section of a new file into the * program data section of the output file, relocating simple program diff --git a/misc/pascal/plink/plsym.c b/misc/pascal/plink/plsym.c index 3f27f512b..ed3f54d01 100644 --- a/misc/pascal/plink/plsym.c +++ b/misc/pascal/plink/plsym.c @@ -325,8 +325,8 @@ static symContainer_t *insertSymbol(poffLibSymbol_t *sym) } /* We get here if: - * a. curr == NULL meaning that the symbol goes at the end of the - * list. (special case, prev == NULL as well. This happens when + * a. curr == NULL meaning that the symbol goes at the end of the + * list. (special case, prev == NULL as well. This happens when * the list is empty). * b. curr != NULL mean that the symbol goes between prev and curr * (special cases: (i) compare == 0 meaning that the symbol is @@ -406,7 +406,7 @@ static symContainer_t *insertSymbol(poffLibSymbol_t *sym) newsym = makeSymContainer(sym); newsym->next = curr; newsym->prev = prev; - + if (prev) prev->next = newsym; else diff --git a/misc/pascal/tests/src/006-optconst.pas b/misc/pascal/tests/src/006-optconst.pas index 511d807eb..43f50adb4 100644 --- a/misc/pascal/tests/src/006-optconst.pas +++ b/misc/pascal/tests/src/006-optconst.pas @@ -1,7 +1,7 @@ { A test of constant optimiztion } program constopt; -var +var i1, i2, i3 : integer; b1 : boolean begin @@ -11,7 +11,7 @@ begin 3. *, DIV, AND, SHL, SHR 4. -, NOT } - + i1 := -2; { -2 } i1 := 3 * 2; { 6 } i1 := 3 * (-2); { -6 } diff --git a/misc/pascal/tests/src/202-strcmp.pas b/misc/pascal/tests/src/202-strcmp.pas index cff214403..60c48f5b4 100644 --- a/misc/pascal/tests/src/202-strcmp.pas +++ b/misc/pascal/tests/src/202-strcmp.pas @@ -6,7 +6,7 @@ CONST lexmiddle2 = 'ZZZLexically Middl'; lexsmall = 'AAALexically Small'; lexnothing = '' -VAR +VAR string1, string2 : string; BEGIN IF (lexbig <= lexmiddle) THEN @@ -18,22 +18,22 @@ BEGIN writeln('ERROR: ', lexmiddle, ' > ', lexmiddle1) else writeln('OKAY: ', lexmiddle, ' <= ', lexmiddle1); - + IF (lexmiddle <> lexmiddle) THEN writeln('ERROR: ', lexmiddle, ' <> ', lexmiddle) else writeln('OKAY: ', lexmiddle, ' = ', lexmiddle); - + IF (lexmiddle = lexnothing) THEN writeln('ERROR: ', lexmiddle, ' = ', lexnothing) else writeln('OKAY: ', lexmiddle, ' <> ', lexnothing); - + IF (lexnothing <> lexnothing) THEN writeln('ERROR: ', lexnothing, ' <> ', lexnothing) else writeln('OKAY: ', lexnothing, ' = ', lexnothing); - + IF (lexmiddle < lexmiddle2) THEN writeln('ERROR: ', lexmiddle, ' < ', lexmiddle2) else @@ -43,5 +43,5 @@ BEGIN writeln('ERROR: ', lexsmall, ' >= ', lexmiddle) else writeln('OKAY: ', lexsmall, ' < ', lexmiddle) - + END. diff --git a/misc/pascal/tests/src/501-uses.pas b/misc/pascal/tests/src/501-uses.pas index 49c3cdaac..1b34add48 100644 --- a/misc/pascal/tests/src/501-uses.pas +++ b/misc/pascal/tests/src/501-uses.pas @@ -1,5 +1,5 @@ program MyProgram; - + uses MyCosineUnit in '501-unit-cosine.pas'; MySineUnit in '501-unit-sine.pas'; @@ -7,7 +7,7 @@ uses var x : real; - + begin write('Enter radians : '); read(x); diff --git a/misc/pascal/tests/src/803-redirect.pas b/misc/pascal/tests/src/803-redirect.pas index d53acc1e1..27afb5165 100644 --- a/misc/pascal/tests/src/803-redirect.pas +++ b/misc/pascal/tests/src/803-redirect.pas @@ -71,7 +71,7 @@ var NewLocation := BASE + value end else - ; (* do nothing we have an undefined form element *) + ; (* do nothing we have an undefined form element *) end; begin (* ProcessCGIData *) diff --git a/misc/pascal/tests/src/804-cgiform.pas b/misc/pascal/tests/src/804-cgiform.pas index e3043f548..0c94290ec 100644 --- a/misc/pascal/tests/src/804-cgiform.pas +++ b/misc/pascal/tests/src/804-cgiform.pas @@ -258,7 +258,7 @@ var GenerateBody; GenerateFooter; end; (* GenerateResponse *) - + procedure Shutdown; begin (* Shutdown *) dispose(NameValuePairs); diff --git a/misc/pascal/tests/src/805-cgimail.pas b/misc/pascal/tests/src/805-cgimail.pas index 5b16f8d52..fbb490229 100644 --- a/misc/pascal/tests/src/805-cgimail.pas +++ b/misc/pascal/tests/src/805-cgimail.pas @@ -254,7 +254,7 @@ var writeln(pipe, '.'); close(pipe); end; //SendEmailWithSendMail - + //*************************************************************** //PURPOSE: Sends and email message using the CDONTS components //NOTE: The CDONTS components were created by Microsoft to diff --git a/misc/pascal/tests/src/806-cgicook.pas b/misc/pascal/tests/src/806-cgicook.pas index 7da5ecffd..a7d2fa5fa 100644 --- a/misc/pascal/tests/src/806-cgicook.pas +++ b/misc/pascal/tests/src/806-cgicook.pas @@ -436,7 +436,7 @@ var begin (* GenerateBodyData *) writeln('<tr>'); writeln('<td width="100%">'); - + //Generate the HTML to display the cookies returned by the browser. writeln('<h1>Current Cookies</h1>'); iNumCookies := length(Cookies); //Number of cookies returned by the browser diff --git a/misc/pascal/tests/src/901-pageutils.pas b/misc/pascal/tests/src/901-pageutils.pas index 855620b1c..f78120eef 100644 --- a/misc/pascal/tests/src/901-pageutils.pas +++ b/misc/pascal/tests/src/901-pageutils.pas @@ -5268,7 +5268,7 @@ END; { change_const_line } { ************************* set_line_flags ******************************** } -PROCEDURE set_line_flags +PROCEDURE set_line_flags (page: page_pointer; ind: short; select, attribute: char; get_line_pointer: get_line_pointer_type) ; @@ -5301,7 +5301,7 @@ END; { set_line_flags } { ************************* get_line_flags ******************************** } -PROCEDURE get_line_flags +PROCEDURE get_line_flags (page: page_pointer; ind: short; VAR select, attribute: char; get_line_pointer: get_line_pointer_type) ; @@ -5326,7 +5326,7 @@ END; { get_line_flags } { ************************* is_selected *********************************** } -FUNCTION is_selected +FUNCTION is_selected (list: list_cb_type; page: page_pointer; ind: short; get_line_pointer: get_line_pointer_type): boolean ; @@ -5360,7 +5360,7 @@ END; { is_selected } { ************************* set_list_line_flags *************************** } -PROCEDURE set_list_line_flags +PROCEDURE set_list_line_flags (VAR list: list_cb_type; select, attribute: char; get_line_pointer: get_line_pointer_type ) ; @@ -5384,7 +5384,7 @@ END; { set_list_line_flags } { ************************* get_next_selected_line ************************ } -PROCEDURE get_next_selected_line +PROCEDURE get_next_selected_line (VAR list: list_cb_type; VAR page: page_pointer; VAR ind: short; get_line_pointer: get_line_pointer_type) ; @@ -5408,7 +5408,7 @@ END; { get_next_selected_line } { ************************* get_prev_selected_line ************************ } -PROCEDURE get_prev_selected_line +PROCEDURE get_prev_selected_line (VAR list: list_cb_type; VAR page: page_pointer; VAR ind: short; get_line_pointer: get_line_pointer_type) ; @@ -5432,7 +5432,7 @@ END; { get_prev_selected_line } { ************************* get_first_selected_line_m *********************** } -PROCEDURE get_first_selected_line_m +PROCEDURE get_first_selected_line_m (VAR list: list_cb_type; VAR page: page_pointer; VAR ind: short; get_line_pointer: get_line_pointer_type) ; @@ -5453,7 +5453,7 @@ END; { get_first_selected_line_m } { ************************* get_first_selected_line ************************ } -PROCEDURE get_first_selected_line +PROCEDURE get_first_selected_line (VAR list: list_cb_type; VAR page: page_pointer; VAR ind: short; get_line_pointer: get_line_pointer_type) ; diff --git a/misc/tools/README.txt b/misc/tools/README.txt index 64ca0b3bd..7eaa77fff 100644 --- a/misc/tools/README.txt +++ b/misc/tools/README.txt @@ -128,7 +128,7 @@ kconfig-frontends-3.3.0-1-libintl.patch See: http://ymorin.is-a-geek.org/hg/kconfig-frontends/file/tip/docs/known-issues.txt - Update: Version 3.6.0 (and above) will build on Cygwin with no patches: + Update: Version 3.6.0 (and above) will build on Cygwin with no patches: http://ymorin.is-a-geek.org/download/kconfig-frontends/ diff --git a/misc/tools/kconfig-frontends-3.3.0-1-libintl.patch b/misc/tools/kconfig-frontends-3.3.0-1-libintl.patch index 3fe3f8163..4774194d0 100644 --- a/misc/tools/kconfig-frontends-3.3.0-1-libintl.patch +++ b/misc/tools/kconfig-frontends-3.3.0-1-libintl.patch @@ -3,11 +3,11 @@ diff -ru kconfig-frontends-3.3.0-1.orig//frontends/nconf/nconf.c kconfig-fronten +++ kconfig-frontends-3.3.0-1/frontends/nconf/nconf.c 2012-04-05 15:16:06.590563200 -0600 @@ -1503,7 +1503,7 @@ } - + notimeout(stdscr, FALSE); - ESCDELAY = 1; + //ESCDELAY = 1; - + /* set btns menu */ curses_menu = new_menu(curses_menu_items); diff -ru kconfig-frontends-3.3.0-1.orig//frontends/nconf/nconf.h kconfig-frontends-3.3.0-1/frontends/nconf/nconf.h @@ -27,22 +27,22 @@ diff -ru kconfig-frontends-3.3.0-1.orig//libs/lxdialog/dialog.h kconfig-frontend @@ -26,11 +26,7 @@ #include <string.h> #include <stdbool.h> - + -#ifndef KBUILD_NO_NLS -# include <libintl.h> -#else # define gettext(Msgid) ((const char *) (Msgid)) -#endif - + #ifdef __sun__ #define CURS_MACROS diff -ru kconfig-frontends-3.3.0-1.orig//libs/parser/lkc.h kconfig-frontends-3.3.0-1/libs/parser/lkc.h --- kconfig-frontends-3.3.0-1.orig//libs/parser/lkc.h 2012-03-20 16:07:45.000000000 -0600 +++ kconfig-frontends-3.3.0-1/libs/parser/lkc.h 2012-04-05 14:59:02.969015400 -0600 @@ -8,14 +8,10 @@ - + #include "expr.h" - + -#ifndef KBUILD_NO_NLS -# include <libintl.h> -#else @@ -51,7 +51,7 @@ diff -ru kconfig-frontends-3.3.0-1.orig//libs/parser/lkc.h kconfig-frontends-3.3 static inline void bindtextdomain(const char *name, const char *dir) {} static inline char *bind_textdomain_codeset(const char *dn, char *c) { return c; } -#endif - + #ifdef __cplusplus extern "C" { diff -ru kconfig-frontends-3.3.0-1.orig//libs/parser/yconf.c kconfig-frontends-3.3.0-1/libs/parser/yconf.c @@ -59,7 +59,7 @@ diff -ru kconfig-frontends-3.3.0-1.orig//libs/parser/yconf.c kconfig-frontends-3 +++ kconfig-frontends-3.3.0-1/libs/parser/yconf.c 2012-04-05 14:59:40.732175300 -0600 @@ -285,12 +285,6 @@ #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) - + #ifndef YY_ -# if YYENABLE_NLS -# if ENABLE_NLS diff --git a/misc/tools/kconfig-frontends/Makefile.in b/misc/tools/kconfig-frontends/Makefile.in index 0d1e6f93d..d1ac32ce7 100644 --- a/misc/tools/kconfig-frontends/Makefile.in +++ b/misc/tools/kconfig-frontends/Makefile.in @@ -358,7 +358,7 @@ scripts/.autostuff/config.h: scripts/.autostuff/stamp-h1 scripts/.autostuff/stamp-h1: $(top_srcdir)/scripts/.autostuff/config.h.in $(top_builddir)/config.status @rm -f scripts/.autostuff/stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status scripts/.autostuff/config.h -$(top_srcdir)/scripts/.autostuff/config.h.in: $(am__configure_deps) +$(top_srcdir)/scripts/.autostuff/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f scripts/.autostuff/stamp-h1 touch $@ diff --git a/misc/tools/kconfig-frontends/aclocal.m4 b/misc/tools/kconfig-frontends/aclocal.m4 index 94136cef4..815633438 100644 --- a/misc/tools/kconfig-frontends/aclocal.m4 +++ b/misc/tools/kconfig-frontends/aclocal.m4 @@ -22,7 +22,7 @@ To do so, use the procedure documented by the package, typically `autoreconf'.]) # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # serial 1 (pkg-config-0.24) -# +# # Copyright © 2004 Scott James Remnant <scott@netsplit.com>. # # This program is free software; you can redistribute it and/or modify @@ -145,7 +145,7 @@ if test $pkg_failed = yes; then _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` - else + else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs diff --git a/misc/tools/kconfig-frontends/docs/kconfig-language.txt b/misc/tools/kconfig-frontends/docs/kconfig-language.txt index c420676c6..8174b4ed2 100644 --- a/misc/tools/kconfig-frontends/docs/kconfig-language.txt +++ b/misc/tools/kconfig-frontends/docs/kconfig-language.txt @@ -173,7 +173,7 @@ module state. Dependency expressions have the following syntax: <expr> '&&' <expr> (6) <expr> '||' <expr> (7) -Expressions are listed in decreasing order of precedence. +Expressions are listed in decreasing order of precedence. (1) Convert the symbol into an expression. Boolean and tristate symbols are simply converted into the respective expression values. All diff --git a/misc/tools/kconfig-frontends/frontends/conf/Makefile.in b/misc/tools/kconfig-frontends/frontends/conf/Makefile.in index 9e8ee4c66..caaa7b329 100644 --- a/misc/tools/kconfig-frontends/frontends/conf/Makefile.in +++ b/misc/tools/kconfig-frontends/frontends/conf/Makefile.in @@ -368,7 +368,7 @@ clean-binPROGRAMS: list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list -conf$(EXEEXT): $(conf_OBJECTS) $(conf_DEPENDENCIES) $(EXTRA_conf_DEPENDENCIES) +conf$(EXEEXT): $(conf_OBJECTS) $(conf_DEPENDENCIES) $(EXTRA_conf_DEPENDENCIES) @rm -f conf$(EXEEXT) $(AM_V_CCLD)$(conf_LINK) $(conf_OBJECTS) $(conf_LDADD) $(LIBS) diff --git a/misc/tools/kconfig-frontends/frontends/gconf/Makefile.in b/misc/tools/kconfig-frontends/frontends/gconf/Makefile.in index b491ef5d4..1e7362b06 100644 --- a/misc/tools/kconfig-frontends/frontends/gconf/Makefile.in +++ b/misc/tools/kconfig-frontends/frontends/gconf/Makefile.in @@ -407,7 +407,7 @@ clean-binPROGRAMS: list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list -gconf$(EXEEXT): $(gconf_OBJECTS) $(gconf_DEPENDENCIES) $(EXTRA_gconf_DEPENDENCIES) +gconf$(EXEEXT): $(gconf_OBJECTS) $(gconf_DEPENDENCIES) $(EXTRA_gconf_DEPENDENCIES) @rm -f gconf$(EXEEXT) $(AM_V_CCLD)$(gconf_LINK) $(gconf_OBJECTS) $(gconf_LDADD) $(LIBS) diff --git a/misc/tools/kconfig-frontends/frontends/gconf/gconf.c.patch b/misc/tools/kconfig-frontends/frontends/gconf/gconf.c.patch index 4b55ff7b8..d43076161 100644 --- a/misc/tools/kconfig-frontends/frontends/gconf/gconf.c.patch +++ b/misc/tools/kconfig-frontends/frontends/gconf/gconf.c.patch @@ -2,12 +2,12 @@ diff --git a/frontends/gconf/gconf.c b/frontends/gconf/gconf.c --- a/frontends/gconf/gconf.c +++ b/frontends/gconf/gconf.c @@ -12,7 +12,7 @@ - + #include <stdlib.h> #include "lkc.h" -#include "images.c" +#include "images.h" - + #include <glade/glade.h> #include <gtk/gtk.h> @@ -1468,8 +1468,10 @@ @@ -19,13 +19,13 @@ diff --git a/frontends/gconf/gconf.c b/frontends/gconf/gconf.c +#endif - gchar *glade_file; + gchar *glade_file = GUI_PATH; - + bindtextdomain(PACKAGE, LOCALEDIR); bind_textdomain_codeset(PACKAGE, "UTF-8"); @@ -1483,6 +1485,7 @@ //add_pixmap_directory (PACKAGE_DATA_DIR "/" PACKAGE "/pixmaps"); //add_pixmap_directory (PACKAGE_SOURCE_DIR "/pixmaps"); - + +#if 0 /* Determine GUI path */ env = getenv(SRCTREE); @@ -35,6 +35,6 @@ diff --git a/frontends/gconf/gconf.c b/frontends/gconf/gconf.c else glade_file = g_strconcat(g_get_current_dir(), "/", av[0], ".glade", NULL); +#endif - + /* Conf stuffs */ if (ac > 1 && av[1][0] == '-') { diff --git a/misc/tools/kconfig-frontends/frontends/mconf/Makefile.in b/misc/tools/kconfig-frontends/frontends/mconf/Makefile.in index 0b684e88e..ba59b7df9 100644 --- a/misc/tools/kconfig-frontends/frontends/mconf/Makefile.in +++ b/misc/tools/kconfig-frontends/frontends/mconf/Makefile.in @@ -374,7 +374,7 @@ clean-binPROGRAMS: list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list -mconf$(EXEEXT): $(mconf_OBJECTS) $(mconf_DEPENDENCIES) $(EXTRA_mconf_DEPENDENCIES) +mconf$(EXEEXT): $(mconf_OBJECTS) $(mconf_DEPENDENCIES) $(EXTRA_mconf_DEPENDENCIES) @rm -f mconf$(EXEEXT) $(AM_V_CCLD)$(mconf_LINK) $(mconf_OBJECTS) $(mconf_LDADD) $(LIBS) diff --git a/misc/tools/kconfig-frontends/frontends/nconf/Makefile.in b/misc/tools/kconfig-frontends/frontends/nconf/Makefile.in index 82540d27b..b9f9d682f 100644 --- a/misc/tools/kconfig-frontends/frontends/nconf/Makefile.in +++ b/misc/tools/kconfig-frontends/frontends/nconf/Makefile.in @@ -372,7 +372,7 @@ clean-binPROGRAMS: list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list -nconf$(EXEEXT): $(nconf_OBJECTS) $(nconf_DEPENDENCIES) $(EXTRA_nconf_DEPENDENCIES) +nconf$(EXEEXT): $(nconf_OBJECTS) $(nconf_DEPENDENCIES) $(EXTRA_nconf_DEPENDENCIES) @rm -f nconf$(EXEEXT) $(AM_V_CCLD)$(nconf_LINK) $(nconf_OBJECTS) $(nconf_LDADD) $(LIBS) diff --git a/misc/tools/kconfig-frontends/frontends/qconf/Makefile.in b/misc/tools/kconfig-frontends/frontends/qconf/Makefile.in index a999f51a2..bb95195e3 100644 --- a/misc/tools/kconfig-frontends/frontends/qconf/Makefile.in +++ b/misc/tools/kconfig-frontends/frontends/qconf/Makefile.in @@ -397,7 +397,7 @@ clean-binPROGRAMS: list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list -qconf$(EXEEXT): $(qconf_OBJECTS) $(qconf_DEPENDENCIES) $(EXTRA_qconf_DEPENDENCIES) +qconf$(EXEEXT): $(qconf_OBJECTS) $(qconf_DEPENDENCIES) $(EXTRA_qconf_DEPENDENCIES) @rm -f qconf$(EXEEXT) $(AM_V_CXXLD)$(qconf_LINK) $(qconf_OBJECTS) $(qconf_LDADD) $(LIBS) diff --git a/misc/tools/kconfig-frontends/frontends/qconf/qconf.cc.patch b/misc/tools/kconfig-frontends/frontends/qconf/qconf.cc.patch index 6769d750c..a8a78bb55 100644 --- a/misc/tools/kconfig-frontends/frontends/qconf/qconf.cc.patch +++ b/misc/tools/kconfig-frontends/frontends/qconf/qconf.cc.patch @@ -3,10 +3,10 @@ diff --git a/frontends/qconf/qconf.cc b/frontends/qconf/qconf.cc +++ b/frontends/qconf/qconf.cc @@ -47,7 +47,7 @@ #include "qconf.h" - + #include "qconf.moc" -#include "images.c" +#include "images.h" - + #ifdef _ # undef _ diff --git a/misc/tools/kconfig-frontends/libs/images/Makefile.in b/misc/tools/kconfig-frontends/libs/images/Makefile.in index 6535424b2..2a748cda3 100644 --- a/misc/tools/kconfig-frontends/libs/images/Makefile.in +++ b/misc/tools/kconfig-frontends/libs/images/Makefile.in @@ -322,7 +322,7 @@ $(am__aclocal_m4_deps): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) -libkconfig-images.a: $(libkconfig_images_a_OBJECTS) $(libkconfig_images_a_DEPENDENCIES) $(EXTRA_libkconfig_images_a_DEPENDENCIES) +libkconfig-images.a: $(libkconfig_images_a_OBJECTS) $(libkconfig_images_a_DEPENDENCIES) $(EXTRA_libkconfig_images_a_DEPENDENCIES) $(AM_V_at)-rm -f libkconfig-images.a $(AM_V_AR)$(libkconfig_images_a_AR) libkconfig-images.a $(libkconfig_images_a_OBJECTS) $(libkconfig_images_a_LIBADD) $(AM_V_at)$(RANLIB) libkconfig-images.a diff --git a/misc/tools/kconfig-frontends/libs/lxdialog/Makefile.in b/misc/tools/kconfig-frontends/libs/lxdialog/Makefile.in index 0a07c7c90..86630bab3 100644 --- a/misc/tools/kconfig-frontends/libs/lxdialog/Makefile.in +++ b/misc/tools/kconfig-frontends/libs/lxdialog/Makefile.in @@ -334,7 +334,7 @@ $(am__aclocal_m4_deps): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) -libkconfig-lxdialog.a: $(libkconfig_lxdialog_a_OBJECTS) $(libkconfig_lxdialog_a_DEPENDENCIES) $(EXTRA_libkconfig_lxdialog_a_DEPENDENCIES) +libkconfig-lxdialog.a: $(libkconfig_lxdialog_a_OBJECTS) $(libkconfig_lxdialog_a_DEPENDENCIES) $(EXTRA_libkconfig_lxdialog_a_DEPENDENCIES) $(AM_V_at)-rm -f libkconfig-lxdialog.a $(AM_V_AR)$(libkconfig_lxdialog_a_AR) libkconfig-lxdialog.a $(libkconfig_lxdialog_a_OBJECTS) $(libkconfig_lxdialog_a_LIBADD) $(AM_V_at)$(RANLIB) libkconfig-lxdialog.a diff --git a/misc/tools/kconfig-frontends/libs/parser/Makefile.in b/misc/tools/kconfig-frontends/libs/parser/Makefile.in index d575f4e55..831feb460 100644 --- a/misc/tools/kconfig-frontends/libs/parser/Makefile.in +++ b/misc/tools/kconfig-frontends/libs/parser/Makefile.in @@ -413,7 +413,7 @@ clean-libLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -libkconfig-parser.la: $(libkconfig_parser_la_OBJECTS) $(libkconfig_parser_la_DEPENDENCIES) $(EXTRA_libkconfig_parser_la_DEPENDENCIES) +libkconfig-parser.la: $(libkconfig_parser_la_OBJECTS) $(libkconfig_parser_la_DEPENDENCIES) $(EXTRA_libkconfig_parser_la_DEPENDENCIES) $(AM_V_CCLD)$(libkconfig_parser_la_LINK) -rpath $(libdir) $(libkconfig_parser_la_OBJECTS) $(libkconfig_parser_la_LIBADD) $(LIBS) mostlyclean-compile: diff --git a/misc/tools/kconfig-frontends/libs/parser/lconf.c b/misc/tools/kconfig-frontends/libs/parser/lconf.c index 24aa3491c..aef090fb1 100644 --- a/misc/tools/kconfig-frontends/libs/parser/lconf.c +++ b/misc/tools/kconfig-frontends/libs/parser/lconf.c @@ -52,7 +52,7 @@ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. + * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 @@ -69,7 +69,7 @@ typedef uint32_t flex_uint32_t; typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; +typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; @@ -189,7 +189,7 @@ extern FILE *zconfin, *zconfout; #define EOB_ACT_LAST_MATCH 2 #define YY_LESS_LINENO(n) - + /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ @@ -251,7 +251,7 @@ struct yy_buffer_state int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ - + /* Whether to try to fill the input buffer when we reach the * end of it. */ @@ -900,7 +900,7 @@ extern int zconfwrap (void ); #endif static void yyunput (int c,char *buf_ptr ); - + #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ); #endif @@ -1010,7 +1010,7 @@ YY_DECL register yy_state_type yy_current_state; register char *yy_cp, *yy_bp; register int yy_act; - + int str = 0; int ts, i; @@ -1621,7 +1621,7 @@ static int yy_get_next_buffer (void) { register yy_state_type yy_current_state; register char *yy_cp; - + yy_current_state = (yy_start); for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) @@ -1640,7 +1640,7 @@ static int yy_get_next_buffer (void) static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { register int yy_is_jam; - + yy_current_state = yy_nxt[yy_current_state][1]; yy_is_jam = (yy_current_state <= 0); @@ -1650,7 +1650,7 @@ static int yy_get_next_buffer (void) static void yyunput (int c, register char * yy_bp ) { register char *yy_cp; - + yy_cp = (yy_c_buf_p); /* undo effects of setting up zconftext */ @@ -1693,7 +1693,7 @@ static int yy_get_next_buffer (void) { int c; - + *(yy_c_buf_p) = (yy_hold_char); if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) @@ -1760,12 +1760,12 @@ static int yy_get_next_buffer (void) /** Immediately switch to a different input stream. * @param input_file A readable stream. - * + * * @note This function does not reset the start condition to @c INITIAL . */ void zconfrestart (FILE * input_file ) { - + if ( ! YY_CURRENT_BUFFER ){ zconfensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = @@ -1778,11 +1778,11 @@ static int yy_get_next_buffer (void) /** Switch to a different input buffer. * @param new_buffer The new input buffer. - * + * */ void zconf_switch_to_buffer (YY_BUFFER_STATE new_buffer ) { - + /* TODO. We should be able to replace this entire function body * with * zconfpop_buffer_state(); @@ -1822,13 +1822,13 @@ static void zconf_load_buffer_state (void) /** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. - * + * * @return the allocated buffer state. */ YY_BUFFER_STATE zconf_create_buffer (FILE * file, int size ) { YY_BUFFER_STATE b; - + b = (YY_BUFFER_STATE) zconfalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in zconf_create_buffer()" ); @@ -1851,11 +1851,11 @@ static void zconf_load_buffer_state (void) /** Destroy the buffer. * @param b a buffer created with zconf_create_buffer() - * + * */ void zconf_delete_buffer (YY_BUFFER_STATE b ) { - + if ( ! b ) return; @@ -1876,7 +1876,7 @@ static void zconf_load_buffer_state (void) { int oerrno = errno; - + zconf_flush_buffer(b ); b->yy_input_file = file; @@ -1892,13 +1892,13 @@ static void zconf_load_buffer_state (void) } b->yy_is_interactive = 0; - + errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. - * + * */ void zconf_flush_buffer (YY_BUFFER_STATE b ) { @@ -1927,7 +1927,7 @@ static void zconf_load_buffer_state (void) * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. - * + * */ void zconfpush_buffer_state (YY_BUFFER_STATE new_buffer ) { @@ -1957,7 +1957,7 @@ void zconfpush_buffer_state (YY_BUFFER_STATE new_buffer ) /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. - * + * */ void zconfpop_buffer_state (void) { @@ -1981,7 +1981,7 @@ void zconfpop_buffer_state (void) static void zconfensure_buffer_stack (void) { int num_to_alloc; - + if (!(yy_buffer_stack)) { /* First allocation is just for 2 elements, since we don't know if this @@ -1994,9 +1994,9 @@ static void zconfensure_buffer_stack (void) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in zconfensure_buffer_stack()" ); - + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - + (yy_buffer_stack_max) = num_to_alloc; (yy_buffer_stack_top) = 0; return; @@ -2024,13 +2024,13 @@ static void zconfensure_buffer_stack (void) /** Setup the input buffer state to scan directly from a user-specified character buffer. * @param base the character buffer * @param size the size in bytes of the character buffer - * - * @return the newly allocated buffer state object. + * + * @return the newly allocated buffer state object. */ YY_BUFFER_STATE zconf_scan_buffer (char * base, yy_size_t size ) { YY_BUFFER_STATE b; - + if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) @@ -2059,14 +2059,14 @@ YY_BUFFER_STATE zconf_scan_buffer (char * base, yy_size_t size ) /** Setup the input buffer state to scan a string. The next call to zconflex() will * scan from a @e copy of @a str. * @param yystr a NUL-terminated string to scan - * + * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use * zconf_scan_bytes() instead. */ YY_BUFFER_STATE zconf_scan_string (yyconst char * yystr ) { - + return zconf_scan_bytes(yystr,strlen(yystr) ); } @@ -2074,7 +2074,7 @@ YY_BUFFER_STATE zconf_scan_string (yyconst char * yystr ) * scan from a @e copy of @a bytes. * @param yybytes the byte buffer to scan * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. - * + * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE zconf_scan_bytes (yyconst char * yybytes, int _yybytes_len ) @@ -2083,7 +2083,7 @@ YY_BUFFER_STATE zconf_scan_bytes (yyconst char * yybytes, int _yybytes_len ) char *buf; yy_size_t n; int i; - + /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; buf = (char *) zconfalloc(n ); @@ -2137,16 +2137,16 @@ static void yy_fatal_error (yyconst char* msg ) /* Accessor methods (get/set functions) to struct members. */ /** Get the current line number. - * + * */ int zconfget_lineno (void) { - + return zconflineno; } /** Get the input stream. - * + * */ FILE *zconfget_in (void) { @@ -2154,7 +2154,7 @@ FILE *zconfget_in (void) } /** Get the output stream. - * + * */ FILE *zconfget_out (void) { @@ -2162,7 +2162,7 @@ FILE *zconfget_out (void) } /** Get the length of the current token. - * + * */ int zconfget_leng (void) { @@ -2170,7 +2170,7 @@ int zconfget_leng (void) } /** Get the current token. - * + * */ char *zconfget_text (void) @@ -2180,18 +2180,18 @@ char *zconfget_text (void) /** Set the current line number. * @param line_number - * + * */ void zconfset_lineno (int line_number ) { - + zconflineno = line_number; } /** Set the input stream. This does not discard the current * input buffer. * @param in_str A readable stream. - * + * * @see zconf_switch_to_buffer */ void zconfset_in (FILE * in_str ) @@ -2245,7 +2245,7 @@ static int yy_init_globals (void) /* zconflex_destroy is for both reentrant and non-reentrant scanners. */ int zconflex_destroy (void) { - + /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ zconf_delete_buffer(YY_CURRENT_BUFFER ); diff --git a/misc/tools/kconfig-frontends/libs/parser/yconf.c b/misc/tools/kconfig-frontends/libs/parser/yconf.c index 817829aef..6b6efcab2 100644 --- a/misc/tools/kconfig-frontends/libs/parser/yconf.c +++ b/misc/tools/kconfig-frontends/libs/parser/yconf.c @@ -1,19 +1,19 @@ /* A Bison parser, made by GNU Bison 2.5. */ /* Bison implementation for Yacc-like parsers in C - + Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ @@ -26,7 +26,7 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ diff --git a/misc/tools/kconfig-frontends/libs/parser/yconf.y.patch b/misc/tools/kconfig-frontends/libs/parser/yconf.y.patch index 6856904ce..09b9bbf55 100644 --- a/misc/tools/kconfig-frontends/libs/parser/yconf.y.patch +++ b/misc/tools/kconfig-frontends/libs/parser/yconf.y.patch @@ -1,27 +1,27 @@ --- a/libs/parser/yconf.y 2012-01-12 22:37:17.582339777 +0100 +++ b/libs/parser/yconf.y 2012-03-03 23:55:29.889737630 +0100 @@ -96,7 +96,7 @@ - + %{ /* Include zconf.hash.c here so it can see the token constants. */ -#include "zconf.hash.c" +#include "hconf.c" %} - + %% @@ -493,7 +493,7 @@ - + sym_init(); _menu_init(); - rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL); + rootmenu.prompt = menu_add_prompt(P_MENU, ROOTMENU, NULL); - + if (getenv("ZCONF_DEBUG")) zconfdebug = 1; @@ -725,7 +725,7 @@ } } - + -#include "zconf.lex.c" +#include "lconf.c" #include "util.c" diff --git a/misc/tools/kconfig-frontends/scripts/.autostuff/m4/libtool.m4 b/misc/tools/kconfig-frontends/scripts/.autostuff/m4/libtool.m4 index 02b4bbec5..2da2dc98d 100644 --- a/misc/tools/kconfig-frontends/scripts/.autostuff/m4/libtool.m4 +++ b/misc/tools/kconfig-frontends/scripts/.autostuff/m4/libtool.m4 @@ -1196,7 +1196,7 @@ fi # Invoke $ECHO with all args, space-separated. func_echo_all () { - $ECHO "$*" + $ECHO "$*" } case "$ECHO" in diff --git a/misc/tools/kconfig-frontends/scripts/.autostuff/m4/lt~obsolete.m4 b/misc/tools/kconfig-frontends/scripts/.autostuff/m4/lt~obsolete.m4 index c573da90c..ffeab5680 100644 --- a/misc/tools/kconfig-frontends/scripts/.autostuff/m4/lt~obsolete.m4 +++ b/misc/tools/kconfig-frontends/scripts/.autostuff/m4/lt~obsolete.m4 @@ -25,7 +25,7 @@ # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. -# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. +# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until diff --git a/misc/tools/kconfig-frontends/utils/Makefile.in b/misc/tools/kconfig-frontends/utils/Makefile.in index 06e1026a1..fe3c93a72 100644 --- a/misc/tools/kconfig-frontends/utils/Makefile.in +++ b/misc/tools/kconfig-frontends/utils/Makefile.in @@ -404,7 +404,7 @@ clean-binPROGRAMS: list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list -gettext$(EXEEXT): $(gettext_OBJECTS) $(gettext_DEPENDENCIES) $(EXTRA_gettext_DEPENDENCIES) +gettext$(EXEEXT): $(gettext_OBJECTS) $(gettext_DEPENDENCIES) $(EXTRA_gettext_DEPENDENCIES) @rm -f gettext$(EXEEXT) $(AM_V_CCLD)$(gettext_LINK) $(gettext_OBJECTS) $(gettext_LDADD) $(LIBS) install-binSCRIPTS: $(bin_SCRIPTS) diff --git a/misc/tools/kconfig-frontends/utils/tweak.in.patch b/misc/tools/kconfig-frontends/utils/tweak.in.patch index c4b855790..0fc79e1a9 100644 --- a/misc/tools/kconfig-frontends/utils/tweak.in.patch +++ b/misc/tools/kconfig-frontends/utils/tweak.in.patch @@ -2,20 +2,20 @@ diff --git a/utils/tweak.in b/utils/tweak.in --- a/utils/tweak.in +++ b/utils/tweak.in @@ -3,8 +3,8 @@ - + myname=${0##*/} - + -# If no prefix forced, use the default CONFIG_ -CONFIG_="${CONFIG_-CONFIG_}" +# If no prefix forced, use the default @CONFIG_@ +CONFIG_="${CONFIG_-@CONFIG_@}" - + usage() { cat >&2 <<EOL @@ -41,7 +41,7 @@ By default, $myname will upper-case the given symbol. Use --keep-case to keep the case of all following symbols unchanged. - + -$myname uses 'CONFIG_' as the default symbol prefix. Set the environment +$myname uses '@CONFIG_@' as the default symbol prefix. Set the environment variable CONFIG_ to the prefix to use. Eg.: CONFIG_="FOO_" $myname ... diff --git a/misc/tools/kconfig-language.txt b/misc/tools/kconfig-language.txt index a686f9cd6..fbcc81fd9 100644 --- a/misc/tools/kconfig-language.txt +++ b/misc/tools/kconfig-language.txt @@ -172,7 +172,7 @@ module state. Dependency expressions have the following syntax: <expr> '&&' <expr> (6) <expr> '||' <expr> (7) -Expressions are listed in decreasing order of precedence. +Expressions are listed in decreasing order of precedence. (1) Convert the symbol into an expression. Boolean and tristate symbols are simply converted into the respective expression values. All diff --git a/misc/tools/kconfig-macos.diff b/misc/tools/kconfig-macos.diff index 10e21bb85..e9ec90b68 100755 --- a/misc/tools/kconfig-macos.diff +++ b/misc/tools/kconfig-macos.diff @@ -6,9 +6,9 @@ diff -ru orig/kconfig-frontends-3.3.0-1/libs/parser/yconf.c kconfig-frontends-3. #include <string.h> #include <stdbool.h> +#include <stddef.h> - + #include "lkc.h" - + diff -ru orig/kconfig-frontends-3.3.0-1/libs/parser/yconf.y kconfig-frontends-3.3.0-1/libs/parser/yconf.y --- orig/kconfig-frontends-3.3.0-1/libs/parser/yconf.y 2012-03-20 15:07:45.000000000 -0700 +++ kconfig-frontends-3.3.0-1/libs/parser/yconf.y 2012-04-13 23:38:22.000000000 -0700 @@ -17,6 +17,6 @@ diff -ru orig/kconfig-frontends-3.3.0-1/libs/parser/yconf.y kconfig-frontends-3. #include <string.h> #include <stdbool.h> +#include <stddef.h> - + #include "lkc.h" - + diff --git a/misc/tools/osmocon/linuxlist.h b/misc/tools/osmocon/linuxlist.h index ff2c49156..b7da3f5dc 100644 --- a/misc/tools/osmocon/linuxlist.h +++ b/misc/tools/osmocon/linuxlist.h @@ -54,14 +54,14 @@ struct llist_head { } while (0) /* - * Insert a new entry between two known consecutive entries. + * Insert a new entry between two known consecutive entries. * * This is only for internal llist manipulation where we know * the prev/next entries already! */ static inline void __llist_add(struct llist_head *_new, - struct llist_head *prev, - struct llist_head *next) + struct llist_head *prev, + struct llist_head *next) { next->prev = _new; _new->next = next; @@ -128,7 +128,7 @@ static inline void llist_del(struct llist_head *entry) static inline void llist_del_init(struct llist_head *entry) { __llist_del(entry->prev, entry->next); - INIT_LLIST_HEAD(entry); + INIT_LLIST_HEAD(entry); } /** @@ -220,7 +220,7 @@ static inline void llist_splice_init(struct llist_head *llist, */ #define llist_for_each(pos, head) \ for (pos = (head)->next, prefetch(pos->next); pos != (head); \ - pos = pos->next, prefetch(pos->next)) + pos = pos->next, prefetch(pos->next)) /** * __llist_for_each - iterate over a llist @@ -242,8 +242,8 @@ static inline void llist_splice_init(struct llist_head *llist, */ #define llist_for_each_prev(pos, head) \ for (pos = (head)->prev, prefetch(pos->prev); pos != (head); \ - pos = pos->prev, prefetch(pos->prev)) - + pos = pos->prev, prefetch(pos->prev)) + /** * llist_for_each_safe - iterate over a llist safe against removal of llist entry * @pos: the &struct llist_head to use as a loop counter. @@ -262,10 +262,10 @@ static inline void llist_splice_init(struct llist_head *llist, */ #define llist_for_each_entry(pos, head, member) \ for (pos = llist_entry((head)->next, typeof(*pos), member), \ - prefetch(pos->member.next); \ - &pos->member != (head); \ - pos = llist_entry(pos->member.next, typeof(*pos), member), \ - prefetch(pos->member.next)) + prefetch(pos->member.next); \ + &pos->member != (head); \ + pos = llist_entry(pos->member.next, typeof(*pos), member), \ + prefetch(pos->member.next)) /** * llist_for_each_entry_reverse - iterate backwards over llist of given type. @@ -275,10 +275,10 @@ static inline void llist_splice_init(struct llist_head *llist, */ #define llist_for_each_entry_reverse(pos, head, member) \ for (pos = llist_entry((head)->prev, typeof(*pos), member), \ - prefetch(pos->member.prev); \ - &pos->member != (head); \ - pos = llist_entry(pos->member.prev, typeof(*pos), member), \ - prefetch(pos->member.prev)) + prefetch(pos->member.prev); \ + &pos->member != (head); \ + pos = llist_entry(pos->member.prev, typeof(*pos), member), \ + prefetch(pos->member.prev)) /** * llist_for_each_entry_continue - iterate over llist of given type @@ -289,10 +289,10 @@ static inline void llist_splice_init(struct llist_head *llist, */ #define llist_for_each_entry_continue(pos, head, member) \ for (pos = llist_entry(pos->member.next, typeof(*pos), member), \ - prefetch(pos->member.next); \ - &pos->member != (head); \ - pos = llist_entry(pos->member.next, typeof(*pos), member), \ - prefetch(pos->member.next)) + prefetch(pos->member.next); \ + &pos->member != (head); \ + pos = llist_entry(pos->member.next, typeof(*pos), member), \ + prefetch(pos->member.next)) /** * llist_for_each_entry_safe - iterate over llist of given type safe against removal of llist entry @@ -304,8 +304,8 @@ static inline void llist_splice_init(struct llist_head *llist, #define llist_for_each_entry_safe(pos, n, head, member) \ for (pos = llist_entry((head)->next, typeof(*pos), member), \ n = llist_entry(pos->member.next, typeof(*pos), member); \ - &pos->member != (head); \ - pos = n, n = llist_entry(n->member.next, typeof(*n), member)) + &pos->member != (head); \ + pos = n, n = llist_entry(n->member.next, typeof(*n), member)) /** * llist_for_each_rcu - iterate over an rcu-protected llist @@ -315,11 +315,11 @@ static inline void llist_splice_init(struct llist_head *llist, #define llist_for_each_rcu(pos, head) \ for (pos = (head)->next, prefetch(pos->next); pos != (head); \ pos = pos->next, ({ smp_read_barrier_depends(); 0;}), prefetch(pos->next)) - + #define __llist_for_each_rcu(pos, head) \ for (pos = (head)->next; pos != (head); \ pos = pos->next, ({ smp_read_barrier_depends(); 0;})) - + /** * llist_for_each_safe_rcu - iterate over an rcu-protected llist safe * against removal of llist entry @@ -339,15 +339,15 @@ static inline void llist_splice_init(struct llist_head *llist, */ #define llist_for_each_entry_rcu(pos, head, member) \ for (pos = llist_entry((head)->next, typeof(*pos), member), \ - prefetch(pos->member.next); \ - &pos->member != (head); \ - pos = llist_entry(pos->member.next, typeof(*pos), member), \ - ({ smp_read_barrier_depends(); 0;}), \ - prefetch(pos->member.next)) + prefetch(pos->member.next); \ + &pos->member != (head); \ + pos = llist_entry(pos->member.next, typeof(*pos), member), \ + ({ smp_read_barrier_depends(); 0;}), \ + prefetch(pos->member.next)) /** - * llist_for_each_continue_rcu - iterate over an rcu-protected llist + * llist_for_each_continue_rcu - iterate over an rcu-protected llist * continuing after existing point. * @pos: the &struct llist_head to use as a loop counter. * @head: the head for your llist. diff --git a/misc/tools/osmocon/linuxrbtree.h b/misc/tools/osmocon/linuxrbtree.h index 079f440d0..57a58d502 100644 --- a/misc/tools/osmocon/linuxrbtree.h +++ b/misc/tools/osmocon/linuxrbtree.h @@ -1,7 +1,7 @@ /* Red Black Trees (C) 1999 Andrea Arcangeli <andrea@suse.de> - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or @@ -145,7 +145,7 @@ extern struct rb_node *rb_first(const struct rb_root *); extern struct rb_node *rb_last(const struct rb_root *); /* Fast replacement of a single node without remove/rebalance/add/rebalance */ -extern void rb_replace_node(struct rb_node *victim, struct rb_node *_new, +extern void rb_replace_node(struct rb_node *victim, struct rb_node *_new, struct rb_root *root); static inline void rb_link_node(struct rb_node * node, struct rb_node * parent, diff --git a/misc/tools/osmocon/osmocon.c b/misc/tools/osmocon/osmocon.c index 3dd738928..53f23667c 100644 --- a/misc/tools/osmocon/osmocon.c +++ b/misc/tools/osmocon/osmocon.c @@ -628,7 +628,7 @@ static int handle_write_dnload(void) default: break; } - } else if (dnload.write_ptr >= dnload.data + dnload.data_len) { + } else if (dnload.write_ptr >= dnload.data + dnload.data_len) { printf("finished\n"); dnload.write_ptr = dnload.data; dnload.serial_fd.when &= ~BSC_FD_WRITE; diff --git a/misc/tools/osmocon/panic.c b/misc/tools/osmocon/panic.c index 0dc7dcc6e..88a4bb6e5 100644 --- a/misc/tools/osmocon/panic.c +++ b/misc/tools/osmocon/panic.c @@ -17,7 +17,7 @@ void osmo_panic(const char *fmt, ...) osmo_panic_default(fmt, args); va_end(args); } - + void osmo_set_panic_handler(osmo_panic_handler_t h) { diff --git a/misc/tools/osmocon/rbtree.c b/misc/tools/osmocon/rbtree.c index 9033a84ac..afdf60c0f 100644 --- a/misc/tools/osmocon/rbtree.c +++ b/misc/tools/osmocon/rbtree.c @@ -2,7 +2,7 @@ Red Black Trees (C) 1999 Andrea Arcangeli <andrea@suse.de> (C) 2002 David Woodhouse <dwmw2@infradead.org> - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or @@ -317,7 +317,7 @@ struct rb_node *rb_next(const struct rb_node *node) /* If we have a right-hand child, go down and then left as far as we can. */ if (node->rb_right) { - node = node->rb_right; + node = node->rb_right; while (node->rb_left) node=node->rb_left; return (struct rb_node *)node; @@ -345,7 +345,7 @@ struct rb_node *rb_prev(const struct rb_node *node) /* If we have a left-hand child, go down and then right as far as we can. */ if (node->rb_left) { - node = node->rb_left; + node = node->rb_left; while (node->rb_right) node=node->rb_right; return (struct rb_node *)node; diff --git a/misc/tools/osmocon/talloc.c b/misc/tools/osmocon/talloc.c index c0072441d..6d99fe8a4 100644 --- a/misc/tools/osmocon/talloc.c +++ b/misc/tools/osmocon/talloc.c @@ -1,4 +1,4 @@ -/* +/* Samba Unix SMB/CIFS implementation. Samba trivial allocation library - new interface @@ -7,11 +7,11 @@ Copyright (C) Andrew Tridgell 2004 Copyright (C) Stefan Metzmacher 2006 - + ** NOTE! The following LGPL license applies to the talloc ** library. This does NOT imply that all of Samba is released ** under the LGPL - + This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either @@ -71,7 +71,7 @@ #define TALLOC_FLAG_POOLMEM 0x08 /* This is allocated in a pool */ #define TALLOC_MAGIC_REFERENCE ((const char *)1) -/* by default we abort when given a bad pointer (such as when talloc_free() is called +/* by default we abort when given a bad pointer (such as when talloc_free() is called on a pointer that came from malloc() */ #ifndef TALLOC_ABORT #define TALLOC_ABORT(reason) abort() @@ -185,7 +185,7 @@ static inline struct talloc_chunk *talloc_chunk_from_ptr(const void *ptr) { const char *pp = (const char *)ptr; struct talloc_chunk *tc = discard_const_p(struct talloc_chunk, pp - TC_HDR_SIZE); - if (unlikely((tc->flags & (TALLOC_FLAG_FREE | ~0xF)) != TALLOC_MAGIC)) { + if (unlikely((tc->flags & (TALLOC_FLAG_FREE | ~0xF)) != TALLOC_MAGIC)) { if (tc->flags & TALLOC_FLAG_FREE) { talloc_abort_double_free(); } else { @@ -330,7 +330,7 @@ static struct talloc_chunk *talloc_alloc_pool(struct talloc_chunk *parent, return result; } -/* +/* Allocate a bit of memory as a child of an existing pointer */ static inline void *__talloc(const void *context, size_t size) @@ -423,7 +423,7 @@ void _talloc_set_destructor(const void *ptr, int (*destructor)(void *)) } /* - increase the reference count on a piece of memory. + increase the reference count on a piece of memory. */ int talloc_increase_ref_count(const void *ptr) { @@ -446,7 +446,7 @@ static int talloc_reference_destructor(struct talloc_reference_handle *handle) } /* - more efficient way to add a name to a pointer - the name must point to a + more efficient way to add a name to a pointer - the name must point to a true string constant */ static inline void _talloc_set_name_const(const void *ptr, const char *name) @@ -476,8 +476,8 @@ static inline void *_talloc_named_const(const void *context, size_t size, const make a secondary reference to a pointer, hanging off the given context. the pointer remains valid until both the original caller and this given context are freed. - - the major use for this is when two different structures need to reference the + + the major use for this is when two different structures need to reference the same underlying data, and you want to be able to free the two instances separately, and in either order */ @@ -503,7 +503,7 @@ void *_talloc_reference(const void *context, const void *ptr) } -/* +/* internal talloc_free call */ static inline int _talloc_free(void *ptr) @@ -611,7 +611,7 @@ static inline int _talloc_free(void *ptr) return 0; } -/* +/* move a lump of memory from one talloc context to another return the ptr on success, or NULL if it could not be transferred. passing NULL as ptr will always return NULL with no side effects. @@ -640,7 +640,7 @@ void *_talloc_steal(const void *new_ctx, const void *ptr) if (tc->prev) tc->prev->next = tc->next; if (tc->next) tc->next->prev = tc->prev; } - + tc->parent = tc->next = tc->prev = NULL; return discard_const_p(void, ptr); } @@ -729,7 +729,7 @@ int talloc_unlink(const void *context, void *ptr) return -1; } } - + tc_p = talloc_chunk_from_ptr(ptr); if (tc_p->refs == NULL) { @@ -951,7 +951,7 @@ void talloc_free_children(void *ptr) } } -/* +/* Allocate a bit of memory as a child of an existing pointer */ void *_talloc(const void *context, size_t size) @@ -977,8 +977,8 @@ void *talloc_named_const(const void *context, size_t size, const char *name) return _talloc_named_const(context, size, name); } -/* - free a talloc pointer. This also frees all child pointers of this +/* + free a talloc pointer. This also frees all child pointers of this pointer recursively return 0 if the memory is actually freed, otherwise -1. The memory @@ -1064,9 +1064,9 @@ void *_talloc_realloc(const void *context, void *ptr, size_t size, const char *n new_ptr = realloc(tc, size + TC_HDR_SIZE); } #endif - if (unlikely(!new_ptr)) { - tc->flags &= ~TALLOC_FLAG_FREE; - return NULL; + if (unlikely(!new_ptr)) { + tc->flags &= ~TALLOC_FLAG_FREE; + return NULL; } tc = (struct talloc_chunk *)new_ptr; @@ -1230,14 +1230,14 @@ static void talloc_report_depth_FILE_helper(const void *ptr, int depth, int max_ } if (depth == 0) { - fprintf(f,"%stalloc report on '%s' (total %6lu bytes in %3lu blocks)\n", + fprintf(f,"%stalloc report on '%s' (total %6lu bytes in %3lu blocks)\n", (max_depth < 0 ? "full " :""), name, (unsigned long)talloc_total_size(ptr), (unsigned long)talloc_total_blocks(ptr)); return; } - fprintf(f, "%*s%-30s contains %6lu bytes in %3lu blocks (ref %d) %p\n", + fprintf(f, "%*s%-30s contains %6lu bytes in %3lu blocks (ref %d) %p\n", depth*4, "", name, (unsigned long)talloc_total_size(ptr), @@ -1344,8 +1344,8 @@ void talloc_enable_leak_report_full(void) atexit(talloc_report_null_full); } -/* - talloc and zero memory. +/* + talloc and zero memory. */ void *_talloc_zero(const void *ctx, size_t size, const char *name) { @@ -1359,7 +1359,7 @@ void *_talloc_zero(const void *ctx, size_t size, const char *name) } /* - memdup with a talloc. + memdup with a talloc. */ void *_talloc_memdup(const void *t, const void *p, size_t size, const char *name) { diff --git a/misc/tools/osmocon/talloc.h b/misc/tools/osmocon/talloc.h index f7f7643b8..efaceb183 100644 --- a/misc/tools/osmocon/talloc.h +++ b/misc/tools/osmocon/talloc.h @@ -1,16 +1,16 @@ #ifndef _TALLOC_H_ #define _TALLOC_H_ -/* +/* Unix SMB/CIFS implementation. Samba temporary memory allocation functions Copyright (C) Andrew Tridgell 2004-2005 Copyright (C) Stefan Metzmacher 2006 - + ** NOTE! The following LGPL license applies to the talloc ** library. This does NOT imply that all of Samba is released ** under the LGPL - + This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either @@ -130,7 +130,7 @@ void *_talloc_reference(const void *context, const void *ptr); int talloc_unlink(const void *context, void *ptr); const char *talloc_set_name(const void *ptr, const char *fmt, ...) PRINTF_ATTRIBUTE(2,3); void talloc_set_name_const(const void *ptr, const char *name); -void *talloc_named(const void *context, size_t size, +void *talloc_named(const void *context, size_t size, const char *fmt, ...) PRINTF_ATTRIBUTE(3,4); void *talloc_named_const(const void *context, size_t size, const char *name); const char *talloc_get_name(const void *ptr); diff --git a/misc/uClibc++/README.txt b/misc/uClibc++/README.txt index e4786d3db..4c87decd7 100755 --- a/misc/uClibc++/README.txt +++ b/misc/uClibc++/README.txt @@ -99,7 +99,7 @@ is still required. This logic would handle both cases: endif To get the required libraries into to the NuttX build, it is necessary to add -them to EXTRA_LIBS and to EXTRA_LIBPATHS. +them to EXTRA_LIBS and to EXTRA_LIBPATHS. LIBSUPXX = ${shell $(CC) --print-file-name=libsupc++.a} EXTRA_LIBPATHS = -L "${shell dirname "$(LIBSUPXX)"}" diff --git a/misc/uClibc++/include/uClibc++/algorithm b/misc/uClibc++/include/uClibc++/algorithm index e13713cfc..5c62ffeaf 100644 --- a/misc/uClibc++/include/uClibc++/algorithm +++ b/misc/uClibc++/include/uClibc++/algorithm @@ -429,10 +429,10 @@ namespace std return first; } } - + ++first; } - + return first; } diff --git a/misc/uClibc++/include/uClibc++/associative_base b/misc/uClibc++/include/uClibc++/associative_base index 67122691b..dbf4ddbbb 100644 --- a/misc/uClibc++/include/uClibc++/associative_base +++ b/misc/uClibc++/include/uClibc++/associative_base @@ -340,7 +340,7 @@ public: { // The following approach ensures that we only need to // provide code for ++ in one place (above) - + _associative_citer temp(base_iter); ++base_iter; return temp; @@ -609,7 +609,7 @@ public: const Compare& comp, const Allocator& A, const key_type (*v_to_k)(const value_type) - ) : base(comp, A, v_to_k) + ) : base(comp, A, v_to_k) { insert(first, last); } diff --git a/misc/uClibc++/include/uClibc++/bitset b/misc/uClibc++/include/uClibc++/bitset index 92243b208..2ef66b501 100644 --- a/misc/uClibc++/include/uClibc++/bitset +++ b/misc/uClibc++/include/uClibc++/bitset @@ -38,12 +38,12 @@ namespace std template <size_t N> bitset<N> operator&(const bitset<N>&, const bitset<N>&); template <size_t N> bitset<N> operator|(const bitset<N>&, const bitset<N>&); template <size_t N> bitset<N> operator^(const bitset<N>&, const bitset<N>&); - template <class charT, class traits, size_t N> basic_istream<charT, traits>& + template <class charT, class traits, size_t N> basic_istream<charT, traits>& operator>>(basic_istream<charT, traits>& is, bitset<N>& x); - template <class charT, class traits, size_t N> basic_ostream<charT, traits>& + template <class charT, class traits, size_t N> basic_ostream<charT, traits>& operator<<(basic_ostream<charT, traits>& os, const bitset<N>& x); - + // Actual Code template<size_t N> class _UCXXEXPORT bitset { @@ -56,7 +56,7 @@ namespace std //From the bit number, figure out which byte we are working with size_t byte_num(size_t bit_num) const - { + { if (WORD_SIZE == 8) { return (bit_num >> 3); @@ -93,7 +93,7 @@ namespace std public: - class _UCXXEXPORT reference + class _UCXXEXPORT reference { friend class bitset; reference() : bit_num(0), parent(0) { } @@ -176,7 +176,7 @@ namespace std typename basic_string<charT,traits,Allocator>::size_type pos = 0, typename basic_string<charT,traits,Allocator>::size_type n = basic_string<charT>::npos - + ) { reset(); @@ -526,7 +526,7 @@ namespace std return retval; } - template <class charT, class traits, size_t N> _UCXXEXPORT basic_istream<charT, traits>& + template <class charT, class traits, size_t N> _UCXXEXPORT basic_istream<charT, traits>& operator>>(basic_istream<charT, traits>& is, bitset<N>& x) { string s; @@ -553,7 +553,7 @@ namespace std return is; } - template <class charT, class traits, size_t N> _UCXXEXPORT basic_ostream<charT, traits>& + template <class charT, class traits, size_t N> _UCXXEXPORT basic_ostream<charT, traits>& operator<<(basic_ostream<charT, traits>& os, const bitset<N>& x) { for (size_t i = N ; i > 0; --i) diff --git a/misc/uClibc++/include/uClibc++/char_traits b/misc/uClibc++/include/uClibc++/char_traits index ec2900ba7..ee05be24d 100644 --- a/misc/uClibc++/include/uClibc++/char_traits +++ b/misc/uClibc++/include/uClibc++/char_traits @@ -62,14 +62,14 @@ namespace std // Specialize for char - template<> struct _UCXXEXPORT char_traits<char> + template<> struct _UCXXEXPORT char_traits<char> { typedef char char_type; typedef short int int_type; typedef char_traits_off_type off_type; typedef char_traits_off_type pos_type; typedef char state_type; - + inline static void assign(char_type & c, const char_type & d) { c = d; } static bool eq(const char_type& c1, const char_type& c2); @@ -142,7 +142,7 @@ namespace std { return 0; } - else + else { return i; } @@ -157,7 +157,7 @@ namespace std }; #ifdef __UCLIBCXX_HAS_WCHAR__ - template<> struct _UCXXEXPORT char_traits<wchar_t> + template<> struct _UCXXEXPORT char_traits<wchar_t> { typedef wchar_t char_type; typedef wint_t int_type; @@ -242,7 +242,7 @@ namespace std inline static char_type eos() { return 0; } inline static int_type eof() { return WEOF; } - inline static int_type not_eof(const int_type & i) + inline static int_type not_eof(const int_type & i) { if (i == WEOF) { diff --git a/misc/uClibc++/include/uClibc++/cwctype b/misc/uClibc++/include/uClibc++/cwctype index 5e4b60538..6901545d8 100644 --- a/misc/uClibc++/include/uClibc++/cwctype +++ b/misc/uClibc++/include/uClibc++/cwctype @@ -66,7 +66,7 @@ #undef iswspace #undef iswupper #undef iswxdigit -#undef iswctype +#undef iswctype #undef towlower #undef towupper #undef towctrans @@ -103,4 +103,4 @@ namespace std } #endif //__ULIBCXX_HAS_WCHAR__ -#endif +#endif diff --git a/misc/uClibc++/include/uClibc++/deque b/misc/uClibc++/include/uClibc++/deque index 48b5db3b3..08261e089 100644 --- a/misc/uClibc++/include/uClibc++/deque +++ b/misc/uClibc++/include/uClibc++/deque @@ -558,7 +558,7 @@ namespace std }; template<class T, class Allocator> deque<T, Allocator>::deque(const Allocator& al) - : data(0), + : data(0), data_size(0), elements(0), first_element(0), last_element(0), a(al) { data_size = __UCLIBCXX_STL_BUFFER_SIZE__; @@ -585,7 +585,7 @@ namespace std } - template<class T, class Allocator> template <class InputIterator> + template<class T, class Allocator> template <class InputIterator> deque<T, Allocator>::deque(InputIterator first, InputIterator last, const Allocator& al) : data(0), data_size(0), elements(0), first_element(0), last_element(0), a(al) @@ -665,7 +665,7 @@ namespace std } } - template<class T, class Allocator> typename deque<T, Allocator>::allocator_type + template<class T, class Allocator> typename deque<T, Allocator>::allocator_type deque<T, Allocator>::get_allocator() const { return a; @@ -694,7 +694,7 @@ namespace std { return deque_citer(this, elements); } - + template<class T, class Allocator> typename deque<T, Allocator>::reverse_iterator deque<T, Allocator>::rbegin() { @@ -813,7 +813,7 @@ namespace std { return data[array_element(elements-1)]; } - + template<class T, class Allocator> void deque<T, Allocator>::push_front(const T& x) { reserve(elements + 1); @@ -867,7 +867,7 @@ namespace std } } - template<class T, class Allocator> template <class InputIterator> + template<class T, class Allocator> template <class InputIterator> void deque<T, Allocator>::insert (iterator position, InputIterator first, InputIterator last) { while (first != last){ @@ -920,7 +920,7 @@ namespace std return deque_iter(this, position.element); } - template<class T, class Allocator> typename deque<T, Allocator>::iterator + template<class T, class Allocator> typename deque<T, Allocator>::iterator deque<T, Allocator>:: erase(typename deque<T, Allocator>::iterator first, typename deque<T, Allocator>::iterator last) { @@ -1010,7 +1010,7 @@ namespace std T * data_temp; size_temp = n + __UCLIBCXX_STL_BUFFER_SIZE__; //Reserve extra 'cause we can data_temp = a.allocate(size_temp); - + first_temp = (size_temp - elements) / 2; for (size_type i = 0; i < elements; ++i) { @@ -1027,7 +1027,7 @@ namespace std last_element = first_element + elements; } - template <class T, class Allocator> _UCXXEXPORT + template <class T, class Allocator> _UCXXEXPORT bool operator==(const deque<T,Allocator>& x, const deque<T,Allocator>& y) { diff --git a/misc/uClibc++/include/uClibc++/exception b/misc/uClibc++/include/uClibc++/exception index 6d91207b8..23b7e0caa 100644 --- a/misc/uClibc++/include/uClibc++/exception +++ b/misc/uClibc++/include/uClibc++/exception @@ -106,7 +106,7 @@ namespace std /** The runtime will call this function if an %exception is thrown which * violates the function's %exception specification. */ - + void unexpected() noreturn_function; /** [18.6.4]/1: "Returns true after completing evaluation of a @@ -119,7 +119,7 @@ namespace std * 2: "When @c uncaught_exception() is true, throwing an %exception can * result in a call of @c terminate() (15.5.1)." */ - + bool uncaught_exception() throw(); } // namespace std diff --git a/misc/uClibc++/include/uClibc++/fstream b/misc/uClibc++/include/uClibc++/fstream index acc3a0308..3ea05f9f8 100644 --- a/misc/uClibc++/include/uClibc++/fstream +++ b/misc/uClibc++/include/uClibc++/fstream @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef __STD_HEADER_FSTREAM +#ifndef __STD_HEADER_FSTREAM #define __STD_HEADER_FSTREAM 1 #include<basic_definitions> @@ -312,7 +312,7 @@ namespace std // Fill rest of buffer - retval = fread(basic_streambuf<charT,traits>::egptr() - + retval = fread(basic_streambuf<charT,traits>::egptr() - basic_streambuf<charT,traits>::gptr() + basic_streambuf<charT,traits>::eback(), sizeof(charT), offset, @@ -336,7 +336,7 @@ namespace std // Read one element of size sizeof(charT) - retval = fread(basic_streambuf<charT,traits>::egptr() - + retval = fread(basic_streambuf<charT,traits>::egptr() - basic_streambuf<charT,traits>::gptr() + basic_streambuf<charT,traits>::eback(), sizeof(charT), 1, @@ -384,7 +384,7 @@ namespace std virtual _UCXXEXPORT int_type pbackfail(int_type c = traits::eof()) { - if (is_open() == false || + if (is_open() == false || basic_streambuf<charT,traits>::gptr() == basic_streambuf<charT,traits>::eback()) { return traits::eof(); @@ -513,7 +513,7 @@ namespace std pbuffer = 0; gbuffer = 0; } - else if (basic_streambuf<charT,traits>::gptr() !=0 && + else if (basic_streambuf<charT,traits>::gptr() !=0 && basic_streambuf<charT,traits>::gptr()==basic_streambuf<charT,traits>::egptr()) { delete [] pbuffer; @@ -523,7 +523,7 @@ namespace std return this; } - virtual _UCXXEXPORT pos_type seekoff(off_type off, ios_base::seekdir way, + virtual _UCXXEXPORT pos_type seekoff(off_type off, ios_base::seekdir way, ios_base::openmode = ios_base::in | ios_base::out) { if (is_open() == false) diff --git a/misc/uClibc++/include/uClibc++/ios b/misc/uClibc++/include/uClibc++/ios index 6b49921ed..1e92643e2 100644 --- a/misc/uClibc++/include/uClibc++/ios +++ b/misc/uClibc++/include/uClibc++/ios @@ -40,7 +40,7 @@ namespace std public: class failure; #ifdef CONFIG_UCLIBCXX_EXCEPTION - class failure : public exception + class failure : public exception { public: explicit failure(const std::string&) { } diff --git a/misc/uClibc++/include/uClibc++/iosfwd b/misc/uClibc++/include/uClibc++/iosfwd index c322b64d3..de9b77e29 100644 --- a/misc/uClibc++/include/uClibc++/iosfwd +++ b/misc/uClibc++/include/uClibc++/iosfwd @@ -29,7 +29,7 @@ extern "C++" { -namespace std +namespace std { class ios_base; template<> class char_traits<char>; @@ -45,10 +45,10 @@ namespace std template <class charT, class traits = char_traits<charT> > class basic_ostream; template <class charT, class traits = char_traits<charT> > class basic_iostream; - template <class charT, class traits = char_traits<charT>, + template <class charT, class traits = char_traits<charT>, class Allocator = allocator<charT> > class basic_stringbuf; - template <class charT, class traits = char_traits<charT>, + template <class charT, class traits = char_traits<charT>, class Allocator = allocator<charT> > class basic_istringstream; template <class charT, class traits = char_traits<charT>, @@ -104,7 +104,7 @@ namespace std typedef basic_ofstream<wchar_t> wofstream; typedef basic_fstream<wchar_t> wfstream; #endif - + template <class state> class fpos; typedef fpos<char_traits<char>::state_type> streampos; #ifdef __UCLIBCXX_HAS_WCHAR__ diff --git a/misc/uClibc++/include/uClibc++/iostream b/misc/uClibc++/include/uClibc++/iostream index 3a2f5c09e..1448793a9 100644 --- a/misc/uClibc++/include/uClibc++/iostream +++ b/misc/uClibc++/include/uClibc++/iostream @@ -62,7 +62,7 @@ namespace std #endif template <class charT, class traits> class _UCXXEXPORT basic_iostream : - public basic_istream<charT,traits>, public basic_ostream<charT,traits> + public basic_istream<charT,traits>, public basic_ostream<charT,traits> { public: // constructor/destructor @@ -70,7 +70,7 @@ namespace std virtual _UCXXEXPORT ~basic_iostream(); //Below }; - template <class charT, class traits> _UCXXEXPORT + template <class charT, class traits> _UCXXEXPORT basic_iostream<charT, traits>:: basic_iostream(basic_streambuf<charT,traits>* sb) : basic_ios<charT, traits>(sb), basic_istream<charT,traits>(sb), basic_ostream<charT,traits>(sb) { diff --git a/misc/uClibc++/include/uClibc++/istream b/misc/uClibc++/include/uClibc++/istream index faedcc1c8..742de59d5 100644 --- a/misc/uClibc++/include/uClibc++/istream +++ b/misc/uClibc++/include/uClibc++/istream @@ -351,7 +351,7 @@ namespace std } if (basic_ios<charT, traits>::mstreambuf == 0){ - + basic_ios<charT,traits>::setstate(ios_base::badbit); return *this; } diff --git a/misc/uClibc++/include/uClibc++/limits b/misc/uClibc++/include/uClibc++/limits index 0b5b159e9..5915012ef 100644 --- a/misc/uClibc++/include/uClibc++/limits +++ b/misc/uClibc++/include/uClibc++/limits @@ -184,7 +184,7 @@ public: static T signaling_NaN(); }; -template <> class numeric_limits<bool> +template <> class numeric_limits<bool> { public: typedef bool T; diff --git a/misc/uClibc++/include/uClibc++/map b/misc/uClibc++/include/uClibc++/map index 6816116bb..afc4689eb 100644 --- a/misc/uClibc++/include/uClibc++/map +++ b/misc/uClibc++/include/uClibc++/map @@ -35,7 +35,7 @@ template<class Key, class T, class Compare = less<Key>, class Allocator = alloca //Compare the keys of the two items - /* template<class Key, class T, class Compare, class Allocator> class _UCXXEXPORT + /* template<class Key, class T, class Compare, class Allocator> class _UCXXEXPORT __base_map<Key, T, Compare, Allocator>::value_compare : public binary_function< typename map<Key, T, Compare, Allocator>::value_type, typename map<Key, T, Compare, Allocator>::value_type, @@ -216,11 +216,11 @@ protected: }; /* Non-member functions. These are at the end because they are not associated with any - * particular class. These will be implemented as I figure out exactly what all of + * particular class. These will be implemented as I figure out exactly what all of * them are supposed to do, and I have time. */ - template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT bool operator< + template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT bool operator< (const map<Key,T,Compare,Allocator>& x, const map<Key,T,Compare,Allocator>& y); template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT bool operator!= @@ -241,13 +241,13 @@ protected: template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT bool operator== (const multimap<Key,T,Compare,Allocator>& x, const multimap<Key,T,Compare,Allocator>& y); - template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT bool operator< + template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT bool operator< (const multimap<Key,T,Compare,Allocator>& x, const multimap<Key,T,Compare,Allocator>& y); template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT bool operator!= (const multimap<Key,T,Compare,Allocator>& x, const multimap<Key,T,Compare,Allocator>& y); - template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT bool operator> + template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT bool operator> (const multimap<Key,T,Compare,Allocator>& x, const multimap<Key,T,Compare,Allocator>& y); template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT bool operator>= @@ -266,4 +266,4 @@ protected: #endif - + diff --git a/misc/uClibc++/include/uClibc++/memory b/misc/uClibc++/include/uClibc++/memory index cd3956f18..f01f97717 100644 --- a/misc/uClibc++/include/uClibc++/memory +++ b/misc/uClibc++/include/uClibc++/memory @@ -38,7 +38,7 @@ namespace std template <class T> class allocator; // Specialize for void: -template <> class _UCXXEXPORT allocator<void> +template <> class _UCXXEXPORT allocator<void> { public: typedef void* pointer; @@ -53,7 +53,7 @@ public: typedef T value_type; typedef size_t size_type; typedef ptrdiff_t difference_type; - + typedef T* pointer; typedef const T* const_pointer; @@ -62,7 +62,7 @@ public: pointer address(reference r) const { return &r; } const_pointer address(const_reference r) const { return &r; } - + allocator() throw(){} template <class U> allocator(const allocator<U>& ) throw(); ~allocator() throw(){} diff --git a/misc/uClibc++/include/uClibc++/new b/misc/uClibc++/include/uClibc++/new index 29baba6af..75dcbf1c3 100644 --- a/misc/uClibc++/include/uClibc++/new +++ b/misc/uClibc++/include/uClibc++/new @@ -58,7 +58,7 @@ _UCXXEXPORT void operator delete[](void* ptr, const std::nothrow_t& ) throw(); inline void* operator new(std::size_t, void* ptr) throw() {return ptr; } inline void operator delete(void* , void *) throw() { } - + inline void* operator new[](std::size_t, void *p) throw() { return p; } inline void operator delete[](void* , void *) throw() {} diff --git a/misc/uClibc++/include/uClibc++/numeric b/misc/uClibc++/include/uClibc++/numeric index 880eb79f7..aceed3e3e 100644 --- a/misc/uClibc++/include/uClibc++/numeric +++ b/misc/uClibc++/include/uClibc++/numeric @@ -29,7 +29,7 @@ extern "C++" { namespace std { - template <class InputIterator, class T> _UCXXEXPORT + template <class InputIterator, class T> _UCXXEXPORT T accumulate(InputIterator first, InputIterator last, T init) { while (first != last) @@ -41,7 +41,7 @@ namespace std return init; } - template <class InputIterator, class T, class BinaryOperation> _UCXXEXPORT + template <class InputIterator, class T, class BinaryOperation> _UCXXEXPORT T accumulate(InputIterator first, InputIterator last, T init, BinaryOperation binary_op) { while (first != last) @@ -53,7 +53,7 @@ namespace std return init; } - template <class InputIterator1, class InputIterator2, class T> _UCXXEXPORT + template <class InputIterator1, class InputIterator2, class T> _UCXXEXPORT T inner_product(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, T init) { @@ -68,7 +68,7 @@ namespace std } template <class InputIterator1, class InputIterator2, class T, - class BinaryOperation1, class BinaryOperation2> _UCXXEXPORT + class BinaryOperation1, class BinaryOperation2> _UCXXEXPORT T inner_product(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, T init, BinaryOperation1 binary_op1, @@ -84,7 +84,7 @@ namespace std return init; } - template <class InputIterator, class OutputIterator> _UCXXEXPORT + template <class InputIterator, class OutputIterator> _UCXXEXPORT OutputIterator partial_sum(InputIterator first, InputIterator last, OutputIterator result) { @@ -104,7 +104,7 @@ namespace std return result; } - template <class InputIterator, class OutputIterator, class BinaryOperation> _UCXXEXPORT + template <class InputIterator, class OutputIterator, class BinaryOperation> _UCXXEXPORT OutputIterator partial_sum(InputIterator first, InputIterator last, OutputIterator result, BinaryOperation binary_op) { @@ -124,7 +124,7 @@ namespace std return result; } - template <class InputIterator, class OutputIterator> _UCXXEXPORT + template <class InputIterator, class OutputIterator> _UCXXEXPORT OutputIterator adjacent_difference(InputIterator first, InputIterator last, OutputIterator result) @@ -146,7 +146,7 @@ namespace std } - template <class InputIterator, class OutputIterator, class BinaryOperation> _UCXXEXPORT + template <class InputIterator, class OutputIterator, class BinaryOperation> _UCXXEXPORT OutputIterator adjacent_difference(InputIterator first, InputIterator last, OutputIterator result, BinaryOperation binary_op) diff --git a/misc/uClibc++/include/uClibc++/ostream b/misc/uClibc++/include/uClibc++/ostream index c62b4c92d..0965fa8a1 100644 --- a/misc/uClibc++/include/uClibc++/ostream +++ b/misc/uClibc++/include/uClibc++/ostream @@ -111,7 +111,7 @@ namespace std _UCXXEXPORT basic_ostream<charT,traits>& write(const char_type* s, streamsize n) { if (basic_ostream<charT,traits>::traits_type::eq_int_type( - basic_ios<charT, traits>::mstreambuf->sputn(s, n), + basic_ios<charT, traits>::mstreambuf->sputn(s, n), basic_ostream<charT,traits>::traits_type::eof()) ) { @@ -167,7 +167,7 @@ namespace std streamsize extra = ios::width() - n; if ((ios::flags()&ios::adjustfield) == ios::right) { - while (extra > 0) + while (extra > 0) { --extra; put(ios::fill()); @@ -197,7 +197,7 @@ namespace std // Implementations of template functions. To allow for partial specialization template <class charT, class traits> _UCXXEXPORT basic_ostream<charT,traits>::~basic_ostream(){ } - + template <class charT, class traits> _UCXXEXPORT basic_ostream<charT,traits>& basic_ostream<charT, traits>::operator<<(bool n) { sentry s(*this); @@ -232,7 +232,7 @@ namespace std return *this; } - template <class charT, class traits> _UCXXEXPORT basic_ostream<charT,traits>& + template <class charT, class traits> _UCXXEXPORT basic_ostream<charT,traits>& basic_ostream<charT, traits>::operator<<(unsigned short n) { sentry s(*this); @@ -268,7 +268,7 @@ namespace std return *this; } - template <class charT, class traits> _UCXXEXPORT basic_ostream<charT,traits>& + template <class charT, class traits> _UCXXEXPORT basic_ostream<charT,traits>& basic_ostream<charT, traits>::operator<<(unsigned long n) { sentry s(*this); @@ -310,7 +310,7 @@ namespace std return *this; } - template <class charT, class traits> _UCXXEXPORT basic_ostream<charT,traits>& + template <class charT, class traits> _UCXXEXPORT basic_ostream<charT,traits>& basic_ostream<charT, traits>::operator<<(basic_streambuf<charT,traits>* sb) { sentry s(*this); @@ -385,7 +385,7 @@ namespace std _UCXXEXPORT ~sentry() { } - _UCXXEXPORT operator bool() + _UCXXEXPORT operator bool() { return ok; } @@ -411,7 +411,7 @@ namespace std out.put(c); return out; } - + template<class charT, class traits> _UCXXEXPORT basic_ostream<charT,traits>& operator<<(basic_ostream<charT,traits>& out, char c) { @@ -419,7 +419,7 @@ namespace std out.put(c); return out; } - + template<class traits> _UCXXEXPORT basic_ostream<char,traits>& operator<<(basic_ostream<char,traits>& out, char c) { @@ -427,7 +427,7 @@ namespace std out.put(c); return out; } - + // signed and unsigned template<class traits> _UCXXEXPORT basic_ostream<char,traits>& operator<<(basic_ostream<char,traits>& out, signed char c) @@ -436,7 +436,7 @@ namespace std out.put(c); return out; } - + template<class traits> _UCXXEXPORT basic_ostream<char,traits>& operator<<(basic_ostream<char,traits>& out, unsigned char c) { @@ -444,7 +444,7 @@ namespace std out.put(c); return out; } - + template<class charT, class traits> _UCXXEXPORT basic_ostream<charT,traits>& operator<<(basic_ostream<charT,traits>& out, const charT* c) { @@ -452,7 +452,7 @@ namespace std out.printout(c, traits::length(c)); return out; } - + template<class charT, class traits> _UCXXEXPORT basic_ostream<charT,traits>& operator<<(basic_ostream<charT,traits>& out, const char* c) { @@ -488,7 +488,7 @@ namespace std return out; } #endif - + // Signed and unsigned template<class traits> _UCXXEXPORT basic_ostream<char,traits>& @@ -498,7 +498,7 @@ namespace std out.printout(reinterpret_cast<const char *>(c), traits::length(reinterpret_cast<const char *>(c))); return out; } - + template<class traits> _UCXXEXPORT basic_ostream<char,traits>& operator<<(basic_ostream<char,traits>& out, const unsigned char* c) { @@ -546,7 +546,7 @@ namespace std // Support for output of long long data types -template<class Ch, class Tr> _UCXXEXPORT basic_ostream<Ch, Tr>& +template<class Ch, class Tr> _UCXXEXPORT basic_ostream<Ch, Tr>& operator<<(basic_ostream<Ch, Tr>& os, signed long long int i) { typename basic_ostream<Ch, Tr>::sentry s(os); @@ -554,7 +554,7 @@ template<class Ch, class Tr> _UCXXEXPORT basic_ostream<Ch, Tr>& return os; } -template<class Ch, class Tr> _UCXXEXPORT basic_ostream<Ch, Tr>& +template<class Ch, class Tr> _UCXXEXPORT basic_ostream<Ch, Tr>& operator<<(basic_ostream<Ch, Tr>& os, unsigned long long int i) { typename basic_ostream<Ch, Tr>::sentry s(os); diff --git a/misc/uClibc++/include/uClibc++/ostream_helpers b/misc/uClibc++/include/uClibc++/ostream_helpers index 214ec259d..559e5ccf6 100644 --- a/misc/uClibc++/include/uClibc++/ostream_helpers +++ b/misc/uClibc++/include/uClibc++/ostream_helpers @@ -338,7 +338,7 @@ namespace std { length = snprintf(buffer, 32, "%*.*f",static_cast<int>(stream.width()),static_cast<int>(stream.precision()), f); } - else + else { length = snprintf(buffer, 32, "%*.*g",static_cast<int>(stream.width()),static_cast<int>(stream.precision()), f); } diff --git a/misc/uClibc++/include/uClibc++/queue b/misc/uClibc++/include/uClibc++/queue index 51fe35cbe..851f1c02a 100644 --- a/misc/uClibc++/include/uClibc++/queue +++ b/misc/uClibc++/include/uClibc++/queue @@ -91,7 +91,7 @@ namespace std template <class T, class Container = vector<T>, class Compare = less<typename Container::value_type> - > class _UCXXEXPORT priority_queue + > class _UCXXEXPORT priority_queue { protected: Container c; @@ -109,7 +109,7 @@ namespace std const Compare& x = Compare(), const Container& y= Container()) : c(y), comp(c) - { + { c.insert(c.end(), first, last); make_heap(c.begin(), c.end(), comp); } diff --git a/misc/uClibc++/include/uClibc++/sstream b/misc/uClibc++/include/uClibc++/sstream index d06d1874f..ff45b144d 100644 --- a/misc/uClibc++/include/uClibc++/sstream +++ b/misc/uClibc++/include/uClibc++/sstream @@ -108,7 +108,7 @@ namespace std ++ielement; } - return retval; + return retval; } virtual _UCXXEXPORT int_type pbackfail(int_type c = traits::eof()) @@ -241,7 +241,7 @@ namespace std if (which & ios_base::in) { newpos = ielement + off; - } + } } else { @@ -274,8 +274,8 @@ namespace std return newpos; } - - virtual _UCXXEXPORT pos_type seekpos(pos_type sp, + + virtual _UCXXEXPORT pos_type seekpos(pos_type sp, ios_base::openmode which = ios_base::in | ios_base::out) { return seekoff(sp, ios_base::beg, which); @@ -295,13 +295,13 @@ namespace std typedef typename traits::pos_type pos_type; typedef typename traits::off_type off_type; - explicit _UCXXEXPORT basic_istringstream(ios_base::openmode m = ios_base::in) + explicit _UCXXEXPORT basic_istringstream(ios_base::openmode m = ios_base::in) : basic_ios<charT, traits>(&sb), basic_istream<charT,traits>(&sb), sb(m) { } - explicit _UCXXEXPORT basic_istringstream(const basic_string<charT,traits,Allocator>& str, - ios_base::openmode which = ios_base::in) + explicit _UCXXEXPORT basic_istringstream(const basic_string<charT,traits,Allocator>& str, + ios_base::openmode which = ios_base::in) : basic_ios<charT, traits>(&sb), basic_istream<charT,traits>(&sb), sb(str, which) { } @@ -341,7 +341,7 @@ namespace std { } - explicit _UCXXEXPORT basic_ostringstream(const basic_string<charT,traits,Allocator>& str, + explicit _UCXXEXPORT basic_ostringstream(const basic_string<charT,traits,Allocator>& str, ios_base::openmode which = ios_base::out) : basic_ios<charT, traits>(&sb), basic_ostream<charT,traits>(&sb), sb(str, which) { diff --git a/misc/uClibc++/include/uClibc++/streambuf b/misc/uClibc++/include/uClibc++/streambuf index 2dfa213d0..2a8ce1491 100644 --- a/misc/uClibc++/include/uClibc++/streambuf +++ b/misc/uClibc++/include/uClibc++/streambuf @@ -60,8 +60,8 @@ namespace std return setbuf(s,n); } - pos_type pubseekoff(off_type off, - typename ios_base::seekdir way, + pos_type pubseekoff(off_type off, + typename ios_base::seekdir way, ios_base::openmode which = ios_base::in | ios_base::out) { @@ -116,7 +116,7 @@ namespace std charT * mgnext; charT * mgend; - // Pointers for the "put" buffers + // Pointers for the "put" buffers charT * mpbeg; charT * mpnext; @@ -125,7 +125,7 @@ namespace std // In the event of null buffers Lets us know what the buffer is opened for ios_base::openmode openedFor; - + basic_streambuf(); basic_streambuf(const basic_streambuf<char, char_traits<char> > &) @@ -138,7 +138,7 @@ namespace std { return *this; } - + char_type* eback() const { return mgbeg; @@ -204,7 +204,7 @@ namespace std return 0; } - virtual pos_type seekoff(off_type , ios_base::seekdir, + virtual pos_type seekoff(off_type , ios_base::seekdir, ios_base::openmode = ios_base::in | ios_base::out) { return 0; @@ -372,7 +372,7 @@ namespace std return T::to_int_type(c); } - template <class C, class T> basic_streambuf<C, T>::basic_streambuf() + template <class C, class T> basic_streambuf<C, T>::basic_streambuf() : myLocale(), mgbeg(0), mgnext(0), mgend(0), mpbeg(0), mpnext(0), mpend(0), openedFor(0) diff --git a/misc/uClibc++/include/uClibc++/string_iostream b/misc/uClibc++/include/uClibc++/string_iostream index 46a9893c1..1f8dd30ec 100644 --- a/misc/uClibc++/include/uClibc++/string_iostream +++ b/misc/uClibc++/include/uClibc++/string_iostream @@ -119,7 +119,7 @@ template<class charT, class traits, class Allocator> _UCXXEXPORT basic_istream<c str.append(1, c); } - return is; + return is; } template<class charT, class traits, class Allocator> _UCXXEXPORT basic_istream<charT,traits>& @@ -139,7 +139,7 @@ template<> _UCXXEXPORT basic_istream<char, char_traits<char> >& operator>>( #ifdef __UCLIBCXX_EXPAND_OSTREAM_CHAR__ template<> _UCXXEXPORT basic_ostream<char, char_traits<char> >& - operator<<(basic_ostream<char, char_traits<char> >& os, + operator<<(basic_ostream<char, char_traits<char> >& os, const basic_string<char,char_traits<char>, std::allocator<char> >& str); #endif diff --git a/misc/uClibc++/include/uClibc++/typeinfo b/misc/uClibc++/include/uClibc++/typeinfo index 88a2639b8..306f214fd 100644 --- a/misc/uClibc++/include/uClibc++/typeinfo +++ b/misc/uClibc++/include/uClibc++/typeinfo @@ -8,12 +8,12 @@ // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2, or (at your option) // any later version. -// +// // GNU CC is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with GNU CC; see the file COPYING. If not, write to // the Free Software Foundation, 59 Temple Place - Suite 330, @@ -52,7 +52,7 @@ namespace __cxxabiv1 #define __GXX_MERGED_TYPEINFO_NAMES 1 #endif -namespace std +namespace std { /** * @brief Part of RTTI. @@ -60,7 +60,7 @@ namespace std * The @c type_info class describes type information generated by * an implementation. */ - class type_info + class type_info { public: /** Destructor. Being the first non-inline virtual function, this @@ -73,13 +73,13 @@ namespace std /// Assigning type_info is not supported. Made private. type_info& operator=(const type_info&); type_info(const type_info&); - + protected: const char *__name; - + protected: explicit type_info(const char *__n): __name(__n) { } - + public: // the public interface /** Returns an @e implementation-defined byte string; this is not @@ -105,7 +105,7 @@ namespace std #endif bool operator!=(const type_info& __arg) const { return !operator==(__arg); } - + // the internal interface public: // return true if this is a pointer type of some kind @@ -132,7 +132,7 @@ namespace std * * If you attempt an invalid @c dynamic_cast expression, an instance of * this class (or something derived from this class) is thrown. */ - class bad_cast : public exception + class bad_cast : public exception { public: bad_cast() throw() { } @@ -140,9 +140,9 @@ namespace std // http://gcc.gnu.org/onlinedocs/gcc-3.0.2/gcc_6.html#SEC118 virtual ~bad_cast() throw(); }; - + /** If you use a NULL pointer in a @c typeid expression, this is thrown. */ - class bad_typeid : public exception + class bad_typeid : public exception { public: bad_typeid () throw() { } diff --git a/misc/uClibc++/include/uClibc++/unwind-cxx.h b/misc/uClibc++/include/uClibc++/unwind-cxx.h index b0d5b416b..d42c61369 100644 --- a/misc/uClibc++/include/uClibc++/unwind-cxx.h +++ b/misc/uClibc++/include/uClibc++/unwind-cxx.h @@ -1,227 +1,227 @@ -// -*- C++ -*- Exception handling and frame unwind runtime interface routines.
-// Copyright (C) 2001 Free Software Foundation, Inc.
-//
-// This file is part of GCC.
-//
-// GCC is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2, or (at your option)
-// any later version.
-//
-// GCC is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with GCC; see the file COPYING. If not, write to
-// the Free Software Foundation, 59 Temple Place - Suite 330,
-// Boston, MA 02111-1307, USA.
-
-// As a special exception, you may use this file as part of a free software
-// library without restriction. Specifically, if other files instantiate
-// templates or use macros or inline functions from this file, or you compile
-// this file and link it with other files to produce an executable, this
-// file does not by itself cause the resulting executable to be covered by
-// the GNU General Public License. This exception does not however
-// invalidate any other reasons why the executable file might be covered by
-// the GNU General Public License.
-
-// This is derived from the C++ ABI for IA-64. Where we diverge
-// for cross-architecture compatibility are noted with "@@@".
-
-#ifndef _UNWIND_CXX_H
-#define _UNWIND_CXX_H 1
-
-// Level 2: C++ ABI
-
-#include <typeinfo>
-#include <exception>
-#include <cstddef>
-#include "unwind.h"
-
-#pragma GCC visibility push(default)
-
-namespace __cxxabiv1
-{
-
-// A primary C++ exception object consists of a header, which is a wrapper
-// around an unwind object header with additional C++ specific information,
-// followed by the exception object itself.
-
-struct __cxa_exception
-{
- // Manage the exception object itself.
- std::type_info *exceptionType;
- void (*exceptionDestructor)(void *);
-
- // The C++ standard has entertaining rules wrt calling set_terminate
- // and set_unexpected in the middle of the exception cleanup process.
- std::unexpected_handler unexpectedHandler;
- std::terminate_handler terminateHandler;
-
- // The caught exception stack threads through here.
- __cxa_exception *nextException;
-
- // How many nested handlers have caught this exception. A negated
- // value is a signal that this object has been rethrown.
- int handlerCount;
-
- // Cache parsed handler data from the personality routine Phase 1
- // for Phase 2 and __cxa_call_unexpected.
- int handlerSwitchValue;
- const unsigned char *actionRecord;
- const unsigned char *languageSpecificData;
- _Unwind_Ptr catchTemp;
- void *adjustedPtr;
-
- // The generic exception header. Must be last.
- _Unwind_Exception unwindHeader;
-};
-
-// A dependent C++ exception object consists of a header, which is a wrapper
-// around an unwind object header with additional C++ specific information,
-// followed by the exception object itself.
-
-struct __cxa_dependent_exception
-{
- // The primary exception
- void *primaryException;
-
- // The C++ standard has entertaining rules wrt calling set_terminate
- // and set_unexpected in the middle of the exception cleanup process.
- std::unexpected_handler unexpectedHandler;
- std::terminate_handler terminateHandler;
-
- // The caught exception stack threads through here.
- __cxa_exception *nextException;
-
- // How many nested handlers have caught this exception. A negated
- // value is a signal that this object has been rethrown.
- int handlerCount;
-
- // Cache parsed handler data from the personality routine Phase 1
- // for Phase 2 and __cxa_call_unexpected.
- int handlerSwitchValue;
- const unsigned char *actionRecord;
- const unsigned char *languageSpecificData;
- _Unwind_Ptr catchTemp;
- void *adjustedPtr;
-
- // The generic exception header. Must be last.
- _Unwind_Exception unwindHeader;
-};
-
-// Each thread in a C++ program has access to a __cxa_eh_globals object.
-
-struct __cxa_eh_globals
-{
- __cxa_exception *caughtExceptions;
- unsigned int uncaughtExceptions;
-};
-
-// The __cxa_eh_globals for the current thread can be obtained by using
-// either of the following functions. The "fast" version assumes at least
-// one prior call of __cxa_get_globals has been made from the current
-// thread, so no initialization is necessary.
-
-extern "C" __cxa_eh_globals *__cxa_get_globals () throw();
-extern "C" __cxa_eh_globals *__cxa_get_globals_fast () throw();
-
-// Allocate memory for the primary exception plus the thrown object.
-
-extern "C" void *__cxa_allocate_exception(std::size_t thrown_size) throw();
-
-// Allocate memory for dependent exception.
-
-extern "C" __cxa_dependent_exception *__cxa_allocate_dependent_exception() throw();
-
-// Free the space allocated for the primary exception.
-
-extern "C" void __cxa_free_exception(void *thrown_exception) throw();
-
-// Free the space allocated for the dependent exception.
-
-extern "C" void __cxa_free_dependent_exception(__cxa_dependent_exception *dependent_exception) throw();
-
-// Throw the exception.
-
-extern "C" void __cxa_throw (void *thrown_exception,
- std::type_info *tinfo,
- void (*dest) (void *)) __attribute__((noreturn));
-
-// Used to implement exception handlers.
-
-extern "C" void *__cxa_begin_catch (void *) throw();
-extern "C" void __cxa_end_catch ();
-extern "C" void __cxa_rethrow () __attribute__((noreturn));
-
-// These facilitate code generation for recurring situations.
-
-extern "C" void __cxa_bad_cast ();
-extern "C" void __cxa_bad_typeid ();
-
-// @@@ These are not directly specified by the IA-64 C++ ABI.
-
-// Handles re-checking the exception specification if unexpectedHandler
-// throws, and if bad_exception needs to be thrown. Called from the
-// compiler.
-
-extern "C" void __cxa_call_unexpected (void *) __attribute__((noreturn));
-
-// Invokes given handler, dying appropriately if the user handler was
-// so inconsiderate as to return.
-
-extern void __terminate(std::terminate_handler) __attribute__((noreturn));
-extern void __unexpected(std::unexpected_handler) __attribute__((noreturn));
-
-// The current installed user handlers.
-
-extern std::terminate_handler __terminate_handler;
-extern std::unexpected_handler __unexpected_handler;
-
-// These are explicitly GNU C++ specific.
-
-// This is the exception class we report -- "GNUCC++\0".
-
-const _Unwind_Exception_Class __gxx_exception_class =
- ((((((((_Unwind_Exception_Class) 'G'
- << 8 | (_Unwind_Exception_Class) 'N')
- << 8 | (_Unwind_Exception_Class) 'U')
- << 8 | (_Unwind_Exception_Class) 'C')
- << 8 | (_Unwind_Exception_Class) 'C')
- << 8 | (_Unwind_Exception_Class) '+')
- << 8 | (_Unwind_Exception_Class) '+')
- << 8 | (_Unwind_Exception_Class) '\0');
-
-// GNU C++ personality routine, Version 0.
-
-extern "C" _Unwind_Reason_Code __gxx_personality_v0
- (int, _Unwind_Action, _Unwind_Exception_Class,
- struct _Unwind_Exception *, struct _Unwind_Context *);
-
-// GNU C++ sjlj personality routine, Version 0.
-
-extern "C" _Unwind_Reason_Code __gxx_personality_sj0
- (int, _Unwind_Action, _Unwind_Exception_Class,
- struct _Unwind_Exception *, struct _Unwind_Context *);
-
-// Acquire the C++ exception header from the C++ object.
-
-static inline __cxa_exception *__get_exception_header_from_obj (void *ptr)
-{
- return reinterpret_cast<__cxa_exception *>(ptr) - 1;
-}
-
-// Acquire the C++ exception header from the generic exception header.
-
-static inline __cxa_exception *__get_exception_header_from_ue (_Unwind_Exception *exc)
-{
- return reinterpret_cast<__cxa_exception *>(exc + 1) - 1;
-}
-
-} /* namespace __cxxabiv1 */
-
-#pragma GCC visibility pop
-
-#endif // _UNWIND_CXX_H
+// -*- C++ -*- Exception handling and frame unwind runtime interface routines. +// Copyright (C) 2001 Free Software Foundation, Inc. +// +// This file is part of GCC. +// +// GCC is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) +// any later version. +// +// GCC is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with GCC; see the file COPYING. If not, write to +// the Free Software Foundation, 59 Temple Place - Suite 330, +// Boston, MA 02111-1307, USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// This is derived from the C++ ABI for IA-64. Where we diverge +// for cross-architecture compatibility are noted with "@@@". + +#ifndef _UNWIND_CXX_H +#define _UNWIND_CXX_H 1 + +// Level 2: C++ ABI + +#include <typeinfo> +#include <exception> +#include <cstddef> +#include "unwind.h" + +#pragma GCC visibility push(default) + +namespace __cxxabiv1 +{ + +// A primary C++ exception object consists of a header, which is a wrapper +// around an unwind object header with additional C++ specific information, +// followed by the exception object itself. + +struct __cxa_exception +{ + // Manage the exception object itself. + std::type_info *exceptionType; + void (*exceptionDestructor)(void *); + + // The C++ standard has entertaining rules wrt calling set_terminate + // and set_unexpected in the middle of the exception cleanup process. + std::unexpected_handler unexpectedHandler; + std::terminate_handler terminateHandler; + + // The caught exception stack threads through here. + __cxa_exception *nextException; + + // How many nested handlers have caught this exception. A negated + // value is a signal that this object has been rethrown. + int handlerCount; + + // Cache parsed handler data from the personality routine Phase 1 + // for Phase 2 and __cxa_call_unexpected. + int handlerSwitchValue; + const unsigned char *actionRecord; + const unsigned char *languageSpecificData; + _Unwind_Ptr catchTemp; + void *adjustedPtr; + + // The generic exception header. Must be last. + _Unwind_Exception unwindHeader; +}; + +// A dependent C++ exception object consists of a header, which is a wrapper +// around an unwind object header with additional C++ specific information, +// followed by the exception object itself. + +struct __cxa_dependent_exception +{ + // The primary exception + void *primaryException; + + // The C++ standard has entertaining rules wrt calling set_terminate + // and set_unexpected in the middle of the exception cleanup process. + std::unexpected_handler unexpectedHandler; + std::terminate_handler terminateHandler; + + // The caught exception stack threads through here. + __cxa_exception *nextException; + + // How many nested handlers have caught this exception. A negated + // value is a signal that this object has been rethrown. + int handlerCount; + + // Cache parsed handler data from the personality routine Phase 1 + // for Phase 2 and __cxa_call_unexpected. + int handlerSwitchValue; + const unsigned char *actionRecord; + const unsigned char *languageSpecificData; + _Unwind_Ptr catchTemp; + void *adjustedPtr; + + // The generic exception header. Must be last. + _Unwind_Exception unwindHeader; +}; + +// Each thread in a C++ program has access to a __cxa_eh_globals object. + +struct __cxa_eh_globals +{ + __cxa_exception *caughtExceptions; + unsigned int uncaughtExceptions; +}; + +// The __cxa_eh_globals for the current thread can be obtained by using +// either of the following functions. The "fast" version assumes at least +// one prior call of __cxa_get_globals has been made from the current +// thread, so no initialization is necessary. + +extern "C" __cxa_eh_globals *__cxa_get_globals () throw(); +extern "C" __cxa_eh_globals *__cxa_get_globals_fast () throw(); + +// Allocate memory for the primary exception plus the thrown object. + +extern "C" void *__cxa_allocate_exception(std::size_t thrown_size) throw(); + +// Allocate memory for dependent exception. + +extern "C" __cxa_dependent_exception *__cxa_allocate_dependent_exception() throw(); + +// Free the space allocated for the primary exception. + +extern "C" void __cxa_free_exception(void *thrown_exception) throw(); + +// Free the space allocated for the dependent exception. + +extern "C" void __cxa_free_dependent_exception(__cxa_dependent_exception *dependent_exception) throw(); + +// Throw the exception. + +extern "C" void __cxa_throw (void *thrown_exception, + std::type_info *tinfo, + void (*dest) (void *)) __attribute__((noreturn)); + +// Used to implement exception handlers. + +extern "C" void *__cxa_begin_catch (void *) throw(); +extern "C" void __cxa_end_catch (); +extern "C" void __cxa_rethrow () __attribute__((noreturn)); + +// These facilitate code generation for recurring situations. + +extern "C" void __cxa_bad_cast (); +extern "C" void __cxa_bad_typeid (); + +// @@@ These are not directly specified by the IA-64 C++ ABI. + +// Handles re-checking the exception specification if unexpectedHandler +// throws, and if bad_exception needs to be thrown. Called from the +// compiler. + +extern "C" void __cxa_call_unexpected (void *) __attribute__((noreturn)); + +// Invokes given handler, dying appropriately if the user handler was +// so inconsiderate as to return. + +extern void __terminate(std::terminate_handler) __attribute__((noreturn)); +extern void __unexpected(std::unexpected_handler) __attribute__((noreturn)); + +// The current installed user handlers. + +extern std::terminate_handler __terminate_handler; +extern std::unexpected_handler __unexpected_handler; + +// These are explicitly GNU C++ specific. + +// This is the exception class we report -- "GNUCC++\0". + +const _Unwind_Exception_Class __gxx_exception_class = + ((((((((_Unwind_Exception_Class) 'G' + << 8 | (_Unwind_Exception_Class) 'N') + << 8 | (_Unwind_Exception_Class) 'U') + << 8 | (_Unwind_Exception_Class) 'C') + << 8 | (_Unwind_Exception_Class) 'C') + << 8 | (_Unwind_Exception_Class) '+') + << 8 | (_Unwind_Exception_Class) '+') + << 8 | (_Unwind_Exception_Class) '\0'); + +// GNU C++ personality routine, Version 0. + +extern "C" _Unwind_Reason_Code __gxx_personality_v0 + (int, _Unwind_Action, _Unwind_Exception_Class, + struct _Unwind_Exception *, struct _Unwind_Context *); + +// GNU C++ sjlj personality routine, Version 0. + +extern "C" _Unwind_Reason_Code __gxx_personality_sj0 + (int, _Unwind_Action, _Unwind_Exception_Class, + struct _Unwind_Exception *, struct _Unwind_Context *); + +// Acquire the C++ exception header from the C++ object. + +static inline __cxa_exception *__get_exception_header_from_obj (void *ptr) +{ + return reinterpret_cast<__cxa_exception *>(ptr) - 1; +} + +// Acquire the C++ exception header from the generic exception header. + +static inline __cxa_exception *__get_exception_header_from_ue (_Unwind_Exception *exc) +{ + return reinterpret_cast<__cxa_exception *>(exc + 1) - 1; +} + +} /* namespace __cxxabiv1 */ + +#pragma GCC visibility pop + +#endif // _UNWIND_CXX_H diff --git a/misc/uClibc++/include/uClibc++/utility b/misc/uClibc++/include/uClibc++/utility index f5cb59f2f..30c6525ae 100644 --- a/misc/uClibc++/include/uClibc++/utility +++ b/misc/uClibc++/include/uClibc++/utility @@ -28,7 +28,7 @@ extern "C++" namespace std { - namespace rel_ops + namespace rel_ops { template<class T> inline bool operator!=(const T& x, const T& y) { @@ -62,7 +62,7 @@ namespace std pair(const T1& x, const T2& y) : first(x), second(y) { } template<class U, class V> pair(const pair<U, V> &p) : first(p.first), second(p.second) { } }; - + template <class T1, class T2> bool operator==(const pair<T1,T2>& x, const pair<T1,T2>& y) { using namespace rel_ops; diff --git a/misc/uClibc++/include/uClibc++/valarray b/misc/uClibc++/include/uClibc++/valarray index f28ad5874..dbbadcb56 100644 --- a/misc/uClibc++/include/uClibc++/valarray +++ b/misc/uClibc++/include/uClibc++/valarray @@ -797,8 +797,8 @@ namespace std void operator|=(const valarray<T>& array) const; void operator<<=(const valarray<T>& array) const; void operator>>=(const valarray<T>& array) const; - - void operator=(const T&); + + void operator=(const T&); private: gslice_array(); diff --git a/misc/uClibc++/include/uClibc++/vector b/misc/uClibc++/include/uClibc++/vector index 88adbd011..25845b87d 100644 --- a/misc/uClibc++/include/uClibc++/vector +++ b/misc/uClibc++/include/uClibc++/vector @@ -42,7 +42,7 @@ namespace std template <class T, class Allocator> bool operator<=(const vector<T,Allocator>& x, const vector<T,Allocator>& y); template <class T, class Allocator> void swap(vector<T,Allocator>& x, vector<T,Allocator>& y); - template <class T, class Allocator> class _UCXXEXPORT vector + template <class T, class Allocator> class _UCXXEXPORT vector { public: diff --git a/misc/uClibc++/libxx/uClibc++/Make.defs b/misc/uClibc++/libxx/uClibc++/Make.defs index cf2089f70..06188047f 100644 --- a/misc/uClibc++/libxx/uClibc++/Make.defs +++ b/misc/uClibc++/libxx/uClibc++/Make.defs @@ -37,7 +37,7 @@ CXXSRCS += algorithm.cxx associative_base.cxx bitset.cxx char_traits.cxx CXXSRCS += complex.cxx del_op.cxx del_opnt.cxx del_opv.cxx del_opvnt.cxx -CXXSRCS += deque.cxx fstream.cxx iomanip.cxx ios.cxx iostream.cxx +CXXSRCS += deque.cxx fstream.cxx iomanip.cxx ios.cxx iostream.cxx CXXSRCS += istream.cxx iterator.cxx limits.cxx list.cxx locale.cxx CXXSRCS += map.cxx new_handler.cxx new_op.cxx new_opnt.cxx new_opv.cxx CXXSRCS += new_opvnt.cxx numeric.cxx ostream.cxx queue.cxx set.cxx @@ -55,7 +55,7 @@ endif CXXSRCS += vterminate.cxx ifneq ($(CONFIG_UCLIBCXX_HAVE_LIBSUPCXX),y) -CXXSRCS += eh_alloc.cxx eh_globals.cxx eh_terminate.cxx +CXXSRCS += eh_alloc.cxx eh_globals.cxx eh_terminate.cxx endif # Add the path to the uClibc++ subdirectory diff --git a/misc/uClibc++/libxx/uClibc++/eh_terminate.cxx b/misc/uClibc++/libxx/uClibc++/eh_terminate.cxx index 5b9e1aa2e..03c336a49 100644 --- a/misc/uClibc++/libxx/uClibc++/eh_terminate.cxx +++ b/misc/uClibc++/libxx/uClibc++/eh_terminate.cxx @@ -58,7 +58,7 @@ namespace std /** The runtime will call this function if an %exception is thrown which * violates the function's %exception specification. */ - + _UCXXEXPORT void unexpected(void) throw() { if (__unexpected_handler) diff --git a/misc/uClibc++/libxx/uClibc++/fstream.cxx b/misc/uClibc++/libxx/uClibc++/fstream.cxx index 535fe9a52..7015b42e8 100644 --- a/misc/uClibc++/libxx/uClibc++/fstream.cxx +++ b/misc/uClibc++/libxx/uClibc++/fstream.cxx @@ -162,7 +162,7 @@ template <> _UCXXEXPORT basic_filebuf<wchar_t, char_traits<wchar_t> >::int_type } *(wstreambuf::egptr()-1) = c; - + wstreambuf::mgnext -= 1; return traits::to_int_type(*wstreambuf::gptr()); diff --git a/misc/uClibc++/libxx/uClibc++/ios.cxx b/misc/uClibc++/libxx/uClibc++/ios.cxx index 3b85d5be2..c21ce1a4d 100644 --- a/misc/uClibc++/libxx/uClibc++/ios.cxx +++ b/misc/uClibc++/libxx/uClibc++/ios.cxx @@ -181,7 +181,7 @@ namespace std{ locale retval = mLocale; mLocale = loc; return retval; - } + } } diff --git a/misc/uClibc++/libxx/uClibc++/locale.cxx b/misc/uClibc++/libxx/uClibc++/locale.cxx index bc41792df..f443f8c24 100644 --- a/misc/uClibc++/libxx/uClibc++/locale.cxx +++ b/misc/uClibc++/libxx/uClibc++/locale.cxx @@ -1,6 +1,6 @@ /* Copyright (C) 2004 Garrett A. Kajmowicz - This file is part of the uClibc++ Library. + This file is part of the uClibc++ Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/nuttx/configs/16z/tools/zneo-zdsii-5_0_1-variadic-func-fix.patch b/nuttx/configs/16z/tools/zneo-zdsii-5_0_1-variadic-func-fix.patch index 3b4b65f2e..b1464f340 100644 --- a/nuttx/configs/16z/tools/zneo-zdsii-5_0_1-variadic-func-fix.patch +++ b/nuttx/configs/16z/tools/zneo-zdsii-5_0_1-variadic-func-fix.patch @@ -22,12 +22,12 @@ index ba7dbe7..b9f9991 100644 + FAR const char *fmt, va_list ap); +#endif static FAR char *nsh_consolelinebuffer(FAR struct nsh_vtbl_s *vtbl); - + #if CONFIG_NFILE_DESCRIPTORS > 0 @@ -213,6 +219,7 @@ static ssize_t nsh_consolewrite(FAR struct nsh_vtbl_s *vtbl, FAR const void *buf * ****************************************************************************/ - + +#if 0 static int nsh_consoleoutput(FAR struct nsh_vtbl_s *vtbl, FAR const char *fmt, ...) @@ -35,7 +35,7 @@ index ba7dbe7..b9f9991 100644 @@ -263,6 +270,51 @@ static int nsh_consoleoutput(FAR struct nsh_vtbl_s *vtbl, #endif } - + +#else +static int nsh_consolevoutput(FAR struct nsh_vtbl_s *vtbl, FAR const char *fmt, va_list ap) +{ @@ -95,7 +95,7 @@ index ba7dbe7..b9f9991 100644 +#endif pstate->cn_vtbl.linebuffer = nsh_consolelinebuffer; pstate->cn_vtbl.exit = nsh_consoleexit; - + @@ -489,3 +545,15 @@ FAR struct console_stdio_s *nsh_newconsole(void) } return pstate; @@ -122,12 +122,12 @@ index c78362f..59bd8d7 100644 #include <stdbool.h> +#include <stdarg.h> #include <errno.h> - + /**************************************************************************** @@ -62,11 +63,13 @@ #define nsh_undirect(v,s) (v)->undirect(v,s) #define nsh_exit(v,s) (v)->exit(v,s) - + +#if 0 #ifdef CONFIG_CPP_HAVE_VARARGS # define nsh_output(v, fmt...) (v)->output(v, ##fmt) @@ -135,9 +135,9 @@ index c78362f..59bd8d7 100644 # define nsh_output vtbl->output #endif +#endif - + /* Size of info to be saved in call to nsh_redirect */ - + @@ -107,7 +110,11 @@ struct nsh_vtbl_s void (*release)(FAR struct nsh_vtbl_s *vtbl); #endif @@ -152,8 +152,8 @@ index c78362f..59bd8d7 100644 void (*redirect)(FAR struct nsh_vtbl_s *vtbl, int fd, FAR uint8_t *save); @@ -159,5 +166,6 @@ struct console_stdio_s /* Defined in nsh_console.c *************************************************/ - + FAR struct console_stdio_s *nsh_newconsole(void); +int nsh_output(FAR struct nsh_vtbl_s *vtbl, FAR const char *fmt, ...); - + #endif /* __APPS_NSHLIB_NSH_CONSOLE_H */ diff --git a/nuttx/configs/mcu123-lpc214x/lpc21isp-1.60.diff b/nuttx/configs/mcu123-lpc214x/lpc21isp-1.60.diff index 9d329c6d2..277b21921 100644 --- a/nuttx/configs/mcu123-lpc214x/lpc21isp-1.60.diff +++ b/nuttx/configs/mcu123-lpc214x/lpc21isp-1.60.diff @@ -2,82 +2,82 @@ diff -rub lpc21isp-1.60/lpc21isp.c lpc21isp-Linux//lpc21isp.c --- lpc21isp-1.60/lpc21isp.c 2008-07-21 15:17:06.000000000 -0600 +++ lpc21isp-Linux//lpc21isp.c 2008-09-16 09:21:20.000000000 -0600 @@ -22,6 +22,7 @@ - #include "adprog.h" - #include "lpcprog.h" - #include "lpcterm.h" -+#include "errno.h" - - /* - Change-History: + #include "adprog.h"
+ #include "lpcprog.h"
+ #include "lpcterm.h"
++#include "errno.h"
+
+ /*
+ Change-History:
@@ -319,10 +320,7 @@ - - if (IspEnvironment->fdCom < 0) - { -- int* p_err = __error(); -- int err; -- if (p_err) { err = *p_err; } -- DebugPrintf(1, "Can't open COM-Port %s ! (Error: %dd (0x%X))\n", IspEnvironment->serial_port, err, err); -+ DebugPrintf(1, "Can't open COM-Port %s ! (Error: %dd (0x%X))\n", IspEnvironment->serial_port, errno, errno); - exit(2); - } - +
+ if (IspEnvironment->fdCom < 0)
+ {
+- int* p_err = __error();
+- int err;
+- if (p_err) { err = *p_err; }
+- DebugPrintf(1, "Can't open COM-Port %s ! (Error: %dd (0x%X))\n", IspEnvironment->serial_port, err, err);
++ DebugPrintf(1, "Can't open COM-Port %s ! (Error: %dd (0x%X))\n", IspEnvironment->serial_port, errno, errno);
+ exit(2);
+ }
+
diff -rub lpc21isp-1.60/lpc21isp.h lpc21isp-Linux//lpc21isp.h --- lpc21isp-1.60/lpc21isp.h 2008-05-10 17:35:00.000000000 -0600 +++ lpc21isp-Linux//lpc21isp.h 2008-09-16 09:18:42.000000000 -0600 @@ -165,6 +165,7 @@ - #endif - - unsigned serial_timeout_count; /**< Local used to track timeouts on serial port read. */ -+ unsigned char DoNotStart; /* Do not start Code if this is set*/ - - } ISP_ENVIRONMENT; - + #endif
+
+ unsigned serial_timeout_count; /**< Local used to track timeouts on serial port read. */
++ unsigned char DoNotStart; /* Do not start Code if this is set*/
+
+ } ISP_ENVIRONMENT;
+
@@ -173,7 +174,6 @@ - #define DebugPrintf(in, ...) - - #else --extern int debug_level; - - #if defined INTEGRATED_IN_WIN_APP - + #define DebugPrintf(in, ...)
+
+ #else
+-extern int debug_level;
+
+ #if defined INTEGRATED_IN_WIN_APP
+
@@ -191,7 +191,6 @@ - - #else - void DebugPrintf(int level, const char *fmt, ...); --//#define DebugPrintf(level, ...) if (level <= debug_level) { TRACE( __VA_ARGS__ ); } - #endif - - void ClearSerialPortBuffers(ISP_ENVIRONMENT *IspEnvironment); +
+ #else
+ void DebugPrintf(int level, const char *fmt, ...);
+-//#define DebugPrintf(level, ...) if (level <= debug_level) { TRACE( __VA_ARGS__ ); }
+ #endif
+
+ void ClearSerialPortBuffers(ISP_ENVIRONMENT *IspEnvironment);
diff -rub lpc21isp-1.60/lpcprog.c lpc21isp-Linux//lpcprog.c --- lpc21isp-1.60/lpcprog.c 2008-07-21 14:39:50.000000000 -0600 +++ lpc21isp-Linux//lpcprog.c 2008-09-16 08:52:46.000000000 -0600 @@ -1062,15 +1062,16 @@ - } - else - { -+ if (IspEnvironment->DoNotStart == 0) -+ { - DebugPrintf(2, "Now launching the brand new code\n"); - fflush(stdout); -- - if (IspEnvironment->HalfDuplex == 0) - sprintf(tmpString, "G %ld A\r\n", IspEnvironment->StartAddress); - else - sprintf(tmpString, "G %ld A\n", IspEnvironment->StartAddress); -- - SendComPort(IspEnvironment, tmpString); //goto 0 : run this fresh new downloaded code code -+ - if (IspEnvironment->BinaryOffset < LPC_RAMSTART) - { // Skip response on G command - show response on Terminal instead - ReceiveComPort(IspEnvironment, Answer, sizeof(Answer)-1, &realsize, 2, 5000); + }
+ else
+ {
++ if (IspEnvironment->DoNotStart == 0)
++ {
+ DebugPrintf(2, "Now launching the brand new code\n");
+ fflush(stdout);
+-
+ if (IspEnvironment->HalfDuplex == 0)
+ sprintf(tmpString, "G %ld A\r\n", IspEnvironment->StartAddress);
+ else
+ sprintf(tmpString, "G %ld A\n", IspEnvironment->StartAddress);
+-
+ SendComPort(IspEnvironment, tmpString); //goto 0 : run this fresh new downloaded code code
++
+ if (IspEnvironment->BinaryOffset < LPC_RAMSTART)
+ { // Skip response on G command - show response on Terminal instead
+ ReceiveComPort(IspEnvironment, Answer, sizeof(Answer)-1, &realsize, 2, 5000);
@@ -1099,6 +1100,7 @@ - return (FAILED_RUN + GetAndReportErrorNumber(Answer)); - } - } -+ } - - fflush(stdout); - } + return (FAILED_RUN + GetAndReportErrorNumber(Answer));
+ }
+ }
++ }
+
+ fflush(stdout);
+ }
Only in lpc21isp-Linux/: lpcprog.c.orig diff -rub lpc21isp-1.60/Makefile lpc21isp-Linux//Makefile --- lpc21isp-1.60/Makefile 2008-04-07 00:23:00.000000000 -0600 @@ -85,18 +85,18 @@ diff -rub lpc21isp-1.60/Makefile lpc21isp-Linux//Makefile @@ -3,9 +3,9 @@ GLOBAL_DEP = adprog.h lpc21isp.h lpcprog.h lpcterm.h CC = gcc - + -ifneq ($findstring("freebsd", $(OSTYPE)),"") -CFLAGS+=-D__FREEBSD__ -endif +#ifneq ($findstring("freebsd", $(OSTYPE)),"") +#CFLAGS+=-D__FREEBSD__ +#endif - + adprog.o: adprog.c $(GLOBAL_DEP) $(CC) $(CDEBUG) $(CFLAGS) -c -o adprog.o adprog.c @@ -21,3 +21,4 @@ - + clean: $(RM) adprog.o lpcprog.o lpcterm.o lpc21isp + $(RM) *~ diff --git a/nuttx/configs/pcduino-a10/nsh/pcduino-140107.patch b/nuttx/configs/pcduino-a10/nsh/pcduino-140107.patch index 203db7f71..b5df28eb8 100644 --- a/nuttx/configs/pcduino-a10/nsh/pcduino-140107.patch +++ b/nuttx/configs/pcduino-a10/nsh/pcduino-140107.patch @@ -5,58 +5,58 @@ index 3cc6323..ad42790 100644 @@ -312,12 +312,14 @@ void up_boot(void) * for all IO regions (Including the vector region). */ - + +lowsyslog("Calling a1x_setupmappings\n"); // REMOVE ME a1x_setupmappings(); - + /* Provide a special mapping for the IRAM interrupt vector positioned in * high memory. */ - + +lowsyslog("Calling a1x_vectormapping\n"); // REMOVE ME a1x_vectormapping(); - + #endif /* CONFIG_ARCH_ROMPGTABLE */ @@ -326,16 +328,19 @@ void up_boot(void) * arm_vector.S */ - + +lowsyslog("Calling a1x_copyvectorblock\n"); // REMOVE ME a1x_copyvectorblock(); - + /* Initialize the FPU */ - + #ifdef CONFIG_ARCH_FPU +lowsyslog("Calling arm_fpuconfig\n"); // REMOVE ME arm_fpuconfig(); #endif - + /* Perform common, low-level chip initialization (might do nothing) */ - + +lowsyslog("Calling a1x_lowsetup\n"); // REMOVE ME a1x_lowsetup(); - + /* Perform early serial initialization if we are going to use the serial @@ -343,6 +348,7 @@ void up_boot(void) */ - + #ifdef USE_EARLYSERIALINIT +lowsyslog("Calling up_earlyserialinit\n"); // REMOVE ME up_earlyserialinit(); #endif - + @@ -353,6 +359,7 @@ void up_boot(void) */ - + #ifdef CONFIG_NUTTX_KERNEL +lowsyslog("Calling a1x_userspace\n"); // REMOVE ME a1x_userspace(); #endif - + @@ -362,5 +369,7 @@ void up_boot(void) * - Configuration of board specific resources (PIOs, LEDs, etc). */ - + +lowsyslog("Calling a1x_boardinitialize\n"); // REMOVE ME a1x_boardinitialize(); +lowsyslog("Returning\n"); // REMOVE ME @@ -68,7 +68,7 @@ index bce82d5..924bd24 100644 @@ -220,6 +220,12 @@ __start: teq r0, r2 bne .Lpgtableclear - + + movw r1, #0x0416 // REMOVE ME + movt r1, #0x01c0 + movw r2, #0x4070 @@ -83,11 +83,11 @@ index f82490c..5c16e48 100644 --- a/nuttx/arch/arm/src/armv7-a/arm_mmu.c +++ b/nuttx/arch/arm/src/armv7-a/arm_mmu.c @@ -94,7 +94,7 @@ void mmu_l1_setentry(uint32_t paddr, uint32_t vaddr, uint32_t mmuflags) - + /* Invalidate the TLB cache associated with virtual address range */ - + - mmu_invalidate_region(vaddr, 1024*1024); +// mmu_invalidate_region(vaddr, 1024*1024); } #endif - + diff --git a/nuttx/configs/pjrc-8051/sdcc-2.6.0.patch b/nuttx/configs/pjrc-8051/sdcc-2.6.0.patch index 551e1ef49..beb8bf2ea 100644 --- a/nuttx/configs/pjrc-8051/sdcc-2.6.0.patch +++ b/nuttx/configs/pjrc-8051/sdcc-2.6.0.patch @@ -9,20 +9,20 @@ diff -u sdcc/device/lib/Makefile.orig sdcc/device/lib/Makefile + $(MAKE) MODELFLAGS="--model-$$model --stack-auto --int-long-reent --float-reent" PORT=$$model PORTDIR=$(BUILDDIR)/$$model-stack-auto PORTINCDIR=$(INCDIR)/mcs51 objects; \ done \ fi - -diff -u sdcc/device/include/stdarg.h.orig sdcc/device/include/stdarg.h + +diff -u sdcc/device/include/stdarg.h.orig sdcc/device/include/stdarg.h --- sdcc/device/include/stdarg.h.orig 2007-03-11 13:21:15.000000000 -0600 +++ sdcc/device/include/stdarg.h 2007-03-11 13:26:59.000000000 -0600 @@ -25,9 +25,9 @@ - + #else - + -typedef unsigned char __data * va_list ; -#define va_arg(marker,type) *((type __data * )(marker -= sizeof(type))) -#define va_start(marker,first) { marker = (va_list) ((char __data * )&first); } +typedef unsigned char * va_list ; +#define va_arg(marker,type) *((type * )(marker -= sizeof(type))) +#define va_start(marker,first) { marker = (va_list) ((char * )&first); } - + #endif - + diff --git a/nuttx/configs/z16f2800100zcog/tools/zneo-zdsii-5_0_1-variadic-func-fix.patch b/nuttx/configs/z16f2800100zcog/tools/zneo-zdsii-5_0_1-variadic-func-fix.patch index 3b4b65f2e..b1464f340 100644 --- a/nuttx/configs/z16f2800100zcog/tools/zneo-zdsii-5_0_1-variadic-func-fix.patch +++ b/nuttx/configs/z16f2800100zcog/tools/zneo-zdsii-5_0_1-variadic-func-fix.patch @@ -22,12 +22,12 @@ index ba7dbe7..b9f9991 100644 + FAR const char *fmt, va_list ap); +#endif static FAR char *nsh_consolelinebuffer(FAR struct nsh_vtbl_s *vtbl); - + #if CONFIG_NFILE_DESCRIPTORS > 0 @@ -213,6 +219,7 @@ static ssize_t nsh_consolewrite(FAR struct nsh_vtbl_s *vtbl, FAR const void *buf * ****************************************************************************/ - + +#if 0 static int nsh_consoleoutput(FAR struct nsh_vtbl_s *vtbl, FAR const char *fmt, ...) @@ -35,7 +35,7 @@ index ba7dbe7..b9f9991 100644 @@ -263,6 +270,51 @@ static int nsh_consoleoutput(FAR struct nsh_vtbl_s *vtbl, #endif } - + +#else +static int nsh_consolevoutput(FAR struct nsh_vtbl_s *vtbl, FAR const char *fmt, va_list ap) +{ @@ -95,7 +95,7 @@ index ba7dbe7..b9f9991 100644 +#endif pstate->cn_vtbl.linebuffer = nsh_consolelinebuffer; pstate->cn_vtbl.exit = nsh_consoleexit; - + @@ -489,3 +545,15 @@ FAR struct console_stdio_s *nsh_newconsole(void) } return pstate; @@ -122,12 +122,12 @@ index c78362f..59bd8d7 100644 #include <stdbool.h> +#include <stdarg.h> #include <errno.h> - + /**************************************************************************** @@ -62,11 +63,13 @@ #define nsh_undirect(v,s) (v)->undirect(v,s) #define nsh_exit(v,s) (v)->exit(v,s) - + +#if 0 #ifdef CONFIG_CPP_HAVE_VARARGS # define nsh_output(v, fmt...) (v)->output(v, ##fmt) @@ -135,9 +135,9 @@ index c78362f..59bd8d7 100644 # define nsh_output vtbl->output #endif +#endif - + /* Size of info to be saved in call to nsh_redirect */ - + @@ -107,7 +110,11 @@ struct nsh_vtbl_s void (*release)(FAR struct nsh_vtbl_s *vtbl); #endif @@ -152,8 +152,8 @@ index c78362f..59bd8d7 100644 void (*redirect)(FAR struct nsh_vtbl_s *vtbl, int fd, FAR uint8_t *save); @@ -159,5 +166,6 @@ struct console_stdio_s /* Defined in nsh_console.c *************************************************/ - + FAR struct console_stdio_s *nsh_newconsole(void); +int nsh_output(FAR struct nsh_vtbl_s *vtbl, FAR const char *fmt, ...); - + #endif /* __APPS_NSHLIB_NSH_CONSOLE_H */ |