Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
csst-pipeline
msc
sextractor
Commits
46dd48fa
Commit
46dd48fa
authored
Feb 11, 2020
by
Emmanuel Bertin
Browse files
Fixed byte-swapping flag issue with -fno-common compilation flag.
parent
c09d0c93
Changes
10
Hide whitespace changes
Inline
Side-by-side
doc/src/conf.py
View file @
46dd48fa
...
...
@@ -67,9 +67,9 @@ author = u'E. Bertin'
# built documents.
#
# The short X.Y version.
version
=
'2.2
4.2
'
version
=
'2.2
5.1
'
# The full version, including alpha/beta/rc tags.
release
=
'2.2
4.2
'
release
=
'2.2
5.1
'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
...
...
@@ -81,7 +81,7 @@ language = None
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#
today
=
'
Fri Dec 29 2017
'
today
=
'
Tue Feb 11 2020
'
#
# Else, today_fmt is used as the format for a strftime call.
#
...
...
@@ -144,7 +144,7 @@ html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
# The name for this set of Sphinx documents.
# "<project> v<release> documentation" by default.
#
# html_title = u'SExtractor v2.2
4.2
'
# html_title = u'SExtractor v2.2
5.1
'
# A shorter title for the navigation bar. Default is the same as html_title.
#
...
...
src/fits/fitsbody.c
View file @
46dd48fa
...
...
@@ -7,7 +7,7 @@
*
* This file part of: AstrOmatic FITS/LDAC library
*
* Copyright: (C) 1995-201
3 Emmanuel Bertin --
IAP/CNRS/
UPMC
* Copyright: (C) 1995-201
0
IAP/CNRS/
SorbonneU
*
* License: GNU General Public License
*
...
...
@@ -23,7 +23,7 @@
* along with AstrOmatic software.
* If not, see <http://www.gnu.org/licenses/>.
*
* Last modified:
28
/0
3
/20
13
* Last modified:
11
/0
2
/20
20
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
...
...
@@ -304,7 +304,7 @@ INPUT A pointer to the tab structure,
OUTPUT -.
NOTES .
AUTHOR E. Bertin (IAP)
VERSION
28
/0
3
/20
13
VERSION
11
/0
2
/20
20
***/
void
read_body
(
tabstruct
*
tab
,
PIXTYPE
*
ptr
,
size_t
size
)
{
...
...
@@ -313,18 +313,19 @@ void read_body(tabstruct *tab, PIXTYPE *ptr, size_t size)
unsigned
char
cuval
,
cublank
;
char
*
bufdata
,
cval
,
cblank
;
unsigned
short
suval
,
sublank
;
unsigned
short
suval
,
sublank
,
ashort
=
1
;
short
val16
,
sval
,
sblank
;
#ifdef HAVE_LONG_LONG_INT
ULONGLONG
lluval
,
llublank
;
SLONGLONG
llval
,
llblank
;
#endif
unsigned
int
iuval
,
iublank
;
int
curval
,
dval
,
blankflag
,
ival
,
iblank
;
int
curval
,
dval
,
blankflag
,
bswapflag
,
ival
,
iblank
;
size_t
i
,
bowl
,
spoonful
,
npix
;
PIXTYPE
bs
,
bz
;
/* a NULL cat structure indicates that no data can be read */
if
(
!
(
cat
=
tab
->
cat
))
return
;
...
...
@@ -332,6 +333,7 @@ void read_body(tabstruct *tab, PIXTYPE *ptr, size_t size)
bs
=
(
PIXTYPE
)
tab
->
bscale
;
bz
=
(
PIXTYPE
)
tab
->
bzero
;
blankflag
=
tab
->
blankflag
;
bswapflag
=
*
((
char
*
)
&
ashort
);
// Byte-swapping flag
switch
(
tab
->
compress_type
)
{
...
...
@@ -630,20 +632,23 @@ INPUT A pointer to the tab structure,
OUTPUT -.
NOTES .
AUTHOR E. Bertin (IAP)
VERSION
28
/0
3
/20
13
VERSION
11
/0
2
/20
20
***/
void
read_ibody
(
tabstruct
*
tab
,
FLAGTYPE
*
ptr
,
size_t
size
)
{
catstruct
*
cat
;
static
int
bufdata0
[
DATA_BUFSIZE
/
sizeof
(
int
)];
char
*
bufdata
;
short
val16
;
int
i
,
bowl
,
spoonful
,
npix
,
curval
,
dval
;
catstruct
*
cat
;
static
int
bufdata0
[
DATA_BUFSIZE
/
sizeof
(
int
)];
char
*
bufdata
;
short
val16
;
unsigned
short
ashort
=
1
;
int
i
,
bowl
,
spoonful
,
npix
,
curval
,
dval
,
bswapflag
;
/* a NULL cat structure indicates that no data can be read */
if
(
!
(
cat
=
tab
->
cat
))
return
;
bswapflag
=
*
((
char
*
)
&
ashort
);
// Byte-swapping flag
switch
(
tab
->
compress_type
)
{
/*-- Uncompressed image */
...
...
@@ -810,15 +815,19 @@ INPUT A pointer to the tab structure,
OUTPUT -.
NOTES .
AUTHOR E. Bertin (IAP)
VERSION
28
/0
3
/20
13
VERSION
11
/0
2
/20
20
***/
void
write_body
(
tabstruct
*
tab
,
PIXTYPE
*
ptr
,
size_t
size
)
{
static
double
bufdata0
[
DATA_BUFSIZE
/
sizeof
(
double
)];
catstruct
*
cat
;
char
*
cbufdata0
;
size_t
i
,
bowl
,
spoonful
;
PIXTYPE
bs
,
bz
;
static
double
bufdata0
[
DATA_BUFSIZE
/
sizeof
(
double
)];
catstruct
*
cat
;
char
*
cbufdata0
;
size_t
i
,
bowl
,
spoonful
;
PIXTYPE
bs
,
bz
;
unsigned
short
ashort
=
1
;
int
bswapflag
;
bswapflag
=
*
((
char
*
)
&
ashort
);
// Byte-swapping flag
bs
=
(
PIXTYPE
)
tab
->
bscale
;
bz
=
(
PIXTYPE
)
tab
->
bzero
;
...
...
@@ -972,7 +981,7 @@ INPUT A pointer to the tab structure,
OUTPUT -.
NOTES .
AUTHOR E. Bertin (IAP)
VERSION
28
/0
3
/20
13
VERSION
11
/0
2
/20
20
***/
void
write_ibody
(
tabstruct
*
tab
,
FLAGTYPE
*
ptr
,
size_t
size
)
{
...
...
@@ -980,7 +989,11 @@ void write_ibody(tabstruct *tab, FLAGTYPE *ptr, size_t size)
catstruct
*
cat
;
char
*
cbufdata0
;
size_t
i
,
bowl
,
spoonful
;
unsigned
short
ashort
=
1
;
double
bs
,
bz
;
int
bswapflag
;
bswapflag
=
*
((
char
*
)
&
ashort
);
// Byte-swapping flag
bs
=
tab
->
bscale
;
bz
=
tab
->
bzero
;
...
...
src/fits/fitscat.h
View file @
46dd48fa
...
...
@@ -7,7 +7,7 @@
*
* This file part of: AstrOmatic FITS/LDAC library
*
* Copyright: (C) 1995-20
12 Emmanuel Bertin --
IAP/CNRS/
UPMC
* Copyright: (C) 1995-20
20
IAP/CNRS/
SorbonneU
*
* License: GNU General Public License
*
...
...
@@ -23,7 +23,7 @@
* along with AstrOmatic software.
* If not, see <http://www.gnu.org/licenses/>.
*
* Last modified:
29
/0
8
/20
1
2
* Last modified:
11
/0
2
/202
0
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
...
...
@@ -332,7 +332,4 @@ extern void error(int, char *, char *),
swapbytes
(
void
*
ptr
,
int
nb
,
int
n
),
warning
(
char
*
msg1
,
char
*
msg2
);
int
bswapflag
;
#endif
src/fits/fitscat_defs.h
View file @
46dd48fa
...
...
@@ -7,7 +7,7 @@
*
* This file part of: AstrOmatic FITS/LDAC library
*
* Copyright: (C) 1995-20
13 Emmanuel Bertin --
IAP/CNRS/
UPMC
* Copyright: (C) 1995-20
20
IAP/CNRS/
SorbonneU
*
* License: GNU General Public License
*
...
...
@@ -23,7 +23,7 @@
* along with AstrOmatic software.
* If not, see <http://www.gnu.org/licenses/>.
*
* Last modified: 1
5
/02/20
13
* Last modified: 1
1
/02/20
20
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
...
...
@@ -90,8 +90,6 @@ char gstr[MAXCHAR];
/*----------------------------- External constants --------------------------*/
extern
int
bswapflag
;
/* != 0 if bytes are swapped/IEEE */
/*------------------------------- Other Macros -----------------------------*/
#if _LARGEFILE_SOURCE
...
...
src/fits/fitscheck.c
View file @
46dd48fa
...
...
@@ -7,7 +7,7 @@
*
* This file part of: AstrOmatic FITS/LDAC library
*
* Copyright: (C) 1995-20
1
0
Emmanuel Bertin -- IAP/CNRS/UPMC
* Copyright: (C) 1995-20
2
0
IAP/CNRS/SorbonneU
*
* License: GNU General Public License
*
...
...
@@ -23,7 +23,7 @@
* along with AstrOmatic software.
* If not, see <http://www.gnu.org/licenses/>.
*
* Last modified:
09/10
/20
1
0
* Last modified:
11/02
/20
2
0
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
...
...
@@ -97,14 +97,15 @@ OUTPUT Checksum.
NOTES Straightforward copy of Seaman & Pence 1995
(ftp://iraf.noao.edu/misc/checksum/).
AUTHOR E. Bertin (IAP)
VERSION
08
/0
5
/200
1
VERSION
11
/0
2
/20
2
0
***/
unsigned
int
decode_checksum
(
char
*
str
)
{
char
cbuf
[
16
];
unsigned
short
*
sbuf
,
los
,
his
;
los
,
his
,
ashort
=
1
;
unsigned
int
hi
,
lo
,
hicarry
,
locarry
;
int
i
;
...
...
@@ -113,7 +114,7 @@ unsigned int decode_checksum(char *str)
cbuf
[
i
]
=
str
[(
i
+
1
)
%
16
]
-
0x30
;
sbuf
=
(
unsigned
short
*
)
cbuf
;
hi
=
lo
=
0
;
if
(
bswapflag
)
if
(
*
((
char
*
)
&
ashort
))
// Byte-swapping required
for
(
i
=
4
;
i
--
;)
{
his
=
*
(
sbuf
++
);
...
...
@@ -153,19 +154,20 @@ NOTES From Seaman & Pence 1995 (ftp://iraf.noao.edu/misc/checksum/). But
depends on the endianity of the machine. The routine below adds
support for ix386-like processors (non-IEEE).
AUTHOR E. Bertin (IAP)
VERSION
08
/0
5
/200
1
VERSION
11
/0
2
/20
2
0
***/
unsigned
int
compute_blocksum
(
char
*
buf
,
unsigned
int
sum
)
{
unsigned
short
*
sbuf
,
his
,
los
;
his
,
los
,
ashort
=
1
;
unsigned
int
hi
,
lo
,
hicarry
,
locarry
;
int
i
;
sbuf
=
(
unsigned
short
*
)
buf
;
hi
=
(
sum
>>
16
);
lo
=
(
sum
<<
16
)
>>
16
;
if
(
bswapflag
)
if
(
*
((
char
*
)
&
ashort
))
// Byte-swapping required
for
(
i
=
FBSIZE
/
4
;
i
--
;)
{
his
=
*
(
sbuf
++
);
...
...
src/fits/fitskey.c
View file @
46dd48fa
...
...
@@ -7,7 +7,7 @@
*
* This file part of: AstrOmatic FITS/LDAC library
*
* Copyright: (C) 1995-20
12 Emmanuel Bertin --
IAP/CNRS/
UPMC
* Copyright: (C) 1995-20
20
IAP/CNRS/
SorbonneU
*
* License: GNU General Public License
*
...
...
@@ -23,7 +23,7 @@
* along with AstrOmatic software.
* If not, see <http://www.gnu.org/licenses/>.
*
* Last modified: 1
3
/0
6
/20
1
2
* Last modified: 1
1
/0
2
/202
0
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
...
...
@@ -208,18 +208,19 @@ INPUT pointer to the table,
OUTPUT A pointer to the relevant key, or NULL if the desired key is not
found in the table.
NOTES If key->ptr is not NULL, the function doesn't do anything.
AUTHOR E. Bertin (IAP
& Leiden observatory
)
AUTHOR E. Bertin (IAP)
E.R. Deul (Sterrewacht Leiden) (Added open_cat error checking)
VERSION 1
8
/02/20
0
0
VERSION 1
1
/02/20
2
0
***/
keystruct
*
read_key
(
tabstruct
*
tab
,
char
*
keyname
)
{
catstruct
*
cat
;
keystruct
*
key
;
char
*
buf
,
*
ptr
,
*
fptr
,
*
fptr0
;
int
i
,
j
,
larray
,
narray
,
size
;
int
esize
;
catstruct
*
cat
;
keystruct
*
key
;
char
*
buf
,
*
ptr
,
*
fptr
,
*
fptr0
;
unsigned
short
ashort
=
1
;
int
i
,
j
,
larray
,
narray
,
size
,
esize
,
bswapflag
;
if
(
!
(
key
=
name_to_key
(
tab
,
keyname
)))
return
NULL
;
...
...
@@ -256,6 +257,7 @@ keystruct *read_key(tabstruct *tab, char *keyname)
/*allocate memory for the array*/
QMALLOC
(
ptr
,
char
,
size
*
narray
);
key
->
ptr
=
ptr
;
bswapflag
=
*
((
char
*
)
&
ashort
);
// Byte-swapping flag
/*read line by line*/
for
(
i
=
narray
;
i
--
;)
...
...
@@ -289,19 +291,20 @@ NOTES The array of pointers pointed by keys is filled with pointers
A NULL keys pointer can be given (no info returned of course).
A NULL keynames pointer means read ALL keys belonging to the table.
A NULL mask pointer means NO selection for reading.
AUTHOR E. Bertin (IAP
& Leiden observatory
)
VERSION 1
8
/02/20
0
0
AUTHOR E. Bertin (IAP)
VERSION 1
1
/02/20
2
0
***/
void
read_keys
(
tabstruct
*
tab
,
char
**
keynames
,
keystruct
**
keys
,
int
nkeys
,
BYTE
*
mask
)
{
catstruct
*
cat
;
keystruct
*
key
,
**
ckeys
;
BYTE
*
mask2
;
char
*
buf
,
*
ptr
,
*
fptr
;
int
i
,
j
,
k
,
n
,
larray
,
narray
,
nb
,
kflag
=
0
,
size
;
int
esize
;
catstruct
*
cat
;
keystruct
*
key
,
**
ckeys
;
BYTE
*
mask2
;
char
*
buf
,
*
ptr
,
*
fptr
;
unsigned
short
ashort
=
1
;
int
i
,
j
,
k
,
n
,
larray
,
narray
,
nb
,
kflag
=
0
,
size
,
esize
,
bswapflag
;
/*!! It is not necessarily the original table */
tab
=
tab
->
key
->
tab
;
...
...
@@ -378,6 +381,7 @@ void read_keys(tabstruct *tab, char **keynames, keystruct **keys, int nkeys,
QFSEEK
(
cat
->
file
,
tab
->
bodypos
,
SEEK_SET
,
cat
->
filename
);
/*read line by line*/
bswapflag
=
*
((
char
*
)
&
ashort
);
// Byte-swapping flag
n
=
0
;
mask2
=
mask
;
for
(
i
=
narray
;
i
--
;)
...
...
@@ -587,20 +591,23 @@ NOTES This is approximately the same code as for read_keys.
A NULL keys pointer can be given (no info returned of course).
A NULL keynames pointer means read ALL keys belonging to the table.
A NULL mask pointer means NO selection for reading.
AUTHOR E. Bertin (IAP
& Leiden observatory
)
VERSION 1
3
/0
6
/20
1
2
AUTHOR E. Bertin (IAP)
VERSION 1
1
/0
2
/202
0
***/
void
show_keys
(
tabstruct
*
tab
,
char
**
keynames
,
keystruct
**
keys
,
int
nkeys
,
BYTE
*
mask
,
FILE
*
stream
,
int
strflag
,
int
banflag
,
int
leadflag
,
output_type
o_type
)
{
catstruct
*
cat
;
keystruct
*
key
,
**
ckeys
;
BYTE
*
mask2
;
char
*
buf
,
*
rfield
,
*
ptr
;
int
i
,
j
,
k
,
n
,
c
,
larray
,
narray
,
nb
,
kflag
,
maxnbytes
,
nelem
,
esize
,
*
key_col
;
catstruct
*
cat
;
keystruct
*
key
,
**
ckeys
;
BYTE
*
mask2
;
char
*
buf
,
*
rfield
,
*
ptr
;
unsigned
short
ashort
=
1
;
int
*
key_col
,
i
,
j
,
k
,
n
,
c
,
larray
,
narray
,
nb
,
kflag
,
maxnbytes
,
nelem
,
esize
,
bswapflag
;
typedef
struct
structreq_keyname
{
char
oldname
[
80
];
/* Name of the original pipeline key */
...
...
@@ -793,6 +800,7 @@ void show_keys(tabstruct *tab, char **keynames, keystruct **keys, int nkeys,
QFSEEK
(
cat
->
file
,
tab
->
bodypos
,
SEEK_SET
,
cat
->
filename
);
/*read line by line*/
bswapflag
=
*
((
char
*
)
&
ashort
);
// Byte-swapping flag
n
=
0
;
mask2
=
mask
;
for
(
i
=
narray
;
i
--
;)
...
...
src/fits/fitsread.c
View file @
46dd48fa
...
...
@@ -7,7 +7,7 @@
*
* This file part of: AstrOmatic FITS/LDAC library
*
* Copyright: (C) 1995-20
1
0
Emmanuel Bertin -- IAP/CNRS/UPMC
* Copyright: (C) 1995-20
2
0
IAP/CNRS/SorbonneU
*
* License: GNU General Public License
*
...
...
@@ -23,7 +23,7 @@
* along with AstrOmatic software.
* If not, see <http://www.gnu.org/licenses/>.
*
* Last modified:
09/10
/20
1
0
* Last modified:
11/02
/20
2
0
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
...
...
@@ -162,18 +162,21 @@ INPUT Table which will be accessed from disk (provided by init_readobj()),
pointer to the temporary buffer.
OUTPUT The number of table lines that remain to be read.
NOTES -.
AUTHOR E. Bertin (IAP
& Leiden observatory
)
VERSION
26
/0
9
/200
4
AUTHOR E. Bertin (IAP)
VERSION
11
/0
2
/20
2
0
***/
int
read_obj
(
tabstruct
*
keytab
,
tabstruct
*
tab
,
char
*
buf
)
{
keystruct
*
key
;
char
*
pin
,
*
pout
;
int
b
,
k
;
int
esize
;
keystruct
*
key
;
char
*
pin
,
*
pout
;
unsigned
short
ashort
=
1
;
int
b
,
k
,
esize
,
bswapflag
;
QFREAD
(
buf
,
keytab
->
naxisn
[
0
],
keytab
->
cat
->
file
,
keytab
->
cat
->
filename
);
bswapflag
=
*
((
char
*
)
&
ashort
);
// Byte-swapping flag
key
=
tab
->
key
;
for
(
k
=
tab
->
nkey
;
k
--
;
key
=
key
->
nextkey
)
if
(
key
->
pos
>=
0
)
...
...
@@ -202,22 +205,23 @@ INPUT Table which will be accessed from disk (provided by init_readobj()),
position number in table.
OUTPUT RETURN_OK if the object has been accessed, RETURN_ERROR otherwise.
NOTES -.
AUTHOR E. Bertin (IAP
& Leiden observatory
)
VERSION
26
/0
9
/200
4
AUTHOR E. Bertin (IAP)
VERSION
11
/0
2
/20
2
0
***/
int
read_obj_at
(
tabstruct
*
keytab
,
tabstruct
*
tab
,
char
*
buf
,
long
pos
)
{
keystruct
*
key
;
char
*
pin
,
*
pout
;
size_t
n
;
int
b
,
k
;
int
esize
;
keystruct
*
key
;
char
*
pin
,
*
pout
;
size_t
n
;
unsigned
short
ashort
=
1
;
int
b
,
k
,
esize
,
bswapflag
;
if
((
n
=
keytab
->
naxisn
[
0
]
*
pos
)
>=
keytab
->
tabsize
)
return
RETURN_ERROR
;
QFSEEK
(
keytab
->
cat
->
file
,
keytab
->
bodypos
+
n
,
SEEK_SET
,
keytab
->
cat
->
filename
);
QFREAD
(
buf
,
keytab
->
naxisn
[
0
],
keytab
->
cat
->
file
,
keytab
->
cat
->
filename
);
bswapflag
=
*
((
char
*
)
&
ashort
);
// Byte-swapping flag
key
=
tab
->
key
;
for
(
k
=
tab
->
nkey
;
k
--
;
key
=
key
->
nextkey
)
if
(
key
->
pos
>=
0
)
...
...
src/fits/fitswrite.c
View file @
46dd48fa
...
...
@@ -7,7 +7,7 @@
*
* This file part of: AstrOmatic FITS/LDAC library
*
* Copyright: (C) 1995-20
12 Emmanuel Bertin --
IAP/CNRS/
UPMC
* Copyright: (C) 1995-20
20
IAP/CNRS/
SorbonneU
*
* License: GNU General Public License
*
...
...
@@ -23,7 +23,7 @@
* along with AstrOmatic software.
* If not, see <http://www.gnu.org/licenses/>.
*
* Last modified:
27
/0
8
/20
1
2
* Last modified:
11
/0
2
/202
0
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
...
...
@@ -87,22 +87,23 @@ INPUT pointer to the catalog structure,
pointer to the table structure.
OUTPUT -.
NOTES -.
AUTHOR E. Bertin (IAP
& Leiden observatory
)
VERSION 1
3
/0
6
/20
1
2
AUTHOR E. Bertin (IAP)
VERSION 1
1
/0
2
/202
0
***/
void
save_tab
(
catstruct
*
cat
,
tabstruct
*
tab
)
{
catstruct
*
tabcat
;
keystruct
*
key
;
tabstruct
*
keytab
;
KINGSIZE_T
tabsize
;
long
size
;
int
b
,
j
,
k
,
o
,
nbytes
,
nkey
,
nobj
,
spoonful
,
tabflag
,
larrayin
,
larrayout
;
char
*
buf
,
*
inbuf
,
*
outbuf
,
*
fptr
,
*
ptr
;
int
esize
;
catstruct
*
tabcat
;
keystruct
*
key
;
tabstruct
*
keytab
;
KINGSIZE_T
tabsize
;
long
size
;
char
*
buf
,
*
inbuf
,
*
outbuf
,
*
fptr
,
*
ptr
;
unsigned
short
ashort
=
1
;
int
b
,
j
,
k
,
o
,
nbytes
,
nkey
,
nobj
,
spoonful
,
tabflag
,
larrayin
,
larrayout
,
esize
,
bswapflag
;
bswapflag
=
*
((
char
*
)
&
ashort
);
// Byte-swapping flag
/* The header itself*/
tabflag
=
save_head
(
cat
,
tab
)
==
RETURN_OK
?
1
:
0
;
/* Allocate memory for the output buffer */
...
...
@@ -314,18 +315,21 @@ INPUT Table structure,
pointer to the temporary buffer.
OUTPUT -.
NOTES key content is destroyed (actually, byte-swapped) on output.
AUTHOR E. Bertin (IAP
& Leiden observatory
)
VERSION
27
/0
8
/20
1
2
AUTHOR E. Bertin (IAP)
VERSION
11
/0
2
/202
0
***/
int
write_obj
(
tabstruct
*
tab
,
char
*
buf
)
{
keystruct
*
key
;
char
*
pin
,
*
pout
,
*
pout2
;
int
b
,
k
;
int
esize
;
catstruct
*
cat
;
keystruct
*
key
;
char
*
pin
,
*
pout
,
*
pout2
;
unsigned
short
ashort
=
1
;
int
b
,
k
,
esize
,
bswapflag
;
bswapflag
=
*
((
char
*
)
&
ashort
);
// Byte-swapping flag
key
=
tab
->
key
;
cat
=
tab
->
cat
;
pout
=
buf
;
for
(
k
=
tab
->
nkey
;
k
--
;
key
=
key
->
nextkey
)
{
...
...
@@ -340,7 +344,7 @@ int write_obj(tabstruct *tab, char *buf)
}
}
QFWRITE
(
buf
,
*
tab
->
naxisn
,
tab
->
cat
->
file
,
tab
->
cat
->
filename
);
QFWRITE
(
buf
,
*
tab
->
naxisn
,
cat
->
file
,
cat
->
filename
);
return
++
tab
->
naxisn
[
1
];
}
...
...
src/ldactoasc.c
View file @
46dd48fa
...
...
@@ -7,7 +7,7 @@
*
* This file part of: SExtractor
*
* Copyright: (C) 2007-20
1
0
Emmanuel Bertin -- IAP/CNRS/UPMC
* Copyright: (C) 2007-20
2
0
IAP/CNRS/SorbonneU
*
* License: GNU General Public License
*
...
...
@@ -22,7 +22,7 @@
* You should have received a copy of the GNU General Public License
* along with SExtractor. If not, see <http://www.gnu.org/licenses/>.
*
* Last modified: 11/
1
0/20
1
0
* Last modified: 11/0
2
/20
2
0
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
...
...
@@ -47,7 +47,6 @@ int main(int argc, char *argv[])
{
catstruct
*
cat
;
tabstruct
*
tab
;
unsigned
short
ashort
=
1
;
char
catname
[
MAXCHAR
];
int
a
,
t
,
opt
,
opt2
,
flag
;
...
...
@@ -59,9 +58,6 @@ int main(int argc, char *argv[])
error
(
EXIT_SUCCESS
,
"SYNTAX: "
,
SYNTAX
);
}
/* Test if byteswapping will be needed */
bswapflag
=
*
((
char
*
)
&
ashort
);
/* Default parameters */
for
(
a
=
1
;
a
<
argc
;
a
++
)
{
...
...
src/prefs.c
View file @
46dd48fa
...
...
@@ -7,7 +7,7 @@
*
* This file part of: SExtractor
*
* Copyright: (C) 1993-20
13 Emmanuel Bertin --
IAP/CNRS/
UPMC
* Copyright: (C) 1993-20
20
IAP/CNRS/
SorbonneU
*
* License: GNU General Public License
*
...
...
@@ -22,7 +22,7 @@
* You should have received a copy of the GNU General Public License
* along with SExtractor. If not, see <http://www.gnu.org/licenses/>.
*
* Last modified: 1
8
/0
6
/20
1
2
* Last modified: 1
1
/0
2
/202
0
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
...
...
@@ -404,14 +404,10 @@ void preprefs()
{
char
str
[
80
];
unsigned
short
ashort
=
1
;
#ifdef USE_THREADS
int
nproc
;
#endif
/* Test if byteswapping will be needed */
bswapflag
=
*
((
char
*
)
&
ashort
);
/* Multithreading */
#ifdef USE_THREADS
if
(
prefs
.
nthreads
<=
0
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment