version 1.16, 2011/09/16 16:37:08
|
version 1.59, 2018/12/24 15:56:34
|
Line 1
|
Line 1
|
/* |
/* |
================================================================================ |
================================================================================ |
RPL/2 (R) version 4.1.3 |
RPL/2 (R) version 4.1.30 |
Copyright (C) 1989-2011 Dr. BERTRAND Joël |
Copyright (C) 1989-2018 Dr. BERTRAND Joël |
|
|
This file is part of RPL/2. |
This file is part of RPL/2. |
|
|
Line 21
|
Line 21
|
|
|
|
|
#ifdef RPLCAS |
#ifdef RPLCAS |
# include "giac.h" |
|
|
// Giac inclut <semaphore.h> et définit sem_t. Or l'émulation |
|
// des IPCS POSIX requiert une redéfinition de sem_t. |
|
|
|
# ifdef IPCS_SYSV |
|
// NetBSD : _SEMAPHORE_H_ |
|
# define _SEMAPHORE_H_ |
|
// Linux : _SEMAPHORE_H |
|
# define _SEMAPHORE_H |
|
# endif |
|
|
|
# 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 |
# undef PACKAGE_NAME |
# undef PACKAGE_NAME |
Line 67 liberation_contexte_cas(struct_processus
|
Line 84 liberation_contexte_cas(struct_processus
|
return; |
return; |
} |
} |
|
|
|
#ifdef RPLCAS |
static unsigned char * |
static unsigned char * |
conversion_rpl_vers_cas(struct_processus *s_etat_processus, |
conversion_rpl_vers_cas(struct_processus *s_etat_processus, |
struct_objet **s_objet) |
struct_objet **s_objet) |
Line 74 conversion_rpl_vers_cas(struct_processus
|
Line 92 conversion_rpl_vers_cas(struct_processus
|
logical1 drapeau; |
logical1 drapeau; |
|
|
struct_liste_chainee *l_element_courant; |
struct_liste_chainee *l_element_courant; |
struct_liste_chainee *l_element_precedent; |
|
|
|
struct_objet *s_objet_temporaire; |
struct_objet *s_objet_temporaire; |
|
|
Line 205 conversion_rpl_vers_cas(struct_processus
|
Line 222 conversion_rpl_vers_cas(struct_processus
|
} |
} |
} |
} |
|
|
l_element_precedent = l_element_courant; |
|
l_element_courant = l_element_courant->suivant; |
l_element_courant = l_element_courant->suivant; |
} |
} |
} |
} |
Line 219 conversion_rpl_vers_cas(struct_processus
|
Line 235 conversion_rpl_vers_cas(struct_processus
|
strstr(reinterpret_cast<char *>(index), |
strstr(reinterpret_cast<char *>(index), |
(const char *) "relax"))) != NULL) |
(const char *) "relax"))) != NULL) |
{ |
{ |
strncpy(reinterpret_cast<char *>(index), " +", 5); |
memcpy(reinterpret_cast<char *>(index), " +", 5); |
} |
} |
|
|
// Si le résultat vaut infinity, on rajoute le signe +. |
// Si le résultat vaut infinity, on rajoute le signe +. |
Line 259 conversion_cas_vers_rpl(struct_processus
|
Line 275 conversion_cas_vers_rpl(struct_processus
|
logical1 drapeau; |
logical1 drapeau; |
|
|
struct_liste_chainee *l_element_courant; |
struct_liste_chainee *l_element_courant; |
struct_liste_chainee *l_element_precedent; |
|
|
|
struct_objet *s_objet; |
struct_objet *s_objet; |
|
|
Line 332 conversion_cas_vers_rpl(struct_processus
|
Line 347 conversion_cas_vers_rpl(struct_processus
|
|
|
if ((s_objet->type == ALG) || (s_objet->type == RPN)) |
if ((s_objet->type == ALG) || (s_objet->type == RPN)) |
{ |
{ |
l_element_precedent = NULL; |
|
l_element_courant = reinterpret_cast<struct_liste_chainee *>( |
l_element_courant = reinterpret_cast<struct_liste_chainee *>( |
s_objet->objet); |
s_objet->objet); |
|
|
Line 378 conversion_cas_vers_rpl(struct_processus
|
Line 392 conversion_cas_vers_rpl(struct_processus
|
} |
} |
} |
} |
|
|
l_element_precedent = l_element_courant; |
|
l_element_courant = l_element_courant->suivant; |
l_element_courant = l_element_courant->suivant; |
} |
} |
} |
} |
Line 391 conversion_cas_vers_rpl(struct_processus
|
Line 404 conversion_cas_vers_rpl(struct_processus
|
|
|
return; |
return; |
} |
} |
|
#endif |
|
|
|
|
/* |
/* |
Line 406 conversion_cas_vers_rpl(struct_processus
|
Line 420 conversion_cas_vers_rpl(struct_processus
|
================================================================================ |
================================================================================ |
*/ |
*/ |
|
|
|
#pragma GCC diagnostic push |
|
#pragma GCC diagnostic ignored "-Wunused-parameter" |
void |
void |
interface_cas(struct_processus *s_etat_processus, |
interface_cas(struct_processus *s_etat_processus, |
enum t_rplcas_commandes commande) |
enum t_rplcas_commandes commande) |
{ |
{ |
# ifdef RPLCAS |
#ifdef RPLCAS |
struct_objet *s_objet_argument_1; |
struct_objet *s_objet_argument_1; |
struct_objet *s_objet_argument_2; |
struct_objet *s_objet_argument_2; |
struct_objet *s_objet_temporaire; |
struct_objet *s_objet_temporaire; |
Line 432 interface_cas(struct_processus *s_etat_p
|
Line 448 interface_cas(struct_processus *s_etat_p
|
{ |
{ |
s_etat_processus->contexte_cas = new giac::context; |
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; |
s_etat_processus->erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
Line 506 interface_cas(struct_processus *s_etat_p
|
Line 522 interface_cas(struct_processus *s_etat_p
|
reinterpret_cast<unsigned char *>(const_cast<char *>( |
reinterpret_cast<unsigned char *>(const_cast<char *>( |
chaine.c_str()))); |
chaine.c_str()))); |
} |
} |
catch(bad_alloc exception) |
catch(bad_alloc &exception) |
{ |
{ |
s_etat_processus->erreur_systeme = d_es_allocation_memoire; |
s_etat_processus->erreur_systeme = d_es_allocation_memoire; |
} |
} |
Line 563 interface_cas(struct_processus *s_etat_p
|
Line 579 interface_cas(struct_processus *s_etat_p
|
l_element_courant = reinterpret_cast<struct_liste_chainee *> |
l_element_courant = reinterpret_cast<struct_liste_chainee *> |
(s_objet_argument_1->objet); |
(s_objet_argument_1->objet); |
position = 1; |
position = 1; |
|
argument_1 = NULL; |
|
argument_3 = NULL; |
argument_4 = NULL; |
argument_4 = NULL; |
|
|
while(l_element_courant != NULL) |
while(l_element_courant != NULL) |
Line 665 interface_cas(struct_processus *s_etat_p
|
Line 683 interface_cas(struct_processus *s_etat_p
|
reinterpret_cast<unsigned char *>(const_cast<char *>( |
reinterpret_cast<unsigned char *>(const_cast<char *>( |
chaine.c_str()))); |
chaine.c_str()))); |
} |
} |
catch(bad_alloc exception) |
catch(bad_alloc &exception) |
{ |
{ |
s_etat_processus->erreur_systeme = d_es_allocation_memoire; |
s_etat_processus->erreur_systeme = d_es_allocation_memoire; |
} |
} |
Line 688 interface_cas(struct_processus *s_etat_p
|
Line 706 interface_cas(struct_processus *s_etat_p
|
} |
} |
|
|
return; |
return; |
|
|
#else |
#else |
|
|
if (s_etat_processus->langue == 'F') |
if (s_etat_processus->langue == 'F') |
Line 706 interface_cas(struct_processus *s_etat_p
|
Line 723 interface_cas(struct_processus *s_etat_p
|
|
|
#endif |
#endif |
} |
} |
|
#pragma GCC diagnostic pop |
|
|
// vim: ts=4 |
// vim: ts=4 |