--- rpl/src/rplexternals.h 2023/08/07 17:43:00 1.100 +++ rpl/src/rplexternals.h 2023/11/27 08:48:46 1.101 @@ -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,15 @@ } \ } } while(0) +#define vectorSize(rpl_object) \ + ({ if ((*rpl_object).type == VIN) \ + (*((integer8 *) (*rpl_object).objet)).taille; \ + else if ((*rpl_object).type == VRL) \ + (*((real8 *) (*rpl_object).objet)).taille; \ + else if ((*rpl_object).type == VCX)) \ + (*((complex16 *) (*rpl_object).objet)).taille; \ + else { executionError("Type mistmatch error"); 0; } }) + // Integer vector #define setIntegerIntoVector(rpl_object, value, position) do { \