From 2b8c1142b851c7a81eafe69ed35c490f3d9c6735 Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 15 Dec 2009 01:39:03 +0000 Subject: Switching to C99 stdint/stdbool.h types git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2342 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/mm/mm_addfreechunk.c | 32 ++++++++++++++++---------------- nuttx/mm/mm_calloc.c | 26 +++++++++++++------------- nuttx/mm/mm_environment.h | 12 ++++++------ nuttx/mm/mm_free.c | 32 ++++++++++++++++---------------- nuttx/mm/mm_initialize.c | 4 ++-- nuttx/mm/mm_internal.h | 38 +++++++++++++++++++------------------- nuttx/mm/mm_mallinfo.c | 2 +- nuttx/mm/mm_malloc.c | 8 ++++---- nuttx/mm/mm_memalign.c | 8 ++++---- nuttx/mm/mm_realloc.c | 8 ++++---- nuttx/mm/mm_sem.c | 6 +++--- nuttx/mm/mm_shrinkchunk.c | 28 ++++++++++++++-------------- nuttx/mm/mm_size2ndx.c | 24 ++++++++++++------------ nuttx/mm/mm_test.c | 16 ++++++++-------- nuttx/mm/mm_zalloc.c | 28 ++++++++++++++-------------- 15 files changed, 136 insertions(+), 136 deletions(-) (limited to 'nuttx') diff --git a/nuttx/mm/mm_addfreechunk.c b/nuttx/mm/mm_addfreechunk.c index c3b74a07d..0cf2fcf42 100644 --- a/nuttx/mm/mm_addfreechunk.c +++ b/nuttx/mm/mm_addfreechunk.c @@ -1,7 +1,7 @@ -/************************************************************ - * mm_addfreechunk.c +/************************************************************************ + * mm/mm_addfreechunk.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,35 +31,35 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Included Files - ************************************************************/ + ************************************************************************/ #include "mm_environment.h" #include "mm_internal.h" -/************************************************************ - * Definitions - ************************************************************/ +/************************************************************************ + * Pre-processor Definitions + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Global Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * mm_addfreechunk * * Description: * Add a free chunk to the node next * It is assumed that the caller holds the mm semaphore * - ************************************************************/ + ************************************************************************/ void mm_addfreechunk(FAR struct mm_freenode_s *node) { diff --git a/nuttx/mm/mm_calloc.c b/nuttx/mm/mm_calloc.c index 6c9db3440..47c75d42f 100644 --- a/nuttx/mm/mm_calloc.c +++ b/nuttx/mm/mm_calloc.c @@ -1,7 +1,7 @@ -/************************************************************ +/************************************************************************ * mm_calloc.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,29 +31,29 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Included Files - ************************************************************/ + ************************************************************************/ #include "mm_environment.h" #include "mm_internal.h" -/************************************************************ - * Definitions - ************************************************************/ +/************************************************************************ + * Pre-processor Definitions + ************************************************************************/ -/************************************************************ +/************************************************************************ * Global Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * calloc * * Descripton: * calloc calculates the size and calls zalloc - ************************************************************/ + ************************************************************************/ FAR void *calloc(size_t n, size_t elem_size) { diff --git a/nuttx/mm/mm_environment.h b/nuttx/mm/mm_environment.h index c64f4ff29..67c2ec05a 100644 --- a/nuttx/mm/mm_environment.h +++ b/nuttx/mm/mm_environment.h @@ -1,7 +1,7 @@ /**************************************************************************** - * mm_environment.h + * mm/mm_environment.h * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __MM_ENVIRONMENT_H -#define __MM_ENVIRONMENT_H +#ifndef __MM_MM_ENVIRONMENT_H +#define __MM_MM_ENVIRONMENT_H /**************************************************************************** * Included Files @@ -62,7 +62,7 @@ #endif /**************************************************************************** - * Definitions + * Pre-processor Definitions ****************************************************************************/ /* Special definitions used when the memory mnager is built @@ -125,4 +125,4 @@ extern void mm_addregion(FAR void *heapstart, size_t heapsize); * Public Function Prototypes ****************************************************************************/ -#endif /* __MM_ENVIRONMENT_H */ +#endif /* __MM_MM_ENVIRONMENT_H */ diff --git a/nuttx/mm/mm_free.c b/nuttx/mm/mm_free.c index ef6e1a5e6..20135484b 100644 --- a/nuttx/mm/mm_free.c +++ b/nuttx/mm/mm_free.c @@ -1,7 +1,7 @@ -/************************************************************ - * mm_free.c +/************************************************************************ + * mm/mm_free.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,36 +31,36 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Included Files - ************************************************************/ + ************************************************************************/ #include #include "mm_environment.h" #include "mm_internal.h" -/************************************************************ - * Definitions - ************************************************************/ +/************************************************************************ + * Pre-processor Definitions + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Public Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * free * * Description: * Returns a chunk of memory into the list of free nodes, * merging with adjacent free chunks if possible. * - ************************************************************/ + ************************************************************************/ void free(FAR void *mem) { diff --git a/nuttx/mm/mm_initialize.c b/nuttx/mm/mm_initialize.c index f3f073142..9a580cd89 100644 --- a/nuttx/mm/mm_initialize.c +++ b/nuttx/mm/mm_initialize.c @@ -1,5 +1,5 @@ /**************************************************************************** - * mm_initialize.c + * mm/mm_initialize.c * * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -41,7 +41,7 @@ #include "mm_internal.h" /**************************************************************************** - * Definitions + * Pre-processor Definitions ****************************************************************************/ /**************************************************************************** diff --git a/nuttx/mm/mm_internal.h b/nuttx/mm/mm_internal.h index 2b23dc0f2..0649122a2 100644 --- a/nuttx/mm/mm_internal.h +++ b/nuttx/mm/mm_internal.h @@ -1,7 +1,7 @@ -/************************************************************ - * mm_internal.h +/************************************************************************ + * mm/mm_internal.h * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,18 +31,18 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ************************************************************************/ -#ifndef __MM_INTERNAL_H -#define __MM_INTERNAL_H +#ifndef __MM_MM_INTERNAL_H +#define __MM_MM_INTERNAL_H -/************************************************************ +/************************************************************************ * Included Files - ************************************************************/ + ************************************************************************/ -/************************************************************ - * Definitions - ************************************************************/ +/************************************************************************ + * Pre-processor Definitions + ************************************************************************/ /* These definitions define the characteristics of allocator * @@ -92,9 +92,9 @@ #define MM_IS_ALLOCATED(n) \ ((int)((struct mm_allocnode_s*)(n)->preceding) < 0)) -/************************************************************ +/************************************************************************ * Public Types - ************************************************************/ + ************************************************************************/ /* This describes an allocated chunk. An allocated chunk is * distinguished from a free chunk by bit 31 of the 'precding' @@ -150,9 +150,9 @@ struct mallinfo }; #endif -/************************************************************ +/************************************************************************ * Global Variables - ************************************************************/ + ************************************************************************/ /* This is the size of the heap provided to mm */ @@ -176,9 +176,9 @@ extern int g_nregions; extern FAR struct mm_freenode_s g_nodelist[MM_NNODES]; -/************************************************************ +/************************************************************************ * Public Function Prototypes - ************************************************************/ + ************************************************************************/ /* Normally defined in malloc.h */ @@ -207,4 +207,4 @@ extern void mm_givesemaphore(void); extern int mm_getsemaphore(void); #endif -#endif /* __MM_INTERNAL_H */ +#endif /* __MM_MM_INTERNAL_H */ diff --git a/nuttx/mm/mm_mallinfo.c b/nuttx/mm/mm_mallinfo.c index 5dbe26609..a7f6d9df6 100644 --- a/nuttx/mm/mm_mallinfo.c +++ b/nuttx/mm/mm_mallinfo.c @@ -42,7 +42,7 @@ #include "mm_internal.h" /**************************************************************************** - * Definitions + * Pre-processor Definitions ****************************************************************************/ /**************************************************************************** diff --git a/nuttx/mm/mm_malloc.c b/nuttx/mm/mm_malloc.c index fb26cbefa..5d5257716 100644 --- a/nuttx/mm/mm_malloc.c +++ b/nuttx/mm/mm_malloc.c @@ -1,7 +1,7 @@ /************************************************************ - * mm_malloc.c + * mm/mm_malloc.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -46,7 +46,7 @@ #include "mm_internal.h" /************************************************************ - * Definitions + * Pre-processor Definitions ************************************************************/ #ifndef NULL diff --git a/nuttx/mm/mm_memalign.c b/nuttx/mm/mm_memalign.c index 7ac192d9c..10c455ff7 100644 --- a/nuttx/mm/mm_memalign.c +++ b/nuttx/mm/mm_memalign.c @@ -1,7 +1,7 @@ /************************************************************ - * mm_memalign.c + * mm/mm_memalign.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -42,7 +42,7 @@ #include "mm_internal.h" /************************************************************ - * Definitions + * Pre-processor Definitions ************************************************************/ /************************************************************ diff --git a/nuttx/mm/mm_realloc.c b/nuttx/mm/mm_realloc.c index 287ad2263..d97bf53a5 100644 --- a/nuttx/mm/mm_realloc.c +++ b/nuttx/mm/mm_realloc.c @@ -1,7 +1,7 @@ /************************************************************ - * mm_realloc.c + * mm/mm_realloc.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -43,7 +43,7 @@ #include "mm_internal.h" /************************************************************ - * Definitions + * Pre-processor Definitions ************************************************************/ /************************************************************ diff --git a/nuttx/mm/mm_sem.c b/nuttx/mm/mm_sem.c index 43d5221cd..f0b35cdda 100644 --- a/nuttx/mm/mm_sem.c +++ b/nuttx/mm/mm_sem.c @@ -1,7 +1,7 @@ /**************************************************************************** - * mm_sem.c + * mm/mm_sem.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -45,7 +45,7 @@ #include "mm_internal.h" /**************************************************************************** - * Definitions + * Pre-processor Definitions ****************************************************************************/ /* Define the following to enable semaphore state monitoring */ diff --git a/nuttx/mm/mm_shrinkchunk.c b/nuttx/mm/mm_shrinkchunk.c index 4e81f5b3a..9361a4f8b 100644 --- a/nuttx/mm/mm_shrinkchunk.c +++ b/nuttx/mm/mm_shrinkchunk.c @@ -1,7 +1,7 @@ -/************************************************************ - * mm_shrinkchunk.c +/************************************************************************ + * mm/mm_shrinkchunk.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,24 +31,24 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Included Files - ************************************************************/ + ************************************************************************/ #include "mm_environment.h" #include "mm_internal.h" -/************************************************************ - * Definitions - ************************************************************/ +/************************************************************************ + * Pre-processor Definitions + ************************************************************************/ -/************************************************************ +/************************************************************************ * Global Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * mm_shrinkchunk * * Description: @@ -62,7 +62,7 @@ * (1) size is the whole chunk size (payload and header) * (2) the caller must hold the MM semaphore. * - ************************************************************/ + ************************************************************************/ void mm_shrinkchunk(FAR struct mm_allocnode_s *node, size_t size) { diff --git a/nuttx/mm/mm_size2ndx.c b/nuttx/mm/mm_size2ndx.c index 416652e03..492dd8ba0 100644 --- a/nuttx/mm/mm_size2ndx.c +++ b/nuttx/mm/mm_size2ndx.c @@ -1,7 +1,7 @@ -/************************************************************ - * mm_size2ndx.c +/************************************************************************ + * mm/mm_size2ndx.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,22 +31,22 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Included Files - ************************************************************/ + ************************************************************************/ #include "mm_environment.h" #include "mm_internal.h" -/************************************************************ - * Definitions - ************************************************************/ +/************************************************************************ + * Pre-processor Definitions + ************************************************************************/ -/************************************************************ +/************************************************************************ * Public Functions - ************************************************************/ + ************************************************************************/ /* Convert the size to a nodelist index */ diff --git a/nuttx/mm/mm_test.c b/nuttx/mm/mm_test.c index 4dadcec27..4e414d848 100644 --- a/nuttx/mm/mm_test.c +++ b/nuttx/mm/mm_test.c @@ -1,7 +1,7 @@ -/************************************************************ - * mm_test.c +/************************************************************************ + * mm/mm_test.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,7 +31,7 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ************************************************************************/ #include #include @@ -46,7 +46,7 @@ #include "mm_internal.h" -/* Definitions */ +/* Pre-processor Definitions */ #define TEST_HEAP1_SIZE 0x00080000 #define TEST_HEAP2_SIZE 0x00080000 @@ -102,9 +102,9 @@ static struct mallinfo alloc_info; static unsigned int g_reportedheapsize = 0; static unsigned int g_actualheapsize = 0; -/************************************************************ +/************************************************************************ * mm_showchunkinfo - ************************************************************/ + ************************************************************************/ static int mm_findinfreelist(struct mm_freenode_s *node) { diff --git a/nuttx/mm/mm_zalloc.c b/nuttx/mm/mm_zalloc.c index 270839cac..97f1079a6 100644 --- a/nuttx/mm/mm_zalloc.c +++ b/nuttx/mm/mm_zalloc.c @@ -1,7 +1,7 @@ -/************************************************************ - * mm_zalloc.c +/************************************************************************ + * mm/mm_zalloc.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,30 +31,30 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Included Files - ************************************************************/ + ************************************************************************/ #include "mm_environment.h" #include "mm_internal.h" -/************************************************************ - * Definitions - ************************************************************/ +/************************************************************************ + * Pre-processor Definitions + ************************************************************************/ -/************************************************************ +/************************************************************************ * Public: Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Name: zalloc * * Description: * zalloc calls malloc, then zeroes out the allocated chunk. * - ************************************************************/ + ************************************************************************/ FAR void *zalloc(size_t size) { -- cgit v1.2.3