--- rpl/src/interface_cas.cpp 2011/09/21 10:35:51 1.18 +++ rpl/src/interface_cas.cpp 2020/01/16 08:57:42 1.64 @@ -1,7 +1,7 @@ /* ================================================================================ - RPL/2 (R) version 4.1.4 - Copyright (C) 1989-2011 Dr. BERTRAND Joël + RPL/2 (R) version 4.1.32 + Copyright (C) 1989-2020 Dr. BERTRAND Joël This file is part of RPL/2. @@ -21,6 +21,7 @@ #ifdef RPLCAS +# define RPLCXX // Giac inclut et définit sem_t. Or l'émulation // des IPCS POSIX requiert une redéfinition de sem_t. @@ -28,9 +29,17 @@ # ifdef IPCS_SYSV // NetBSD : _SEMAPHORE_H_ # define _SEMAPHORE_H_ +// Linux : _SEMAPHORE_H +# define _SEMAPHORE_H # endif -# include "giac.h" +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wstrict-aliasing" +# pragma GCC diagnostic ignored "-Wunused-parameter" +# pragma GCC diagnostic ignored "-Wempty-body" +# pragma GCC diagnostic ignored "-Wunknown-pragmas" +# include "giacPCH.h" +# pragma GCC diagnostic pop # undef PACKAGE # undef PACKAGE_NAME @@ -76,6 +85,7 @@ liberation_contexte_cas(struct_processus return; } +#ifdef RPLCAS static unsigned char * conversion_rpl_vers_cas(struct_processus *s_etat_processus, struct_objet **s_objet) @@ -83,7 +93,6 @@ conversion_rpl_vers_cas(struct_processus logical1 drapeau; struct_liste_chainee *l_element_courant; - struct_liste_chainee *l_element_precedent; struct_objet *s_objet_temporaire; @@ -214,7 +223,6 @@ conversion_rpl_vers_cas(struct_processus } } - l_element_precedent = l_element_courant; l_element_courant = l_element_courant->suivant; } } @@ -228,7 +236,7 @@ conversion_rpl_vers_cas(struct_processus strstr(reinterpret_cast(index), (const char *) "relax"))) != NULL) { - strncpy(reinterpret_cast(index), " +", 5); + memcpy(reinterpret_cast(index), " +", 5); } // Si le résultat vaut infinity, on rajoute le signe +. @@ -268,7 +276,6 @@ conversion_cas_vers_rpl(struct_processus logical1 drapeau; struct_liste_chainee *l_element_courant; - struct_liste_chainee *l_element_precedent; struct_objet *s_objet; @@ -341,7 +348,6 @@ conversion_cas_vers_rpl(struct_processus if ((s_objet->type == ALG) || (s_objet->type == RPN)) { - l_element_precedent = NULL; l_element_courant = reinterpret_cast( s_objet->objet); @@ -387,7 +393,6 @@ conversion_cas_vers_rpl(struct_processus } } - l_element_precedent = l_element_courant; l_element_courant = l_element_courant->suivant; } } @@ -400,6 +405,7 @@ conversion_cas_vers_rpl(struct_processus return; } +#endif /* @@ -415,11 +421,13 @@ conversion_cas_vers_rpl(struct_processus ================================================================================ */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" void interface_cas(struct_processus *s_etat_processus, enum t_rplcas_commandes commande) { -# ifdef RPLCAS +#ifdef RPLCAS struct_objet *s_objet_argument_1; struct_objet *s_objet_argument_2; struct_objet *s_objet_temporaire; @@ -441,7 +449,7 @@ interface_cas(struct_processus *s_etat_p { s_etat_processus->contexte_cas = new giac::context; } - catch(bad_alloc exception) + catch(bad_alloc &exception) { s_etat_processus->erreur_systeme = d_es_allocation_memoire; return; @@ -515,7 +523,7 @@ interface_cas(struct_processus *s_etat_p reinterpret_cast(const_cast( chaine.c_str()))); } - catch(bad_alloc exception) + catch(bad_alloc &exception) { s_etat_processus->erreur_systeme = d_es_allocation_memoire; } @@ -572,6 +580,8 @@ interface_cas(struct_processus *s_etat_p l_element_courant = reinterpret_cast (s_objet_argument_1->objet); position = 1; + argument_1 = NULL; + argument_3 = NULL; argument_4 = NULL; while(l_element_courant != NULL) @@ -674,7 +684,7 @@ interface_cas(struct_processus *s_etat_p reinterpret_cast(const_cast( chaine.c_str()))); } - catch(bad_alloc exception) + catch(bad_alloc &exception) { s_etat_processus->erreur_systeme = d_es_allocation_memoire; } @@ -697,7 +707,6 @@ interface_cas(struct_processus *s_etat_p } return; - #else if (s_etat_processus->langue == 'F') @@ -715,5 +724,6 @@ interface_cas(struct_processus *s_etat_p #endif } +#pragma GCC diagnostic pop // vim: ts=4