summarylogtreecommitdiffstats
path: root/gcc10.patch
blob: 78d64de7d951c0683d80b875e2e0d3ba83d344b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
diff -ur sextractor-2.25.0.orig/man/Makefile.am sextractor-2.25.0/man/Makefile.am
--- sextractor-2.25.0.orig/man/Makefile.am	2018-02-08 11:13:59.000000000 +0100
+++ sextractor-2.25.0/man/Makefile.am	2020-11-04 18:17:56.611830537 +0100
@@ -26,5 +26,5 @@
 #
 #%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-dist_man_MANS = sex.1 sex.x
+dist_man_MANS = sex.1
 
Only in sextractor-2.25.0.orig/man: sex.x
diff -ur sextractor-2.25.0.orig/src/assoc.h sextractor-2.25.0/src/assoc.h
--- sextractor-2.25.0.orig/src/assoc.h	2018-02-08 11:13:59.000000000 +0100
+++ sextractor-2.25.0/src/assoc.h	2020-11-05 15:41:37.404981610 +0100
@@ -1,3 +1,4 @@
+#pragma once
 /*
 *				assoc.h
 *
diff -ur sextractor-2.25.0.orig/src/astrom.h sextractor-2.25.0/src/astrom.h
--- sextractor-2.25.0.orig/src/astrom.h	2018-02-08 11:13:59.000000000 +0100
+++ sextractor-2.25.0/src/astrom.h	2020-11-05 15:41:41.613027361 +0100
@@ -1,3 +1,4 @@
+#pragma once
 /*
 *				astrom.h
 *
diff -ur sextractor-2.25.0.orig/src/back.h sextractor-2.25.0/src/back.h
--- sextractor-2.25.0.orig/src/back.h	2018-02-08 11:13:59.000000000 +0100
+++ sextractor-2.25.0/src/back.h	2020-11-05 15:41:44.425057934 +0100
@@ -1,3 +1,4 @@
+#pragma once
 /*
 *				back.h
 *
diff -ur sextractor-2.25.0.orig/src/bpro.h sextractor-2.25.0/src/bpro.h
--- sextractor-2.25.0.orig/src/bpro.h	2018-02-08 11:13:59.000000000 +0100
+++ sextractor-2.25.0/src/bpro.h	2020-11-05 15:41:46.649082177 +0100
@@ -1,3 +1,4 @@
+#pragma once
 /*
 *				bpro.h
 *
diff -ur sextractor-2.25.0.orig/src/catout.c sextractor-2.25.0/src/catout.c
--- sextractor-2.25.0.orig/src/catout.c	2018-02-08 11:13:59.000000000 +0100
+++ sextractor-2.25.0/src/catout.c	2020-11-04 15:53:21.431460487 +0100
@@ -1000,7 +1000,7 @@
       break;
 
     case ASCII_SKYCAT:
-      fprintf(ascfile, skycattail);
+      fprintf(ascfile, "%s", skycattail);
       if (!prefs.pipe_flag)
         fclose(ascfile);
       break;
diff -ur sextractor-2.25.0.orig/src/check.h sextractor-2.25.0/src/check.h
--- sextractor-2.25.0.orig/src/check.h	2018-02-08 11:13:59.000000000 +0100
+++ sextractor-2.25.0/src/check.h	2020-11-05 15:41:48.881106712 +0100
@@ -1,3 +1,4 @@
+#pragma once
 /*
 *				check.h
 *
diff -ur sextractor-2.25.0.orig/src/clean.c sextractor-2.25.0/src/clean.c
--- sextractor-2.25.0.orig/src/clean.c	2018-02-08 11:13:59.000000000 +0100
+++ sextractor-2.25.0/src/clean.c	2020-11-05 16:43:20.905049726 +0100
@@ -46,6 +46,7 @@
 
 static LONG		*cleanvictim;
 
+objliststruct   *cleanobjlist;
 
 /******************************* initclean **********************************
 PROTO   void initclean(void)
diff -ur sextractor-2.25.0.orig/src/clean.h sextractor-2.25.0/src/clean.h
--- sextractor-2.25.0.orig/src/clean.h	2018-02-08 11:13:59.000000000 +0100
+++ sextractor-2.25.0/src/clean.h	2020-11-05 16:45:16.238291234 +0100
@@ -1,3 +1,4 @@
+#pragma once
 /*
 *				clean.h
 *
@@ -33,7 +34,7 @@
 
 /*------------------------------- variables ---------------------------------*/
 
-objliststruct	*cleanobjlist;		/* laconic, isn't it? */
+extern objliststruct	*cleanobjlist;		/* laconic, isn't it? */
 
 /*------------------------------- functions ---------------------------------*/
 
