[PATCH] use C-style comments
Simon Marlow
marlowsd at gmail.com
Fri Jan 6 10:21:47 CET 2012
I tend to use C++ style rather than C style for single-line comments,
except for code that will be #included into Haskell source.
On 05/01/2012 20:03, Gabor Greif wrote:
> Also remove underscore identifier as
> it is not needed, StgFunTable is now
> consistent with StgRegTable.
> ---
> includes/stg/Regs.h | 10 +++++-----
> 1 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/includes/stg/Regs.h b/includes/stg/Regs.h
> index bfc3d4b..bf17b7e 100644
> --- a/includes/stg/Regs.h
> +++ b/includes/stg/Regs.h
> @@ -1,6 +1,6 @@
> /* -----------------------------------------------------------------------------
> *
> - * (c) The GHC Team, 1998-2009
> + * (c) The GHC Team, 1998-2012
> *
> * Registers in the STG machine.
> *
> @@ -21,7 +21,7 @@
> *
> * The register set is backed by a table in memory (struct
> * StgRegTable). If a particular STG register is not mapped to a
> - * machine register, then the apprpriate slot in this table is used
> + * machine register, then the appropriate slot in this table is used
> * instead.
> *
> * This table is itself pointed to by another register, BaseReg. If
> @@ -58,7 +58,7 @@ typedef union {
> * register, probably because there's a shortage of real registers.
> * 2) caller-saves registers are saved across a CCall
> */
> -typedef struct StgRegTable_ {
> +typedef struct {
This is also a convention - sometimes it is necessary to
forward-reference a struct, so I name structs with an underscore suffix.
Cheers,
Simon
> StgUnion rR1;
> StgUnion rR2;
> StgUnion rR3;
> @@ -80,13 +80,13 @@ typedef struct StgRegTable_ {
> StgPtr rSpLim;
> StgPtr rHp;
> StgPtr rHpLim;
> - struct CostCentreStack_ * rCCCS; // current cost-centre-stack
> + struct CostCentreStack_ * rCCCS; /* current cost-centre-stack */
> struct StgTSO_ * rCurrentTSO;
> struct nursery_ * rNursery;
> struct bdescr_ * rCurrentNursery; /* Hp/HpLim point into this block */
> struct bdescr_ * rCurrentAlloc; /* for allocation using allocate() */
> StgWord rHpAlloc; /* number of *bytes* being allocated in heap */
> - StgWord rRet; // holds the return code of the thread
> + StgWord rRet; /* holds the return code of the thread */
> } StgRegTable;
>
> #if IN_STG_CODE
More information about the Cvs-ghc
mailing list