Skip to content

Commit b6b2e31

Browse files
committed
Merge branch 'master' of https://github.com/ahay/src
2 parents 1b5dc7a + 4083d52 commit b6b2e31

File tree

16 files changed

+983
-47
lines changed

16 files changed

+983
-47
lines changed

system/generic/predicates.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ REAL *e;
495495
/* */
496496
/*****************************************************************************/
497497

498-
double doublerand()
498+
double doublerand(void)
499499
{
500500
double result;
501501
double expo;
@@ -521,7 +521,7 @@ double doublerand()
521521
/* */
522522
/*****************************************************************************/
523523

524-
double narrowdoublerand()
524+
double narrowdoublerand(void)
525525
{
526526
double result;
527527
double expo;
@@ -546,7 +546,7 @@ double narrowdoublerand()
546546
/* */
547547
/*****************************************************************************/
548548

549-
double uniformdoublerand()
549+
double uniformdoublerand(void)
550550
{
551551
double result;
552552
long a, b;
@@ -564,7 +564,7 @@ double uniformdoublerand()
564564
/* */
565565
/*****************************************************************************/
566566

567-
float floatrand()
567+
float floatrand(void)
568568
{
569569
float result;
570570
float expo;
@@ -589,7 +589,7 @@ float floatrand()
589589
/* */
590590
/*****************************************************************************/
591591

592-
float narrowfloatrand()
592+
float narrowfloatrand(void)
593593
{
594594
float result;
595595
float expo;
@@ -613,7 +613,7 @@ float narrowfloatrand()
613613
/* */
614614
/*****************************************************************************/
615615

616-
float uniformfloatrand()
616+
float uniformfloatrand(void)
617617
{
618618
float result;
619619
long a;
@@ -643,7 +643,7 @@ float uniformfloatrand()
643643
/*****************************************************************************/
644644

645645

646-
void exactinit()
646+
void exactinit(void)
647647
{
648648
REAL half;
649649
REAL check, lastcheck;

system/seismic/ctoeplitz.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ void ctoeplitz_solve (const sf_complex *r /* top row of the matrix */,
106106
}
107107
}
108108

109-
void ctoeplitz_close()
109+
void ctoeplitz_close(void)
110110
/*< free allocated storage >*/
111111
{
112112
free (a);

system/seismic/fft2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ void sft2_init(float o1, float d1,
155155
}
156156

157157
/*------------------------------------------------------------*/
158-
void sft2_close()
158+
void sft2_close(void)
159159
/*< close shift >*/
160160
{
161161
free(shf1);

system/seismic/img2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@ void img2x_close(sf_fslice imag,
691691
}
692692

693693
/*------------------------------------------------------------*/
694-
void img2_close()
694+
void img2_close(void)
695695
/*< deallocate >*/
696696
{
697697
free(**qs); free(*qs); free(qs);

system/seismic/radon.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ void radon_init (int nx_in /* number of offsets */,
3737
czero = sf_cmplx(0.,0.);
3838
}
3939

40-
void radon_close ()
40+
void radon_close (void)
4141
/*< free allocated storage >*/
4242
{
4343
free (c0);

system/seismic/rweone.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ void rweone_thr(
559559
}
560560
}
561561

562-
void rweone_tap_init()
562+
void rweone_tap_init(void)
563563
/*< initialize taper >*/
564564
{
565565
int itap,jtap;
@@ -632,7 +632,7 @@ void rweone_fft(
632632
}
633633

634634

635-
void rweone_mrs_init()
635+
void rweone_mrs_init(void)
636636
/*< init MRS >*/
637637
{
638638
int ig;

trip/iwave/grid/main/standardmodel.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ int main(int argc, char **argv) {
601601
/* DS */
602602
if (model == 10){
603603
for(i = 0; i< 4 ; i++){
604-
sprintf(numlname,"m%d_numl",i+1);
604+
snprintf(numlname,10,"m%d_numl",i+1);
605605
/* set up layer numbers for velocity, density, bulkmod and buoyancy */
606606
if (ps_ffint(*par,numlname,numl+i)) numl[i] = 1;
607607

@@ -614,7 +614,7 @@ int main(int argc, char **argv) {
614614

615615
for (j =0; j< numl[i]; j++){
616616
if (j < numl[i]-1){
617-
sprintf(x1rsname,"m%d_rf%d",i+1,j+1);
617+
snprintf(x1rsname,10,"m%d_rf%d",i+1,j+1);
618618
if(ps_fffloat(*par,x1rsname,x1rs[i]+j))
619619
{ x1rs[i][j] = e1;
620620
fprintf(stdout, "WARNING: x1rs[%d][%d] is set to the default value %f!\n",i,j,e1);
@@ -623,7 +623,7 @@ int main(int argc, char **argv) {
623623
fprintf(stdout,"%s=%e\n",x1rsname,*(x1rs[i]+j));
624624

625625
}
626-
sprintf(valname,"m%d_val%d",i+1,j+1);
626+
snprintf(valname,10,"m%d_val%d",i+1,j+1);
627627
if(ps_fffloat(*par,valname,values[i]+j))
628628
{ values[i][j] = Vdefault[i];
629629
fprintf(stdout, "WARNING: values[%d][%d] is set to the default value %f!\n",i,j,Vdefault[i]);

trip/iwave/grid/main/standardmodel_elastic.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@ int main(int argc, char **argv) {
629629
/* DS */
630630
if (model == 10){
631631
for(i = 0; i< 4 ; i++){
632-
sprintf(numlname,"m%d_numl",i+1);
632+
snprintf(numlname,10,"m%d_numl",i+1);
633633
/* set up layer numbers for velocity, density, bulkmod and buoyancy */
634634
if (ps_ffint(*par,numlname,numl+i)) numl[i] = 1;
635635

@@ -642,7 +642,7 @@ int main(int argc, char **argv) {
642642

643643
for (j =0; j< numl[i]; j++){
644644
if (j < numl[i]-1){
645-
sprintf(x1rsname,"m%d_rf%d",i+1,j+1);
645+
snprintf(x1rsname,10,"m%d_rf%d",i+1,j+1);
646646
if(ps_fffloat(*par,x1rsname,x1rs[i]+j))
647647
{ x1rs[i][j] = e1;
648648
fprintf(stderr, "WARNING: x1rs[%d][%d] is set to the default value %f!\n",i,j,e1);
@@ -651,7 +651,7 @@ int main(int argc, char **argv) {
651651
fprintf(stderr,"%s=%e\n",x1rsname,*(x1rs[i]+j));
652652

653653
}
654-
sprintf(valname,"m%d_val%d",i+1,j+1);
654+
snprintf(valname,10,"m%d_val%d",i+1,j+1);
655655
if(ps_fffloat(*par,valname,values[i]+j))
656656
{ values[i][j] = Vdefault[i];
657657
fprintf(stderr, "WARNING: values[%d][%d] is set to the default value %f!\n",i,j,Vdefault[i]);

user/chen/wavmod.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ void wavmod_shot(sf_file dat, sf_file wfl, int ns, int *ps, float **ws)
124124
sf_floatwrite(data[0], ntj*ng, dat);
125125
}
126126

127-
void wavmod_close()
127+
void wavmod_close(void)
128128
/*< release memory >*/
129129
{
130130
free(data[0]);

user/chengjb/Mtti2devectorlrsvd_double.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -664,12 +664,12 @@ int main(int argc, char* argv[])
664664
memset(datapznumber,0,10);
665665
memset(datasznumber,0,10);
666666

667-
sprintf(dataznumber,"dataz%d",it/1);
668-
sprintf(dataxnumber,"datax%d",it/1);
669-
sprintf(datapxnumber,"datapx%d",it/1);
670-
sprintf(datasxnumber,"datasx%d",it/1);
671-
sprintf(datapznumber,"datapz%d",it/1);
672-
sprintf(datasznumber,"datasz%d",it/1);
667+
snprintf(dataznumber,10,"dataz%d",it/1);
668+
snprintf(dataxnumber,10,"datax%d",it/1);
669+
snprintf(datapxnumber,10,"datapx%d",it/1);
670+
snprintf(datasxnumber,10,"datasx%d",it/1);
671+
snprintf(datapznumber,10,"datapz%d",it/1);
672+
snprintf(datasznumber,10,"datasz%d",it/1);
673673

674674
fp1 = fopen(dataxnumber,"wb");
675675
fp2 = fopen(dataznumber,"wb");

0 commit comments

Comments
 (0)