--- rpl/src/compilation.c 2010/03/07 18:33:02 1.5 +++ rpl/src/compilation.c 2010/08/13 21:01:10 1.18 @@ -1,6 +1,6 @@ /* ================================================================================ - RPL/2 (R) version 4.0.12 + RPL/2 (R) version 4.0.18 Copyright (C) 1989-2010 Dr. BERTRAND Joël This file is part of RPL/2. @@ -20,7 +20,7 @@ */ -#include "rpl.conv.h" +#include "rpl-conv.h" /* @@ -830,19 +830,19 @@ swap(void *variable_1, void *variable_2, register unsigned char *t_var_2; register unsigned char variable_temporaire; - register signed long i; + register unsigned long i; t_var_1 = (unsigned char *) variable_1; t_var_2 = (unsigned char *) variable_2; - i = taille; - - for(i--; i >= 0; i--) + for(i = 0; i < taille; i++) { - variable_temporaire = t_var_1[i]; - t_var_1[i] = t_var_2[i]; - t_var_2[i] = variable_temporaire; + variable_temporaire = (*t_var_1); + (*(t_var_1++)) = (*t_var_2); + (*(t_var_2++)) = variable_temporaire; } + + return; } @@ -1686,6 +1686,35 @@ conversion_majuscule(unsigned char *chai return(chaine_convertie); } +void +conversion_majuscule_limitee(unsigned char *chaine_entree, + unsigned char *chaine_sortie, unsigned long longueur) +{ + unsigned long i; + + for(i = 0; i < longueur; i++) + { + if (isalpha((*chaine_entree))) + { + (*chaine_sortie) = (unsigned char) toupper((*chaine_entree)); + } + else + { + (*chaine_sortie) = (*chaine_entree); + } + + if ((*chaine_entree) == d_code_fin_chaine) + { + break; + } + + chaine_entree++; + chaine_sortie++; + } + + return; +} + /* ================================================================================