Skip to content

Commit 4fc58c1

Browse files
committed
fix verbatim function defs in mod files
These will no longer compile on newer gcc versions (15+) where C23 is the default and a function declaration of this type: ``` func (); ``` now means: ``` func (void); ``` where it meant: ``` func (<any arguments>); ``` before. See: https://gcc.gnu.org/gcc-15/porting_to.html To test, one can tweak nrnmech_makefile to add `-std=c23` to the `CFLAGS` variable.
1 parent 6037077 commit 4fc58c1

File tree

8 files changed

+33
-34
lines changed

8 files changed

+33
-34
lines changed

examples/PTcell/mod/vecstim.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ NET_RECEIVE (w) {
4141
}
4242

4343
VERBATIM
44-
extern double* vector_vec();
45-
extern int vector_capacity();
46-
extern void* vector_arg();
44+
extern double* vector_vec(void *);
45+
extern int vector_capacity(void *);
46+
extern void* vector_arg(int);
4747
ENDVERBATIM
4848

4949
PROCEDURE element() {

examples/batch_rxd_net/mod/vecstim.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ NET_RECEIVE (w) {
4141
}
4242

4343
VERBATIM
44-
extern double* vector_vec();
45-
extern int vector_capacity();
46-
extern void* vector_arg();
44+
extern double* vector_vec(void *);
45+
extern int vector_capacity(void *);
46+
extern void* vector_arg(int);
4747
ENDVERBATIM
4848

4949
PROCEDURE element() {

examples/rxd_net/mod/vecstim.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ NET_RECEIVE (w) {
4141
}
4242

4343
VERBATIM
44-
extern double* vector_vec();
45-
extern int vector_capacity();
46-
extern void* vector_arg();
44+
extern double* vector_vec(void *);
45+
extern int vector_capacity(void *);
46+
extern void* vector_arg(int);
4747
ENDVERBATIM
4848

4949
PROCEDURE element() {

netpyne/batchtools/examples/wscale/mod/ProbAMPANMDA_EMS.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ ENDVERBATIM
317317
: independent of nhost or which host this instance is on
318318
: is desired, since each instance on this cpu draws from
319319
: the same stream
320-
value = scop_random(1)
320+
value = scop_random()
321321
VERBATIM
322322
}
323323
ENDVERBATIM

netpyne/batchtools/examples/wscale/mod/ProbGABAAB_EMS.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ ENDVERBATIM
316316
: independent of nhost or which host this instance is on
317317
: is desired, since each instance on this cpu draws from
318318
: the same stream
319-
urand = scop_random(1)
319+
urand = scop_random()
320320
VERBATIM
321321
}
322322
ENDVERBATIM

netpyne/batchtools/examples/wscale/mod/vecstim.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ NET_RECEIVE (w) {
4141
}
4242

4343
VERBATIM
44-
extern double* vector_vec();
45-
extern int vector_capacity();
46-
extern void* vector_arg();
44+
extern double* vector_vec(void *);
45+
extern int vector_capacity(void *);
46+
extern void* vector_arg(int);
4747
ENDVERBATIM
4848

4949
PROCEDURE element() {

netpyne/support/nte.mod

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -101,38 +101,37 @@ extern unsigned int iscrsz;
101101
extern int *iscr;
102102
extern int *iscrset(int);
103103
extern double BVBASE;
104-
extern double* hoc_pgetarg();
104+
extern double* hoc_pgetarg(int);
105105
extern void hoc_notify_iv();
106106
extern double hoc_call_func(Symbol*, int narg);
107107
extern FILE* hoc_obj_file_arg(int narg);
108-
extern Object** hoc_objgetarg();
109-
char *gargstr();
110-
char** hoc_pgargstr();
111-
extern void vector_resize();
112-
extern int vector_instance_px();
113-
extern void* vector_arg();
114-
extern double* vector_vec();
108+
extern Object** hoc_objgetarg(int);
109+
char *gargstr(int);
110+
char** hoc_pgargstr(int);
111+
extern void vector_resize(void *, int);
112+
extern int vector_instance_px(void *, double **);
113+
extern void* vector_arg(int);
114+
extern double* vector_vec(void *);
115115
extern int vector_buffer_size(void*);
116116
extern double hoc_epsilon;
117117
extern int stoprun;
118-
extern void set_seed();
118+
extern void set_seed(double);
119119
extern void dshuffle(double* x,int nx);
120-
extern void mcell_ran4_init(u_int32_t);
121-
extern double mcell_ran4(u_int32_t *idx1, double *x, unsigned int n, double range);
122-
extern int nrn_mlh_gsort();
120+
extern void mcell_ran4_init(uint32_t);
121+
extern double mcell_ran4(uint32_t *idx1, double *x, unsigned int n, double range);
123122
extern int ivoc_list_count(Object*);
124123
extern Object* ivoc_list_item(Object*, int);
125124
extern int list_vector_px2();
126125
extern int hoc_is_double_arg(int narg);
127126
extern int hoc_is_str_arg(int narg);
128127
extern int hoc_is_object_arg(int narg);
129128
extern int hoc_is_pdouble_arg(int narg);
130-
extern Symbol *hoc_get_symbol(char *);
129+
extern Symbol *hoc_get_symbol(const char *);
131130
extern Symbol *hoc_lookup(const char*);
132131
extern Point_process* ob2pntproc(Object*);
133132

134133
extern char* hoc_object_name(Object*);
135-
extern int cmpdfn();
134+
extern int cmpdfn(double, double);
136135
extern int openvec(int, double **);
137136
int list_vector_px();
138137
double *list_vector_resize();
@@ -188,8 +187,8 @@ int *iscrset (int nx) {
188187

189188

190189
// from stats.mod
191-
static u_int32_t ilow=0;
192-
static u_int32_t ihigh=0;
190+
static uint32_t ilow=0;
191+
static uint32_t ihigh=0;
193192

194193
//shuffle array of unsigned ints
195194
void ishuffle(int* x,int nx) {
@@ -207,7 +206,7 @@ void ishuffle(int* x,int nx) {
207206
// end of stats.mod
208207

209208
static const double* ITsortdata = NULL; /* used in the quicksort algorithm */
210-
static double tetrospks2(double*, double*, double*, int, int, int), pdfpr(), tetrospks3(double*, double*, double*, double*, int ,int, int);
209+
static double tetrospks2(double*, double*, double*, int, int, int), pdfpr(double*, int, int, char*), tetrospks3(double*, double*, double*, double*, int ,int, int);
211210
static int dbxi[10];
212211

213212

netpyne/tutorials/mod/vecstim.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ NET_RECEIVE (w) {
4141
}
4242

4343
VERBATIM
44-
extern double* vector_vec();
45-
extern int vector_capacity();
46-
extern void* vector_arg();
44+
extern double* vector_vec(void *);
45+
extern int vector_capacity(void *);
46+
extern void* vector_arg(int);
4747
ENDVERBATIM
4848

4949
PROCEDURE element() {

0 commit comments

Comments
 (0)