--- rpl/src/rplexternals.h 2020/01/10 11:15:51 1.97 +++ rpl/src/rplexternals.h 2024/01/09 07:33:56 1.103 @@ -1,7 +1,7 @@ /* ================================================================================ - RPL/2 (R) version 4.1.32 - Copyright (C) 1989-2020 Dr. BERTRAND Joël + RPL/2 (R) version 4.1.35 + Copyright (C) 1989-2024 Dr. BERTRAND Joël This file is part of RPL/2. @@ -592,22 +592,28 @@ else \ { \ __type = 0; \ - if (strstr(#__VA_ARGS__, "integer") != NULL) \ - if ((*rpl_object).type == INT) __type = 1; \ - if (strstr(#__VA_ARGS__, "real") != NULL) \ - if ((*rpl_object).type == REL) __type = 1; \ - if (strstr(#__VA_ARGS__, "complex") != NULL) \ - if ((*rpl_object).type == CPL) __type = 1; \ - if (strstr(#__VA_ARGS__, "string") != NULL) \ - if ((*rpl_object).type == CHN) __type = 1; \ - if (strstr(#__VA_ARGS__, "list") != NULL) \ - if ((*rpl_object).type == LST) __type = 1; \ - if (strstr(#__VA_ARGS__, "external") != NULL) \ + if (strstr(#__VA_ARGS__, "integerVector") != NULL) { \ + if ((*rpl_object).type == VIN) __type = 1; } \ + else if (strstr(#__VA_ARGS__, "realVector") != NULL) { \ + if ((*rpl_object).type == VRL) __type = 1; } \ + else if (strstr(#__VA_ARGS__, "complexVector") != NULL) { \ + if ((*rpl_object).type == VCX) __type = 1; } \ + else if (strstr(#__VA_ARGS__, "integer") != NULL) { \ + if ((*rpl_object).type == INT) __type = 1; } \ + else if (strstr(#__VA_ARGS__, "real") != NULL) { \ + if ((*rpl_object).type == REL) __type = 1; } \ + else if (strstr(#__VA_ARGS__, "complex") != NULL) { \ + if ((*rpl_object).type == CPL) __type = 1; } \ + else if (strstr(#__VA_ARGS__, "string") != NULL) { \ + if ((*rpl_object).type == CHN) __type = 1; } \ + else if (strstr(#__VA_ARGS__, "list") != NULL) { \ + if ((*rpl_object).type == LST) __type = 1; } \ + else if (strstr(#__VA_ARGS__, "external") != NULL) { \ if ((*rpl_object).type == EXT) { \ if ((*rpl_object).descripteur_bibliotheque == \ - __static_library_descriptor) __type = 1; }\ - if (strstr(#__VA_ARGS__, "unknown") != NULL) \ - __type = 1; \ + __static_library_descriptor) __type = 1; } }\ + else if (strstr(#__VA_ARGS__, "unknown") != NULL) { \ + __type = 1; } \ if (__type == 0) \ { \ executionError("Type not allowed"); \ @@ -878,6 +884,13 @@ } \ } } while(0) +#define vectorSize(rpl_object) \ + ({ integer8 __size; if (((*rpl_object).type == VIN) || \ + ((*rpl_object).type == VRL) || \ + ((*rpl_object).type == VCX)) \ + __size = (*((struct_vecteur *) (*rpl_object).objet)).taille; \ + else executionError("Type mistmatch error"); __size; }) + // Integer vector #define setIntegerIntoVector(rpl_object, value, position) do { \