diff -ur sextractor-2.25.0.orig/src/define.h sextractor-2.25.0/src/define.h
--- sextractor-2.25.0.orig/src/define.h	2018-02-08 11:13:59.000000000 +0100
+++ sextractor-2.25.0/src/define.h	2020-11-05 17:08:58.941704214 +0100
@@ -1,3 +1,4 @@
+#pragma once
 /*
 *				define.h
 *
@@ -167,7 +168,7 @@
 #define	QCALLOC(ptr, typ, nel) \
 		{if (!(ptr = (typ *)calloc((size_t)(nel),sizeof(typ)))) \
 		   { \
-		   sprintf(gstr, #ptr " (" #nel "=%lld elements) " \
+		   sprintf(gstr, #ptr " (" #nel "=%ld elements) " \
 			"at line %d in module " __FILE__ " !", \
 			(size_t)(nel)*sizeof(typ), __LINE__); \
 		   error(EXIT_FAILURE, "Could not allocate memory for ", gstr);\
@@ -177,7 +178,7 @@
 #define	QMALLOC(ptr, typ, nel) \
 		{if (!(ptr = (typ *)malloc((size_t)(nel)*sizeof(typ)))) \
 		   { \
-		   sprintf(gstr, #ptr " (" #nel "=%lld elements) " \
+		   sprintf(gstr, #ptr " (" #nel "=%ld elements) " \
 			"at line %d in module " __FILE__ " !", \
 			(size_t)(nel)*sizeof(typ), __LINE__); \
 		   error(EXIT_FAILURE, "Could not allocate memory for ", gstr);\
@@ -187,7 +188,7 @@
 #define	QMALLOC16(ptr, typ, nel) \
 		{if (posix_memalign((void **)&ptr, 16, (size_t)(nel)*sizeof(typ))) \
 		   { \
-		   sprintf(gstr, #ptr " (" #nel "=%lld elements) " \
+		   sprintf(gstr, #ptr " (" #nel "=%ld elements) " \
 			"at line %d in module " __FILE__ " !", \
 			(size_t)(nel)*sizeof(typ), __LINE__); \
 		   error(EXIT_FAILURE, "Could not allocate memory for ", gstr);\
@@ -197,7 +198,7 @@
 #define	QREALLOC(ptr, typ, nel) \
 		{if (!(ptr = (typ *)realloc(ptr, (size_t)(nel)*sizeof(typ))))\
 		   { \
-		   sprintf(gstr, #ptr " (" #nel "=%lld elements) " \
+		   sprintf(gstr, #ptr " (" #nel "=%ld elements) " \
 			"at line %d in module " __FILE__ " !", \
 			(size_t)(nel)*sizeof(typ), __LINE__); \
 		   error(EXIT_FAILURE, "Could not allocate memory for ", gstr);\
@@ -208,7 +209,7 @@
 		{if (ptrin) \
                   {if (!(ptrout = (typ *)malloc((size_t)(nel)*sizeof(typ)))) \
 		     { \
-		     sprintf(gstr, #ptrout " (" #nel "=%lld elements) " \
+		     sprintf(gstr, #ptrout " (" #nel "=%ld elements) " \
 			"at line %d in module " __FILE__ " !", \
 			(size_t)(nel)*sizeof(typ), __LINE__); \
 		     error(EXIT_FAILURE,"Could not allocate memory for ",gstr);\
diff -ur sextractor-2.25.0.orig/src/extract.h sextractor-2.25.0/src/extract.h
--- sextractor-2.25.0.orig/src/extract.h	2018-02-08 11:13:59.000000000 +0100
+++ sextractor-2.25.0/src/extract.h	2020-11-05 16:40:14.567040126 +0100
@@ -1,3 +1,4 @@
+#pragma once
 /*
 *				extract.h
 *
@@ -36,9 +37,6 @@
 typedef	enum		{COMPLETE, INCOMPLETE, NONOBJECT, OBJECT}
 				status;	/* Extraction status */
 
-/*--------------------------------- variables -------------------------------*/
-PIXTYPE		*dumscan;
-
 /*------------------------------- structures --------------------------------*/
 /* Temporary object parameters during extraction */
 typedef struct structinfo
diff -ur sextractor-2.25.0.orig/src/fft.h sextractor-2.25.0/src/fft.h
--- sextractor-2.25.0.orig/src/fft.h	2018-02-08 11:13:59.000000000 +0100
+++ sextractor-2.25.0/src/fft.h	2020-11-05 17:09:19.593929943 +0100
@@ -1,3 +1,4 @@
+#pragma once
 /*
 *				fft.h
 *
@@ -40,7 +41,7 @@
 #define	QFFTWF_MALLOC(ptr, typ, nel) \
 		{if (!(ptr = (typ *)fftwf_malloc((size_t)(nel)*sizeof(typ)))) \
 		   { \
-		   sprintf(gstr, #ptr " (" #nel "=%lld elements) " \
+		   sprintf(gstr, #ptr " (" #nel "=%ld elements) " \
 			"at line %d in module " __FILE__ " !", \
 			(size_t)(nel)*sizeof(typ), __LINE__); \
 		   error(EXIT_FAILURE, "Could not allocate memory for ", gstr);\
diff -ur sextractor-2.25.0.orig/src/field.h sextractor-2.25.0/src/field.h
--- sextractor-2.25.0.orig/src/field.h	2018-02-08 11:13:59.000000000 +0100
+++ sextractor-2.25.0/src/field.h	2020-11-05 15:42:21.837468945 +0100
@@ -1,3 +1,4 @@
+#pragma once
 /*
 *				field.h
 *
diff -ur sextractor-2.25.0.orig/src/filter.h sextractor-2.25.0/src/filter.h
--- sextractor-2.25.0.orig/src/filter.h	2018-02-08 11:13:59.000000000 +0100
+++ sextractor-2.25.0/src/filter.h	2020-11-05 16:00:23.481451076 +0100
@@ -1,3 +1,4 @@
+#pragma once
 /*
 *				filter.h
 *
@@ -43,7 +44,7 @@
   struct structbpann	*bpann;
   }	filterstruct;
 
-filterstruct	*thefilter;
+extern filterstruct	*thefilter;
 
 /*------------------------------- functions ---------------------------------*/
 void		convolve(picstruct *, PIXTYPE *, int y),
