memp: fixed compiling various combinations of memp stats (display etc.)

This commit is contained in:
goldsimon 2016-07-08 08:21:57 +02:00
parent a463119597
commit 959042aa88
4 changed files with 8 additions and 8 deletions

View File

@ -245,9 +245,9 @@ memp_init(void)
memp_pools[i]->stats->illegal = 0;
memp_pools[i]->stats->avail = memp_pools[i]->num;
#ifdef LWIP_DEBUG
#if defined(LWIP_DEBUG) || LWIP_STATS_DISPLAY
memp_pools[i]->stats->name = memp_pools[i]->desc;
#endif /* LWIP_DEBUG */
#endif /* defined(LWIP_DEBUG) || LWIP_STATS_DISPLAY */
#if LWIP_STATS
lwip_stats.memp[i] = memp_pools[i]->stats;

View File

@ -116,7 +116,7 @@ void
stats_display_memp(struct stats_mem *mem, int index)
{
if (index < MEMP_MAX) {
stats_display_mem(mem, memp_names[index]);
stats_display_mem(mem, mem->name);
}
}
#endif /* MEMP_STATS */

View File

@ -138,10 +138,10 @@ struct memp_desc {
/** Number of elements */
u16_t num;
#if defined(LWIP_DEBUG) || MEMP_OVERFLOW_CHECK
#if defined(LWIP_DEBUG) || MEMP_OVERFLOW_CHECK || LWIP_STATS_DISPLAY
/** Textual description */
const char *desc;
#endif /* LWIP_DEBUG || MEMP_OVERFLOW_CHECK */
#endif /* LWIP_DEBUG || MEMP_OVERFLOW_CHECK || LWIP_STATS_DISPLAY */
/** Base address */
u8_t *base;
@ -151,7 +151,7 @@ struct memp_desc {
#endif /* MEMP_MEM_MALLOC */
};
#ifdef LWIP_DEBUG
#if defined(LWIP_DEBUG) || MEMP_OVERFLOW_CHECK || LWIP_STATS_DISPLAY
#define DECLARE_LWIP_MEMPOOL_DESC(desc) (desc),
#else
#define DECLARE_LWIP_MEMPOOL_DESC(desc)

View File

@ -93,9 +93,9 @@ struct stats_igmp {
};
struct stats_mem {
#ifdef LWIP_DEBUG
#if defined(LWIP_DEBUG) || LWIP_STATS_DISPLAY
const char *name;
#endif /* LWIP_DEBUG */
#endif /* defined(LWIP_DEBUG) || LWIP_STATS_DISPLAY */
STAT_COUNTER err;
mem_size_t avail;
mem_size_t used;