--- rpl/src/rpl.h 2019/11/06 17:31:47 1.336 +++ rpl/src/rpl.h 2020/11/01 08:51:42 1.342 @@ -1,7 +1,7 @@ /* ================================================================================ RPL/2 (R) version 4.1.32 - Copyright (C) 1989-2019 Dr. BERTRAND Joël + Copyright (C) 1989-2020 Dr. BERTRAND Joël This file is part of RPL/2. @@ -269,8 +269,11 @@ #ifndef RPLARGS # ifndef UNIX_PATH_MAX - struct sockaddr_un sizecheck; +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wunused-variable" + static struct sockaddr_un sizecheck; # define UNIX_PATH_MAX sizeof(sizecheck.sun_path) +# pragma GCC diagnostic pop # endif #endif @@ -731,13 +734,29 @@ void *debug_memoire_modification(void *p void debug_memoire_retrait(void *ptr); void debug_memoire_verification(); -pid_t debug_fork(); - -#define malloc(s) debug_memoire_ajout(s, __FUNCTION__, __LINE__, #s) #define free(s) debug_memoire_retrait(s) -#define realloc(s, t) debug_memoire_modification(s, t, \ - __FUNCTION__, __LINE__, #t) -#define fork() debug_fork() +#ifdef RPLCXX +# define malloc(s) debug_memoire_ajout(s, \ + const_cast \ + (reinterpret_cast \ + (const_cast(__FUNCTION__))), __LINE__, \ + const_cast \ + (reinterpret_cast \ + (const_cast(#s)))) +# define realloc(s, t) debug_memoire_modification(s, t, \ + const_cast \ + (reinterpret_cast \ + (const_cast(__FUNCTION__))), __LINE__, \ + const_cast \ + (reinterpret_cast \ + (const_cast(#t)))) +#else +# define malloc(s) debug_memoire_ajout(s, __FUNCTION__, __LINE__, \ + (const unsigned char *) #s) +# define realloc(s, t) debug_memoire_modification(s, t, \ + __FUNCTION__, __LINE__, (const unsigned char *) #t) +#endif +#define fork() debug_fork(s_etat_processus) #endif #ifdef DEBUG_RETURN @@ -1115,7 +1134,8 @@ pid_t debug_fork(); #define VIN __RPL_VIN #define VRL __RPL_VRL -enum t_rplcas_commandes { RPLCAS_INTEGRATION = 0, RPLCAS_LIMITE }; +enum t_rplcas_commandes { RPLCAS_INTEGRATION = 0, RPLCAS_LIMITE, + RPLCAS_SIMPLIFICATION }; enum t_type { ADR = 0, ALG, BIN, CHN, CPL, EXT, FCH, FCT, INT, LST, MCX, MIN, MRL, MTX, NOM, NON, PRC, REC, REL, RPN, SCK, @@ -2557,6 +2577,10 @@ typedef struct processus } struct_processus; #endif +#ifdef DEBUG_MEMOIRE +pid_t debug_fork(struct_processus *s_etat_processus); +#endif + /* ================================================================================