diff -ur sextractor-2.25.0.orig/src/fits/fitscat.h sextractor-2.25.0/src/fits/fitscat.h
--- sextractor-2.25.0.orig/src/fits/fitscat.h	2018-02-08 11:13:59.000000000 +0100
+++ sextractor-2.25.0/src/fits/fitscat.h	2020-11-05 13:50:18.676162190 +0100
@@ -333,6 +333,4 @@
 		warning(char *msg1, char *msg2);
 
 
-int		bswapflag;
-
 #endif
diff -ur sextractor-2.25.0.orig/src/fits/fitscat_defs.h sextractor-2.25.0/src/fits/fitscat_defs.h
--- sextractor-2.25.0.orig/src/fits/fitscat_defs.h	2018-02-08 11:13:59.000000000 +0100
+++ sextractor-2.25.0/src/fits/fitscat_defs.h	2020-11-05 17:21:37.441962003 +0100
@@ -1,3 +1,4 @@
+#pragma once
 /*
 *				fitscat_defs.h
 *
@@ -85,9 +86,6 @@
 typedef	unsigned char	BYTE;			/* a byte */
 typedef	int		LONG;			/* for DEC-Alpha... */
 	
-/*----------------------------- Internal constants --------------------------*/
-char		gstr[MAXCHAR];
-
 /*----------------------------- External constants --------------------------*/
 
 extern int	bswapflag;		/* != 0 if bytes are swapped/IEEE */
