Skip to content
Snippets Groups Projects
Commit 943b0e1f authored by Pedro Gonnet's avatar Pedro Gonnet
Browse files

make all particle counters size_t instead of int. this will break a lot of...

make all particle counters size_t instead of int. this will break a lot of stuff, the following commits will be file-by-file fixes.
parent df4c568f
No related branches found
No related tags found
2 merge requests!136Master,!114size_t
...@@ -85,8 +85,8 @@ struct space { ...@@ -85,8 +85,8 @@ struct space {
struct gpart *gparts; struct gpart *gparts;
/* The total number of parts in the space. */ /* The total number of parts in the space. */
int nr_parts, size_parts; size_t nr_parts, size_parts;
int nr_gparts, size_gparts; size_t nr_gparts, size_gparts;
/* Is the space periodic? */ /* Is the space periodic? */
int periodic; int periodic;
...@@ -102,12 +102,13 @@ struct space { ...@@ -102,12 +102,13 @@ struct space {
/* Buffers for parts that we will receive from foreign cells. */ /* Buffers for parts that we will receive from foreign cells. */
struct part *parts_foreign; struct part *parts_foreign;
int nr_parts_foreign, size_parts_foreign; size_t nr_parts_foreign, size_parts_foreign;
}; };
/* Interval stack necessary for parallel particle sorting. */ /* Interval stack necessary for parallel particle sorting. */
struct qstack { struct qstack {
volatile int i, j, min, max; volatile size_t i, j;
volatile int min, max;
volatile int ready; volatile int ready;
}; };
struct parallel_sort { struct parallel_sort {
...@@ -121,13 +122,13 @@ struct parallel_sort { ...@@ -121,13 +122,13 @@ struct parallel_sort {
extern struct parallel_sort space_sort_struct; extern struct parallel_sort space_sort_struct;
/* function prototypes. */ /* function prototypes. */
void space_parts_sort(struct space *s, int *ind, int N, int min, int max, void space_parts_sort(struct space *s, size_t *ind, size_t N, int min, int max,
int verbose); int verbose);
void space_gparts_sort(struct gpart *gparts, int *ind, int N, int min, int max); void space_gparts_sort(struct gpart *gparts, size_t *ind, size_t N, int min, int max);
struct cell *space_getcell(struct space *s); struct cell *space_getcell(struct space *s);
int space_getsid(struct space *s, struct cell **ci, struct cell **cj, int space_getsid(struct space *s, struct cell **ci, struct cell **cj,
double *shift); double *shift);
void space_init(struct space *s, double dim[3], struct part *parts, int N, void space_init(struct space *s, double dim[3], struct part *parts, size_t N,
int periodic, double h_max, int verbose); int periodic, double h_max, int verbose);
void space_map_cells_pre(struct space *s, int full, void space_map_cells_pre(struct space *s, int full,
void (*fun)(struct cell *c, void *data), void *data); void (*fun)(struct cell *c, void *data), void *data);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment