Remove array_ prefix from ARRAY_DEF

See commit on shared pointers.
This commit is contained in:
Patrick Pelissier committed 2017-07-27 22:16:15 +02:00
1 parent 4cb92a92b8
commit 34943e5b2a
14 files changed
+226 -224

No files matched your search

+2 -2
View File
@@ -1,7 +1,7 @@
#include "m-array.h"
// Let's define an array of 'char *' named 'charp'
ARRAY_DEF (charp, char *)
ARRAY_DEF (array_charp, char *)
int main(void)
{
@@ -20,7 +20,7 @@ int main(void)
// Use iterator to display contents of al
printf("Original contents of al: ");
array_it_charp_t itr;
array_charp_it_t itr;
for (array_charp_it(itr, al) ; !array_charp_end_p (itr); array_charp_next(itr)) {
char *element = *array_charp_ref(itr);
printf ("%s ", element);
+3 -3
View File
@@ -1,12 +1,12 @@
#include "m-array.h"
// Let's define an array of 'char *' named 'charp'
ARRAY_DEF (charp, char *)
ARRAY_DEF (array_charp, char *)
int main(void)
{
// Create an array list 'al'
M_LET (al, ARRAY_OPLIST(charp)) {
M_LET (al, ARRAY_OPLIST(array_charp)) {
// add elements to the array list
array_charp_push_back (al,"C");
array_charp_push_back (al,"A");
@@ -18,7 +18,7 @@ int main(void)
// Display contents of al
printf("Original contents of al: ");
// For each element of the array al
for M_EACH(element, al, ARRAY_OPLIST(charp)) {
for M_EACH(element, al, ARRAY_OPLIST(array_charp)) {
printf ("%s ", *element);
}
printf("\n");
+1 -1
View File
@@ -2,7 +2,7 @@
#include "m-array.h"
// Let's define an array of 'int' named 'int'
ARRAY_DEF(int, int)
ARRAY_DEF(array_int, int)
const int n = 100000;
+2 -2
View File
@@ -3,8 +3,8 @@
#include "m-array.h"
#include "m-algo.h"
ARRAY_DEF(mpz, mpz_t, M_CLASSIC_OPLIST(mpz))
ALGO_DEF(array_mpz, ARRAY_OPLIST(mpz, M_CLASSIC_OPLIST(mpz)))
ARRAY_DEF(array_mpz, mpz_t, M_CLASSIC_OPLIST(mpz))
ALGO_DEF(array_mpz, ARRAY_OPLIST(array_mpz, M_CLASSIC_OPLIST(mpz)))
static inline void my_mpz_inc(mpz_t *d, const mpz_t a){
mpz_add(*d, *d, a);
+1 -1
View File
@@ -4,7 +4,7 @@
#include "m-array.h"
#include "m-string.h"
ARRAY_DEF(int, int)
ARRAY_DEF(array_int, int)
typedef struct {
int pos;
+2 -2
View File
@@ -23,9 +23,9 @@ DICT_DEF2(my,
#define MY_DICT_OPLIST DICT_OPLIST(my, STRING_OPLIST, INTEGER_OPLIST)
/* Define an array of such dictionary named array_my_t */
ARRAY_DEF(my, dict_my_t, MY_DICT_OPLIST)
ARRAY_DEF(array_my, dict_my_t, MY_DICT_OPLIST)
/* Define the oplist associated to this array of dictionary of variant */
#define MY_ARRAY_OPLIST ARRAY_OPLIST(my, MY_DICT_OPLIST)
#define MY_ARRAY_OPLIST ARRAY_OPLIST(array_my, MY_DICT_OPLIST)
int main(void)
{
+2 -2
View File
@@ -78,12 +78,12 @@ extern bool json_in_str(json_t *, FILE *);
DICT_DEF2(json, string_t, STRING_OPLIST, json_t, JSON_OPLIST)
ARRAY_DEF(json, json_t, JSON_OPLIST)
ARRAY_DEF(array_json, json_t, JSON_OPLIST)
VARIANT_DEF2(variant_json,
(boolean, bool, M_OPEXTEND(M_DEFAULT_OPLIST, OUT_STR(boolean_out_str), IN_STR(boolean_in_str M_IPTR)) ),
(real, float, M_OPEXTEND (M_DEFAULT_OPLIST, OUT_STR(real_out_str), IN_STR(real_in_str M_IPTR))),
(array, array_json_t, ARRAY_OPLIST(json, JSON_OPLIST)),
(array, array_json_t, ARRAY_OPLIST(array_json, JSON_OPLIST)),
(dict, dict_json_t, DICT_OPLIST(json, STRING_OPLIST, JSON_OPLIST)))
struct json_node_s {