@@ -125,8 +123,8 @@
 
 #define	QCALLOC(ptr, typ, nel) \
 		{if (!(ptr = (typ *)calloc((size_t)(nel),sizeof(typ)))) \
-		   { \
-		   sprintf(gstr, #ptr " (" #nel "=%lld elements) " \
+		   { char gstr[MAXCHAR] ;\
+		   sprintf(gstr, #ptr " (" #nel "=%ld elements) " \
 			"at line %d in module " __FILE__ " !", \
 			(size_t)(nel)*sizeof(typ), __LINE__); \
 		   error(EXIT_FAILURE, "Could not allocate memory for ", gstr);\
@@ -135,8 +133,8 @@
 
 #define	QMALLOC(ptr, typ, nel) \
 		{if (!(ptr = (typ *)malloc((size_t)(nel)*sizeof(typ)))) \
-		   { \
-		   sprintf(gstr, #ptr " (" #nel "=%lld elements) " \
+		   { char gstr[MAXCHAR] ;\
+		   sprintf(gstr, #ptr " (" #nel "=%ld elements) " \
 			"at line %d in module " __FILE__ " !", \
 			(size_t)(nel)*sizeof(typ), __LINE__); \
 		   error(EXIT_FAILURE, "Could not allocate memory for ", gstr);\
@@ -145,8 +143,8 @@
 
 #define	QREALLOC(ptr, typ, nel) \
 		{if (!(ptr = (typ *)realloc(ptr, (size_t)(nel)*sizeof(typ))))\
-		   { \
-		   sprintf(gstr, #ptr " (" #nel "=%lld elements) " \
+		   { char gstr[MAXCHAR] ;\
+		   sprintf(gstr, #ptr " (" #nel "=%ld elements) " \
 			"at line %d in module " __FILE__ " !", \
 			(size_t)(nel)*sizeof(typ), __LINE__); \
 		   error(EXIT_FAILURE, "Could not allocate memory for ", gstr);\
@@ -156,8 +154,8 @@
 #define QMEMCPY(ptrin, ptrout, typ, nel) \
 		{if (ptrin) \
                   {if (!(ptrout = (typ *)malloc((size_t)(nel)*sizeof(typ)))) \
-		     { \
-		     sprintf(gstr, #ptrout " (" #nel "=%lld elements) " \
+		     { char gstr[MAXCHAR] ;\
+		     sprintf(gstr, #ptrout " (" #nel "=%ld elements) " \
 			"at line %d in module " __FILE__ " !", \
 			(size_t)(nel)*sizeof(typ), __LINE__); \
 		     error(EXIT_FAILURE,"Could not allocate memory for ",gstr);\
diff -ur sextractor-2.25.0.orig/src/flag.h sextractor-2.25.0/src/flag.h
--- sextractor-2.25.0.orig/src/flag.h	2018-02-08 11:13:59.000000000 +0100
+++ sextractor-2.25.0/src/flag.h	2020-11-05 15:42:33.733599698 +0100
@@ -1,3 +1,4 @@
+#pragma once
 /*
 *				flag.h
 *
diff -ur sextractor-2.25.0.orig/src/globals.h sextractor-2.25.0/src/globals.h
--- sextractor-2.25.0.orig/src/globals.h	2018-02-08 11:13:59.000000000 +0100
+++ sextractor-2.25.0/src/globals.h	2020-11-05 15:23:40.821224641 +0100
@@ -1,3 +1,4 @@
+#pragma once
 /*
 *				globals.h
 *
@@ -30,13 +31,13 @@
 
 /*----------------------- miscellaneous variables ---------------------------*/
 
-sexcatstruct		thecat;
-picstruct		thefield1,thefield2, thewfield1,thewfield2;
-objstruct		flagobj;
-obj2struct		flagobj2;
+extern sexcatstruct		thecat;
+extern picstruct		thefield1,thefield2, thewfield1,thewfield2;
+extern objstruct		flagobj;
+extern obj2struct		flagobj2;
 extern obj2struct	outobj2;
-float			ctg[37], stg[37];
-char			gstr[MAXCHAR];
+extern float			ctg[37], stg[37];
+extern char			gstr[MAXCHAR];
 
 /*------------------------------- functions ---------------------------------*/
 extern void	alloccatparams(void),
diff -ur sextractor-2.25.0.orig/src/growth.h sextractor-2.25.0/src/growth.h
--- sextractor-2.25.0.orig/src/growth.h	2018-02-08 11:13:59.000000000 +0100
+++ sextractor-2.25.0/src/growth.h	2020-11-05 15:42:42.177692510 +0100
@@ -1,3 +1,4 @@
+#pragma once
 /*
 *				growth.h
 *
diff -ur sextractor-2.25.0.orig/src/header.c sextractor-2.25.0/src/header.c
--- sextractor-2.25.0.orig/src/header.c	2018-02-08 11:13:59.000000000 +0100
+++ sextractor-2.25.0/src/header.c	2020-11-04 18:39:04.072382059 +0100
@@ -63,7 +63,7 @@
     {
 /*- Skip previous ENDs in multi-FITS extension headers */
     for (i=frameno-1; i--;)
-      while (fgets(str, MAXCHAR, file)
+      while (fgets(str, sizeof(str), file)
 		&& strncmp(str,"END ",4)
 		&& strncmp(str,"END\n",4));
     memset(str, ' ', 80);
diff -ur sextractor-2.25.0.orig/src/header.h sextractor-2.25.0/src/header.h
--- sextractor-2.25.0.orig/src/header.h	2018-02-08 11:13:59.000000000 +0100
+++ sextractor-2.25.0/src/header.h	2020-11-05 15:42:47.217747908 +0100
@@ -1,3 +1,4 @@
+#pragma once
 /*
 *				header.h
 *
diff -ur sextractor-2.25.0.orig/src/image.h sextractor-2.25.0/src/image.h
--- sextractor-2.25.0.orig/src/image.h	2018-02-08 11:13:59.000000000 +0100
+++ sextractor-2.25.0/src/image.h	2020-11-05 15:42:50.277781541 +0100
@@ -1,3 +1,4 @@
+#pragma once
 /*
 *				image.h
 *
diff -ur sextractor-2.25.0.orig/src/interpolate.h sextractor-2.25.0/src/interpolate.h
--- sextractor-2.25.0.orig/src/interpolate.h	2018-02-08 11:13:59.000000000 +0100
+++ sextractor-2.25.0/src/interpolate.h	2020-11-05 15:42:52.945810866 +0100
@@ -1,3 +1,4 @@
+#pragma once
 /*
 *				interpolate.h
 *
diff -ur sextractor-2.25.0.orig/src/key.h sextractor-2.25.0/src/key.h
--- sextractor-2.25.0.orig/src/key.h	2018-02-08 11:13:59.000000000 +0100
+++ sextractor-2.25.0/src/key.h	2020-11-05 15:42:56.309847842 +0100
@@ -1,3 +1,4 @@
+#pragma once
 /*
 *				key.h
 *
diff -ur sextractor-2.25.0.orig/src/ldactoasc.c sextractor-2.25.0/src/ldactoasc.c
--- sextractor-2.25.0.orig/src/ldactoasc.c	2018-02-08 11:13:59.000000000 +0100
+++ sextractor-2.25.0/src/ldactoasc.c	2020-11-05 13:52:00.613278447 +0100
@@ -41,6 +41,8 @@
 #define		SYNTAX  "ldactoasc catalog\n"
 extern const char	notokstr[];
 
+int bswapflag ;
+
 /********************************** main ************************************/
 int	main(int argc, char *argv[])
 
diff -ur sextractor-2.25.0.orig/src/ldactoasc.h sextractor-2.25.0/src/ldactoasc.h
--- sextractor-2.25.0.orig/src/ldactoasc.h	2018-02-08 11:13:59.000000000 +0100
+++ sextractor-2.25.0/src/ldactoasc.h	2020-11-05 17:14:35.545374422 +0100
@@ -1,3 +1,4 @@
+#pragma once
 /*
 *				ldactoasc.h
 *
@@ -61,10 +62,6 @@
 
 /*------------ Set defines according to machine's specificities -------------*/
 
-#if 0
-#define	NO_ENVVAR
-#endif
-
 /*--------------------- in case of missing constants ------------------------*/
 
 #ifndef         SEEK_SET
diff -ur sextractor-2.25.0.orig/src/main.c sextractor-2.25.0/src/main.c
--- sextractor-2.25.0.orig/src/main.c	2018-02-08 11:13:59.000000000 +0100
+++ sextractor-2.25.0/src/main.c	2020-11-05 16:38:40.650026991 +0100
@@ -38,6 +38,9 @@
 #include	"define.h"
 #include	"globals.h"
 #include	"prefs.h"
+#include	"psf.h"
+#include	"filter.h"
+#include	"som.h"
 #include "pattern.h"
 #define		SYNTAX \
 EXECUTABLE " <image> [<image2>][-c <configuration_file>][-<keyword> <value>]\n" \
@@ -48,6 +51,28 @@
 extern const char       notokstr[];
 extern keystruct	objkey[];
 
+int bswapflag ;
+sexcatstruct  thecat;
+picstruct thefield1,thefield2, thewfield1,thewfield2;
+objstruct flagobj;
+obj2struct flagobj2;
+char gstr[MAXCHAR];
+float ctg[37], stg[37];
+prefstruct              prefs;
+int      plistexist_value, plistexist_dvalue, plistexist_cdvalue,
+        plistexist_flag, plistexist_wflag, plistexist_dthresh, plistexist_var,
+        plistexist_dgeo,
+        plistoff_value, plistoff_dvalue, plistoff_cdvalue,
+        plistoff_flag[MAXFLAG], plistoff_wflag, plistoff_dthresh, plistoff_var,
+        plistoff_dgeox, plistoff_dgeoy, plistsize;
+psfstruct        *psf,*thedpsf,*thepsf;
+psfitstruct      *thepsfit,*thedpsfit;
+PIXTYPE          *checkmask;
+filterstruct     *thefilter;
+somstruct        *thesom;
+int idummy ;
+
+
 /********************************** main ************************************/
 int	main(int argc, char *argv[])
 
@@ -58,6 +83,10 @@
 		**argkey, **argval,
 		*pstr;
 
+   unsigned short ashort =1 ;
+   bswapflag = *((char *)&ashort) ;
+
+
 setlinebuf(stdout);
  if (argc<2)
     {
diff -ur sextractor-2.25.0.orig/src/neurro.h sextractor-2.25.0/src/neurro.h
--- sextractor-2.25.0.orig/src/neurro.h	2018-02-08 11:13:59.000000000 +0100
+++ sextractor-2.25.0/src/neurro.h	2020-11-05 15:43:04.321935902 +0100
@@ -1,3 +1,4 @@
+#pragma once
 /*
 *				neurro.h
 *
diff -ur sextractor-2.25.0.orig/src/param.h sextractor-2.25.0/src/param.h
--- sextractor-2.25.0.orig/src/param.h	2018-02-08 11:13:59.000000000 +0100
+++ sextractor-2.25.0/src/param.h	2020-11-05 15:43:08.313979781 +0100
@@ -1,3 +1,4 @@
+#pragma once
 /*
 *				param.h
 *
diff -ur sextractor-2.25.0.orig/src/paramprofit.h sextractor-2.25.0/src/paramprofit.h
--- sextractor-2.25.0.orig/src/paramprofit.h	2018-02-08 11:13:59.000000000 +0100
+++ sextractor-2.25.0/src/paramprofit.h	2020-11-05 15:43:11.706017063 +0100
@@ -1,3 +1,4 @@
+#pragma once
 /*
 *				paramprofit.h
 *
diff -ur sextractor-2.25.0.orig/src/pattern.h sextractor-2.25.0/src/pattern.h
--- sextractor-2.25.0.orig/src/pattern.h	2018-02-08 11:13:59.000000000 +0100
+++ sextractor-2.25.0/src/pattern.h	2020-11-05 15:43:17.950085690 +0100
@@ -1,3 +1,4 @@
+#pragma once
 /*
 *				pattern.h
 *
diff -ur sextractor-2.25.0.orig/src/photom.h sextractor-2.25.0/src/photom.h
--- sextractor-2.25.0.orig/src/photom.h	2018-02-08 11:13:59.000000000 +0100
+++ sextractor-2.25.0/src/photom.h	2020-11-05 15:43:26.574180476 +0100
@@ -1,3 +1,4 @@
+#pragma once
 /*
 *				photom.h
 *
diff -ur sextractor-2.25.0.orig/src/plist.h sextractor-2.25.0/src/plist.h
--- sextractor-2.25.0.orig/src/plist.h	2018-02-08 11:13:59.000000000 +0100
+++ sextractor-2.25.0/src/plist.h	2020-11-05 16:00:12.365329066 +0100
@@ -1,3 +1,4 @@
+#pragma once
 /*
 *				plist.h
 *
@@ -47,7 +48,7 @@
 
 /*-------------------------------- globals ----------------------------------*/
 
-int	plistexist_value, plistexist_dvalue, plistexist_cdvalue,
+extern int	plistexist_value, plistexist_dvalue, plistexist_cdvalue,
 	plistexist_flag, plistexist_wflag, plistexist_dthresh, plistexist_var,
 	plistexist_dgeo,
 	plistoff_value, plistoff_dvalue, plistoff_cdvalue,
diff -ur sextractor-2.25.0.orig/src/preflist.h sextractor-2.25.0/src/preflist.h
--- sextractor-2.25.0.orig/src/preflist.h	2018-02-08 11:13:59.000000000 +0100
+++ sextractor-2.25.0/src/preflist.h	2020-11-05 16:37:01.620961488 +0100
@@ -1,3 +1,4 @@
+#pragma once
 /*
 *				preflist.h
 *
@@ -39,7 +40,7 @@
 #endif
 
 /*-------------------------------- initialization ---------------------------*/
- int	idummy;
+extern int	idummy;
 
  pkeystruct key[] =
  {
diff -ur sextractor-2.25.0.orig/src/prefs.c sextractor-2.25.0/src/prefs.c
--- sextractor-2.25.0.orig/src/prefs.c	2018-02-08 11:13:59.000000000 +0100
+++ sextractor-2.25.0/src/prefs.c	2020-11-05 14:20:00.967662245 +0100
@@ -396,6 +396,7 @@
   }
 
 
+extern int bswapflag ;
 /********************************* preprefs **********************************/
 /*
 Set number of threads and endianity.
diff -ur sextractor-2.25.0.orig/src/prefs.h sextractor-2.25.0/src/prefs.h
--- sextractor-2.25.0.orig/src/prefs.h	2018-02-08 11:13:59.000000000 +0100
+++ sextractor-2.25.0/src/prefs.h	2020-11-05 15:59:10.644651633 +0100
@@ -254,7 +254,7 @@
   int		nthreads;			/* Number of active threads */
   }	prefstruct;
 
-  prefstruct		prefs;
+extern  prefstruct		prefs;
 
 /*-------------------------------- protos -----------------------------------*/
 extern int	cistrcmp(char *cs, char *ct, int mode);
diff -ur sextractor-2.25.0.orig/src/profit.c sextractor-2.25.0/src/profit.c
--- sextractor-2.25.0.orig/src/profit.c	2018-02-08 11:13:59.000000000 +0100
+++ sextractor-2.25.0/src/profit.c	2020-11-05 17:18:08.503690732 +0100
@@ -1999,7 +1999,7 @@
 		*kernelt, *pixin,*pixin0, *mask,*maskt, *pixinout,
 		*dpixin,*dpixin0, *dpixout,*dpixout0, *dx,*dy,
 		*dgeoxpix0,*dgeoypix0, *dgeoxpix,*dgeoypix,
-		xcin,xcout,ycin,ycout, xsin,ysin, xin,yin, x,y, val,
+		xcin,xcout,ycin,ycout, xsin,ysin, xin,yin, val,
 		invpixstep;
    int		*start,*startt, *nmask,*nmaskt, *modnaxisn,
 		i,j,k,n,t,w,
@@ -2263,7 +2263,7 @@
    psfstruct	*psf;
    float      *mask,*maskt, *ppix;
    float       dx,dy, r,r2,rmin,rmin2,rmax,rmax2,rsig,invrsig2;
-   int          width,height,npix,offset, psfwidth,psfheight,psfnpix,
+   int          width,height,npix,offset, psfwidth,psfheight,
                 cpwidth, cpheight,hcpwidth,hcpheight, i,j,x,y;
 
   if (!(psf=profit->psf))
@@ -2271,7 +2271,6 @@
 
   psfwidth = profit->modnaxisn[0];
   psfheight = profit->modnaxisn[1];
-  psfnpix = psfwidth*psfheight;
   width = profit->modnaxisn[0];
   height = profit->modnaxisn[1];
   npix = width*height;
@@ -2610,7 +2609,6 @@
 float profit_spiralindex(profitstruct *profit)
   {
    objstruct	*obj;
-   obj2struct	*obj2;
    float	*dx,*dy, *fdx,*fdy, *gdx,*gdy, *gdxt,*gdyt, *pix,
 		fwhm, invtwosigma2, hw,hh, ohw,ohh, x,y,xstart, tx,ty,txstart,
 		gx,gy, r2, spirindex, invsig, val, sep;
@@ -2620,7 +2618,6 @@
   npix = profit->objnaxisn[0]*profit->objnaxisn[1];
 
   obj = profit->obj;
-  obj2 = profit->obj2;
 /* Compute simple derivative vectors at a fraction of the object scale */
   fwhm = profit->guessradius * 2.0 / 4.0;
   if (fwhm < 2.0)
@@ -3462,7 +3459,6 @@
 		parfitenum parfittype,
 		float priorcen, float priorsig)
   {
-   double	dtemp;
    float	*paramptr;
    int		index;
 
@@ -3633,8 +3629,7 @@
 		xmmin,maxmx, maxmmin;
    float	*x,*xmin,*xmax;
    parfitenum	*fittype;
-   int		*fflag,
-		f,f1,f2, p,p1,p2, nfree, nparam, nmin,nmax;
+   int		f,f1,f2, p,p1,p2, nfree, nparam, nmin,nmax;
 
   nparam = profit->nparam;
   fittype = profit->parfittype;
@@ -3978,7 +3973,7 @@
   {
    double	xscale, yscale, saspect, ctheta,stheta, flux, scaling, bn, n,
 		dx1cout,dx2cout, ddx1[36],ddx2[36];
-   float	posin[PROFIT_MAXEXTRA], posout[2], dnaxisn[2],
+   float	posin[2+PROFIT_MAXEXTRA], posout[2], dnaxisn[2],
 		*pixin, *pixin2, *pixout,
 		fluxfac, amp,cd11,cd12,cd21,cd22, dx1,dx2,
 		x1,x10,x2, x1cin,x2cin, x1cout,x2cout, x1max,x2max, x1in,x2in,
@@ -4657,7 +4652,7 @@
 			start, fac;
    int			linecount[2+PROFIT_MAXEXTRA],
 			*naxisn,
-			i,j,n, ival, nlines, kwidth,width, badpixflag, naxis;
+			i,j,n, ival, nlines, kwidth,width, naxis;
 
   naxis = prof->naxis;
   naxisn = prof->naxisn;
@@ -4691,7 +4686,6 @@
   kwidth = prof->kernelwidth[0];
   nlines = prof->kernelnlines;
 /* First step: interpolate along NAXIS1 from the data themselves */
-  badpixflag = 0;
   pixin = prof->pix+start;
   pixout = prof->kernelbuf;
   for (j=nlines; j--;)
diff -ur sextractor-2.25.0.orig/src/psf.h sextractor-2.25.0/src/psf.h
--- sextractor-2.25.0.orig/src/psf.h	2018-02-08 11:13:59.000000000 +0100
+++ sextractor-2.25.0/src/psf.h	2020-11-05 16:01:19.958070960 +0100
@@ -1,3 +1,4 @@
+#pragma once
 /*
 *				psf.h
 *
@@ -104,9 +105,9 @@
   }	psfitstruct;
 
 /*----------------------------- Global variables ----------------------------*/
-psfstruct	*psf,*thedpsf,*thepsf;
-psfitstruct	*thepsfit,*thedpsfit;
-PIXTYPE		*checkmask;
+extern psfstruct	*psf,*thedpsf,*thepsf;
+extern psfitstruct	*thepsfit,*thedpsfit;
+extern PIXTYPE		*checkmask;
 
 /*-------------------------------- functions --------------------------------*/
 extern void	compute_pos(int *pnpsf,int *pconvflag,int *pnpsfflag,
diff -ur sextractor-2.25.0.orig/src/retina.h sextractor-2.25.0/src/retina.h
--- sextractor-2.25.0.orig/src/retina.h	2018-02-08 11:13:59.000000000 +0100
+++ sextractor-2.25.0/src/retina.h	2020-11-05 17:14:47.937509936 +0100
@@ -1,3 +1,4 @@
+#pragma once
 /*
 *				retina.h
 *
@@ -38,8 +39,6 @@
   struct structbpann	*bpann;	/* The neural network */
   }     retistruct;
 
-retistruct	*theretina;
-
 /*------------------------------- functions ---------------------------------*/
 
 retistruct	*getretina(char *filename);
diff -ur sextractor-2.25.0.orig/src/scan.c sextractor-2.25.0/src/scan.c
--- sextractor-2.25.0.orig/src/scan.c	2018-02-08 11:13:59.000000000 +0100
+++ sextractor-2.25.0/src/scan.c	2020-11-05 16:57:30.726222764 +0100
@@ -46,6 +46,7 @@
 #include	"image.h"
 #include	"plist.h"
 #include	"weight.h"
+#include	"clean.h"
 
 /****************************** scanimage ************************************
 PROTO   void scanimage(picstruct *field, picstruct *dfield, picstruct *ffield,
@@ -83,7 +84,7 @@
    PIXTYPE		thresh, relthresh, cdnewsymbol, cdwthresh,wthresh,
 			*scan,*dscan,*cdscan,*dwscan,*dwscanp,*dwscann,
 			*cdwscan,*cdwscanp,*cdwscann,*wscand,
-			*scant, *wscan,*wscann,*wscanp, *dgeoscanx, *dgeoscany;
+			*scant, *wscan,*wscann,*wscanp, *dgeoscanx, *dgeoscany, *dumscan;
    FLAGTYPE		*pfscan[MAXFLAG];
    status		cs, ps, *psstack;
    int			*start, *end, ymax;
@@ -778,13 +779,11 @@
    objliststruct	objlistout, *objlist2;
    static objstruct	obj;
    objstruct		*cobj;
-   pliststruct		*pixel;
    static int		id_parent;
    int 			i,j,n;
 
   cfield = dfield? dfield: field;
 
-  pixel = objlist->plist;
   objlistout.obj = NULL;
   objlistout.plist = NULL;
   objlistout.nobj = objlistout.npix = 0;
diff -ur sextractor-2.25.0.orig/src/sexhead.h sextractor-2.25.0/src/sexhead.h
--- sextractor-2.25.0.orig/src/sexhead.h	2018-02-08 11:13:59.000000000 +0100
+++ sextractor-2.25.0/src/sexhead.h	2020-11-05 15:44:00.070548644 +0100
@@ -1,3 +1,4 @@
+#pragma once
 /*
 *				sexhead.h
 *
diff -ur sextractor-2.25.0.orig/src/sexhead1.h sextractor-2.25.0/src/sexhead1.h
--- sextractor-2.25.0.orig/src/sexhead1.h	2018-02-08 11:13:59.000000000 +0100
+++ sextractor-2.25.0/src/sexhead1.h	2020-11-05 16:37:27.453239429 +0100
@@ -1,3 +1,4 @@
+#pragma once
 /*
 *				sexhead1.h
 *
@@ -26,7 +27,7 @@
 *
 *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-int	idummy;
+extern int	idummy;
 double	ddummy;
 
 keystruct	headkey1[] = {
diff -ur sextractor-2.25.0.orig/src/sexheadsc.h sextractor-2.25.0/src/sexheadsc.h
--- sextractor-2.25.0.orig/src/sexheadsc.h	2018-02-08 11:13:59.000000000 +0100
+++ sextractor-2.25.0/src/sexheadsc.h	2020-11-05 15:44:05.994613759 +0100
@@ -1,3 +1,4 @@
+#pragma once
 /*
 *				sexheadsc.h
 *
diff -ur sextractor-2.25.0.orig/src/som.h sextractor-2.25.0/src/som.h
--- sextractor-2.25.0.orig/src/som.h	2018-02-08 11:13:59.000000000 +0100
+++ sextractor-2.25.0/src/som.h	2020-11-05 16:35:02.567681244 +0100
@@ -1,3 +1,4 @@
+#pragma once
 /*
 *				som.h
 *
@@ -70,7 +71,7 @@
   float		stderror;		/* Global reduced error */
   }	somstruct;
 
-somstruct	*thesom;
+extern somstruct	*thesom;
 
 /*---------------------------------- protos --------------------------------*/
 
diff -ur sextractor-2.25.0.orig/src/threads.h sextractor-2.25.0/src/threads.h
--- sextractor-2.25.0.orig/src/threads.h	2018-02-08 11:13:59.000000000 +0100
+++ sextractor-2.25.0/src/threads.h	2020-11-05 15:44:16.018723943 +0100
@@ -1,3 +1,4 @@
+#pragma once
 /*
 *				threads.h
 *
diff -ur sextractor-2.25.0.orig/src/types.h sextractor-2.25.0/src/types.h
--- sextractor-2.25.0.orig/src/types.h	2018-02-08 11:13:59.000000000 +0100
+++ sextractor-2.25.0/src/types.h	2020-11-05 15:44:20.770776180 +0100
@@ -1,3 +1,4 @@
+#pragma once
 /*
 *				types.h
 *
diff -ur sextractor-2.25.0.orig/src/wcs/poly.c sextractor-2.25.0/src/wcs/poly.c
--- sextractor-2.25.0.orig/src/wcs/poly.c	2018-02-08 11:13:59.000000000 +0100
+++ sextractor-2.25.0/src/wcs/poly.c	2020-11-05 17:13:20.772556746 +0100
@@ -736,16 +736,14 @@
  ***/
 void	poly_initortho(polystruct *poly, double *data, int ndata)
   {
-   double	*basis, *coeff, *invec,*invect0,*invect,*invect02,*invect2,
+   double	*basis, *invect0,*invect,*invect02,*invect2,
 		*rdiag, *deortho,
 		scale,s, dval;
-   int		c,i,j,m,n, ndmc, ndim,ncoeff;
+   int		c,i,j, ndmc, ncoeff;
 
 /* Prepare the vectors and counters */
-  ndim = poly->ndim;
   ncoeff = poly->ncoeff;
   basis = poly->basis;
-  coeff = poly->coeff;
 
 /* Allocate memory for orthonormalization matrix and vector */
   QCALLOC(poly->deorthomat, double, ncoeff*ncoeff);
@@ -754,9 +752,6 @@
 
 /* Do a QR decomposition of input vector set */
 /* Vectors are stored as rows to speed up the Householder transformation */
-  n = ncoeff;
-  m = ndata;
-  invec = data;
   for (c=0; c<ncoeff; c++)
     {
     ndmc = ndata - c;
diff -ur sextractor-2.25.0.orig/src/wcscelsys.h sextractor-2.25.0/src/wcscelsys.h
--- sextractor-2.25.0.orig/src/wcscelsys.h	2018-02-08 11:13:59.000000000 +0100
+++ sextractor-2.25.0/src/wcscelsys.h	2020-11-05 15:44:23.514806341 +0100
@@ -1,3 +1,4 @@
+#pragma once
 /*
 *				wcscelsys.h
 *
diff -ur sextractor-2.25.0.orig/src/weight.h sextractor-2.25.0/src/weight.h
--- sextractor-2.25.0.orig/src/weight.h	2018-02-08 11:13:59.000000000 +0100
+++ sextractor-2.25.0/src/weight.h	2020-11-05 15:44:27.154846349 +0100
@@ -1,3 +1,4 @@
+#pragma once
 /*
 *				weight.h
 *
diff -ur sextractor-2.25.0.orig/src/winpos.h sextractor-2.25.0/src/winpos.h
--- sextractor-2.25.0.orig/src/winpos.h	2018-02-08 11:13:59.000000000 +0100
+++ sextractor-2.25.0/src/winpos.h	2020-11-05 15:44:31.694896252 +0100
@@ -1,3 +1,4 @@
+#pragma once
 /*
 *				winpos.h
 *
diff -ur sextractor-2.25.0.orig/src/xml.c sextractor-2.25.0/src/xml.c
--- sextractor-2.25.0.orig/src/xml.c	2018-02-08 11:13:59.000000000 +0100
+++ sextractor-2.25.0/src/xml.c	2020-11-04 16:20:59.063700657 +0100
@@ -696,7 +696,7 @@
 		name, ucd);
       break;
     case P_STRING:
-      sprintf(value, (char *)key[i].ptr);
+      sprintf(value, "%s",(char *)key[i].ptr);
       fprintf(file, "   <PARAM name=\"%s\" datatype=\"char\" arraysize=\"*\""
 	" ucd=\"%s\" value=\"%s\"/>\n",
 	name, ucd, *value? value: " ");
@@ -705,13 +705,13 @@
       n = *(key[i].nlistptr);
       if (n)
         {
-        sprintf(value, ((char **)key[i].ptr)[0]);
+        sprintf(value, "%s", ((char **)key[i].ptr)[0]);
         fprintf(file, "   <PARAM name=\"%s\" datatype=\"char\""
 		" arraysize=\"*\" ucd=\"%s\" value=\"%s",
 		name, ucd, *value? value: " ");
         for (j=1; j<n; j++)
           {
-          sprintf(value, ((char **)key[i].ptr)[j]);
+          sprintf(value, "%s", ((char **)key[i].ptr)[j]);
           fprintf(file, ",%s", *value? value: " ");
           }
         fprintf(file, "\"/>\n");
@@ -722,7 +722,7 @@
 		name, ucd);
       break;
     case P_KEY:
-      sprintf(value, key[i].keylist[*((int *)key[i].ptr)]);
+      sprintf(value, "%s", key[i].keylist[*((int *)key[i].ptr)]);
       fprintf(file, "   <PARAM name=\"%s\" datatype=\"char\" arraysize=\"*\""
 	" ucd=\"%s\" value=\"%s\"/>\n",
 	name, ucd, value);
@@ -731,13 +731,13 @@
       n = *(key[i].nlistptr);
       if (n)
         {
-        sprintf(value, key[i].keylist[((int *)key[i].ptr)[0]]);
+        sprintf(value, "%s", key[i].keylist[((int *)key[i].ptr)[0]]);
         fprintf(file, "   <PARAM name=\"%s\" datatype=\"char\""
 		" arraysize=\"*\" ucd=\"%s\" value=\"%s",
 		name, ucd, value);
         for (j=1; j<n; j++)
           {
-          sprintf(value, key[i].keylist[((int *)key[i].ptr)[j]]);
+          sprintf(value, "%s", key[i].keylist[((int *)key[i].ptr)[j]]);
           fprintf(file, ",%s", value);
           }
         fprintf(file, "\"/>\n");
diff -ur sextractor-2.25.0.orig/src/xml.h sextractor-2.25.0/src/xml.h
--- sextractor-2.25.0.orig/src/xml.h	2018-02-08 11:13:59.000000000 +0100
+++ sextractor-2.25.0/src/xml.h	2020-11-05 15:44:37.954965054 +0100
@@ -1,3 +1,4 @@
+#pragma once
 /*
 *				xml.h
 *