getdata-commits Mailing List for GetData (Page 20)
Scientific Database Format
Brought to you by:
ketiltrout
This list is closed, nobody may subscribe to it.
| 2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(5) |
Oct
(20) |
Nov
(21) |
Dec
(16) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2011 |
Jan
(1) |
Feb
(1) |
Mar
(56) |
Apr
(20) |
May
(4) |
Jun
(2) |
Jul
(3) |
Aug
(11) |
Sep
(2) |
Oct
(4) |
Nov
(18) |
Dec
(16) |
| 2012 |
Jan
(8) |
Feb
(12) |
Mar
(30) |
Apr
(13) |
May
(10) |
Jun
(17) |
Jul
(18) |
Aug
(19) |
Sep
|
Oct
(1) |
Nov
(1) |
Dec
(9) |
| 2013 |
Jan
(1) |
Feb
(4) |
Mar
(27) |
Apr
(6) |
May
(3) |
Jun
(1) |
Jul
(10) |
Aug
|
Sep
(3) |
Oct
(15) |
Nov
(4) |
Dec
(9) |
| 2014 |
Jan
|
Feb
(3) |
Mar
(4) |
Apr
(10) |
May
(15) |
Jun
|
Jul
(14) |
Aug
|
Sep
(2) |
Oct
(6) |
Nov
|
Dec
(9) |
| 2015 |
Jan
(2) |
Feb
(3) |
Mar
(1) |
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <ket...@us...> - 2010-10-21 02:37:05
|
Revision: 460
http://getdata.svn.sourceforge.net/getdata/?rev=460&view=rev
Author: ketiltrout
Date: 2010-10-21 02:36:58 +0000 (Thu, 21 Oct 2010)
Log Message:
-----------
Middle-ended ARM fixes (including the introduction of GD_NOT_ARM_ENDIAN).
Modified Paths:
--------------
trunk/getdata/ChangeLog
trunk/getdata/NEWS
trunk/getdata/bindings/cxx/test/big_test.cpp
trunk/getdata/bindings/f77/test/big_test.f
trunk/getdata/bindings/f77/test/big_test95.f90
trunk/getdata/bindings/idl/test/big_test.pro
trunk/getdata/bindings/make_parameters.c
trunk/getdata/bindings/python/test/big_test.py
trunk/getdata/man/dirfile-format.5
trunk/getdata/man/gd_alter_endianness.3.in
trunk/getdata/man/gd_cbopen.3
trunk/getdata/man/gd_endianness.3
trunk/getdata/src/endian.c
trunk/getdata/src/errors.c
trunk/getdata/src/flush.c
trunk/getdata/src/getdata.c
trunk/getdata/src/getdata.h.in
trunk/getdata/src/internal.h
trunk/getdata/src/move.c
trunk/getdata/src/open.c
trunk/getdata/src/parse.c
trunk/getdata/src/putdata.c
trunk/getdata/test/endian_get.c
Modified: trunk/getdata/ChangeLog
===================================================================
--- trunk/getdata/ChangeLog 2010-10-20 01:03:29 UTC (rev 459)
+++ trunk/getdata/ChangeLog 2010-10-21 02:36:58 UTC (rev 460)
@@ -1,3 +1,26 @@
+2010-10-21 D. V. Wiebe <ge...@ke...> svn:460
+ * test/endian_get.c: Test ARM endianness.
+ * bindings/python/test/big_test.py bindings/cxx/test/big_test.cpp
+ bindings/f77/test/big_test.f bindings/f77/test/big_test95.f90
+ bindings/idl/test/big_test.pro: Fix test 79 on middle-ended platforms.
+
+ * src/getdata.h.in: Added GD_NOT_ARM_ENDIAN and conditionally figure out
+ whether it or GD_ARM_ENDIAN should be zero.
+ * bindings/make_parameters.c: Added GD_NOT_ARM_ENDIAN.
+ * src/internal.h: compute GD_ARM_FLAG.
+ * src/endian.c (_GD_ByteSwapFragment) src/open.c (gd_cbopen) src/getdata.c
+ (_GD_DoRaw) src/flush.c (_GD_FlushFragment) src/putdata.c (_GD_DoRawOut)
+ src/parse.c (_GD_ParseDirective): Fix handling of ARM flag.
+ * src/move.c (_GD_MogrifyFile): Only apply the ARM fix to double precision
+ data. Also fixed the count in byte swapping calls.
+
+ * src/flush.c (_GD_FindVersion): Fix logic for ARM endianness. Fix ordering
+ of fragment metadata tests.
+
+ * src/flush.c (_GD_FindVersion) src/errors.c: Better script for
+ GD_E_BAD_VERSION. Differentiate between a non-conformant dirfile and an
+ invalid version number.
+
2010-10-20 D. V. Wiebe <ge...@ke...> svn:459
* test/version_5.c: Fix for WORDS_BIGENDIAN.
Modified: trunk/getdata/NEWS
===================================================================
--- trunk/getdata/NEWS 2010-10-20 01:03:29 UTC (rev 459)
+++ trunk/getdata/NEWS 2010-10-21 02:36:58 UTC (rev 460)
@@ -113,6 +113,11 @@
dirfile. Primarily useful to callers as a "null dirfile" placeholder.
* GD_E_OPEN_INCLUDE has been renamed to GD_E_OPEN_FRAGMENT, but the former
symbol remains as an alias.
+ * Two new bitflags to gd_cbopen and gd_open: GD_ARM_ENDIAN and
+ GD_NOT_ARM_ENDIAN allow specifying the default ordering of double precision
+ data. These flags may also be used with gd_alter_endianness() and will be
+ returned by gd_endianness(). On all platforms except for middle-endian
+ ARMs, GD_NOT_ARM_ENDIAN equals zero and may be omitted.
* Where gd_flush() and gd_metaflush() in the past raised GD_E_OPEN_INCLUDE
on I/O error, they now raise the new GD_FLUSH.
* All functions now raise GD_E_DIMENSION when encountering a scalar field
Modified: trunk/getdata/bindings/cxx/test/big_test.cpp
===================================================================
--- trunk/getdata/bindings/cxx/test/big_test.cpp 2010-10-20 01:03:29 UTC (rev 459)
+++ trunk/getdata/bindings/cxx/test/big_test.cpp 2010-10-21 02:36:58 UTC (rev 460)
@@ -896,7 +896,7 @@
CHECK_INT(78,frag->Encoding(),RawEncoding);
// 79: Fragment::Endianness check
- CHECK_INT(79,frag->Endianness(),GD_LITTLE_ENDIAN);
+ CHECK_INT(79,frag->Endianness(),GD_LITTLE_ENDIAN | GD_NOT_ARM_ENDIAN);
// 80: Dirfile::Name check
str = d->Name();
Modified: trunk/getdata/bindings/f77/test/big_test.f
===================================================================
--- trunk/getdata/bindings/f77/test/big_test.f 2010-10-20 01:03:29 UTC (rev 459)
+++ trunk/getdata/bindings/f77/test/big_test.f 2010-10-21 02:36:58 UTC (rev 460)
@@ -2601,7 +2601,7 @@
WRITE(*, 2001) 79, e
ENDIF
- IF (n .NE. GD_LE) THEN
+ IF (n .NE. (GD_LE + GD_NA)) THEN
ne = ne + 1
WRITE(*, 2002) 79, n
ENDIF
Modified: trunk/getdata/bindings/f77/test/big_test95.f90
===================================================================
--- trunk/getdata/bindings/f77/test/big_test95.f90 2010-10-20 01:03:29 UTC (rev 459)
+++ trunk/getdata/bindings/f77/test/big_test95.f90 2010-10-21 02:36:58 UTC (rev 460)
@@ -3314,7 +3314,7 @@
write(*, 2001) 79, e
end if
- if (n .ne. GD_LITTLE_ENDIAN) then
+ if (n .ne. (GD_LITTLE_ENDIAN + GD_NOT_ARM_ENDIAN)) then
ne = ne + 1
write(*, 2002) 79, n
end if
Modified: trunk/getdata/bindings/idl/test/big_test.pro
===================================================================
--- trunk/getdata/bindings/idl/test/big_test.pro 2010-10-20 01:03:29 UTC (rev 459)
+++ trunk/getdata/bindings/idl/test/big_test.pro 2010-10-21 02:36:58 UTC (rev 460)
@@ -792,7 +792,7 @@
; 79: gd_endianness
n = gd_endianness(d, fragment=0)
nume += check_ok(79, d)
-nume += check_simple(79, n, !GD.LITTLE_ENDIAN)
+nume += check_simple(79, n, (!GD.LITTLE_ENDIAN + !GD.NOT_ARM_ENDIAN))
; 80: dirfilename
n = gd_dirfilename(d)
Modified: trunk/getdata/bindings/make_parameters.c
===================================================================
--- trunk/getdata/bindings/make_parameters.c 2010-10-20 01:03:29 UTC (rev 459)
+++ trunk/getdata/bindings/make_parameters.c 2010-10-21 02:36:58 UTC (rev 460)
@@ -88,6 +88,7 @@
CONSTANT(IGNORE_REFS, "GD_IR", 1),
CONSTANT(PRETTY_PRINT, "GD_PP", 1),
CONSTANT(ARM_ENDIAN, "GD_AE", 1),
+ CONSTANT(NOT_ARM_ENDIAN, "GD_NA", 1),
CONSTANT(PERMISSIVE, "GD_PM", 1),
CONSTANT(AUTO_ENCODED, "GD_EA", 1),
Modified: trunk/getdata/bindings/python/test/big_test.py
===================================================================
--- trunk/getdata/bindings/python/test/big_test.py 2010-10-20 01:03:29 UTC (rev 459)
+++ trunk/getdata/bindings/python/test/big_test.py 2010-10-21 02:36:58 UTC (rev 460)
@@ -990,7 +990,8 @@
# 79: endianness check
try:
- CheckSimple(79,f.endianness,pygetdata.LITTLE_ENDIAN)
+ CheckSimple(79,f.endianness,pygetdata.LITTLE_ENDIAN |
+ pygetdata.NOT_ARM_ENDIAN)
except:
CheckOK(79)
Modified: trunk/getdata/man/dirfile-format.5
===================================================================
--- trunk/getdata/man/dirfile-format.5 2010-10-20 01:03:29 UTC (rev 459)
+++ trunk/getdata/man/dirfile-format.5 2010-10-21 02:36:58 UTC (rev 460)
@@ -13,7 +13,7 @@
.\" Texts. A copy of the license is included in the `COPYING.DOC' file
.\" as part of this distribution.
.\"
-.TH dirfile\-format 5 "15 October 2010" "Standards Version 8" "DATA FORMATS"
+.TH dirfile\-format 5 "21 October 2010" "Standards Version 8" "DATA FORMATS"
.SH NAME
dirfile\-format \(em the dirfile database format specification file
.SH DESCRIPTION
@@ -943,7 +943,7 @@
This document describes Version 8 of the Dirfile Standards.
-Version 8 of the Standards (August 2010) added the
+Version 8 of the Standards (October 2010) added the
.B DIVIDE
and
.B RECIP
Modified: trunk/getdata/man/gd_alter_endianness.3.in
===================================================================
--- trunk/getdata/man/gd_alter_endianness.3.in 2010-10-20 01:03:29 UTC (rev 459)
+++ trunk/getdata/man/gd_alter_endianness.3.in 2010-10-21 02:36:58 UTC (rev 460)
@@ -15,7 +15,7 @@
.\" Texts. A copy of the license is included in the `COPYING.DOC' file
.\" as part of this distribution.
.\"
-.TH gd_alter_endianness 3 "20 July 2010" "Version 0.7.0" "GETDATA"
+.TH gd_alter_endianness 3 "21 October 2010" "Version 0.7.0" "GETDATA"
.SH NAME
gd_alter_endianness \(em modify the byte sex of fields in a dirfile
.SH SYNOPSIS
@@ -23,7 +23,7 @@
.HP
.nh
.ad l
-.BI "int gd_alter_endianness(DIRFILE *" dirfile ", unsigned int"
+.BI "int gd_alter_endianness(DIRFILE *" dirfile ", unsigned long"
.IB byte_sex ", int " fragment_index ", int " recode );
.hy
.ad n
@@ -65,6 +65,8 @@
Furthermore, any of these may be bitwise or'd
with
.B GD_ARM_ENDIAN
+or
+.B GD_NOT_ARM_ENDIAN
indicating that the floating point data are stored in the ARM middle-endian
format.
.P
Modified: trunk/getdata/man/gd_cbopen.3
===================================================================
--- trunk/getdata/man/gd_cbopen.3 2010-10-20 01:03:29 UTC (rev 459)
+++ trunk/getdata/man/gd_cbopen.3 2010-10-21 02:36:58 UTC (rev 460)
@@ -13,7 +13,7 @@
.\" Texts. A copy of the license is included in the `COPYING.DOC' file
.\" as part of this distribution.
.\"
-.TH gd_cbopen 3 "20 October 2010" "Version 0.7.0" "GETDATA"
+.TH gd_cbopen 3 "21 October 2010" "Version 0.7.0" "GETDATA"
.SH NAME
gd_cbopen, gd_open \(em open or create a dirfile
.SH SYNOPSIS
@@ -68,27 +68,49 @@
.BR GD_RDWR
(read-write), and may also contain zero or more of the following flags,
bitwise-or'd together:
+.P
+.B GD_ARM_ENDIAN
+.PD 0
.TP
-.B GD_ARM_ENDIAN
-Specifies that double precision floating point raw data on disk is stored in the
-middle-endian format used by older ARM processors.
+.PD
+.B GD_NOT_ARM_ENDIAN
+Specifies that double precision floating point raw data on disk is, or is not,
+stored in the middle-endian format used by older ARM processors.
-This flag is only honoured if no
-.B ENDIAN
-directive occurs in the dirfile format specification, unless
+These flag are only set the default endianness, and will be overridden when an
+.B /ENDIAN
+directive specifies the byte sex of
+.B RAW
+fields, unless
.B GD_FORCE_ENDIAN
is also specified.
+
+On every platform, one of these flags
+.RB ( GD_NOT_ARM_ENDIAN
+on all but middle-ended ARM systems)
+indicates the native behaviour of the platform. That symbol will equal zero,
+and may be omitted.
+.P
+.B GD_BIG_ENDIAN
+.PD 0
.TP
-.B GD_BIG_ENDIAN
-Specifies that raw data on disk is stored as big-endian data (most significant
-byte first). Specifying this flag along with the contradictory
-.BR GD_LITTLE_ENDIAN
-will cause the library to assume that the endianness of the data is opposite to
-that of the native architecture.
+.PD
+.B GD_LITTLE_ENDIAN
+Specifies the default byte sex of raw data stored on disk to be either
+big-endian (most significant byte first) or little-endian (least significant
+byte first). Omitting both flags indicates the default should be the native
+endianness of the platform.
-This flag is only honoured if no
-.B ENDIAN
-directive occurs in the dirfile format specification, unless
+Unlike the ARM endianness flags above, neither of these symbols is ever zero.
+Specifying both these flags together will cause the library to assume that the
+endianness of the data is opposite to that of the native architecture, whatever
+that might be.
+
+These flag are only set the default endianness, and will be overridden when an
+.B /ENDIAN
+directive specifies the byte sex of
+.B RAW
+fields, unless
.B GD_FORCE_ENDIAN
is also specified.
.TP
@@ -126,7 +148,7 @@
.TP
.B GD_FORCE_ENCODING
Specifies that
-.B ENCODING
+.B /ENCODING
directives (see
.BR dirfile-format (5))
found in the dirfile format specification should be ignored. The encoding scheme
@@ -136,15 +158,15 @@
.TP
.B GD_FORCE_ENDIAN
Specifies that
-.B ENDIAN
+.B /ENDIAN
directives (see
.BR dirfile-format (5))
-found in the dirfile format specification should be ignored. When specified
-with one or more of
-.BR GD_ARM_ENDIAN ,\~ GD_BIG_ENDIAN " or " GD_LITTLE_ENDIAN ,
-the specified endianness will be assumed. If this flag is specified with
-none of those flags, the dirfile will be assumed to have the endianness of
-the native architecture.
+found in the dirfile format specification should be ignored. All raw data will
+be assumed to have the byte sex indicated through the presence or absense of the
+.BR GD_ARM_ENDIAN ,\~ GD_BIG_ENDIAN ,\~ GD_LITTLE_ENDIAN ,
+and
+.B GD_NOT_ARM_ENDIAN
+flags.
.TP
.B GD_IGNORE_DUPS
If the dirfile format metadata specifies more than one field with the same name,
@@ -161,19 +183,6 @@
.B GD_E_FORMAT_DUPLICATE
suberrors itself with an appropriate callback function.
.TP
-.B GD_LITTLE_ENDIAN
-Specifies that raw data on disk is stored as little-endian data (least
-significant byte first). Specifying this flag along with the contradictory
-.BR GD_BIG_ENDIAN
-will cause the library to assume that the endianness of the data is opposite to
-that of the native architecture.
-
-This flag is only honoured if no
-.B ENDIAN
-directive occurs in the dirfile format specification, unless
-.B GD_FORCE_ENDIAN
-is also specified.
-.TP
.B GD_PEDANTIC
Reject dirfiles which don't conform to the Dirfile Standards. See the
.B Standards Compliance
@@ -443,7 +452,7 @@
.TP
.B GD_E_FORMAT_ENDIAN
The byte sex specified by an
-.B ENDIAN
+.B /ENDIAN
directive was unrecognised.
.TP
.B GD_E_FORMAT_LITERAL
Modified: trunk/getdata/man/gd_endianness.3
===================================================================
--- trunk/getdata/man/gd_endianness.3 2010-10-20 01:03:29 UTC (rev 459)
+++ trunk/getdata/man/gd_endianness.3 2010-10-21 02:36:58 UTC (rev 460)
@@ -49,11 +49,13 @@
.BR gd_endianness ()
returns the byte sex of the specified fragment, which will be either
.BR GD_BIG_ENDIAN " or " GD_LITTLE_ENDIAN ,
-possibly bitwise-or'd with
-.BR GD_ARM_ENDIAN ,
-if floating point data in this fragment are stored in the old ARM middle-endian
-format. On error, it returns zero and sets the dirfile error to a non-zero
-error value. Possible error values are:
+bitwise-or'd with either
+.B GD_ARM_ENDIAN
+or
+.BR GD_NOT_ARM_ENDIAN ,
+indicating whether double-precision floating point data in this fragment are
+stored in the old ARM middle-endian format. On error, it returns zero and
+sets the dirfile error to a non-zero error value. Possible error values are:
.TP 8
.B GD_E_BAD_DIRFILE
The supplied dirfile was invalid.
Modified: trunk/getdata/src/endian.c
===================================================================
--- trunk/getdata/src/endian.c 2010-10-20 01:03:29 UTC (rev 459)
+++ trunk/getdata/src/endian.c 2010-10-21 02:36:58 UTC (rev 460)
@@ -39,7 +39,7 @@
#else
(byte_sex & GD_BIG_ENDIAN) ? GD_BIG_ENDIAN : GD_LITTLE_ENDIAN
#endif
- ) | (byte_sex & GD_ARM_ENDIAN);
+ ) | (byte_sex & GD_ARM_FLAG);
/* check protection */
if (D->fragment[fragment].protection & GD_PROTECT_FORMAT) {
Modified: trunk/getdata/src/errors.c
===================================================================
--- trunk/getdata/src/errors.c 2010-10-20 01:03:29 UTC (rev 459)
+++ trunk/getdata/src/errors.c 2010-10-21 02:36:58 UTC (rev 460)
@@ -177,7 +177,10 @@
{ GD_E_BAD_REPR, GD_E_REPR_PUT, "Unable to write to field reprentation: .{4}",
0 },
/* GD_E_BAD_VERSION 3 = version */
- { GD_E_BAD_VERSION, 0, "Bad version specified: {3}", 0 },
+ { GD_E_BAD_VERSION, GD_E_VERS_NONE,
+ "Dirfile conforms to no Standards Version", 0 },
+ { GD_E_BAD_VERSION, GD_E_VERS_MISSING,
+ "Dirfile does not conform to Standards Version {3}", 0 },
/* GD_E_FLUSH: 3 = suberror, 4 = filename */
{ GD_E_FLUSH, GD_E_FLUSH_MKTMP, "I/O error creating temporary file: ", 1 },
{ GD_E_FLUSH, GD_E_FLUSH_OPEN, "I/O error opening temporary file: ", 1 },
Modified: trunk/getdata/src/flush.c
===================================================================
--- trunk/getdata/src/flush.c 2010-10-20 01:03:29 UTC (rev 459)
+++ trunk/getdata/src/flush.c 2010-10-21 02:36:58 UTC (rev 460)
@@ -479,7 +479,8 @@
fprintf(stream, "/ENDIAN %s%s\n",
(D->fragment[i].byte_sex & GD_LITTLE_ENDIAN) ? "little" : "big",
((permissive || D->standards >= 8) &&
- D->fragment[i].byte_sex & GD_ARM_ENDIAN) ? " arm" : "");
+ (D->fragment[i].byte_sex & GD_ARM_FLAG) == GD_ARM_ENDIAN) ? " arm" :
+ "");
if (permissive || D->standards >= 6) {
if (D->fragment[i].protection == GD_PROTECT_NONE)
@@ -712,20 +713,30 @@
D->av &= GD_VERS_GE_3;
for (i = 0; D->av && i < (unsigned int)D->n_fragment; ++i) {
- if (D->fragment[i].frame_offset > 0)
- D->av &= GD_VERS_GE_1;
- else if (D->fragment[i].byte_sex !=
-#ifdef WORDS_BIGENDIAN
- GD_BIG_ENDIAN
+ /* on an arm-endian platform, the arm flag is set by /ENDIAN directives
+ * missing an "arm" token, but it's absense might mean either an "arm"
+ * token was present, or else there was no /ENDIAN directive at all */
+ if (D->fragment[i].byte_sex & GD_ARM_FLAG)
+#if ARM_ENDIAN_DOUBLES
+ D->av &= GD_VERS_GE_5;
#else
+ D->av &= GD_VERS_GE_8;
+ else
+#endif
+ if ((D->fragment[i].encoding != GD_UNENCODED &&
+ D->fragment[i].encoding != GD_AUTO_ENCODED) ||
+ D->fragment[i].protection)
+ D->av &= GD_VERS_GE_6;
+ else if (D->fragment[i].byte_sex &
+#if WORDS_BIGENDIAN
GD_LITTLE_ENDIAN
+#else
+ GD_BIG_ENDIAN
#endif
)
D->av &= GD_VERS_GE_5;
- else if ((D->fragment[i].encoding != GD_UNENCODED &&
- D->fragment[i].encoding != GD_AUTO_ENCODED) ||
- D->fragment[i].protection)
- D->av &= GD_VERS_GE_6;
+ else if (D->fragment[i].frame_offset > 0)
+ D->av &= GD_VERS_GE_1;
}
for (i = 0; D->av && i < D->n_entries; ++i) {
@@ -884,7 +895,8 @@
if (vers < 0 || vers > GD_DIRFILE_STANDARDS_VERSION ||
~D->av & (1ULL << vers))
{
- _GD_SetError(D, GD_E_BAD_VERSION, 0, NULL, vers, NULL);
+ _GD_SetError(D, GD_E_BAD_VERSION, (D->av == 0) ? GD_E_VERS_NONE :
+ GD_E_VERS_MISSING, NULL, vers, NULL);
dreturn("%i", -1);
return -1;
}
Modified: trunk/getdata/src/getdata.c
===================================================================
--- trunk/getdata/src/getdata.c 2010-10-20 01:03:29 UTC (rev 459)
+++ trunk/getdata/src/getdata.c 2010-10-21 02:36:58 UTC (rev 460)
@@ -332,10 +332,7 @@
/* convert to/from middle-ended doubles */
if ((E->EN(raw,data_type) == GD_FLOAT64 ||
E->EN(raw,data_type) == GD_COMPLEX128) &&
-#ifdef ARM_ENDIAN_DOUBLES
- ~
-#endif
- D->fragment[E->fragment_index].byte_sex & GD_ARM_ENDIAN)
+ D->fragment[E->fragment_index].byte_sex & GD_ARM_FLAG)
{
_GD_ArmEndianise((uint64_t *)(databuffer + n_read * E->e->EN(raw,size)),
E->EN(raw,data_type) & GD_COMPLEX, samples_read);
Modified: trunk/getdata/src/getdata.h.in
===================================================================
--- trunk/getdata/src/getdata.h.in 2010-10-20 01:03:29 UTC (rev 459)
+++ trunk/getdata/src/getdata.h.in 2010-10-21 02:36:58 UTC (rev 460)
@@ -355,7 +355,15 @@
#define GD_IGNORE_REFS 0x00000800 /* ignore REFERENCE directives --
dirfile_include only */
#define GD_PRETTY_PRINT 0x00001000 /* make a nicer looking format file */
-#define GD_ARM_ENDIAN 0x00002000 /* ARM-endian doubles */
+
+#if (defined __arm__ && !(defined __VFP_FP__ || defined __MAVERICK__))
+# define GD_ARM_ENDIAN 0x00000000 /* ARM-endian doubles */
+# define GD_NOT_ARM_ENDIAN 0x00002000 /* "normal"-endian doubles */
+#else
+# define GD_ARM_ENDIAN 0x00002000 /* ARM-endian doubles */
+# define GD_NOT_ARM_ENDIAN 0x00000000 /* "normal"-endian doubles */
+#endif
+
#define GD_PERMISSIVE 0x00004000 /* be permissive */
#define GD_ENCODING 0x0F000000 /* mask */
Modified: trunk/getdata/src/internal.h
===================================================================
--- trunk/getdata/src/internal.h 2010-10-20 01:03:29 UTC (rev 459)
+++ trunk/getdata/src/internal.h 2010-10-21 02:36:58 UTC (rev 460)
@@ -101,6 +101,8 @@
# include <io.h>
#endif
+#define GD_ARM_FLAG (GD_ARM_ENDIAN | GD_NOT_ARM_ENDIAN)
+
/* Type conventions:
*
* - samples per frame is always gd_spf_t (aka uin16_t)
@@ -334,6 +336,9 @@
#define GD_E_FLUSH_OPEN 2
#define GD_E_FLUSH_RENAME 3
+#define GD_E_VERS_NONE 1
+#define GD_E_VERS_MISSING 2
+
struct _gd_raw_file {
char* name;
int fp;
Modified: trunk/getdata/src/move.c
===================================================================
--- trunk/getdata/src/move.c 2010-10-20 01:03:29 UTC (rev 459)
+++ trunk/getdata/src/move.c 2010-10-21 02:36:58 UTC (rev 460)
@@ -99,8 +99,10 @@
enc_in = _gd_ef + E->e->EN(raw,file)[0].encoding;
/* Need to do the ARM thing? */
- arm_endianise = ((byte_sex & GD_ARM_ENDIAN) && enc_out->ecor) ^
- ((D->fragment[E->fragment_index].byte_sex & GD_ARM_ENDIAN) && enc_in->ecor);
+ arm_endianise = (((byte_sex & GD_ARM_FLAG) && enc_out->ecor) ^
+ ((D->fragment[E->fragment_index].byte_sex & GD_ARM_FLAG) && enc_in->ecor))
+ && (E->EN(raw,data_type) == GD_FLOAT64 ||
+ E->EN(raw,data_type) == GD_COMPLEX128);
/* Normalise endiannesses */
#ifdef WORDS_BIGENDIAN
@@ -216,14 +218,14 @@
/* fix army-ness, if required */
if (arm_endianise)
_GD_ArmEndianise((uint64_t *)buffer, E->EN(raw,data_type) & GD_COMPLEX,
- ns);
+ nread);
/* swap endianness, if required */
if (byte_sex) {
if (E->EN(raw,data_type) & GD_COMPLEX)
- _GD_FixEndianness((char *)buffer, E->e->EN(raw,size) / 2, ns * 2);
+ _GD_FixEndianness((char *)buffer, E->e->EN(raw,size) / 2, nread * 2);
else
- _GD_FixEndianness((char *)buffer, E->e->EN(raw,size), ns);
+ _GD_FixEndianness((char *)buffer, E->e->EN(raw,size), nread);
}
nwrote = (*enc_out->write)(E->e->EN(raw,file) + 1, buffer,
Modified: trunk/getdata/src/open.c
===================================================================
--- trunk/getdata/src/open.c 2010-10-20 01:03:29 UTC (rev 459)
+++ trunk/getdata/src/open.c 2010-10-21 02:36:58 UTC (rev 460)
@@ -311,7 +311,7 @@
#else
(D->flags & GD_BIG_ENDIAN) ? GD_BIG_ENDIAN : GD_LITTLE_ENDIAN
#endif
- ) | (D->flags & GD_ARM_ENDIAN);
+ ) | (D->flags & GD_ARM_FLAG);
D->fragment[0].ref_name = NULL;
D->fragment[0].frame_offset = 0;
D->fragment[0].protection = GD_PROTECT_NONE;
Modified: trunk/getdata/src/parse.c
===================================================================
--- trunk/getdata/src/parse.c 2010-10-20 01:03:29 UTC (rev 459)
+++ trunk/getdata/src/parse.c 2010-10-21 02:36:58 UTC (rev 460)
@@ -1515,13 +1515,19 @@
else
_GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_ENDIAN,
D->fragment[me].cname, linenum, NULL);
- if (n_cols > 2) {
- if (strcmp(in_cols[2], "arm") == 0)
- D->fragment[me].byte_sex |= GD_ARM_ENDIAN;
- else
+ if (n_cols > 2 && (!pedantic || *standards >= 8)) {
+ if (strcmp(in_cols[2], "arm") == 0) {
+#if ! ARM_ENDIAN_DOUBLES
+ D->fragment[me].byte_sex |= GD_ARM_FLAG;
+#endif
+ } else
_GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_ENDIAN,
D->fragment[me].cname, linenum, NULL);
}
+#if ARM_ENDIAN_DOUBLES
+ else
+ D->fragment[me].byte_sex |= GD_ARM_FLAG;
+#endif
}
} else if (strcmp(ptr, "FRAMEOFFSET") == 0 && (!pedantic || *standards >= 1))
D->fragment[me].frame_offset = strtoll(in_cols[1], NULL, 10);
Modified: trunk/getdata/src/putdata.c
===================================================================
--- trunk/getdata/src/putdata.c 2010-10-20 01:03:29 UTC (rev 459)
+++ trunk/getdata/src/putdata.c 2010-10-21 02:36:58 UTC (rev 460)
@@ -78,10 +78,7 @@
/* convert to/from middle-ended doubles */
if ((E->EN(raw,data_type) == GD_FLOAT64 || E->EN(raw,data_type) ==
GD_COMPLEX128) &&
-#ifdef ARM_ENDIAN_DOUBLES
- ~
-#endif
- D->fragment[E->fragment_index].byte_sex & GD_ARM_ENDIAN)
+ D->fragment[E->fragment_index].byte_sex & GD_ARM_FLAG)
{
_GD_ArmEndianise((uint64_t*)databuffer, E->EN(raw,data_type) & GD_COMPLEX,
ns);
Modified: trunk/getdata/test/endian_get.c
===================================================================
--- trunk/getdata/test/endian_get.c 2010-10-20 01:03:29 UTC (rev 459)
+++ trunk/getdata/test/endian_get.c 2010-10-21 02:36:58 UTC (rev 460)
@@ -16,8 +16,12 @@
const char* filedir = __TEST__ "dirfile";
const char* format = __TEST__ "dirfile/format";
const char* format1 = __TEST__ "dirfile/format1";
+ const char* format2 = __TEST__ "dirfile/format2";
+ const char* format3 = __TEST__ "dirfile/format3";
const char* format_data = "ENDIAN little\nINCLUDE format1\n";
- const char* format_data1 = "ENDIAN big\n";
+ const char* format_data1 = "ENDIAN big\nINCLUDE format2\n";
+ const char* format_data2 = "ENDIAN big arm\nINCLUDE format3\n";
+ const char* format_data3 = "ENDIAN little arm\n";
int fd, r = 0;
mkdir(filedir, 0777);
@@ -30,20 +34,34 @@
write(fd, format_data1, strlen(format_data1));
close(fd);
+ fd = open(format2, O_CREAT | O_EXCL | O_WRONLY, 0666);
+ write(fd, format_data2, strlen(format_data2));
+ close(fd);
+
+ fd = open(format3, O_CREAT | O_EXCL | O_WRONLY, 0666);
+ write(fd, format_data3, strlen(format_data3));
+ close(fd);
+
DIRFILE* D = gd_open(filedir, GD_RDONLY | GD_VERBOSE);
unsigned long n = gd_endianness(D, 0);
unsigned long m = gd_endianness(D, 1);
+ unsigned long l = gd_endianness(D, 2);
+ unsigned long k = gd_endianness(D, 3);
int error = gd_error(D);
gd_close(D);
unlink(format);
unlink(format1);
+ unlink(format2);
+ unlink(format3);
rmdir(filedir);
CHECKI(error, 0);
- CHECKX(n, GD_LITTLE_ENDIAN);
- CHECKX(m, GD_BIG_ENDIAN);
+ CHECKX(n, GD_LITTLE_ENDIAN | GD_NOT_ARM_ENDIAN);
+ CHECKX(m, GD_BIG_ENDIAN | GD_NOT_ARM_ENDIAN);
+ CHECKX(l, GD_BIG_ENDIAN | GD_ARM_ENDIAN);
+ CHECKX(k, GD_LITTLE_ENDIAN | GD_ARM_ENDIAN);
return r;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ket...@us...> - 2010-10-20 01:03:35
|
Revision: 459
http://getdata.svn.sourceforge.net/getdata/?rev=459&view=rev
Author: ketiltrout
Date: 2010-10-20 01:03:29 +0000 (Wed, 20 Oct 2010)
Log Message:
-----------
Big-endian fixes.
Modified Paths:
--------------
trunk/getdata/ChangeLog
trunk/getdata/NEWS
trunk/getdata/man/gd_cbopen.3
trunk/getdata/man/gd_close.3
trunk/getdata/man/gd_invalid_dirfile.3
trunk/getdata/src/flush.c
trunk/getdata/src/getdata.c
trunk/getdata/src/putdata.c
trunk/getdata/test/version_5.c
Modified: trunk/getdata/ChangeLog
===================================================================
--- trunk/getdata/ChangeLog 2010-10-19 20:39:45 UTC (rev 458)
+++ trunk/getdata/ChangeLog 2010-10-20 01:03:29 UTC (rev 459)
@@ -1,3 +1,11 @@
+2010-10-20 D. V. Wiebe <ge...@ke...> svn:459
+ * test/version_5.c: Fix for WORDS_BIGENDIAN.
+
+ * src/getdata.c (_GD_DoRaw) src/putdata.c (_GD_DoRawOut): Fix
+ _GD_FixEndianness test.
+
+ * src/flush.c (_GD_FindVersion): Native byte sex is assumed in early versions.
+
2010-10-19 D. V. Wiebe <ge...@ke...> svn:457
* legacy.c (_GD_GetDirfile): On error, set *error_code (now passed as a
parameter), copy the error, discard the bad dirfile, and return NULL.
Modified: trunk/getdata/NEWS
===================================================================
--- trunk/getdata/NEWS 2010-10-19 20:39:45 UTC (rev 458)
+++ trunk/getdata/NEWS 2010-10-20 01:03:29 UTC (rev 459)
@@ -38,8 +38,10 @@
* Since Standards Versions 4 and earlier were never codified, we've made some
assumptions as to their behaviour in certain undocumented situtations. Most
noticably, they still prohibit ASCII control codes (bytes < 0x20) and '/'
- in field names.
- * Every Dirfile object now complies to a particular Standards Version, which
+ in field names. We also assume these dirfiles have native byte sex, even
+ though some early Standards Version implied only little-ended data was
+ acceptable.
+ * Every Dirfile object now records its current Standards Version, which
affects functions such as gd_add_spec(). The Version will start out as the
value of the last /VERSION directive encountered by the parser, or else the
latest compliant Standards Version. It can be changed (see below).
@@ -60,8 +62,9 @@
* BUG FIX: Using a complex valued vector as the second input field in a
MULTIPLY wouldn't result in the field being internally flagged as complex,
leading to loss of the imaginary part in certain situtaitons.
- * BUG FIX: Trying to write to a LINTERP which isn't monotonic now results in
- error. Previously, this was allowed, with arbitrary data stored to disk.
+ * BUG FIX: Trying to write to a LINTERP via a table which isn't monotonic now
+ results in error. Previously, this was allowed, with arbitrary data stored
+ to disk.
API Changes
Modified: trunk/getdata/man/gd_cbopen.3
===================================================================
--- trunk/getdata/man/gd_cbopen.3 2010-10-19 20:39:45 UTC (rev 458)
+++ trunk/getdata/man/gd_cbopen.3 2010-10-20 01:03:29 UTC (rev 459)
@@ -13,7 +13,7 @@
.\" Texts. A copy of the license is included in the `COPYING.DOC' file
.\" as part of this distribution.
.\"
-.TH gd_cbopen 3 "15 October 2010" "Version 0.7.0" "GETDATA"
+.TH gd_cbopen 3 "20 October 2010" "Version 0.7.0" "GETDATA"
.SH NAME
gd_cbopen, gd_open \(em open or create a dirfile
.SH SYNOPSIS
@@ -285,7 +285,7 @@
The latest Dirfile Standards Version which this release of GetData understands
is provided in the preprocessor macro
.B GD_DIRFILE_STANDARDS_VERSION
-defined in getdata.h. GetData is able to open and parse any Dirfile which
+defined in getdata.h. GetData is able to open and parse any dirfile which
conforms to this Standards Version, or to any earlier Version. The
.BR dirfile-format (5)
manual page lists the changes between Standards Versions.
@@ -306,7 +306,7 @@
mode.
.I Permissive
-mode is provided primarily to allow GetData to be used on Dirfiles which
+mode is provided primarily to allow GetData to be used on dirfiles which
conform to no single Standard, but which were accepted by the GetData parser
in previous versions. It is notably lax regarding reserved field names, and
field name characters, the mixing of old and new data type specifiers, and
@@ -611,8 +611,27 @@
.BR gd_error_string (3).
When finished with it, a caller should de-allocate the DIRFILE object by calling
.BR gd_close (3),
+or
+.BR gd_discard (3),
even if the open failed.
.SH BUGS
+When working with dirfiles conforming to Standards Versions 4 and earlier
+(before the introduction of the
+.B ENDIAN
+directive), GetData assumes the dirfile has native byte sex, even though,
+officially, these early Standards stipulated data to be little-endian. This is
+necessary since, in the absense of an explicit
+.B /VERSION
+directive, it is often impossible to determine the intended Standards Version of
+a dirfile, and the current behaviour is to assume native byte sex for modern
+dirfiles lacking
+.BR /ENDIAN .
+To read an old, little-ended dirfile on a big-ended platform, an
+.B /ENDIAN
+directive should be added to the format specification, or else
+.B GD_LITTLE_ENDIAN
+should be specified by the caller.
+
GetData's parser assumes it is running on an ASCII-compatible platform. Format
specification parsing will fail gloriously on an EBCDIC platform.
.SH SEE ALSO
@@ -621,6 +640,7 @@
.BR dirfile-format (5),
.BR gd_close (3),
.BR gd_dirfile_standards (3),
+.BR gd_discard (3),
.BR gd_error (3),
.BR gd_error_string (3),
.BR gd_getdata (3),
Modified: trunk/getdata/man/gd_close.3
===================================================================
--- trunk/getdata/man/gd_close.3 2010-10-19 20:39:45 UTC (rev 458)
+++ trunk/getdata/man/gd_close.3 2010-10-20 01:03:29 UTC (rev 459)
@@ -13,7 +13,7 @@
.\" Texts. A copy of the license is included in the `COPYING.DOC' file
.\" as part of this distribution.
.\"
-.TH gd_close 3 "15 October 2010" "Version 0.7.0" "GETDATA"
+.TH gd_close 3 "20 October 2010" "Version 0.7.0" "GETDATA"
.SH NAME
gd_close, gd_discard \(em close a dirfile and free associated memory.
.SH SYNOPSIS
@@ -57,9 +57,10 @@
behave identically.
One of these functions should be called on all pointers returned by
-.BR gd_cbopen (3)
+.BR gd_cbopen (3),
+.BR gd_open (3),
and
-.BR gd_open (3),
+.BR gd_invalid_dirfile (3),
even if the call to those function failed. After
.BR gd_close ()
or
@@ -73,7 +74,7 @@
object. See
.BR gd_dirfile_standards (3)
to change or report the current Standards Version. If the dirfile metadata
-conforms to no known Standards Version, a Standards non-compliant fragment will
+conforms to no known Standards Version, Standards non-compliant metadata will
be written.
.SH RETURN VALUE
.BR gd_close ()
@@ -107,4 +108,5 @@
.BR gd_error (3),
.BR gd_error_string (3),
.BR gd_flush (3),
+.BR gd_invalid_dirfile (3),
.BR gd_open (3)
Modified: trunk/getdata/man/gd_invalid_dirfile.3
===================================================================
--- trunk/getdata/man/gd_invalid_dirfile.3 2010-10-19 20:39:45 UTC (rev 458)
+++ trunk/getdata/man/gd_invalid_dirfile.3 2010-10-20 01:03:29 UTC (rev 459)
@@ -13,7 +13,7 @@
.\" Texts. A copy of the license is included in the `COPYING.DOC' file
.\" as part of this distribution.
.\"
-.TH gd_invalid_dirfile 3 "15 October 2010" "Version 0.7.0" "GETDATA"
+.TH gd_invalid_dirfile 3 "20 October 2010" "Version 0.7.0" "GETDATA"
.SH NAME
gd_invalid_dirfile \(em obtain an pointer to an invalid DIRFILE object
.SH SYNOPSIS
@@ -54,7 +54,7 @@
.in
.PP
which also returns a pointer to an invalid DIRFILE object. The difference
-is that an invalid DIRFILE created in this way has a non-zero Dirfile
+is that an invalid DIRFILE created in this way has a non-zero dirfile
error (obtainable with
.BR gd_error (3)),
while the dirfile error of the invalid DIRFILE returned by
@@ -68,4 +68,5 @@
.SH SEE ALSO
.BR gd_close (3),
.BR gd_discard (3),
+.BR gd_error (3),
.BR gd_open (3)
Modified: trunk/getdata/src/flush.c
===================================================================
--- trunk/getdata/src/flush.c 2010-10-19 20:39:45 UTC (rev 458)
+++ trunk/getdata/src/flush.c 2010-10-20 01:03:29 UTC (rev 459)
@@ -714,7 +714,13 @@
for (i = 0; D->av && i < (unsigned int)D->n_fragment; ++i) {
if (D->fragment[i].frame_offset > 0)
D->av &= GD_VERS_GE_1;
- else if (D->fragment[i].byte_sex != GD_LITTLE_ENDIAN)
+ else if (D->fragment[i].byte_sex !=
+#ifdef WORDS_BIGENDIAN
+ GD_BIG_ENDIAN
+#else
+ GD_LITTLE_ENDIAN
+#endif
+ )
D->av &= GD_VERS_GE_5;
else if ((D->fragment[i].encoding != GD_UNENCODED &&
D->fragment[i].encoding != GD_AUTO_ENCODED) ||
Modified: trunk/getdata/src/getdata.c
===================================================================
--- trunk/getdata/src/getdata.c 2010-10-19 20:39:45 UTC (rev 458)
+++ trunk/getdata/src/getdata.c 2010-10-20 01:03:29 UTC (rev 459)
@@ -341,7 +341,7 @@
E->EN(raw,data_type) & GD_COMPLEX, samples_read);
}
- if (D->fragment[E->fragment_index].byte_sex ==
+ if (D->fragment[E->fragment_index].byte_sex &
#ifdef WORDS_BIGENDIAN
GD_LITTLE_ENDIAN
#else
Modified: trunk/getdata/src/putdata.c
===================================================================
--- trunk/getdata/src/putdata.c 2010-10-19 20:39:45 UTC (rev 458)
+++ trunk/getdata/src/putdata.c 2010-10-20 01:03:29 UTC (rev 459)
@@ -87,7 +87,7 @@
ns);
}
- if (D->fragment[E->fragment_index].byte_sex ==
+ if (D->fragment[E->fragment_index].byte_sex &
#ifdef WORDS_BIGENDIAN
GD_LITTLE_ENDIAN
#else
Modified: trunk/getdata/test/version_5.c
===================================================================
--- trunk/getdata/test/version_5.c 2010-10-19 20:39:45 UTC (rev 458)
+++ trunk/getdata/test/version_5.c 2010-10-20 01:03:29 UTC (rev 459)
@@ -17,7 +17,11 @@
const char* data = __TEST__ "dirfile/a.r";
const char* format_data =
"/VERSION 5\n"
+#ifdef WORDS_BIGENDIAN
+ "/ENDIAN little\n"
+#else
"/ENDIAN big\n"
+#endif
"a.r RAW UINT8 8\n"
"ENCODING PHASE a.r 0\n";
uint16_t c[8];
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ket...@us...> - 2010-10-19 20:39:51
|
Revision: 458
http://getdata.svn.sourceforge.net/getdata/?rev=458&view=rev
Author: ketiltrout
Date: 2010-10-19 20:39:45 +0000 (Tue, 19 Oct 2010)
Log Message:
-----------
Fix type
Modified Paths:
--------------
trunk/getdata/bindings/python/pydirfile.c
Modified: trunk/getdata/bindings/python/pydirfile.c
===================================================================
--- trunk/getdata/bindings/python/pydirfile.c 2010-10-19 02:37:29 UTC (rev 457)
+++ trunk/getdata/bindings/python/pydirfile.c 2010-10-19 20:39:45 UTC (rev 458)
@@ -853,7 +853,7 @@
const char** fields;
char* keywords[] = { "parent", "type", NULL };
const char* parent = NULL;
- gd_type_t type = (int)GD_NO_ENTRY;
+ gd_entype_t type = GD_NO_ENTRY;
int i;
if (!PyArg_ParseTupleAndKeywords(args, keys,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ket...@us...> - 2010-10-19 02:37:36
|
Revision: 457
http://getdata.svn.sourceforge.net/getdata/?rev=457&view=rev
Author: ketiltrout
Date: 2010-10-19 02:37:29 +0000 (Tue, 19 Oct 2010)
Log Message:
-----------
Fix memory leak in Legacy API.
Modified Paths:
--------------
trunk/getdata/ChangeLog
trunk/getdata/NEWS
trunk/getdata/src/legacy.c
Modified: trunk/getdata/ChangeLog
===================================================================
--- trunk/getdata/ChangeLog 2010-10-18 22:31:37 UTC (rev 456)
+++ trunk/getdata/ChangeLog 2010-10-19 02:37:29 UTC (rev 457)
@@ -1,4 +1,8 @@
-2010-10-18 D. V. Wiebe <ge...@ke...> svn:455
+2010-10-19 D. V. Wiebe <ge...@ke...> svn:457
+ * legacy.c (_GD_GetDirfile): On error, set *error_code (now passed as a
+ parameter), copy the error, discard the bad dirfile, and return NULL.
+
+2010-10-18 D. V. Wiebe <ge...@ke...> svn:456
GetData-0.7.0rc2:
* encoding.c (_GD_ResolveSymbol _GD_MissingFramework): Fix types for
Modified: trunk/getdata/NEWS
===================================================================
--- trunk/getdata/NEWS 2010-10-18 22:31:37 UTC (rev 456)
+++ trunk/getdata/NEWS 2010-10-19 02:37:29 UTC (rev 457)
@@ -120,6 +120,14 @@
* BUG FIX: gd_metaflush() now fails and raises GD_E_ACCMODE if called on a
read-only dirfile
+ Legacy API Changes
+
+ * In the legacy format struct, DIVIDE fields are listed as MULTIPLYs and RECIP
+ fields are listed as LINCOMs, with the dividend stored in m[0].
+ * BUG FIX: In previous versions, attempting to access an invalid dirfile
+ (anything that would cause gd_open to fail) resulted in leaked memory. This
+ leak has been plugged.
+
Bindings
* C++: Const member functions are now flagged as such.
Modified: trunk/getdata/src/legacy.c
===================================================================
--- trunk/getdata/src/legacy.c 2010-10-18 22:31:37 UTC (rev 456)
+++ trunk/getdata/src/legacy.c 2010-10-19 02:37:29 UTC (rev 457)
@@ -114,7 +114,7 @@
/* _GD_GetDirfile: Locate the legacy DIRFILE given the filespec. This started
* life as GetFormat...
*/
-static DIRFILE* _GD_GetDirfile(const char *filename_in, int mode)
+static DIRFILE* _GD_GetDirfile(const char *filename_in, int mode, int *error_code)
{
unsigned int i_dirfile;
void *ptr;
@@ -134,7 +134,7 @@
if ((mode & GD_RDWR) && (_GD_Dirfiles.D[i_dirfile]->flags & GD_ACCMODE) ==
GD_RDONLY) {
/* close it */
- gd_close(_GD_Dirfiles.D[i_dirfile]);
+ gd_discard(_GD_Dirfiles.D[i_dirfile]);
/* copy the last dirfile in the list over top of this one and decrement
* the counter -- next realloc will do nothing */
@@ -150,29 +150,28 @@
/* if we get here, the file has not yet been read */
/* Allocate the memory, then fill. If we have an error, */
/* we will have to free the memory... */
- _GD_Dirfiles.n++;
- ptr = realloc(_GD_Dirfiles.D, _GD_Dirfiles.n * sizeof(DIRFILE*));
+ ptr = realloc(_GD_Dirfiles.D, (_GD_Dirfiles.n + 1) * sizeof(DIRFILE*));
if (ptr == NULL) {
- /* There's been a problem trying to create a new dirfile object, even an
- * invalid one. So, return the only one we're guaranteed to have... */
- _GD_GlobalErrors.error = GD_E_ALLOC;
- dreturn("%p", &_GD_GlobalErrors);
- return &_GD_GlobalErrors;
+ *error_code = _GD_GlobalErrors.error = GD_E_ALLOC;
+ dreturn("%p", NULL);
+ return NULL;
}
_GD_Dirfiles.D = (DIRFILE **)ptr;
/* Open a dirfile */
- _GD_Dirfiles.D[_GD_Dirfiles.n - 1] = gd_open(filedir, mode);
+ _GD_Dirfiles.D[_GD_Dirfiles.n] = gd_open(filedir, mode);
- /* Error encountered -- the dirfile will shortly be deleted */
- if (_GD_Dirfiles.D[_GD_Dirfiles.n - 1]->error != GD_E_OK) {
- dreturn("%p", _GD_Dirfiles.D[_GD_Dirfiles.n - 1]);
- return _GD_Dirfiles.D[--_GD_Dirfiles.n];
+ /* Error encountered -- clean up */
+ if (_GD_Dirfiles.D[_GD_Dirfiles.n]->error != GD_E_OK) {
+ *error_code = _GD_CopyGlobalError(_GD_Dirfiles.D[_GD_Dirfiles.n]);
+ gd_discard(_GD_Dirfiles.D[_GD_Dirfiles.n]);
+ dreturn("%p", NULL);
+ return NULL;
}
- dreturn("%p", _GD_Dirfiles.D[_GD_Dirfiles.n - 1]);
- return _GD_Dirfiles.D[_GD_Dirfiles.n - 1];
+ dreturn("%p", _GD_Dirfiles.D[_GD_Dirfiles.n]);
+ return _GD_Dirfiles.D[_GD_Dirfiles.n++];
}
static void CopyRawEntry(struct RawEntryType* R, gd_entry_t* E)
@@ -349,8 +348,6 @@
{
dtrace("\"%s\", %p", filedir, error_code);
- DIRFILE *D = _GD_GetDirfile(filedir, GD_RDONLY);
-
unsigned int i;
int nraw = 0;
@@ -360,8 +357,9 @@
int nbit = 0;
int nphase = 0;
- if (D->error) {
- *error_code = _GD_CopyGlobalError(D);
+ DIRFILE *D = _GD_GetDirfile(filedir, GD_RDONLY, error_code);
+
+ if (!D) {
dreturn("%p", NULL);
return NULL;
}
@@ -490,10 +488,9 @@
first_frame, first_samp, num_frames, num_samp, return_type, data_out,
error_code);
- D = _GD_GetDirfile(filename, GD_RDONLY);
+ D = _GD_GetDirfile(filename, GD_RDONLY, error_code);
- if (D->error) {
- *error_code = _GD_CopyGlobalError(D);
+ if (!D) {
dreturn("%i", 0);
return 0;
}
@@ -519,10 +516,9 @@
dtrace("\"%s\", %p, <unused>", filename, error_code);
- D = _GD_GetDirfile(filename, GD_RDONLY);
+ D = _GD_GetDirfile(filename, GD_RDONLY, error_code);
- if (D->error) {
- *error_code = _GD_CopyGlobalError(D);
+ if (!D) {
dreturn("%i", 0);
return 0;
}
@@ -543,10 +539,9 @@
dtrace("\"%s\", \"%s\", %p", filename, field_code, error_code);
- D = _GD_GetDirfile(filename, GD_RDONLY);
+ D = _GD_GetDirfile(filename, GD_RDONLY, error_code);
- if (D->error) {
- *error_code = _GD_CopyGlobalError(D);
+ if (!D) {
dreturn("%i", 0);
return 0;
}
@@ -571,10 +566,9 @@
first_frame, first_samp, num_frames, num_samp, data_type, data_in,
error_code);
- D = _GD_GetDirfile(filename, GD_RDWR | GD_UNENCODED);
+ D = _GD_GetDirfile(filename, GD_RDWR | GD_UNENCODED, error_code);
- if (D->error) {
- *error_code = _GD_CopyGlobalError(D);
+ if (!D) {
dreturn("%i", 0);
return 0;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ket...@us...> - 2010-10-18 22:31:46
|
Revision: 456
http://getdata.svn.sourceforge.net/getdata/?rev=456&view=rev
Author: ketiltrout
Date: 2010-10-18 22:31:37 +0000 (Mon, 18 Oct 2010)
Log Message:
-----------
0.7.0rc2: fix types in dlopen code.
Modified Paths:
--------------
trunk/getdata/ChangeLog
trunk/getdata/NEWS
trunk/getdata/configure.ac
trunk/getdata/src/encoding.c
Modified: trunk/getdata/ChangeLog
===================================================================
--- trunk/getdata/ChangeLog 2010-10-17 09:02:13 UTC (rev 455)
+++ trunk/getdata/ChangeLog 2010-10-18 22:31:37 UTC (rev 456)
@@ -1,3 +1,9 @@
+2010-10-18 D. V. Wiebe <ge...@ke...> svn:455
+ GetData-0.7.0rc2:
+
+ * encoding.c (_GD_ResolveSymbol _GD_MissingFramework): Fix types for
+ USE_MODULES.
+
2010-10-17 D. V. Wiebe <ge...@ke...> svn:455
GetData-0.7.0rc1:
Modified: trunk/getdata/NEWS
===================================================================
--- trunk/getdata/NEWS 2010-10-17 09:02:13 UTC (rev 455)
+++ trunk/getdata/NEWS 2010-10-18 22:31:37 UTC (rev 456)
@@ -1,4 +1,4 @@
-New in version 0.7.0rc1:
+New in version 0.7.0rc2:
Dirfile Changes
Modified: trunk/getdata/configure.ac
===================================================================
--- trunk/getdata/configure.ac 2010-10-17 09:02:13 UTC (rev 455)
+++ trunk/getdata/configure.ac 2010-10-18 22:31:37 UTC (rev 456)
@@ -22,7 +22,7 @@
m4_define(getdata_major, 0)
m4_define(getdata_minor, 7)
m4_define(getdata_revision, 0)
-m4_define(getdata_extra, [rc1])
+m4_define(getdata_extra, [rc2])
m4_define(getdata_version,
getdata_major.getdata_minor.getdata_revision[]getdata_extra)
Modified: trunk/getdata/src/encoding.c
===================================================================
--- trunk/getdata/src/encoding.c 2010-10-17 09:02:13 UTC (rev 455)
+++ trunk/getdata/src/encoding.c 2010-10-18 22:31:37 UTC (rev 456)
@@ -176,7 +176,7 @@
encoding == GD_TEXT_ENCODED || encoding == GD_LZMA_ENCODED))
#ifdef USE_MODULES
-static void* _GD_ResolveSymbol(lt__handle* lib, struct encoding_t* enc,
+static void* _GD_ResolveSymbol(lt_dlhandle lib, struct encoding_t* enc,
const char* name)
{
void* func;
@@ -225,35 +225,39 @@
/* Try to resolve the symbols */
if (_gd_ef[encoding].provides & GD_EF_OPEN)
- _gd_ef[encoding].open = (int (*)(_gd_raw_file*, int,
+ _gd_ef[encoding].open = (int (*)(struct _gd_raw_file*, int,
int))_GD_ResolveSymbol(lib, _gd_ef + encoding, "Open");
if (_gd_ef[encoding].provides & GD_EF_CLOSE)
- _gd_ef[encoding].close = (int (*)(_gd_raw_file*))_GD_ResolveSymbol(lib,
- _gd_ef + encoding, "Close");
+ _gd_ef[encoding].close =
+ (int (*)(struct _gd_raw_file*))_GD_ResolveSymbol(lib, _gd_ef + encoding,
+ "Close");
if (_gd_ef[encoding].provides & GD_EF_TOUCH)
- _gd_ef[encoding].touch = (int (*)(_gd_raw_file*))_GD_ResolveSymbol(lib,
- _gd_ef + encoding, "Touch");
+ _gd_ef[encoding].touch = (int (*)(struct _gd_raw_file*))
+ _GD_ResolveSymbol(lib, _gd_ef + encoding, "Touch");
if (_gd_ef[encoding].provides & GD_EF_SEEK)
- _gd_ef[encoding].seek = (off64_t (*)(_gd_raw_file*, off64_t, gd_type_t,
- int))_GD_ResolveSymbol(lib, _gd_ef + encoding, "Seek");
+ _gd_ef[encoding].seek = (off64_t (*)(struct _gd_raw_file*, off64_t,
+ gd_type_t, int))_GD_ResolveSymbol(lib, _gd_ef + encoding, "Seek");
if (_gd_ef[encoding].provides & GD_EF_READ)
- _gd_ef[encoding].read = (ssize_t (*)(_gd_raw_file*, void*, gd_type_t,
- size_t))_GD_ResolveSymbol(lib, _gd_ef + encoding, "Read");
+ _gd_ef[encoding].read = (ssize_t (*)(struct _gd_raw_file*, void*,
+ gd_type_t, size_t))_GD_ResolveSymbol(lib, _gd_ef + encoding,
+ "Read");
if (_gd_ef[encoding].provides & GD_EF_SIZE)
- _gd_ef[encoding].size = (off64_t (*)(_gd_raw_file*,
+ _gd_ef[encoding].size = (off64_t (*)(struct _gd_raw_file*,
gd_type_t))_GD_ResolveSymbol(lib, _gd_ef + encoding, "Size");
if (_gd_ef[encoding].provides & GD_EF_WRITE)
- _gd_ef[encoding].write = (ssize_t (*)(_gd_raw_file*, const void*,
+ _gd_ef[encoding].write = (ssize_t (*)(struct _gd_raw_file*, const void*,
gd_type_t, size_t))_GD_ResolveSymbol(lib, _gd_ef + encoding,
"Write");
if (_gd_ef[encoding].provides & GD_EF_SYNC)
- _gd_ef[encoding].sync = (int (*)(_gd_raw_file*))_GD_ResolveSymbol(lib,
- _gd_ef + encoding, "Sync");
+ _gd_ef[encoding].sync =
+ (int (*)(struct _gd_raw_file*))_GD_ResolveSymbol(lib, _gd_ef + encoding,
+ "Sync");
if (_gd_ef[encoding].provides & GD_EF_UNLINK)
- _gd_ef[encoding].unlink = (int (*)(_gd_raw_file*))_GD_ResolveSymbol(lib,
- _gd_ef + encoding, "Unlink");
+ _gd_ef[encoding].unlink =
+ (int (*)(struct _gd_raw_file*))_GD_ResolveSymbol(lib, _gd_ef + encoding,
+ "Unlink");
if (_gd_ef[encoding].provides & GD_EF_TEMP)
- _gd_ef[encoding].temp = (int (*)(_gd_raw_file*,
+ _gd_ef[encoding].temp = (int (*)(struct _gd_raw_file*,
int))_GD_ResolveSymbol(lib, _gd_ef + encoding, "Temp");
/* we tried our best, don't bother trying again */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ket...@us...> - 2010-10-17 09:02:23
|
Revision: 455
http://getdata.svn.sourceforge.net/getdata/?rev=455&view=rev
Author: ketiltrout
Date: 2010-10-17 09:02:13 +0000 (Sun, 17 Oct 2010)
Log Message:
-----------
0.7.0rc1: update NEWS; Bump interface numbers; removed --disable-checkdirfile.
Modified Paths:
--------------
trunk/getdata/ChangeLog
trunk/getdata/NEWS
trunk/getdata/bindings/python/pyentry.c
trunk/getdata/configure.ac
trunk/getdata/man/gd_dirfile_standards.3
trunk/getdata/src/getdata.h.in
trunk/getdata/util/Makefile.am
Property Changed:
----------------
trunk/getdata/NEWS
Modified: trunk/getdata/ChangeLog
===================================================================
--- trunk/getdata/ChangeLog 2010-10-16 03:46:35 UTC (rev 454)
+++ trunk/getdata/ChangeLog 2010-10-17 09:02:13 UTC (rev 455)
@@ -1,3 +1,11 @@
+2010-10-17 D. V. Wiebe <ge...@ke...> svn:455
+ GetData-0.7.0rc1:
+
+ * configure.ac: update library interface numbers. Removed
+ --disable-checkdirfile.
+
+ * MEWS: Update.
+
2010-10-16 D. V. Wiebe <ge...@ke...> svn:453
* configure.ac: Generate Makefiles even for bindings we're not using (so we
can still run maintainer tasks on them.)
Modified: trunk/getdata/NEWS
===================================================================
--- trunk/getdata/NEWS 2010-10-16 03:46:35 UTC (rev 454)
+++ trunk/getdata/NEWS 2010-10-17 09:02:13 UTC (rev 455)
@@ -1,9 +1,168 @@
-New in version 0.7.0a2:
+New in version 0.7.0rc1:
- * Plus ça change, plus c'est la même chose.
+ Dirfile Changes
+ * Dirfile Standards Version 8 has been released. It adds two new field types:
+ DIVIDE, which computes X/Y for vectors X and Y, and RECIP, which computes
+ A/X for vector X and scalar A. A few other changes are listed below.
+ * Slashes on reserved words are now mandatory, allowing fields with reserved
+ words as names.
+ * The long deprecated single character data type codes have been removed.
+ * Just to be clear: these removed features are still supported by GetData,
+ since it can handle older Standards Versions as well.
+ * The /ENDIAN directive now takes an optional second parameter. The only
+ allowed value for this second token is "arm", which indicates that double
+ precision floating point data (including double precision complex data) are
+ stored in the ARM middle-endian format.
+
+ Library Changes
+
+ * GetData, including its bindings, is now supported under MacOS X, Cygwin, and
+ Win32 using MinGW. In the case of MinGW, this includes linking against the
+ Microsoft C Runtime, which isn't POSIX compliant. Users should excercise
+ caution when writing to dirfiles in this case.
+ * GetData can now be used on ARM processors. As a side-effect, GetData can
+ now read and write the middle-ended floating point format used by older ARM
+ processors (on any processor).
+ * Some changes have been made to the parser. It now operates in one of two
+ modes: pedantic mode, which adheres strictly to one particular Dirfile
+ Standards Version, and permissive mode (the default) which is more
+ lenient, as the old parser was. Encountering a /VERSION directive will
+ switch the parser from permissive to pedantic mode unless told not to (see
+ GD_PERMISSIVE below), and will change the particular Standards Version to
+ which pedantic mode is adhering.
+ * As a result of the previous change, the Standards compliance of the parser
+ in strict mode has been greatly increased. This affects allowed characters
+ in field names, and field name lengths. The existance or lack thereof of
+ the implicit FILEFRAM field (an alias for INDEX) is also affected.
+ * Since Standards Versions 4 and earlier were never codified, we've made some
+ assumptions as to their behaviour in certain undocumented situtations. Most
+ noticably, they still prohibit ASCII control codes (bytes < 0x20) and '/'
+ in field names.
+ * Every Dirfile object now complies to a particular Standards Version, which
+ affects functions such as gd_add_spec(). The Version will start out as the
+ value of the last /VERSION directive encountered by the parser, or else the
+ latest compliant Standards Version. It can be changed (see below).
+ * When writing metadata to disk, fragments will be written according to the
+ current Standards Version of the dirfile object, rather than always using
+ the latest version, as before.
+ * The C library now sports an "ANSI C" mode, which allows compilation of
+ GetData without a C99-compliant compiler. Some functionality may be lost,
+ most prominently, but unsurprisingly, the default (C99) API.
+ * LINTERP tables are no longer required to be sorted. The library will
+ sort them, if needed. As a side-effect of this, tables are no longer read
+ twice when loading, leading to potential speed-up.
+ * BUG FIX: The library wasn't properly checking that the second and higher
+ input fields in LINCOM and MULTIPLY fields were, in fact, vectors, leading
+ to possible segfaults.
+ * BUG FIX: A memory leak associated with modifying LINCOM metadata has been
+ fixed.
+ * BUG FIX: Using a complex valued vector as the second input field in a
+ MULTIPLY wouldn't result in the field being internally flagged as complex,
+ leading to loss of the imaginary part in certain situtaitons.
+ * BUG FIX: Trying to write to a LINTERP which isn't monotonic now results in
+ error. Previously, this was allowed, with arbitrary data stored to disk.
+
+ API Changes
+
+ * Due to namespace conflicts with the MacOS X System Library (which contains
+ the C Standard Library), a wholesale renaming of public symbols has been
+ performed. All public functions, and data types now begin with 'gd_'. All
+ public preprocessor macros now begin with 'GD_'. Symbol renaming has
+ occurred in the following manner:
+ - functions which started with 'put' simply prefix 'gd_' to their name. So
+ put_constant() becomes gd_put_constant().
+ - functions which started with 'get' replace 'get' with 'gd', except those
+ functions with a corresponding 'put' function, these simply prefix 'gd_'.
+ So, get_constants() becomes gd_constants(), but get_constant() becomes
+ gd_get_constant().
+ - functions which started with 'dirfile' replace 'dirfile' with 'gd',
+ except for dirfilename(), which becomes gd_dirfilename(). So,
+ dirfile_alter_encoding() become gd_alter_encoding().
+ - macros which started with 'GETDATA_' now start with 'GD_'. Those that
+ started with 'NO_GETDATA_' now start with 'GD_NO_'. So GETDATA_LEGACY_API
+ becomes GD_LEGACY_API and NO_GETDATA_LEGACY_API becomes GD_NO_LEGACY_API.
+ * The above renaming rules result in one gd_ namespace clash. As a result,
+ get_reference() has been removed completely. Calls will have to be
+ changed to use gd_reference(), formerly dirfile_reference().
+ * To ease transition to the new namespace, defining GD_FUNCTION_ALIASES before
+ including getdata.h will create a bunch of preprocessor macros which map the
+ old names to the new.
+ * The meaning of the GD_PEDANTIC flag to gd_[cb]open() has changed. It now
+ forces the parser to start off in pedantic mode (see above), following the
+ latest Standards Version, rather than the default permissive mode. This is
+ a subtle change, and in most cases the effects of GD_PEDANTIC will be the
+ same as they were before.
+ * A new dirfile flag, GD_PERMISSIVE, has been added. Passing this to
+ gd_[cb]open() will prohibit the parser from switching into pedantic mode
+ when it encounters a /VERSION directive. This flag is needed to read
+ dirfiles which claim to adhere to the Standards via a /VERSION directive,
+ but contain invalid syntax nonetheless.
+ * The current Standards Version of an open dirfile can be set or queried by
+ calling the new function gd_dirfile_standards(). NB: this only affects the
+ open dirfile, not the metadata stored on disk.
+ * A new function, gd_rewrite_fragment() will force GetData to write the
+ specified fragment to disk, even if no metadata in the fragment has changed.
+ * Two new functions, gd_bof() and gd_eof() can be used to find the sample
+ number of the beginning- or end-of-field for a given field. Notably, these
+ can be used to calculate the amount of raw data on disk for a given field.
+ * The new gd_invalid_dirfile() function will return a newly created, invalid
+ dirfile. Primarily useful to callers as a "null dirfile" placeholder.
+ * GD_E_OPEN_INCLUDE has been renamed to GD_E_OPEN_FRAGMENT, but the former
+ symbol remains as an alias.
+ * Where gd_flush() and gd_metaflush() in the past raised GD_E_OPEN_INCLUDE
+ on I/O error, they now raise the new GD_FLUSH.
+ * All functions now raise GD_E_DIMENSION when encountering a scalar field
+ when expecting a vector. In the past, the error value returned was
+ different for different functions.
+ * getdata.h now wraps itself in an extern "C" block if included by a C++
+ compiler.
+ * BUG FIX: gd_metaflush() now fails and raises GD_E_ACCMODE if called on a
+ read-only dirfile
+
+ Bindings
+
+ * C++: Const member functions are now flagged as such.
+ * F95: For consistency sake, the Fortran 95 bindings have undergone the same
+ renaming as the C bindings. All functions are now preceded by 'fgd_'.
+ * IDL: The IDL bindings have also followed suit in the great renaming. The
+ exception to this is GETDATA_CONSTANTS(), which is not renamed.
+ * C++ BUG FIX: Entry::Scalar() no longer rejects valid values of index.
+ * Python BUG FIX: A non-litteral phase shift is now properly reported.
+
+ Miscellaneous
+
+ * The --disable-checkdirfile option has been removed from ./configure. It
+ is now always installed.
+ * A utility, dirfile2ascii, is now installed alongside checkdirfile. This
+ utility converts all or part of a dirfile into ASCII text. dirfile2ascii
+ was written by Matthew Truch.
+ * The thoroughness of the checks done by checkdirfile have increased. It now
+ reports format syntax errors, Dirfile Standards compliance, problems with
+ field definitions (such as missing input fields), and the size of the
+ dirfile.
+
|==============================================================================|
+New in version 0.6.3:
+
+ Bindings
+
+ * A memory leak has been plugged in the Python bindings manifesting in calls
+ to dirfile.getdata() returning a NumPy array. In previous versions, the
+ memory used by the returned array to hold the data was not reclaimed by GC.
+
+|==============================================================================|
+
+New in version 0.6.2:
+
+ Library Changes
+
+ * Attempting to get the number of frames from an ASCII file no longer fails
+ the second time.
+
+|==============================================================================|
+
New in version 0.6.1:
API Changes
Property changes on: trunk/getdata/NEWS
___________________________________________________________________
Added: svn:mergeinfo
+ /branches/getdata-0.4/NEWS:217-227
/branches/getdata-0.6/NEWS:369-391
/branches/getdata-arm/NEWS:355-413
/branches/getdata-osx/NEWS:400-402
Modified: trunk/getdata/bindings/python/pyentry.c
===================================================================
--- trunk/getdata/bindings/python/pyentry.c 2010-10-16 03:46:35 UTC (rev 454)
+++ trunk/getdata/bindings/python/pyentry.c 2010-10-17 09:02:13 UTC (rev 455)
@@ -1904,10 +1904,6 @@
" 'in_field': a string containing the input field code.\n"\
" 'shift: a number or CONST field code specifying the number of\n"\
" samples to shift the data.\n\n"\
-" PHASE: (in_field, shift)\n"\
-" 'in_field': a string containing the input field code.\n"\
-" 'shift': a number or CONST field code specifying the number of\n"\
-" samples to shift the data.\n\n"\
" POLYNOM: (in_field, a)\n"\
" 'in_field': a string containing the input field code.\n"\
" 'a': a tuple of the co-efficients of the polynomial. The\n"\
Modified: trunk/getdata/configure.ac
===================================================================
--- trunk/getdata/configure.ac 2010-10-16 03:46:35 UTC (rev 454)
+++ trunk/getdata/configure.ac 2010-10-17 09:02:13 UTC (rev 455)
@@ -22,7 +22,7 @@
m4_define(getdata_major, 0)
m4_define(getdata_minor, 7)
m4_define(getdata_revision, 0)
-m4_define(getdata_extra, [a2])
+m4_define(getdata_extra, [rc1])
m4_define(getdata_version,
getdata_major.getdata_minor.getdata_revision[]getdata_extra)
@@ -43,20 +43,20 @@
[C compiler command on the build system (only needed if cross-compiling)])
dnl libgetdata current interface version
-AC_SUBST(GETDATA_IFACE_VERSION, [3])
+AC_SUBST(GETDATA_IFACE_VERSION, [4])
dnl libgetdata current interface implementation revision
AC_SUBST(GETDATA_IMPL_REVISION, [0])
dnl libgetdata interface age (current interface - oldest supported interface)
-AC_SUBST(GETDATA_IFACE_AGE, [1])
+AC_SUBST(GETDATA_IFACE_AGE, [0])
dnl libgetdata++ interface version info
-AC_SUBST(GETDATAXX_VERSION, [1:0:0])
+AC_SUBST(GETDATAXX_VERSION, [2:0:1])
dnl libfgetdata interface version info
-AC_SUBST(FGETDATA_VERSION, [1:0:0])
+AC_SUBST(FGETDATA_VERSION, [2:0:1])
dnl libf95getdata interface version info
-AC_SUBST(F95GETDATA_VERSION, [1:0:0])
+AC_SUBST(F95GETDATA_VERSION, [2:0:0])
AC_CONFIG_SRCDIR([src/getdata.c])
AC_CONFIG_HEADER([src/config.h])
@@ -134,18 +134,6 @@
AC_MSG_CHECKING([whether to build in ANSI C compliance mode])
AC_MSG_RESULT([$disable_c99])
-dnl checkdirfile
-AC_ARG_ENABLE(checkdirfile, AS_HELP_STRING([--disable-checkdirfile],
- [don't build or install the checkdirfile utility]),
- [
- case "${enableval}" in
- no) make_checkdirfile="don't build" ;;
- *) make_checkdirfile="build" ;;
- esac
- ], [ make_checkdirfile="build" ])
-AC_MSG_CHECKING([whether to compile and install checkdirfile])
-AC_MSG_RESULT([$make_checkdirfile])
-
dnl bindings, globally
make_cxxbindings="yes"
make_f77bindings="yes"
@@ -793,7 +781,6 @@
AM_CONDITIONAL(INTEL_FC_COMPILER, [test "x$gd_cv_fc_compiler_intel" == "xyes"])
AM_CONDITIONAL(LFS_TRANSITIONAL_API, [test "x$gd_cv_type_off64_t" = "xyes"])
AM_CONDITIONAL(INCLUDE_LEGACY_API, [test "x$include_legacy_api" != "xno"])
-AM_CONDITIONAL(MAKE_CHECKDIRFILE, [test "x$make_checkdirfile" = "xbuild"])
AM_CONDITIONAL(MAKE_CXXBINDINGS, [test "x$make_cxxbindings" = "xyes"])
AM_CONDITIONAL(MAKE_F77BINDINGS, [test "x$make_f77bindings" != "xno"])
AM_CONDITIONAL(MAKE_F95BINDINGS, [test "x$make_f95bindings" = "xyes"])
@@ -868,7 +855,6 @@
echo
echo "Configuration summary: "
-echo " checkdirfile utility: ${make_checkdirfile}"
echo " ANSI C compatibility mode: ${disable_c99}"
echo " LFS transitional API: ${lfs_transitional_api}"
echo " Legacy API: ${include_legacy_api}"
Modified: trunk/getdata/man/gd_dirfile_standards.3
===================================================================
--- trunk/getdata/man/gd_dirfile_standards.3 2010-10-16 03:46:35 UTC (rev 454)
+++ trunk/getdata/man/gd_dirfile_standards.3 2010-10-17 09:02:13 UTC (rev 455)
@@ -67,7 +67,7 @@
Specifies the current Standards Version should be set to the latest version
to which the loaded dirfile conforms.
.P
-If the loaded dirfile cannot conform to the specified
+If the loaded dirfile does not conform to the specified
.IR version ,
this function fails, and the current Standards Version is unchanged. If the
loaded dirfile conforms to no known Standards Version, this function will fail
Modified: trunk/getdata/src/getdata.h.in
===================================================================
--- trunk/getdata/src/getdata.h.in 2010-10-16 03:46:35 UTC (rev 454)
+++ trunk/getdata/src/getdata.h.in 2010-10-17 09:02:13 UTC (rev 455)
@@ -873,6 +873,7 @@
/* function aliases */
#ifdef GD_FUNCTION_ALIASES
+# warning "Using deprecated function aliases."
# define dirfile_add gd_add
# define dirfile_add_bit gd_add_bit
# define dirfile_add_clincom gd_add_clincom
Modified: trunk/getdata/util/Makefile.am
===================================================================
--- trunk/getdata/util/Makefile.am 2010-10-16 03:46:35 UTC (rev 454)
+++ trunk/getdata/util/Makefile.am 2010-10-17 09:02:13 UTC (rev 455)
@@ -31,11 +31,7 @@
LDADD=../src/libgetdata.la
INCLUDES=${WALL} $(WEXTRA) -I$(top_srcdir)/src
-if MAKE_CHECKDIRFILE
-CHECKDIRFILE=checkdirfile dirfile2ascii
-endif
-
-bin_PROGRAMS=$(CHECKDIRFILE)
+bin_PROGRAMS=checkdirfile dirfile2ascii
checkdirfile_SOURCES=checkdirfile.c
dirfile2ascii_SOURCES=dirfile2ascii.c
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ket...@us...> - 2010-10-16 03:46:41
|
Revision: 454
http://getdata.svn.sourceforge.net/getdata/?rev=454&view=rev
Author: ketiltrout
Date: 2010-10-16 03:46:35 +0000 (Sat, 16 Oct 2010)
Log Message:
-----------
Test suite fixes.
Modified Paths:
--------------
trunk/getdata/src/internal.h
trunk/getdata/src/mod.c
trunk/getdata/test/add_crecip.c
trunk/getdata/test/add_crecip89.c
trunk/getdata/test/add_recip.c
trunk/getdata/test/alter_crecip89.c
trunk/getdata/test/madd_crecip.c
trunk/getdata/test/madd_crecip89.c
trunk/getdata/test/madd_recip.c
Modified: trunk/getdata/src/internal.h
===================================================================
--- trunk/getdata/src/internal.h 2010-10-16 03:14:00 UTC (rev 453)
+++ trunk/getdata/src/internal.h 2010-10-16 03:46:35 UTC (rev 454)
@@ -723,7 +723,7 @@
# define gd_nothrow
#endif
-#if GD_NO_C99_API
+#ifdef GD_C89_API
# define EN(t,v) u.t.v
# define ES(v) u.v
#else
Modified: trunk/getdata/src/mod.c
===================================================================
--- trunk/getdata/src/mod.c 2010-10-16 03:14:00 UTC (rev 453)
+++ trunk/getdata/src/mod.c 2010-10-16 03:46:35 UTC (rev 454)
@@ -699,7 +699,7 @@
break;
case GD_CONST_ENTRY:
- Q.EN(cons,const_type) = (N->EN(cons,const_type) == GD_NULL)
+ Q.EN(cons,const_type) = (N->EN(cons,const_type) == GD_NULL) ?
E->EN(cons,const_type) : N->EN(cons,const_type);
if (Q.EN(cons,const_type) & 0x40 || GD_SIZE(Q.EN(cons,const_type)) == 0) {
Modified: trunk/getdata/test/add_crecip.c
===================================================================
--- trunk/getdata/test/add_crecip.c 2010-10-16 03:14:00 UTC (rev 453)
+++ trunk/getdata/test/add_crecip.c 2010-10-16 03:46:35 UTC (rev 454)
@@ -33,7 +33,7 @@
CHECKI(e.field_type, GD_RECIP_ENTRY);
CHECKS(e.in_fields[0], "in");
CHECKI(e.comp_scal, 1);
- CHECKC(e.u.recip.cdividend, cdividend);
+ CHECKC(e.EN(recip,cdividend), cdividend);
CHECKI(e.fragment_index, 0);
gd_free_entry_strings(&e);
Modified: trunk/getdata/test/add_crecip89.c
===================================================================
--- trunk/getdata/test/add_crecip89.c 2010-10-16 03:14:00 UTC (rev 453)
+++ trunk/getdata/test/add_crecip89.c 2010-10-16 03:46:35 UTC (rev 454)
@@ -30,8 +30,8 @@
CHECKI(e.field_type, GD_RECIP_ENTRY);
CHECKS(e.in_fields[0], "in");
CHECKI(e.comp_scal, 1);
- CHECKF(e.u.recip.cdividend[0], dividend[0]);
- CHECKF(e.u.recip.cdividend[1], dividend[1]);
+ CHECKF(e.EN(recip,cdividend)[0], dividend[0]);
+ CHECKF(e.EN(recip,cdividend)[1], dividend[1]);
CHECKI(e.fragment_index, 0);
gd_free_entry_strings(&e);
Modified: trunk/getdata/test/add_recip.c
===================================================================
--- trunk/getdata/test/add_recip.c 2010-10-16 03:14:00 UTC (rev 453)
+++ trunk/getdata/test/add_recip.c 2010-10-16 03:46:35 UTC (rev 454)
@@ -28,7 +28,7 @@
CHECKI(e.field_type, GD_RECIP_ENTRY);
CHECKS(e.in_fields[0], "in");
CHECKI(e.comp_scal, 0);
- CHECKF(e.u.recip.dividend, 33.3);
+ CHECKF(e.EN(recip,dividend), 33.3);
CHECKI(e.fragment_index, 0);
gd_free_entry_strings(&e);
Modified: trunk/getdata/test/alter_crecip89.c
===================================================================
--- trunk/getdata/test/alter_crecip89.c 2010-10-16 03:14:00 UTC (rev 453)
+++ trunk/getdata/test/alter_crecip89.c 2010-10-16 03:46:35 UTC (rev 454)
@@ -51,8 +51,8 @@
CHECKI(error,0);
CHECKI(n,0);
CHECKI(ret,0);
- CHECKF(E.u.recip.cdividend[0], div[0]);
- CHECKF(E.u.recip.cdividend[1], div[1]);
+ CHECKF(E.EN(recip,cdividend)[0], div[0]);
+ CHECKF(E.EN(recip,cdividend)[1], div[1]);
CHECKS(E.in_fields[0], "phase");
return r;
Modified: trunk/getdata/test/madd_crecip.c
===================================================================
--- trunk/getdata/test/madd_crecip.c 2010-10-16 03:14:00 UTC (rev 453)
+++ trunk/getdata/test/madd_crecip.c 2010-10-16 03:46:35 UTC (rev 454)
@@ -33,7 +33,7 @@
if (!r) {
CHECKI(e.field_type, GD_RECIP_ENTRY);
CHECKS(e.in_fields[0], "in1");
- CHECKC(e.u.recip.cdividend, v);
+ CHECKC(e.EN(recip,cdividend), v);
CHECKI(e.comp_scal, 1);
CHECKI(e.fragment_index, 0);
gd_free_entry_strings(&e);
Modified: trunk/getdata/test/madd_crecip89.c
===================================================================
--- trunk/getdata/test/madd_crecip89.c 2010-10-16 03:14:00 UTC (rev 453)
+++ trunk/getdata/test/madd_crecip89.c 2010-10-16 03:46:35 UTC (rev 454)
@@ -30,8 +30,8 @@
if (!r) {
CHECKI(e.field_type, GD_RECIP_ENTRY);
CHECKS(e.in_fields[0], "in1");
- CHECKF(e.u.recip.cdividend[0], div[0]);
- CHECKF(e.u.recip.cdividend[1], div[1]);
+ CHECKF(e.EN(recip,cdividend)[0], div[0]);
+ CHECKF(e.EN(recip,cdividend)[1], div[1]);
CHECKI(e.comp_scal, 1);
CHECKI(e.fragment_index, 0);
gd_free_entry_strings(&e);
Modified: trunk/getdata/test/madd_recip.c
===================================================================
--- trunk/getdata/test/madd_recip.c 2010-10-16 03:14:00 UTC (rev 453)
+++ trunk/getdata/test/madd_recip.c 2010-10-16 03:46:35 UTC (rev 454)
@@ -28,7 +28,7 @@
if (!r) {
CHECKI(e.field_type, GD_RECIP_ENTRY);
CHECKS(e.in_fields[0], "in1");
- CHECKF(e.u.recip.dividend, 3.2);
+ CHECKF(e.EN(recip,dividend), 3.2);
CHECKI(e.comp_scal, 0);
CHECKI(e.fragment_index, 0);
gd_free_entry_strings(&e);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ket...@us...> - 2010-10-16 03:14:06
|
Revision: 453
http://getdata.svn.sourceforge.net/getdata/?rev=453&view=rev
Author: ketiltrout
Date: 2010-10-16 03:14:00 +0000 (Sat, 16 Oct 2010)
Log Message:
-----------
Somehow the "make dist" bug fix escaped. We recaptured it.
Modified Paths:
--------------
trunk/getdata/ChangeLog
trunk/getdata/configure.ac
Modified: trunk/getdata/ChangeLog
===================================================================
--- trunk/getdata/ChangeLog 2010-10-16 02:25:29 UTC (rev 452)
+++ trunk/getdata/ChangeLog 2010-10-16 03:14:00 UTC (rev 453)
@@ -1,3 +1,7 @@
+2010-10-16 D. V. Wiebe <ge...@ke...> svn:453
+ * configure.ac: Generate Makefiles even for bindings we're not using (so we
+ can still run maintainer tasks on them.)
+
2010-10-16 D. V. Wiebe <ge...@ke...> svn:452
* src/getdata.h.in: Keep anonymous structs and unions in C99-mode.
* src/internal.h: Helper macros for C99/C89 differences.
@@ -3,7 +7,4 @@
* test/ src/ bindings/: Update for changes.
- * configure.ac: Generate Makefiles even for bindings we're not using (so we
- can still run maintainer tasks on them.)
-
2010-09-18 D. V. Wiebe <ge...@ke...> svn:448
* bindings/python/pydirfile.c (gdpy_dirfile_close gdpy_dirfile_discard)
Modified: trunk/getdata/configure.ac
===================================================================
--- trunk/getdata/configure.ac 2010-10-16 02:25:29 UTC (rev 452)
+++ trunk/getdata/configure.ac 2010-10-16 03:14:00 UTC (rev 453)
@@ -758,23 +758,15 @@
echo
AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([bindings/Makefile])
-if test "x$make_cxxbindings" = "xyes"; then
- AC_CONFIG_FILES([bindings/cxx/Makefile])
- AC_CONFIG_FILES([bindings/cxx/test/Makefile])
-fi
-if test "x$make_f77bindings" = "xyes"; then
- AC_CONFIG_FILES([bindings/f77/Makefile])
- AC_CONFIG_FILES([bindings/f77/test/Makefile])
-fi
-if test "x$make_idlbindings" = "xyes"; then
- AC_CONFIG_FILES([bindings/idl/Makefile])
- AC_CONFIG_FILES([bindings/idl/makedlm.sh])
- AC_CONFIG_FILES([bindings/idl/test/Makefile])
-fi
-if test "x$make_pybindings" = "xyes"; then
- AC_CONFIG_FILES([bindings/python/Makefile])
- AC_CONFIG_FILES([bindings/python/test/Makefile])
-fi
+AC_CONFIG_FILES([bindings/cxx/Makefile])
+AC_CONFIG_FILES([bindings/cxx/test/Makefile])
+AC_CONFIG_FILES([bindings/f77/Makefile])
+AC_CONFIG_FILES([bindings/f77/test/Makefile])
+AC_CONFIG_FILES([bindings/idl/Makefile])
+AC_CONFIG_FILES([bindings/idl/makedlm.sh])
+AC_CONFIG_FILES([bindings/idl/test/Makefile])
+AC_CONFIG_FILES([bindings/python/Makefile])
+AC_CONFIG_FILES([bindings/python/test/Makefile])
AC_CONFIG_FILES([doc/Makefile])
AC_CONFIG_FILES([man/Makefile])
AC_CONFIG_FILES([man/gd_alter_encoding.3])
@@ -888,13 +880,13 @@
echo
echo " Supported internal encodings:${ENCODINGS_BUILT}"
if test "x${use_modules}" != "xno"; then
-echo " Supported external encodings:${ENCODINGS_MODS}"
+ echo " Supported external encodings:${ENCODINGS_MODS}"
fi
echo " Unsupported encodings: ${ENCODINGS_LEFT}"
echo
echo " Bindings built: ${BINDINGS_BUILT}"
echo " Bindings not built: ${BINDINGS_LEFT}"
if test "x$make_pybindings" != "xno"; then
-echo " NumPy support in Python: ${have_numpy}"
+ echo " NumPy support in Python: ${have_numpy}"
fi
echo
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ket...@us...> - 2010-10-16 02:25:39
|
Revision: 452
http://getdata.svn.sourceforge.net/getdata/?rev=452&view=rev
Author: ketiltrout
Date: 2010-10-16 02:25:29 +0000 (Sat, 16 Oct 2010)
Log Message:
-----------
Enough with those ANSI-C-mandated silly named structs, except, of course, in ANSI C
mode. Back to the anonymous goodness of previous versions. Admittedly, this isn't
even C99-compatible, but it is allowed by C1X, so we'll stick with it until someone
whom we're unable to placate with ANSI C mode complains. (It's allowed in C++, and
seems to have appeared in the MS C header files, and, thence, GCC support.)
Also fixed the autotools "make dist" bug reported by Ted.
Modified Paths:
--------------
trunk/getdata/ChangeLog
trunk/getdata/NEWS
trunk/getdata/bindings/cxx/constentry.cpp
trunk/getdata/bindings/cxx/getdata/constentry.h
trunk/getdata/bindings/cxx/getdata/entry.h
trunk/getdata/bindings/cxx/getdata/rawentry.h
trunk/getdata/bindings/cxx/rawentry.cpp
trunk/getdata/bindings/f77/fgetdata.c
trunk/getdata/bindings/idl/getdata.c
trunk/getdata/bindings/python/pyentry.c
trunk/getdata/configure.ac
trunk/getdata/src/add.c
trunk/getdata/src/common.c
trunk/getdata/src/constant.c
trunk/getdata/src/del.c
trunk/getdata/src/encoding.c
trunk/getdata/src/endian.c
trunk/getdata/src/entry.c
trunk/getdata/src/field_list.c
trunk/getdata/src/flimits.c
trunk/getdata/src/flush.c
trunk/getdata/src/getdata.c
trunk/getdata/src/getdata.h.in
trunk/getdata/src/internal.h
trunk/getdata/src/legacy.c
trunk/getdata/src/meta_list.c
trunk/getdata/src/mod.c
trunk/getdata/src/move.c
trunk/getdata/src/name.c
trunk/getdata/src/native.c
trunk/getdata/src/nframes.c
trunk/getdata/src/parse.c
trunk/getdata/src/putdata.c
trunk/getdata/src/spf.c
trunk/getdata/test/add.c
trunk/getdata/test/add_bit.c
trunk/getdata/test/add_clincom.c
trunk/getdata/test/add_code.c
trunk/getdata/test/add_const.c
trunk/getdata/test/add_cpolynom.c
trunk/getdata/test/add_duplicate.c
trunk/getdata/test/add_format.c
trunk/getdata/test/add_invalid.c
trunk/getdata/test/add_lincom.c
trunk/getdata/test/add_linterp.c
trunk/getdata/test/add_phase.c
trunk/getdata/test/add_polynom.c
trunk/getdata/test/add_protect.c
trunk/getdata/test/add_raw.c
trunk/getdata/test/add_rdonly.c
trunk/getdata/test/add_sbit.c
trunk/getdata/test/add_scalar.c
trunk/getdata/test/add_sort.c
trunk/getdata/test/add_spec.c
trunk/getdata/test/add_spec_meta.c
trunk/getdata/test/add_type.c
trunk/getdata/test/alter_entry.c
trunk/getdata/test/alter_entry_recode.c
trunk/getdata/test/alter_entry_scalar2a.c
trunk/getdata/test/alter_entry_scalar2n.c
trunk/getdata/test/alter_entry_scalar3.c
trunk/getdata/test/alter_entry_scalar4.c
trunk/getdata/test/alter_linterp.c
trunk/getdata/test/alter_polynom_coeff.c
trunk/getdata/test/entry_bit.c
trunk/getdata/test/entry_bit_scalar.c
trunk/getdata/test/entry_lincom.c
trunk/getdata/test/entry_lincom_scalar.c
trunk/getdata/test/entry_linterp.c
trunk/getdata/test/entry_phase.c
trunk/getdata/test/entry_phase_scalar.c
trunk/getdata/test/entry_polynom.c
trunk/getdata/test/entry_polynom_scalar.c
trunk/getdata/test/entry_raw.c
trunk/getdata/test/entry_raw_scalar.c
trunk/getdata/test/entry_scalar_repr.c
trunk/getdata/test/header_complex.c
trunk/getdata/test/madd.c
trunk/getdata/test/madd_bit.c
trunk/getdata/test/madd_clincom.c
trunk/getdata/test/madd_const.c
trunk/getdata/test/madd_cpolynom.c
trunk/getdata/test/madd_lincom.c
trunk/getdata/test/madd_linterp.c
trunk/getdata/test/madd_phase.c
trunk/getdata/test/madd_polynom.c
trunk/getdata/test/madd_sbit.c
trunk/getdata/test/madd_spec.c
Modified: trunk/getdata/ChangeLog
===================================================================
--- trunk/getdata/ChangeLog 2010-10-16 01:41:34 UTC (rev 451)
+++ trunk/getdata/ChangeLog 2010-10-16 02:25:29 UTC (rev 452)
@@ -1,3 +1,11 @@
+2010-10-16 D. V. Wiebe <ge...@ke...> svn:452
+ * src/getdata.h.in: Keep anonymous structs and unions in C99-mode.
+ * src/internal.h: Helper macros for C99/C89 differences.
+ * test/ src/ bindings/: Update for changes.
+
+ * configure.ac: Generate Makefiles even for bindings we're not using (so we
+ can still run maintainer tasks on them.)
+
2010-09-18 D. V. Wiebe <ge...@ke...> svn:448
* bindings/python/pydirfile.c (gdpy_dirfile_close gdpy_dirfile_discard)
bindings/cxx/dirfile.cpp (Dirfile::Discard Dirfile::Close)
@@ -6,7 +14,7 @@
GetData C internals.
* src/open.c (gd_invalid_dirfile): Added.
- * src/cxx/: Declare const member functions.
+ * bindings/cxx/: Declare const member functions.
* configure.ac: Fix mkdir check for C++ compilers masquerading as C
compilers.
Modified: trunk/getdata/NEWS
===================================================================
--- trunk/getdata/NEWS 2010-10-16 01:41:34 UTC (rev 451)
+++ trunk/getdata/NEWS 2010-10-16 02:25:29 UTC (rev 452)
@@ -1,4 +1,4 @@
-New in version 0.7.0a1:
+New in version 0.7.0a2:
* Plus ça change, plus c'est la même chose.
Modified: trunk/getdata/bindings/cxx/constentry.cpp
===================================================================
--- trunk/getdata/bindings/cxx/constentry.cpp 2010-10-16 01:41:34 UTC (rev 451)
+++ trunk/getdata/bindings/cxx/constentry.cpp 2010-10-16 02:25:29 UTC (rev 452)
@@ -33,13 +33,13 @@
{
E.field = strdup(field_code);
E.field_type = GD_CONST_ENTRY;
- E.u.cons.type = (gd_type_t)data_type;
+ E.u.cons.const_type = (gd_type_t)data_type;
E.fragment_index = fragment_index;
}
int ConstEntry::SetType(DataType type)
{
- E.u.cons.type = (gd_type_t)type;
+ E.u.cons.const_type = (gd_type_t)type;
if (D != NULL)
return gd_alter_entry(D->D, E.field, &E, 0);
Modified: trunk/getdata/bindings/cxx/getdata/constentry.h
===================================================================
--- trunk/getdata/bindings/cxx/getdata/constentry.h 2010-10-16 01:41:34 UTC (rev 451)
+++ trunk/getdata/bindings/cxx/getdata/constentry.h 2010-10-16 02:25:29 UTC (rev 452)
@@ -36,7 +36,7 @@
ConstEntry(const char* field_code, DataType type, int fragment_index = 0);
- virtual DataType ConstType() const { return (DataType)E.u.cons.type; }
+ virtual DataType ConstType() const { return (DataType)E.u.cons.const_type; }
int SetType(DataType type);
Modified: trunk/getdata/bindings/cxx/getdata/entry.h
===================================================================
--- trunk/getdata/bindings/cxx/getdata/entry.h 2010-10-16 01:41:34 UTC (rev 451)
+++ trunk/getdata/bindings/cxx/getdata/entry.h 2010-10-16 02:25:29 UTC (rev 452)
@@ -108,7 +108,7 @@
};
virtual DataType RawType() const {
- return (E.field_type == GD_RAW_ENTRY) ? (DataType)E.u.raw.type :
+ return (E.field_type == GD_RAW_ENTRY) ? (DataType)E.u.raw.data_type :
Unknown;
};
@@ -164,7 +164,7 @@
/* CONST methods */
virtual DataType ConstType() const {
- return (E.field_type == GD_CONST_ENTRY) ? (DataType)E.u.cons.type :
+ return (E.field_type == GD_CONST_ENTRY) ? (DataType)E.u.cons.const_type :
Unknown;
};
Modified: trunk/getdata/bindings/cxx/getdata/rawentry.h
===================================================================
--- trunk/getdata/bindings/cxx/getdata/rawentry.h 2010-10-16 01:41:34 UTC (rev 451)
+++ trunk/getdata/bindings/cxx/getdata/rawentry.h 2010-10-16 02:25:29 UTC (rev 452)
@@ -39,7 +39,7 @@
virtual gd_spf_t SamplesPerFrame() const { return E.u.raw.spf; };
- virtual DataType RawType() const { return (DataType)E.u.raw.type; };
+ virtual DataType RawType() const { return (DataType)E.u.raw.data_type; };
const char* FileName();
int SetSamplesPerFrame(gd_spf_t spf, int recode = 0);
Modified: trunk/getdata/bindings/cxx/rawentry.cpp
===================================================================
--- trunk/getdata/bindings/cxx/rawentry.cpp 2010-10-16 01:41:34 UTC (rev 451)
+++ trunk/getdata/bindings/cxx/rawentry.cpp 2010-10-16 02:25:29 UTC (rev 452)
@@ -36,7 +36,7 @@
E.field = strdup(field_code);
E.field_type = GD_RAW_ENTRY;
E.u.raw.spf = spf;
- E.u.raw.type = (gd_type_t)data_type;
+ E.u.raw.data_type = (gd_type_t)data_type;
E.fragment_index = fragment_index;
}
@@ -72,7 +72,7 @@
int RawEntry::SetType(DataType type, int recode)
{
- E.u.raw.type = (gd_type_t)type;
+ E.u.raw.data_type = (gd_type_t)type;
if (D != NULL)
return gd_alter_entry(D->D, E.field, &E, recode);
Modified: trunk/getdata/bindings/f77/fgetdata.c
===================================================================
--- trunk/getdata/bindings/f77/fgetdata.c 2010-10-16 01:41:34 UTC (rev 451)
+++ trunk/getdata/bindings/f77/fgetdata.c 2010-10-16 02:25:29 UTC (rev 452)
@@ -413,8 +413,8 @@
*field_code_l), &E) || E.field_type != GD_RAW_ENTRY)
*spf = 0;
else {
- *spf = E.u.raw.spf;
- *dtype = E.u.raw.type;
+ *spf = E.EN(raw,spf);
+ *dtype = E.EN(raw,data_type);
*fragment_index = E.fragment_index;
gd_free_entry_strings(&E);
}
@@ -444,23 +444,23 @@
*field_code_l), &E) || E.field_type != GD_LINCOM_ENTRY)
*nfields = 0;
else {
- *nfields = E.u.lincom.n_fields;
+ *nfields = E.EN(lincom,n_fields);
*fragment_index = E.fragment_index;
_GDF_FString(infield1, infield1_l, E.in_fields[0]);
- *m1 = E.u.lincom.m[0];
- *b1 = E.u.lincom.b[0];
+ *m1 = E.EN(lincom,m)[0];
+ *b1 = E.EN(lincom,b)[0];
- if (E.u.lincom.n_fields > 1) {
+ if (E.EN(lincom,n_fields) > 1) {
_GDF_FString(infield2, infield2_l, E.in_fields[1]);
- *m2 = E.u.lincom.m[1];
- *b2 = E.u.lincom.b[1];
+ *m2 = E.EN(lincom,m)[1];
+ *b2 = E.EN(lincom,b)[1];
}
- if (E.u.lincom.n_fields > 2) {
+ if (E.EN(lincom,n_fields) > 2) {
_GDF_FString(infield3, infield3_l, E.in_fields[2]);
- *m3 = E.u.lincom.m[2];
- *b3 = E.u.lincom.b[2];
+ *m3 = E.EN(lincom,m)[2];
+ *b3 = E.EN(lincom,b)[2];
}
gd_free_entry_strings(&E);
@@ -492,23 +492,23 @@
*nfields = 0;
gd_free_entry_strings(&E);
} else {
- *nfields = E.u.lincom.n_fields;
+ *nfields = E.EN(lincom,n_fields);
*fragment_index = E.fragment_index;
_GDF_FString(infield1, infield1_l, E.in_fields[0]);
- _gd_c2cp(m1, E.u.lincom.cm[0]);
- _gd_c2cp(b1, E.u.lincom.cb[0]);
+ _gd_c2cp(m1, E.EN(lincom,cm)[0]);
+ _gd_c2cp(b1, E.EN(lincom,cb)[0]);
- if (E.u.lincom.n_fields > 1) {
+ if (E.EN(lincom,n_fields) > 1) {
_GDF_FString(infield2, infield2_l, E.in_fields[1]);
- _gd_c2cp(m2, E.u.lincom.cm[1]);
- _gd_c2cp(b2, E.u.lincom.cb[1]);
+ _gd_c2cp(m2, E.EN(lincom,cm)[1]);
+ _gd_c2cp(b2, E.EN(lincom,cb)[1]);
}
- if (E.u.lincom.n_fields > 2) {
+ if (E.EN(lincom,n_fields) > 2) {
_GDF_FString(infield3, infield3_l, E.in_fields[2]);
- _gd_c2cp(m3, E.u.lincom.cm[2]);
- _gd_c2cp(b3, E.u.lincom.cb[2]);
+ _gd_c2cp(m3, E.EN(lincom,cm)[2]);
+ _gd_c2cp(b3, E.EN(lincom,cb)[2]);
}
gd_free_entry_strings(&E);
}
@@ -535,23 +535,23 @@
*field_code_l), &E) || E.field_type != GD_POLYNOM_ENTRY)
*poly_ord = 0;
else {
- *poly_ord = E.u.polynom.poly_ord;
+ *poly_ord = E.EN(polynom,poly_ord);
*fragment_index = E.fragment_index;
_GDF_FString(infield, infield_l, E.in_fields[0]);
- switch (E.u.polynom.poly_ord) {
+ switch (E.EN(polynom,poly_ord)) {
case 5:
- *a5 = E.u.polynom.a[5];
+ *a5 = E.EN(polynom,a)[5];
case 4:
- *a4 = E.u.polynom.a[4];
+ *a4 = E.EN(polynom,a)[4];
case 3:
- *a3 = E.u.polynom.a[3];
+ *a3 = E.EN(polynom,a)[3];
case 2:
- *a2 = E.u.polynom.a[2];
+ *a2 = E.EN(polynom,a)[2];
case 1:
- *a1 = E.u.polynom.a[1];
- *a0 = E.u.polynom.a[0];
+ *a1 = E.EN(polynom,a)[1];
+ *a0 = E.EN(polynom,a)[0];
}
gd_free_entry_strings(&E);
}
@@ -577,23 +577,23 @@
*field_code_l), &E) || E.field_type != GD_POLYNOM_ENTRY)
*poly_ord = 0;
else {
- *poly_ord = E.u.polynom.poly_ord;
+ *poly_ord = E.EN(polynom,poly_ord);
*fragment_index = E.fragment_index;
_GDF_FString(infield, infield_l, E.in_fields[0]);
- switch (E.u.polynom.poly_ord) {
+ switch (E.EN(polynom,poly_ord)) {
case 5:
- _gd_c2cp(a5, E.u.polynom.ca[5]);
+ _gd_c2cp(a5, E.EN(polynom,ca)[5]);
case 4:
- _gd_c2cp(a4, E.u.polynom.ca[4]);
+ _gd_c2cp(a4, E.EN(polynom,ca)[4]);
case 3:
- _gd_c2cp(a3, E.u.polynom.ca[3]);
+ _gd_c2cp(a3, E.EN(polynom,ca)[3]);
case 2:
- _gd_c2cp(a2, E.u.polynom.ca[2]);
+ _gd_c2cp(a2, E.EN(polynom,ca)[2]);
case 1:
- _gd_c2cp(a1, E.u.polynom.ca[1]);
- _gd_c2cp(a0, E.u.polynom.ca[0]);
+ _gd_c2cp(a1, E.EN(polynom,ca)[1]);
+ _gd_c2cp(a0, E.EN(polynom,ca)[0]);
}
gd_free_entry_strings(&E);
}
@@ -618,7 +618,7 @@
*field_code_l), &E) || E.field_type != GD_LINTERP_ENTRY)
*in_field_l = 0;
else {
- _GDF_FString(table, table_l, E.u.linterp.table);
+ _GDF_FString(table, table_l, E.EN(linterp,table));
_GDF_FString(in_field, in_field_l, E.in_fields[0]);
*fragment_index = E.fragment_index;
gd_free_entry_strings(&E);
@@ -644,8 +644,8 @@
*in_field_l = 0;
else {
_GDF_FString(in_field, in_field_l, E.in_fields[0]);
- *bitnum = E.u.bit.bitnum;
- *numbits = E.u.bit.numbits;
+ *bitnum = E.EN(bit,bitnum);
+ *numbits = E.EN(bit,numbits);
*fragment_index = E.fragment_index;
gd_free_entry_strings(&E);
}
@@ -670,8 +670,8 @@
*in_field_l = 0;
else {
_GDF_FString(in_field, in_field_l, E.in_fields[0]);
- *bitnum = E.u.bit.bitnum;
- *numbits = E.u.bit.numbits;
+ *bitnum = E.EN(bit,bitnum);
+ *numbits = E.EN(bit,numbits);
*fragment_index = E.fragment_index;
gd_free_entry_strings(&E);
}
@@ -749,7 +749,7 @@
*in_field_l = 0;
else {
_GDF_FString(in_field, in_field_l, E.in_fields[0]);
- *dividend = E.u.recip.dividend;
+ *dividend = E.EN(recip,dividend);
*fragment_index = E.fragment_index;
gd_free_entry_strings(&E);
}
@@ -774,7 +774,7 @@
*in_field_l = 0;
else {
_GDF_FString(in_field, in_field_l, E.in_fields[0]);
- _gd_c2cp(cdividend, E.u.recip.cdividend);
+ _gd_c2cp(cdividend, E.EN(recip,cdividend));
*fragment_index = E.fragment_index;
gd_free_entry_strings(&E);
}
@@ -800,7 +800,7 @@
*in_field_l = 0;
else {
_GDF_FString(in_field, in_field_l, E.in_fields[0]);
- *shift = E.u.phase.shift;
+ *shift = E.EN(phase,shift);
*fragment_index = E.fragment_index;
gd_free_entry_strings(&E);
}
@@ -823,7 +823,7 @@
*field_code_l), &E) || E.field_type != GD_CONST_ENTRY)
*data_type = 0;
else {
- *data_type = E.u.cons.type;
+ *data_type = E.EN(cons,const_type);
*fragment_index = E.fragment_index;
gd_free_entry_strings(&E);
}
@@ -2513,14 +2513,14 @@
ok = 0;
break;
case GD_LINCOM_ENTRY:
- if (*index > GD_MAX_LINCOM + E.u.lincom.n_fields ||
- (*index > E.u.lincom.n_fields && *index <= GD_MAX_LINCOM))
+ if (*index > GD_MAX_LINCOM + E.EN(lincom,n_fields) ||
+ (*index > E.EN(lincom,n_fields) && *index <= GD_MAX_LINCOM))
{
ok = 0;
}
break;
case GD_POLYNOM_ENTRY:
- if (*index > E.u.polynom.poly_ord + 1)
+ if (*index > E.EN(polynom,poly_ord) + 1)
ok = 0;
break;
case GD_BIT_ENTRY:
@@ -2578,14 +2578,14 @@
ok = 0;
break;
case GD_LINCOM_ENTRY:
- if (*index > GD_MAX_LINCOM + E.u.lincom.n_fields ||
- (*index > E.u.lincom.n_fields && *index <= GD_MAX_LINCOM))
+ if (*index > GD_MAX_LINCOM + E.EN(lincom,n_fields) ||
+ (*index > E.EN(lincom,n_fields) && *index <= GD_MAX_LINCOM))
{
ok = 0;
}
break;
case GD_POLYNOM_ENTRY:
- if (*index > E.u.polynom.poly_ord + 1)
+ if (*index > E.EN(polynom,poly_ord) + 1)
ok = 0;
break;
case GD_BIT_ENTRY:
Modified: trunk/getdata/bindings/idl/getdata.c
===================================================================
--- trunk/getdata/bindings/idl/getdata.c 2010-10-16 01:41:34 UTC (rev 451)
+++ trunk/getdata/bindings/idl/getdata.c 2010-10-16 02:25:29 UTC (rev 452)
@@ -421,18 +421,18 @@
{
case GD_RAW_ENTRY:
*(IDL_UINT*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "SPF",
- IDL_MSG_LONGJMP, NULL)) = E->u.raw.spf;
+ IDL_MSG_LONGJMP, NULL)) = E->spf;
*(IDL_INT*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "DATA_TYPE",
- IDL_MSG_LONGJMP, NULL)) = E->u.raw.type;
+ IDL_MSG_LONGJMP, NULL)) = E->data_type;
IDL_StrStore((IDL_STRING*)(data + IDL_StructTagInfoByName(gdidl_entry_def,
"SCALAR", IDL_MSG_LONGJMP, NULL)), E->scalar[0]);
break;
case GD_LINCOM_ENTRY:
*(IDL_INT*)(data + IDL_StructTagInfoByName(gdidl_entry_def,
- "N_FIELDS", IDL_MSG_LONGJMP, NULL)) = E->u.lincom.n_fields;
+ "N_FIELDS", IDL_MSG_LONGJMP, NULL)) = E->n_fields;
*(IDL_INT*)(data + IDL_StructTagInfoByName(gdidl_entry_def,
"COMP_SCAL", IDL_MSG_LONGJMP, NULL)) = E->comp_scal;
- for (i = 0; i < E->u.lincom.n_fields; ++i) {
+ for (i = 0; i < E->n_fields; ++i) {
IDL_StrStore((IDL_STRING*)(data +
IDL_StructTagInfoByName(gdidl_entry_def, "IN_FIELDS",
IDL_MSG_LONGJMP, NULL)) + i, E->in_fields[i]);
@@ -447,29 +447,29 @@
if (E->comp_scal) {
gdidl_c99_to_dcmp((IDL_DCOMPLEX*)(data +
IDL_StructTagInfoByName(gdidl_entry_def, "CM", IDL_MSG_LONGJMP,
- NULL)), E->u.lincom.cm, E->u.lincom.n_fields);
+ NULL)), E->cm, E->n_fields);
gdidl_c99_to_dcmp((IDL_DCOMPLEX*)(data +
IDL_StructTagInfoByName(gdidl_entry_def, "CB", IDL_MSG_LONGJMP,
- NULL)), E->u.lincom.cb, E->u.lincom.n_fields);
+ NULL)), E->cb, E->n_fields);
} else {
memcpy(data + IDL_StructTagInfoByName(gdidl_entry_def, "M",
- IDL_MSG_LONGJMP, NULL), E->u.lincom.m, E->u.lincom.n_fields *
+ IDL_MSG_LONGJMP, NULL), E->m, E->n_fields *
sizeof(double));
memcpy(data + IDL_StructTagInfoByName(gdidl_entry_def, "B",
- IDL_MSG_LONGJMP, NULL), E->u.lincom.b, E->u.lincom.n_fields *
+ IDL_MSG_LONGJMP, NULL), E->b, E->n_fields *
sizeof(double));
}
break;
case GD_LINTERP_ENTRY:
IDL_StrStore((IDL_STRING*)(data + IDL_StructTagInfoByName(gdidl_entry_def,
- "TABLE", IDL_MSG_LONGJMP, NULL)), E->u.linterp.table);
+ "TABLE", IDL_MSG_LONGJMP, NULL)), E->table);
break;
case GD_BIT_ENTRY:
case GD_SBIT_ENTRY:
*(IDL_INT*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "BITNUM",
- IDL_MSG_LONGJMP, NULL)) = E->u.bit.bitnum;
+ IDL_MSG_LONGJMP, NULL)) = E->bitnum;
*(IDL_INT*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "NUMBITS",
- IDL_MSG_LONGJMP, NULL)) = E->u.bit.numbits;
+ IDL_MSG_LONGJMP, NULL)) = E->numbits;
IDL_StrStore((IDL_STRING*)(data + IDL_StructTagInfoByName(gdidl_entry_def,
"SCALAR", IDL_MSG_LONGJMP, NULL)), E->scalar[0]);
IDL_StrStore((IDL_STRING*)(data + IDL_StructTagInfoByName(gdidl_entry_def,
@@ -489,14 +489,14 @@
if (E->comp_scal)
gdidl_c99_to_dcmp((IDL_DCOMPLEX*)(data +
IDL_StructTagInfoByName(gdidl_entry_def, "CDIVIDEND",
- IDL_MSG_LONGJMP, NULL)), &E->u.recip.cdividend, 1);
+ IDL_MSG_LONGJMP, NULL)), &E->cdividend, 1);
else
*(double*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "DIVIDEND",
- IDL_MSG_LONGJMP, NULL)) = E->u.recip.dividend;
+ IDL_MSG_LONGJMP, NULL)) = E->dividend;
break;
case GD_PHASE_ENTRY:
*(IDL_LONG*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "SHIFT",
- IDL_MSG_LONGJMP, NULL)) = E->u.phase.shift;
+ IDL_MSG_LONGJMP, NULL)) = E->shift;
IDL_StrStore((IDL_STRING*)(data + IDL_StructTagInfoByName(gdidl_entry_def,
"SCALAR", IDL_MSG_LONGJMP, NULL)), E->scalar[0]);
break;
@@ -504,9 +504,9 @@
*(IDL_INT*)(data + IDL_StructTagInfoByName(gdidl_entry_def,
"COMP_SCAL", IDL_MSG_LONGJMP, NULL)) = E->comp_scal;
*(IDL_INT*)(data + IDL_StructTagInfoByName(gdidl_entry_def,
- "POLY_ORD", IDL_MSG_LONGJMP, NULL)) = E->u.polynom.poly_ord;
+ "POLY_ORD", IDL_MSG_LONGJMP, NULL)) = E->poly_ord;
- for (i = 0; i <= E->u.polynom.poly_ord; ++i)
+ for (i = 0; i <= E->poly_ord; ++i)
IDL_StrStore((IDL_STRING*)(data +
IDL_StructTagInfoByName(gdidl_entry_def, "SCALAR",
IDL_MSG_LONGJMP, NULL)) + i, E->scalar[i]);
@@ -514,15 +514,15 @@
if (E->comp_scal)
gdidl_c99_to_dcmp((IDL_DCOMPLEX*)(data +
IDL_StructTagInfoByName(gdidl_entry_def, "CA", IDL_MSG_LONGJMP,
- NULL)), E->u.polynom.ca, E->u.polynom.poly_ord + 1);
+ NULL)), E->ca, E->poly_ord + 1);
else
memcpy(data + IDL_StructTagInfoByName(gdidl_entry_def, "A",
- IDL_MSG_LONGJMP, NULL), E->u.polynom.a,
- (E->u.polynom.poly_ord + 1) * sizeof(double));
+ IDL_MSG_LONGJMP, NULL), E->a,
+ (E->poly_ord + 1) * sizeof(double));
break;
case GD_CONST_ENTRY:
*(IDL_INT*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "DATA_TYPE",
- IDL_MSG_LONGJMP, NULL)) = E->u.cons.type;
+ IDL_MSG_LONGJMP, NULL)) = E->const_type;
break;
case GD_NO_ENTRY:
case GD_INDEX_ENTRY:
@@ -595,16 +595,16 @@
if (o != -1) {
if (d->type != IDL_TYP_UINT)
idl_abort("GD_ENTRY element INDEX must be of type UINT");
- E->u.raw.spf = *(uint16_t*)(data + o);
+ E->spf = *(uint16_t*)(data + o);
}
o = IDL_StructTagInfoByName(v->value.s.sdef, "DATA_TYPE", action, &d);
if (o != -1) {
if (d->type != IDL_TYP_INT)
idl_abort("GD_ENTRY element DATA_TYPE must be of type INT");
- E->u.raw.type = *(int16_t*)(data + o);
+ E->data_type = *(int16_t*)(data + o);
} else
- E->u.raw.type = GD_NULL;
+ E->data_type = GD_NULL;
copy_scalar[0] = 1;
@@ -614,7 +614,7 @@
if (o != -1) {
if (d->type != IDL_TYP_INT)
idl_abort("GD_ENTRY element N_FIELDS must be of type INT");
- n = E->u.lincom.n_fields = *(int16_t*)(data + o);
+ n = E->n_fields = *(int16_t*)(data + o);
}
o = IDL_StructTagInfoByName(v->value.s.sdef, "COMP_SCAL", action, &d);
@@ -652,7 +652,7 @@
n = GD_MAX_LINCOM;
}
if (d->type == IDL_TYP_DCOMPLEX)
- gdidl_dcmp_to_c99(E->u.lincom.cm, (IDL_DCOMPLEX*)data + o, n);
+ gdidl_dcmp_to_c99(E->cm, (IDL_DCOMPLEX*)data + o, n);
else
idl_abort("GD_ENTRY element CM must be of type DCOMPLEX");
}
@@ -666,9 +666,9 @@
n = GD_MAX_LINCOM;
}
if (d->type == IDL_TYP_DOUBLE) {
- memcpy(E->u.lincom.m, data + o, n * sizeof(double));
+ memcpy(E->m, data + o, n * sizeof(double));
for (i = 0; i < n; ++i)
- E->u.lincom.cm[i] = E->u.lincom.m[i];
+ E->cm[i] = E->m[i];
} else
idl_abort("GD_ENTRY element M must be of type DOUBLE");
}
@@ -684,8 +684,8 @@
n = GD_MAX_LINCOM;
}
if (d->type == IDL_TYP_DCOMPLEX)
- gdidl_dcmp_to_c99(E->u.lincom.cb, (IDL_DCOMPLEX*)data + o,
- E->u.lincom.n_fields);
+ gdidl_dcmp_to_c99(E->cb, (IDL_DCOMPLEX*)data + o,
+ E->n_fields);
else
idl_abort("GD_ENTRY element CB must be of type DCOMPLEX");
}
@@ -699,10 +699,10 @@
n = GD_MAX_LINCOM;
}
if (d->type == IDL_TYP_DOUBLE) {
- memcpy(E->u.lincom.b, data + o, E->u.lincom.n_fields *
+ memcpy(E->b, data + o, E->n_fields *
sizeof(double));
- for (i = 0; i < E->u.lincom.n_fields; ++i)
- E->u.lincom.cb[i] = E->u.lincom.b[i];
+ for (i = 0; i < E->n_fields; ++i)
+ E->cb[i] = E->b[i];
} else
idl_abort("GD_ENTRY element B must be of type DOUBLE");
}
@@ -721,15 +721,15 @@
if (o != -1) {
if (d->type != IDL_TYP_INT)
idl_abort("GD_ENTRY element BITNUM must be of type INT");
- E->u.bit.bitnum = *(int16_t*)(data + o);
+ E->bitnum = *(int16_t*)(data + o);
} else
- E->u.bit.bitnum = -1;
+ E->bitnum = -1;
o = IDL_StructTagInfoByName(v->value.s.sdef, "NUMBITS", action, &d);
if (o != -1) {
if (d->type != IDL_TYP_INT)
idl_abort("GD_ENTRY element NUMBITS must be of type INT");
- E->u.bit.numbits = *(int16_t*)(data + o);
+ E->numbits = *(int16_t*)(data + o);
}
copy_scalar[0] = copy_scalar[1] = 1;
@@ -754,7 +754,7 @@
o = IDL_StructTagInfoByName(v->value.s.sdef, "CDIVIDEND", action, &d);
if (o != -1) {
if (d->type == IDL_TYP_DCOMPLEX)
- gdidl_dcmp_to_c99(&E->u.recip.cdividend, (IDL_DCOMPLEX*)data + o,
+ gdidl_dcmp_to_c99(&E->cdividend, (IDL_DCOMPLEX*)data + o,
1);
else
idl_abort("GD_ENTRY element CDIVIDEND must be of type DCOMPLEX");
@@ -763,7 +763,7 @@
o = IDL_StructTagInfoByName(v->value.s.sdef, "DIVIDEND", action, &d);
if (o != -1) {
if (d->type == IDL_TYP_DOUBLE)
- E->u.recip.dividend = *(double*)(data + o);
+ E->dividend = *(double*)(data + o);
else
idl_abort("GD_ENTRY element DIVIDEND must be of type DOUBLE");
}
@@ -775,7 +775,7 @@
&d);
if (d->type != IDL_TYP_LONG)
idl_abort("GD_ENTRY element SHIFT must be of type LONG");
- E->u.phase.shift = *(int16_t*)(data + o);
+ E->shift = *(int16_t*)(data + o);
copy_scalar[0] = 1;
break;
case GD_POLYNOM_ENTRY:
@@ -783,8 +783,8 @@
if (o != -1) {
if (d->type != IDL_TYP_INT)
idl_abort("GD_ENTRY element POLY_ORD must be of type INT");
- E->u.polynom.poly_ord = *(int16_t*)(data + o);
- n = E->u.polynom.poly_ord + 1;
+ E->poly_ord = *(int16_t*)(data + o);
+ n = E->poly_ord + 1;
}
for (i = 0 ; i < n; ++i)
@@ -807,7 +807,7 @@
n = GD_MAX_POLYORD;
}
if (d->type == IDL_TYP_DCOMPLEX)
- gdidl_dcmp_to_c99(E->u.polynom.ca, (IDL_DCOMPLEX*)data + o, n);
+ gdidl_dcmp_to_c99(E->ca, (IDL_DCOMPLEX*)data + o, n);
else
idl_abort("GD_ENTRY element CA must be of type DCOMPLEX");
}
@@ -821,7 +821,7 @@
n = GD_MAX_POLYORD;
}
if (d->type == IDL_TYP_DOUBLE)
- memcpy(E->u.polynom.a, data + o, n * sizeof(double));
+ memcpy(E->a, data + o, n * sizeof(double));
else
idl_abort("GD_ENTRY element A must be of type DOUBLE");
}
@@ -832,9 +832,9 @@
if (o != -1) {
if (d->type != IDL_TYP_INT)
idl_abort("GD_ENTRY element DATA_TYPE must be of type INT");
- E->u.cons.type = *(int16_t*)(data + o);
+ E->const_type = *(int16_t*)(data + o);
} else
- E->u.cons.type = GD_NULL;
+ E->const_type = GD_NULL;
break;
case GD_NO_ENTRY:
case GD_INDEX_ENTRY:
Modified: trunk/getdata/bindings/python/pyentry.c
===================================================================
--- trunk/getdata/bindings/python/pyentry.c 2010-10-16 01:41:34 UTC (rev 451)
+++ trunk/getdata/bindings/python/pyentry.c 2010-10-16 02:25:29 UTC (rev 452)
@@ -167,13 +167,13 @@
switch (E->field_type)
{
case GD_RAW_ENTRY:
- E->u.raw.type = (gd_type_t)PyInt_AsLong(PyTuple_GetItem(tuple, 0));
- if (GDPY_INVALID_TYPE(E->u.raw.type))
+ E->data_type = (gd_type_t)PyInt_AsLong(PyTuple_GetItem(tuple, 0));
+ if (GDPY_INVALID_TYPE(E->data_type))
PyErr_SetString(PyExc_ValueError,
"'pygetdata.entry' invalid data type");
gdpy_set_scalar_from_pyobj(PyTuple_GetItem(tuple, 1), GD_UINT16,
- &E->scalar[0], &E->u.raw.spf);
+ &E->scalar[0], &E->spf);
break;
case GD_LINCOM_ENTRY:
parm1 = PyTuple_GetItem(tuple, 0);
@@ -188,7 +188,7 @@
return;
}
- count = E->u.lincom.n_fields = PyTuple_Size(parm1);
+ count = E->n_fields = PyTuple_Size(parm1);
if (count > GD_MAX_LINCOM)
count = GD_MAX_LINCOM;
@@ -210,14 +210,14 @@
obj = PyTuple_GetItem(parm2, i);
if (PyComplex_Check(obj)) {
E->comp_scal = 1;
- E->u.lincom.cm[i] = gdpy_as_complex(obj);
+ E->cm[i] = gdpy_as_complex(obj);
} else if (E->comp_scal)
gdpy_set_scalar_from_pyobj(obj, GD_COMPLEX128, &E->scalar[i],
- &E->u.lincom.cm[i]);
+ &E->cm[i]);
else {
gdpy_set_scalar_from_pyobj(obj, GD_FLOAT64, &E->scalar[i],
- &E->u.lincom.m[i]);
- E->u.lincom.cm[i] = E->u.lincom.m[i];
+ &E->m[i]);
+ E->cm[i] = E->m[i];
}
if (PyErr_Occurred()) {
@@ -228,14 +228,14 @@
obj = PyTuple_GetItem(parm3, i);
if (PyComplex_Check(obj)) {
E->comp_scal = 1;
- E->u.lincom.cb[i] = gdpy_as_complex(obj);
+ E->cb[i] = gdpy_as_complex(obj);
} else if (E->comp_scal)
gdpy_set_scalar_from_pyobj(obj, GD_COMPLEX128,
- &E->scalar[i + GD_MAX_LINCOM], &E->u.lincom.cb[i]);
+ &E->scalar[i + GD_MAX_LINCOM], &E->cb[i]);
else {
gdpy_set_scalar_from_pyobj(obj, GD_FLOAT64,
- &E->scalar[i + GD_MAX_LINCOM], &E->u.lincom.b[i]);
- E->u.lincom.cb[i] = E->u.lincom.b[i];
+ &E->scalar[i + GD_MAX_LINCOM], &E->b[i]);
+ E->cb[i] = E->b[i];
}
if (PyErr_Occurred()) {
@@ -252,7 +252,7 @@
return;
}
- E->u.linterp.table = gdpy_dup_pystring(PyTuple_GetItem(tuple, 1));
+ E->table = gdpy_dup_pystring(PyTuple_GetItem(tuple, 1));
if (PyErr_Occurred()) {
dreturnvoid();
@@ -269,12 +269,12 @@
}
gdpy_set_scalar_from_pyobj(PyTuple_GetItem(tuple, 1), GD_INT16,
- &E->scalar[0], &E->u.bit.bitnum);
+ &E->scalar[0], &E->bitnum);
if (size > 2)
gdpy_set_scalar_from_pyobj(PyTuple_GetItem(tuple, 2), GD_INT16,
- &E->scalar[1], &E->u.bit.numbits);
+ &E->scalar[1], &E->numbits);
else {
- E->u.bit.numbits = 1;
+ E->numbits = 1;
E->scalar[1] = NULL;
}
break;
@@ -305,14 +305,14 @@
obj = PyTuple_GetItem(tuple, 1);
if (PyComplex_Check(obj)) {
E->comp_scal = 1;
- E->u.recip.cdividend = gdpy_as_complex(obj);
+ E->cdividend = gdpy_as_complex(obj);
} else if (E->comp_scal)
gdpy_set_scalar_from_pyobj(obj, GD_COMPLEX128, &E->scalar[0],
- &E->u.recip.cdividend);
+ &E->cdividend);
else {
gdpy_set_scalar_from_pyobj(obj, GD_FLOAT64, &E->scalar[0],
- &E->u.recip.dividend);
- E->u.recip.cdividend = E->u.recip.dividend;
+ &E->dividend);
+ E->cdividend = E->dividend;
}
if (PyErr_Occurred()) {
@@ -329,7 +329,7 @@
}
gdpy_set_scalar_from_pyobj(PyTuple_GetItem(tuple, 1), GD_INT64,
- &E->scalar[0], &E->u.phase.shift);
+ &E->scalar[0], &E->shift);
break;
case GD_POLYNOM_ENTRY:
parm2 = PyTuple_GetItem(tuple, 1);
@@ -340,7 +340,7 @@
return;
}
- E->u.polynom.poly_ord = count = PyTuple_Size(parm2) - 1;
+ E->poly_ord = count = PyTuple_Size(parm2) - 1;
if (count > GD_MAX_POLYORD)
count = GD_MAX_POLYORD;
@@ -355,15 +355,15 @@
obj = PyTuple_GetItem(parm2, i);
if (PyComplex_Check(obj)) {
E->comp_scal = 1;
- E->u.polynom.ca[i] = gdpy_as_complex(obj);
+ E->ca[i] = gdpy_as_complex(obj);
E->scalar[i] = NULL;
} else if (E->comp_scal)
gdpy_set_scalar_from_pyobj(obj, GD_COMPLEX128, &E->scalar[i],
- &E->u.polynom.ca[i]);
+ &E->ca[i]);
else {
gdpy_set_scalar_from_pyobj(obj, GD_FLOAT64, &E->scalar[i],
- &E->u.polynom.a[i]);
- E->u.polynom.ca[i] = E->u.polynom.a[i];
+ &E->a[i]);
+ E->ca[i] = E->a[i];
}
if (PyErr_Occurred()) {
@@ -373,8 +373,8 @@
}
break;
case GD_CONST_ENTRY:
- E->u.cons.type = (gd_type_t)PyInt_AsLong(PyTuple_GetItem(tuple, 0));
- if (GDPY_INVALID_TYPE(E->u.cons.type))
+ E->const_type = (gd_type_t)PyInt_AsLong(PyTuple_GetItem(tuple, 0));
+ if (GDPY_INVALID_TYPE(E->const_type))
PyErr_SetString(PyExc_ValueError,
"'pygetdata.entry' invalid data type");
case GD_NO_ENTRY:
@@ -653,8 +653,8 @@
switch (self->E->field_type)
{
case GD_LINCOM_ENTRY:
- tuple = PyTuple_New(self->E->u.lincom.n_fields);
- for (i = 0; i < self->E->u.lincom.n_fields; ++i)
+ tuple = PyTuple_New(self->E->n_fields);
+ for (i = 0; i < self->E->n_fields; ++i)
PyTuple_SetItem(tuple, i, PyString_FromString(self->E->in_fields[i]));
break;
case GD_LINTERP_ENTRY:
@@ -703,14 +703,14 @@
return -1;
}
- if (PyTuple_Size(value) < self->E->u.lincom.n_fields) {
+ if (PyTuple_Size(value) < self->E->n_fields) {
PyErr_SetString(PyExc_TypeError, "'pygetdata.entry' "
"not enough items in tuple for in_fields");
dreturn("%i", -1);
return -1;
}
- for (i = 0; i < self->E->u.lincom.n_fields; ++i)
+ for (i = 0; i < self->E->n_fields; ++i)
s[i] = gdpy_dup_pystring(PyTuple_GetItem(value, i));
if (PyErr_Occurred()) {
@@ -718,7 +718,7 @@
return -1;
}
- for (i = 0; i < self->E->u.lincom.n_fields; ++i) {
+ for (i = 0; i < self->E->n_fields; ++i) {
free(self->E->in_fields[i]);
self->E->in_fields[i] = s[i];
}
@@ -804,9 +804,9 @@
dtrace("%p, %p", self, closure);
if (self->E->field_type == GD_RAW_ENTRY)
- t = self->E->u.raw.type;
+ t = self->E->data_type;
else if (self->E->field_type == GD_CONST_ENTRY)
- t = self->E->u.cons.type;
+ t = self->E->const_type;
else
PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' "
"attribute 'data_type_name' not available for entry type %s",
@@ -831,9 +831,9 @@
dtrace("%p, %p", self, closure);
if (self->E->field_type == GD_RAW_ENTRY)
- obj = PyInt_FromLong(self->E->u.raw.type);
+ obj = PyInt_FromLong(self->E->data_type);
else if (self->E->field_type == GD_CONST_ENTRY)
- obj = PyInt_FromLong(self->E->u.cons.type);
+ obj = PyInt_FromLong(self->E->const_type);
else
PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' "
"attribute 'data_type' not available for entry type %s",
@@ -873,9 +873,9 @@
}
if (self->E->field_type == GD_RAW_ENTRY)
- self->E->u.raw.type = (gd_type_t)t;
+ self->E->data_type = (gd_type_t)t;
else
- self->E->u.cons.type = (gd_type_t)t;
+ self->E->const_type = (gd_type_t)t;
dreturn("%i", 0);
return 0;
@@ -889,7 +889,7 @@
if (self->E->field_type == GD_RAW_ENTRY) {
if (self->E->scalar[0] == NULL)
- obj = PyInt_FromLong(self->E->u.raw.spf);
+ obj = PyInt_FromLong(self->E->spf);
else
obj = PyString_FromString(self->E->scalar[0]);
} else
@@ -927,7 +927,7 @@
free(self->E->scalar[0]);
self->E->scalar[0] = scalar;
- self->E->u.raw.spf = spf;
+ self->E->spf = spf;
dreturn("%i", 0);
return 0;
@@ -940,7 +940,7 @@
dtrace("%p, %p", self, closure);
if (self->E->field_type == GD_LINCOM_ENTRY) {
- obj = PyInt_FromLong(self->E->u.lincom.n_fields);
+ obj = PyInt_FromLong(self->E->n_fields);
} else
PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' "
"attribute 'n_fields' not available for entry type %s",
@@ -976,16 +976,16 @@
}
/* free extra terms */
- for (i = n; i < self->E->u.lincom.n_fields; ++i)
+ for (i = n; i < self->E->n_fields; ++i)
free(self->E->in_fields[i]);
/* initialise new terms */
- for (i = self->E->u.lincom.n_fields; i < n; ++i) {
+ for (i = self->E->n_fields; i < n; ++i) {
self->E->in_fields[i] = strdup("");
- self->E->u.lincom.m[i] = self->E->u.lincom.b[i] = 0;
+ self->E->m[i] = self->E->b[i] = 0;
}
- self->E->u.lincom.n_fields = n;
+ self->E->n_fields = n;
dreturn("%i", 0);
return 0;
@@ -999,11 +999,11 @@
dtrace("%p, %p", self, closure);
if (self->E->field_type == GD_LINCOM_ENTRY) {
- obj = PyTuple_New(self->E->u.lincom.n_fields);
- for (i = 0; i < self->E->u.lincom.n_fields; ++i)
+ obj = PyTuple_New(self->E->n_fields);
+ for (i = 0; i < self->E->n_fields; ++i)
PyTuple_SetItem(obj, i, (self->E->scalar[i] == NULL) ?
- (self->E->comp_scal) ? gdpy_from_complex(self->E->u.lincom.cm[i]) :
- PyFloat_FromDouble(self->E->u.lincom.m[i]) :
+ (self->E->comp_scal) ? gdpy_from_complex(self->E->cm[i]) :
+ PyFloat_FromDouble(self->E->m[i]) :
PyString_FromString(self->E->scalar[i]));
} else
PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' "
@@ -1040,14 +1040,14 @@
return -1;
}
- if (PyTuple_Size(value) < self->E->u.lincom.n_fields) {
+ if (PyTuple_Size(value) < self->E->n_fields) {
PyErr_SetString(PyExc_TypeError, "'pygetdata.entry' "
"not enough items in tuple for attribute 'm'");
dreturn("%i", -1);
return -1;
}
- for (i = 0; i < self->E->u.lincom.n_fields; ++i) {
+ for (i = 0; i < self->E->n_fields; ++i) {
PyObject *obj = PyTuple_GetItem(value, i);
if (PyComplex_Check(obj)) {
comp_scal = 1;
@@ -1069,11 +1069,11 @@
return -1;
}
- for (i = 0; i < self->E->u.lincom.n_fields; ++i) {
- if (cimag(self->E->u.lincom.cb[i]))
+ for (i = 0; i < self->E->n_fields; ++i) {
+ if (cimag(self->E->cb[i]))
comp_scal = 1;
- self->E->u.lincom.cm[i] = cm[i];
- self->E->u.lincom.m[i] = m[i];
+ self->E->cm[i] = cm[i];
+ self->E->m[i] = m[i];
free(self->E->scalar[i]);
self->E->scalar[i] = scalar[i];
}
@@ -1091,11 +1091,11 @@
dtrace("%p, %p", self, closure);
if (self->E->field_type == GD_LINCOM_ENTRY) {
- obj = PyTuple_New(self->E->u.lincom.n_fields);
- for (i = 0; i < self->E->u.lincom.n_fields; ++i)
+ obj = PyTuple_New(self->E->n_fields);
+ for (i = 0; i < self->E->n_fields; ++i)
PyTuple_SetItem(obj, i, (self->E->scalar[i + GD_MAX_LINCOM] == NULL) ?
- (self->E->comp_scal) ? gdpy_from_complex(self->E->u.lincom.cb[i]) :
- PyFloat_FromDouble(self->E->u.lincom.b[i]) :
+ (self->E->comp_scal) ? gdpy_from_complex(self->E->cb[i]) :
+ PyFloat_FromDouble(self->E->b[i]) :
PyString_FromString(self->E->scalar[i + GD_MAX_LINCOM]));
} else
PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' "
@@ -1132,14 +1132,14 @@
return -1;
}
- if (PyTuple_Size(value) < self->E->u.lincom.n_fields) {
+ if (PyTuple_Size(value) < self->E->n_fields) {
PyErr_SetString(PyExc_TypeError, "'pygetdata.entry' "
"not enough items in tuple for attribute 'b'");
dreturn("%i", -1);
return -1;
}
- for (i = 0; i < self->E->u.lincom.n_fields; ++i) {
+ for (i = 0; i < self->E->n_fields; ++i) {
PyObject *obj = PyTuple_GetItem(value, i);
if (PyComplex_Check(obj)) {
comp_scal = 1;
@@ -1161,11 +1161,11 @@
return -1;
}
- for (i = 0; i < self->E->u.lincom.n_fields; ++i) {
- if (cimag(self->E->u.lincom.cm[i]))
+ for (i = 0; i < self->E->n_fields; ++i) {
+ if (cimag(self->E->cm[i]))
comp_scal = 1;
- self->E->u.lincom.cb[i] = cb[i];
- self->E->u.lincom.b[i] = b[i];
+ self->E->cb[i] = cb[i];
+ self->E->b[i] = b[i];
free(self->E->scalar[i + GD_MAX_LINCOM]);
self->E->scalar[i + GD_MAX_LINCOM] = scalar[i];
}
@@ -1181,7 +1181,7 @@
PyObject* obj = NULL;
if (self->E->field_type == GD_LINTERP_ENTRY)
- obj = PyString_FromString(self->E->u.linterp.table);
+ obj = PyString_FromString(self->E->table);
else
PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' "
"attribute 'table' not available for entry type %s",
@@ -1228,7 +1228,7 @@
self->E->field_type == GD_SBIT_ENTRY)
{
if (self->E->scalar[0] == NULL)
- obj = PyInt_FromLong(self->E->u.bit.bitnum);
+ obj = PyInt_FromLong(self->E->bitnum);
else
obj = PyString_FromString(self->E->scalar[0]);
} else
@@ -1264,7 +1264,7 @@
return -1;
}
- self->E->u.bit.bitnum = (gd_bit_t)bitnum;
+ self->E->bitnum = (gd_bit_t)bitnum;
free(self->E->scalar[0]);
self->E->scalar[0] = scalar;
@@ -1282,7 +1282,7 @@
self->E->field_type == GD_SBIT_ENTRY)
{
if (self->E->scalar[1] == NULL)
- obj = PyInt_FromLong(self->E->u.bit.numbits);
+ obj = PyInt_FromLong(self->E->numbits);
else
obj = PyString_FromString(self->E->scalar[1]);
} else
@@ -1319,7 +1319,7 @@
return -1;
}
- self->E->u.bit.numbits = (gd_bit_t)numbits;
+ self->E->numbits = (gd_bit_t)numbits;
free(self->E->scalar[1]);
self->E->scalar[1] = scalar;
@@ -1338,9 +1338,9 @@
if (self->E->scalar[0])
obj = PyString_FromString(self->E->scalar[0]);
else if (self->E->comp_scal)
- obj = gdpy_from_complex(self->E->u.recip.cdividend);
+ obj = gdpy_from_complex(self->E->cdividend);
else
- obj = PyFloat_FromDouble(self->E->u.recip.dividend);
+ obj = PyFloat_FromDouble(self->E->dividend);
} else
PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' "
"attribute 'dividend' not available for entry type %s",
@@ -1385,8 +1385,8 @@
}
self->E->comp_scal = comp_scal;
- self->E->u.recip.cdividend = cdividend;
- self->E->u.recip.dividend = dividend;
+ self->E->cdividend = cdividend;
+ self->E->dividend = dividend;
free(self->E->scalar[0]);
self->E->scalar[0] = scalar;
@@ -1402,7 +1402,7 @@
if (self->E->field_type == GD_PHASE_ENTRY) {
if (self->E->scalar[0] == NULL)
- obj = PyLong_FromLongLong((PY_LONG_LONG)self->E->u.phase.shift);
+ obj = PyLong_FromLongLong((PY_LONG_LONG)self->E->shift);
else
obj = PyString_FromString(self->E->scalar[0]);
} else
@@ -1437,7 +1437,7 @@
return -1;
}
- self->E->u.phase.shift = shift;
+ self->E->shift = shift;
free(self->E->scalar[0]);
self->E->scalar[0] = scalar;
@@ -1453,11 +1453,11 @@
dtrace("%p, %p", self, closure);
if (self->E->field_type == GD_POLYNOM_ENTRY) {
- obj = PyTuple_New(self->E->u.polynom.poly_ord + 1);
- for (i = 0; i <= self->E->u.polynom.poly_ord; ++i)
+ obj = PyTuple_New(self->E->poly_ord + 1);
+ for (i = 0; i <= self->E->poly_ord; ++i)
PyTuple_SetItem(obj, i, (self->E->scalar[i] == NULL) ?
- (self->E->comp_scal) ? gdpy_from_complex(self->E->u.polynom.ca[i]) :
- PyFloat_FromDouble(self->E->u.polynom.a[i]) :
+ (self->E->comp_scal) ? gdpy_from_complex(self->E->ca[i]) :
+ PyFloat_FromDouble(self->E->a[i]) :
PyString_FromString(self->E->scalar[i]));
} else
PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' "
@@ -1494,14 +1494,14 @@
return -1;
}
- if (PyTuple_Size(value) < self->E->u.polynom.poly_ord + 1) {
+ if (PyTuple_Size(value) < self->E->poly_ord + 1) {
PyErr_SetString(PyExc_TypeError, "'pygetdata.entry' "
"not enough items in tuple for attribute 'a'");
dreturn("%i", -1);
return -1;
}
- for (i = 0; i <= self->E->u.polynom.poly_ord; ++i) {
+ for (i = 0; i <= self->E->poly_ord; ++i) {
PyObject *obj = PyTuple_GetItem(value, i);
if (PyComplex_Check(obj)) {
comp_scal = 1;
@@ -1520,9 +1520,9 @@
return -1;
}
- for (i = 0; i <= self->E->u.polynom.poly_ord; ++i) {
- self->E->u.polynom.a[i] = a[i];
- self->E->u.polynom.ca[i] = ca[i];
+ for (i = 0; i <= self->E->poly_ord; ++i) {
+ self->E->a[i] = a[i];
+ self->E->ca[i] = ca[i];
free(self->E->scalar[i]);
self->E->scalar[i] = scalar[i];
}
@@ -1539,7 +1539,7 @@
dtrace("%p, %p", self, closure);
if (self->E->field_type == GD_POLYNOM_ENTRY)
- obj = PyInt_FromLong(self->E->u.polynom.poly_ord);
+ obj = PyInt_FromLong(self->E->poly_ord);
else
PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' "
"attribute 'poly_ord' not available for entry type %s",
@@ -1574,7 +1574,7 @@
return -1;
}
- self->E->u.polynom.poly_ord = n;
+ self->E->poly_ord = n;
dreturn("%i", 0);
return 0;
@@ -1596,14 +1596,14 @@
tuple = Py_BuildValue("()");
break;
case GD_CONST_ENTRY:
- tuple = Py_BuildValue("(i)", self->E->u.cons.type);
+ tuple = Py_BuildValue("(i)", self->E->const_type);
break;
case GD_RAW_ENTRY:
- tuple = Py_BuildValue("(iI)", self->E->u.raw.type, self->E->u.raw.spf);
+ tuple = Py_BuildValue("(iI)", self->E->data_type, self->E->spf);
break;
case GD_LINTERP_ENTRY:
tuple = Py_BuildValue("(ss)", self->E->in_fields[0],
- self->E->u.linterp.table);
+ self->E->table);
break;
case GD_MULTIPLY_ENTRY:
case GD_DIVIDE_ENTRY:
@@ -1613,73 +1613,73 @@
case GD_RECIP_ENTRY:
if (self->E->comp_scal)
tuple = Py_BuildValue("(sO)", self->E->in_fields[0],
- gdpy_from_complex(self->E->u.recip.cdividend));
+ gdpy_from_complex(self->E->cdividend));
else
tuple = Py_BuildValue("(sd)", self->E->in_fields[0],
- self->E->u.recip.dividend);
+ self->E->dividend);
break;
case GD_PHASE_ENTRY:
tuple = Py_BuildValue("(si)", self->E->in_fields[0],
- self->E->u.phase.shift);
+ self->E->shift);
break;
case GD_POLYNOM_ENTRY:
- a = PyTuple_New(self->E->u.polynom.poly_ord + 1);
+ a = PyTuple_New(self->E->poly_ord + 1);
if (self->E->comp_scal)
- for (i = 0; i <= self->E->u.polynom.poly_ord; ++i)
- PyTuple_SetItem(a, i, gdpy_from_complex(self->E->u.polynom.ca[i]));
+ for (i = 0; i <= self->E->poly_ord; ++i)
+ PyTuple_SetItem(a, i, gdpy_from_complex(self->E->ca[i]));
else
- for (i = 0; i <= self->E->u.polynom.poly_ord; ++i)
- PyTuple_SetItem(a, i, PyFloat_FromDouble(self->E->u.polynom.a[i]));
+ for (i = 0; i <= self->E->poly_ord; ++i)
+ PyTuple_SetItem(a, i, PyFloat_FromDouble(self->E->a[i]));
tuple = Py_BuildValue("(sO)", self->E->in_fields[0], a);
break;
case GD_LINCOM_ENTRY:
- switch (self->E->u.lincom.n_fields) {
+ switch (self->E->n_fields) {
case 1:
if (self->E->comp_scal)
tuple = Py_BuildValue("((s)(O)(O))", self->E->in_fields[0],
- gdpy_from_complex(self->E->u.lincom.cm[0]),
- gdpy_from_complex(self->E->u.lincom.cb[0]));
+ gdpy_from_complex(self->E->cm[0]),
+ gdpy_from_complex(self->E->cb[0]));
else
tuple = Py_BuildValue("((s)(d)(d))", self->E->in_fields[0],
- self->E->u.lincom.m[0], self->E->u.lincom.b[0]);
+ self->E->m[0], self->E->b[0]);
break;
case 2:
if (self->E->comp_scal)
tuple = Py_BuildValue("((ss)(OO)(OO))", self->E->in_fields[0],
self->E->in_fields[1],
- gdpy_from_complex(self->E->u.lincom.cm[0]),
- gdpy_from_complex(self->E->u.lincom.cm[1]),
- gdpy_from_complex(self->E->u.lincom.cb[0]),
- gdpy_from_complex(self->E->u.lincom.cb[1]));
+ gdpy_from_complex(self->E->cm[0]),
+ gdpy_from_complex(self->E->cm[1]),
+ gdpy_from_complex(self->E->cb[0]),
+ gdpy_from_complex(self->E->cb[1]));
else
tuple = Py_BuildValue("((ss)(dd)(dd))", self->E->in_fields[0],
- self->E->in_fields[1], self->E->u.lincom.m[0],
- self->E->u.lincom.m[1], self->E->u.lincom.b[0],
- self->E->u.lincom.b[1]);
+ self->E->in_fields[1], self->E->m[0],
+ self->E->m[1], self->E->b[0],
+ self->E->b[1]);
break;
case 3:
if (self->E->comp_scal)
tuple = Py_BuildValue("((sss)(OOO)(OOO))", self->E->in_fields[0],
self->E->in_fields[1], self->E->in_fields[2],
- gdpy_from_complex(self->E->u.lincom.cm[0]),
- gdpy_from_complex(self->E->u.lincom.cm[1]),
- gdpy_from_complex(self->E->u.lincom.cm[2]),
- gdpy_from_complex(self->E->u.lincom.cb[0]),
- gdpy_from_complex(self->E->u.lincom.cb[1]),
- gdpy_from_complex(self->E->u.lincom.cb[2]));
+ gdpy_from_complex(self->E->cm[0]),
+ gdpy_from_complex(self->E->cm[1]),
+ gdpy_from_complex(self->E->cm[2]),
+ gdpy_from_complex(self->E->cb[0]),
+ gdpy_from_complex(self->E->cb[1]),
+ gdpy_from_complex(self->E->cb[2]));
else
tuple = Py_BuildValue("((sss)(ddd)(ddd))", self->E->in_fields[0],
self->E->in_fields[1], self->E->in_fields[2],
- self->E->u.lincom.m[0], self->E->u.lincom.m[1],
- self->E->u.lincom.m[2], self->E->u.lincom.b[0],
- self->E->u.lincom.b[1], self->E->u.lincom.b[2]);
+ self->E->m[0], self->E->m[1],
+ self->E->m[2], self->E->b[0],
+ self->E->b[1], self->E->b[2]);
break;
}
break;
case GD_BIT_ENTRY:
case GD_SBIT_ENTRY:
tuple = Py_BuildValue("(sii)", self->E->in_fields[0],
- self->E->u.bit.bitnum, self->E->u.bit.numbits);
+ self->E->bitnum, self->E->numbits);
break;
}
Modified: trunk/getdata/configure.ac
===================================================================
--- trunk/getdata/configure.ac 2010-10-16 01:41:34 UTC (rev 451)
+++ trunk/getdata/configure.ac 2010-10-16 02:25:29 UTC (rev 452)
@@ -22,7 +22,7 @@
m4_define(getdata_major, 0)
m4_define(getdata_minor, 7)
m4_define(getdata_revision, 0)
-m4_define(getdata_extra, [a1])
+m4_define(getdata_extra, [a2])
m4_define(getdata_version,
getdata_major.getdata_minor.getdata_revision[]getdata_extra)
Modified: trunk/getdata/src/add.c
===================================================================
--- trunk/getdata/src/add.c 2010-10-16 01:41:34 UTC (rev 451)
+++ trunk/getdata/src/add.c 2010-10-16 02:25:29 UTC (rev 452)
@@ -184,35 +184,40 @@
return -1;
}
- E->u.raw.type = entry->u.raw.type;
- E->e->u.raw.file[0].fp = E->e->u.raw.file[1].fp = -1;
- E->e->u.raw.file[0].encoding = GD_ENC_UNKNOWN;
+ E->EN(raw,data_type) = entry->EN(raw,data_type);
+ E->e->EN(raw,file)[0].fp = E->e->EN(raw,file)[1].fp = -1;
+ E->e->EN(raw,file)[0].encoding = GD_ENC_UNKNOWN;
- if ((E->e->u.raw.filebase = (char *)malloc(FILENAME_MAX)) == NULL) {
+ if ((E->e->EN(raw,filebase) = (char *)malloc(FILENAME_MAX)) == NULL) {
_GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
break;
}
if (D->fragment[E->fragment_index].sname)
- snprintf(E->e->u.raw.filebase, FILENAME_MAX, "%s/%s/%s", D->name,
+ snprintf(E->e->EN(raw,filebase), FILENAME_MAX, "%s/%s/%s", D->name,
D->fragment[E->fragment_index].sname, E->field);
else
- snprintf(E->e->u.raw.filebase, FILENAME_MAX, "%s/%s", D->name,
+ snprintf(E->e->EN(raw,filebase), FILENAME_MAX, "%s/%s", D->name,
E->field);
- if ((E->u.raw.spf = entry->u.raw.spf) == 0)
+ if ((E->EN(raw,spf) = entry->EN(raw,spf)) == 0)
_GD_SetError(D, GD_E_BAD_ENTRY, GD_E_BAD_ENTRY_SPF, NULL,
- entry->u.raw.spf, NULL);
- else if (E->u.raw.type & 0x40 || (E->e->u.raw.size =
- GD_SIZE(E->u.raw.type)) == 0)
- _GD_SetError(D, GD_E_BAD_TYPE, entry->u.raw.type, NULL, 0, NULL);
+ entry->EN(raw,spf), NULL);
+ else if (E->EN(raw,data_type) & 0x40 || (E->e->EN(raw,size) =
+ GD_SIZE(E->EN(raw,data_type))) == 0)
+ _GD_SetError(D, GD_E_BAD_TYPE, entry->EN(raw,data_type), NULL, 0, NULL);
else if (!_GD_Supports(D, E, GD_EF_TOUCH))
; /* error already set */
- else if (_GD_SetEncodedName(D, E->e->u.raw.file, E->e->u.raw.filebase, 0))
+ else if (_GD_SetEncodedName(D, E->e->EN(raw,file), E->e->EN(raw,filebase),
+ 0))
+ {
; /* error already set */
- else if ((*_gd_ef[E->e->u.raw.file[0].encoding].touch)(E->e->u.raw.file))
- _GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[0].name, errno, NULL);
- else if (D->fragment[E->fragment_index].ref_name == NULL) {
+ } else if ((*_gd_ef[E->e->EN(raw,file)[0].encoding].touch)(E->e->EN(raw,
+ file)))
+ {
+ _GD_SetError(D, GD_E_RAW_IO, 0, E->e->EN(raw,file)[0].name, errno,
+ NULL);
+ } else if (D->fragment[E->fragment_index].ref_name == NULL) {
/* This is the first raw field in this fragment */
new_ref = strdup(E->field);
if (new_ref == NULL)
@@ -221,38 +226,38 @@
copy_scalar[0] = 1;
break;
case GD_LINCOM_ENTRY:
- E->u.lincom.n_fields = entry->u.lincom.n_fields;
+ E->EN(lincom,n_fields) = entry->EN(lincom,n_fields);
- if (E->u.lincom.n_fields < 1 || E->u.lincom.n_fields > GD_MAX_LINCOM)
+ if (E->EN(lincom,n_fields) < 1 || E->EN(lincom,n_fields) > GD_MAX_LINCOM)
_GD_SetError(D, GD_E_BAD_ENTRY, GD_E_BAD_ENTRY_NFIELDS, NULL,
- E->u.lincom.n_fields, NULL);
+ E->EN(lincom,n_fields), NULL);
else {
if (entry->comp_scal) {
int cs = 0;
- memcpy(E->u.lincom.cm, entry->u.lincom.cm, sizeof(double) * 2 *
- E->u.lincom.n_fields);
- memcpy(E->u.lincom.cb, entry->u.lincom.cb, sizeof(double) * 2 *
- E->u.lincom.n_fields);
- for (i = 0; i < E->u.lincom.n_fields; ++i) {
- E->u.lincom.m[i] = creal(E->u.lincom.cm[i]);
- E->u.lincom.b[i] = creal(E->u.lincom.cb[i]);
- if (cimag(E->u.lincom.cm[i]) || cimag(E->u.lincom.cb[i]))
+ memcpy(E->EN(lincom,cm), entry->EN(lincom,cm), sizeof(double) * 2 *
+ E->EN(lincom,n_fields));
+ memcpy(E->EN(lincom,cb), entry->EN(lincom,cb), sizeof(double) * 2 *
+ E->EN(lincom,n_fields));
+ for (i = 0; i < E->EN(lincom,n_fields); ++i) {
+ E->EN(lincom,m)[i] = creal(E->EN(lincom,cm)[i]);
+ E->EN(lincom,b)[i] = creal(E->EN(lincom,cb)[i]);
+ if (cimag(E->EN(lincom,cm)[i]) || cimag(E->EN(lincom,cb)[i]))
cs = 1;
}
E->comp_scal = cs;
} else {
- memcpy(E->u.lincom.m, entry->u.lincom.m, sizeof(double) *
- E->u.lincom.n_fields);
- memcpy(E->u.lincom.b, entry->u.lincom.b, sizeof(double) *
- E->u.lincom.n_fields);
- for (i = 0; i < E->u.lincom.n_fields; ++i) {
- _gd_r2c(E->u.lincom.cm[i], E->u.lincom.m[i]);
- _gd_r2c(E->u.lincom.cb[i], E->u.lincom.b[i]);
+ memcpy(E->EN(lincom,m), entry->EN(lincom,m), sizeof(double) *
+ E->EN(lincom,n_fields));
+ memcpy(E->EN(lincom,b), entry->EN(lincom,b), sizeof(double) *
+ E->EN(lincom,n_fields));
+ for (i = 0; i < E->EN(lincom,n_fields); ++i) {
+ _gd_r2c(E->EN(lincom,cm)[i], E->EN(lincom,m)[i]);
+ _gd_r2c(E->EN(lincom,cb)[i], E->EN(lincom,b)[i]);
}
E->comp_scal = 0;
}
- for (i = 0; i < E->u.lincom.n_fields; ++i) {
+ for (i = 0; i < E->EN(lincom,n_fields); ++i) {
if ((E->in_fields[i] = strdup(entry->in_fields[i])) == NULL)
_GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
copy_scalar[i] = copy_scalar[i + GD_MAX_LINCOM] = 1;
@@ -260,12 +265,15 @@
}
break;
case GD_LINTERP_ENTRY:
- E->e->u.linterp.table_len = -1;
+ E->e->EN(linterp,table_len) = -1;
if ((E->in_fields[0] = strdup(entry->in_fields[0])) == NULL)
_GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
- else if ((E->u.linterp.table = strdup(entry->u.linterp.table)) == NULL)
+ else if ((E->EN(linterp,table) = strdup(entry->EN(linterp,table)))
+ == NULL)
+ {
_GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
+ }
break;
case GD_MULTIPLY_ENTRY:
case GD_DIVIDE_ENTRY:
@@ -280,73 +288,76 @@
copy_scalar[0] = 1;
if (entry->comp_scal) {
- _gd_c2c(E->u.recip.cdividend, entry->u.recip.cdividend);
- E->u.recip.dividend = creal(E->u.recip.cdividend);
- E->comp_scal = (cimag(E->u.recip.cdividend) == 0) ? 0 : 1;
+ _gd_c2c(E->EN(recip,cdividend), entry->EN(recip,cdividend));
+ E->EN(recip,dividend) = creal(E->EN(recip,cdividend));
+ E->comp_scal = (cimag(E->EN(recip,cdividend)) == 0) ? 0 : 1;
} else {
- E->u.recip.dividend = entry->u.recip.dividend;
- _gd_r2c(E->u.recip.cdividend, E->u.recip.dividend);
+ E->EN(recip,dividend) = entry->EN(recip,dividend);
+ _gd_r2c(E->EN(recip,cdividend), E->EN(recip,dividend));
E->comp_scal = 0;
}
break;
case GD_BIT_ENTRY:
case GD_SBIT_ENTRY:
- E->u.bit.numbits = entry->u.bit.numbits;
- E->u.bit.bitnum = entry->u.bit.bitnum;
+ E->EN(bit,numbits) = entry->EN(bit,numbits);
+ E->EN(bit,bitnum) = entry->EN(bit,bitnum);
if ((E->in_fields[0] = strdup(entry->in_fields[0])) == NULL)
_GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
- else if (E->u.bit.numbits < 1)
+ else if (E->EN(bit,numbits) < 1)
_GD_SetError(D, GD_E_BAD_ENTRY, GD_E_BAD_ENTRY_NUMBITS, NULL,
- entry->u.bit.numbits, NULL);
- else if (E->u.bit.bitnum < 0)
+ entry->EN(bit,numbits), NULL);
+ else if (E->EN(bit,bitnum) < 0)
_GD_SetError(D, GD_E_BAD_ENTRY, GD_E_BAD_ENTRY_BITNUM, NULL,
- entry->u.bit.bitnum, NULL);
- else if (E->u.bit.bitnum + E->u.bit.numbits - 1 > 63)
+ entry->EN(bit,bitnum), NULL);
+ else if (E->EN(bit,bitnum) + E->EN(bit,numbits) - 1 > 63)
_GD_SetError(D, GD_E_BAD_ENTRY, GD_E_BAD_ENTRY_BITSIZE, NULL,
- E->u.bit.bitnum + E->u.bit.numbits - 1, NULL);
+ E->EN(bit,bitnum) + E->EN(bit,numbits) - 1, NULL);
copy_scalar[0] = copy_scalar[1] = 1;
break;
case GD_PHASE_ENTRY:
- E->u.phase.shift = entry->u.phase.shift;
+ E->EN(phase,shift) = entry->EN(phase,shift);
if ((E->in_fields[0] = strdup(entry->in_fields[0])) == NULL)
_GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL);
copy_scalar[0] = 1;
break;
case GD_CONST_ENTRY:
- E->u.cons.type = entry->u.cons.type;
+ E->EN(cons,const_type) = entry->EN(cons,const_type);
- if (E->u.cons.type & 0x40 || GD_SIZE(E->u.cons.type) == 0)
- _GD_SetError(D, GD_E_BAD_TYPE, E->u.cons.type, NULL, 0, NULL);
+ if (E->EN(cons,const_type) & 0x40 || GD_SIZE(E->EN(cons,const_type)) == 0)
+ _GD_SetError(D, GD_E_BAD_TYPE, E->...
[truncated message content] |
|
From: <ket...@us...> - 2010-10-16 01:41:42
|
Revision: 451
http://getdata.svn.sourceforge.net/getdata/?rev=451&view=rev
Author: ketiltrout
Date: 2010-10-16 01:41:34 +0000 (Sat, 16 Oct 2010)
Log Message:
-----------
Doc updates
Modified Paths:
--------------
trunk/getdata/man/dirfile-format.5
trunk/getdata/man/gd_add.3
trunk/getdata/man/gd_alter_bit.3
trunk/getdata/man/gd_alter_entry.3
trunk/getdata/man/gd_bof.3
trunk/getdata/man/gd_cbopen.3
trunk/getdata/man/gd_close.3
trunk/getdata/man/gd_constants.3
trunk/getdata/man/gd_dirfile_standards.3
trunk/getdata/man/gd_entry.3
trunk/getdata/man/gd_eof.3
trunk/getdata/man/gd_field_list.3
trunk/getdata/man/gd_field_list_by_type.3
trunk/getdata/man/gd_framenum_subset.3
trunk/getdata/man/gd_include.3
trunk/getdata/man/gd_invalid_dirfile.3
trunk/getdata/man/gd_mconstants.3
trunk/getdata/man/gd_mfield_list.3
trunk/getdata/man/gd_mfield_list_by_type.3
trunk/getdata/man/gd_mstrings.3
trunk/getdata/man/gd_mvector_list.3
trunk/getdata/man/gd_rewrite_fragment.3
trunk/getdata/man/gd_strings.3
trunk/getdata/man/gd_uninclude.3
trunk/getdata/man/gd_vector_list.3
Modified: trunk/getdata/man/dirfile-format.5
===================================================================
--- trunk/getdata/man/dirfile-format.5 2010-10-15 19:22:58 UTC (rev 450)
+++ trunk/getdata/man/dirfile-format.5 2010-10-16 01:41:34 UTC (rev 451)
@@ -13,7 +13,7 @@
.\" Texts. A copy of the license is included in the `COPYING.DOC' file
.\" as part of this distribution.
.\"
-.TH dirfile\-format 5 "15 July 2010" "Standards Version 8" "DATA FORMATS"
+.TH dirfile\-format 5 "15 October 2010" "Standards Version 8" "DATA FORMATS"
.SH NAME
dirfile\-format \(em the dirfile database format specification file
.SH DESCRIPTION
@@ -32,7 +32,7 @@
located in the base dirfile directory. This file may contain only part of
the format specification, and may reference other fragments (using the
.B /INCLUDE
-directive) containing futher format specification. This inclusion mechanism
+directive) containing further format specification. This inclusion mechanism
may be nested arbitrarily deep.
The explicit text encoding of these files is not specified by these standards,
@@ -411,7 +411,7 @@
which is a special, implicit field which contains the integer frame index.
Field names are case sensitive.
-If the field name beginning a field specifiction line does contain a
+If the field name beginning a field specification line does contain a
.B /
character, the line is assumed to specify a metafield. See the
.B META
@@ -614,7 +614,7 @@
.TP
.B POLYNOM
The POLYNOM vector field type specifies a polynomial function of a single input
-vector field. Synax is:
+vector field. Syntax is:
.RS
.IP
.I <field_name>
Modified: trunk/getdata/man/gd_add.3
===================================================================
--- trunk/getdata/man/gd_add.3 2010-10-15 19:22:58 UTC (rev 450)
+++ trunk/getdata/man/gd_add.3 2010-10-16 01:41:34 UTC (rev 451)
@@ -13,7 +13,7 @@
.\" Texts. A copy of the license is included in the `COPYING.DOC' file
.\" as part of this distribution.
.\"
-.TH gd_add 3 "21 July 2010" "Version 0.7.0" "GETDATA"
+.TH gd_add 3 "15 October 2010" "Version 0.7.0" "GETDATA"
.SH NAME
gd_add, gd_madd \(em add a field to a dirfile
.SH SYNOPSIS
@@ -144,7 +144,7 @@
field.
.TP
.B GD_E_UNSUPPORTED
-The encoding scheme of the indicated format specification fragment does notr
+The encoding scheme of the indicated format specification fragment does not
support creating an empty binary file to be associated with a newly added
.B RAW
field.
Modified: trunk/getdata/man/gd_alter_bit.3
===================================================================
--- trunk/getdata/man/gd_alter_bit.3 2010-10-15 19:22:58 UTC (rev 450)
+++ trunk/getdata/man/gd_alter_bit.3 2010-10-16 01:41:34 UTC (rev 451)
@@ -13,7 +13,7 @@
.\" Texts. A copy of the license is included in the `COPYING.DOC' file
.\" as part of this distribution.
.\"
-.TH gd_alter_bit 3 "21 July 2010" "Version 0.7.0" "GETDATA"
+.TH gd_alter_bit 3 "15 October 2010" "Version 0.7.0" "GETDATA"
.SH NAME
gd_alter_bit, gd_alter_clincom, gd_alter_const, gd_alter_cpolynom,
gd_alter_crecip, gd_alter_divide, gd_alter_lincom, gd_alter_linterp,
@@ -80,7 +80,7 @@
.I field_code
indicates the the field to be modified, which may be a regular field, or a
metafield specified by its full (slashed) field code, but should not contain a
-representtion suffix. The meaning and valid
+representation suffix. The meaning and valid
types of other arguments may be obtained from the
.BR get_entry (3)
and
Modified: trunk/getdata/man/gd_alter_entry.3
===================================================================
--- trunk/getdata/man/gd_alter_entry.3 2010-10-15 19:22:58 UTC (rev 450)
+++ trunk/getdata/man/gd_alter_entry.3 2010-10-16 01:41:34 UTC (rev 451)
@@ -13,7 +13,7 @@
.\" Texts. A copy of the license is included in the `COPYING.DOC' file
.\" as part of this distribution.
.\"
-.TH gd_alter_entry 3 "21 July 2010" "Version 0.7.0" "GETDATA"
+.TH gd_alter_entry 3 "15 October 2010" "Version 0.7.0" "GETDATA"
.SH NAME
gd_alter_entry \(em modify the metadata of a dirfile field
.SH SYNOPSIS
@@ -39,7 +39,7 @@
may also refer to a metafield by specifying it using its full (slashed) field
code. However,
.I field_code
-should never contain a represenation suffix.
+should never contain a representation suffix.
The form of
.I entry
@@ -136,12 +136,12 @@
.B CONST
field to be used for the corresponding field parameter. If the parameter was
previously a literal number, it will be replaced by the specified field code.
-If the paramter was previously a field code, the new field code will replace the
+If the parameter was previously a field code, the new field code will replace the
old one.
.IP \(bu 4
a pointer the empty string (""). In this case, no change is made to the field
code for the corresponding field parameter: if one already existed, it is kept,
-otherise the correponding literal numerical parameter is used. If the value
+otherwise the corresponding literal numerical parameter is used. If the value
of the corresponding numerical
.I entry
member is the special value listed above indicating no change, no change is
@@ -171,7 +171,7 @@
The field specified by
.I field_code
was not found. This error may also result from attempting to dereference a
-scalar field code which indicates a non-existant field.
+scalar field code which indicates a non-existent field.
.TP
.B GD_E_BAD_DIRFILE
The supplied dirfile was invalid.
Modified: trunk/getdata/man/gd_bof.3
===================================================================
--- trunk/getdata/man/gd_bof.3 2010-10-15 19:22:58 UTC (rev 450)
+++ trunk/getdata/man/gd_bof.3 2010-10-16 01:41:34 UTC (rev 451)
@@ -13,7 +13,7 @@
.\" Texts. A copy of the license is included in the `COPYING.DOC' file
.\" as part of this distribution.
.\"
-.TH gd_bof 3 "24 July 2010" "Version 0.7.0" "GETDATA"
+.TH gd_bof 3 "15 October 2010" "Version 0.7.0" "GETDATA"
.SH NAME
gd_bof \(em report the start of data in a field
.SH SYNOPSIS
@@ -41,15 +41,15 @@
field, the beginning-of-field corresponds to the frame offset of that field
(see
.BR gd_frameoffset (3)).
-For other field types, the beginning-of-field marker is equivalent to the
-beginning-of-field marker furthest from the start of the dirfile of any of the
-field inputs. The beginning-of-field marker for the special field
+The beginning-of-field for all other vector field type is the same as the
+beginning-of-field of whichever of its input fields that starts latest. The
+beginning-of-field marker for the special field
.I INDEX
-is always sample zero.
+is always zero.
The beginning-of-field marker for a field containing no data is in the same
location as, or after, its end-of-field marker (see
-.BR gd_bof (3)).
+.BR gd_eof (3)).
For a
.B RAW
field, the difference between the locations of the beginning- and end-of-field
Modified: trunk/getdata/man/gd_cbopen.3
===================================================================
--- trunk/getdata/man/gd_cbopen.3 2010-10-15 19:22:58 UTC (rev 450)
+++ trunk/getdata/man/gd_cbopen.3 2010-10-16 01:41:34 UTC (rev 451)
@@ -13,7 +13,7 @@
.\" Texts. A copy of the license is included in the `COPYING.DOC' file
.\" as part of this distribution.
.\"
-.TH gd_cbopen 3 "24 July 2010" "Version 0.7.0" "GETDATA"
+.TH gd_cbopen 3 "15 October 2010" "Version 0.7.0" "GETDATA"
.SH NAME
gd_cbopen, gd_open \(em open or create a dirfile
.SH SYNOPSIS
@@ -282,7 +282,7 @@
Specifies that raw data files are not encoded, but written verbatim to disk.
.SS Standards Compliance
-The latest Dirfile Standards Version which this version of GetData understands
+The latest Dirfile Standards Version which this release of GetData understands
is provided in the preprocessor macro
.B GD_DIRFILE_STANDARDS_VERSION
defined in getdata.h. GetData is able to open and parse any Dirfile which
@@ -293,7 +293,7 @@
The GetData parser can operate in two modes: a
.I permissive
mode, in which much
-non-Standards compliant sytax is allowed, and a
+non-Standards compliant syntax is allowed, and a
.I pedanitc
mode, in which the parser adheres strictly to the Standards. If
.B GD_PEDANTIC
@@ -310,7 +310,7 @@
conform to no single Standard, but which were accepted by the GetData parser
in previous versions. It is notably lax regarding reserved field names, and
field name characters, the mixing of old and new data type specifiers, and
-generally ignores the presense of
+generally ignores the presence of
.B /VERSION
directives.
In read-write mode,
@@ -344,9 +344,9 @@
.B GD_PERMISSIVE
flag was passed to
.BR gd_cbopen (),
-in which case, no mode switch will take place.
+in which case no mode switch will take place.
-Independant of the mode of the parser when parsing the format specification,
+Independent of the mode of the parser when parsing the format specification,
GetData will calculate a list of Standards Versions to which the parsed
metadata conform to. The
.BR gd_dirfile_standards (3)
@@ -609,7 +609,7 @@
A descriptive error string for the last error encountered can be obtained from
a call to
.BR gd_error_string (3).
-When finished with it, a caller should deallocate the DIRFILE object by calling
+When finished with it, a caller should de-allocate the DIRFILE object by calling
.BR gd_close (3),
even if the open failed.
.SH BUGS
Modified: trunk/getdata/man/gd_close.3
===================================================================
--- trunk/getdata/man/gd_close.3 2010-10-15 19:22:58 UTC (rev 450)
+++ trunk/getdata/man/gd_close.3 2010-10-16 01:41:34 UTC (rev 451)
@@ -13,7 +13,7 @@
.\" Texts. A copy of the license is included in the `COPYING.DOC' file
.\" as part of this distribution.
.\"
-.TH gd_close 3 "24 July 2010" "Version 0.7.0" "GETDATA"
+.TH gd_close 3 "15 October 2010" "Version 0.7.0" "GETDATA"
.SH NAME
gd_close, gd_discard \(em close a dirfile and free associated memory.
.SH SYNOPSIS
@@ -79,7 +79,7 @@
.BR gd_close ()
and
.BR gd_discard ()
-return zero on success. On error, they do not deallocate
+return zero on success. On error, they do not de-allocate
.I dirfile
and set the dirfile error to a non-zero error value. Possible error values
are:
Modified: trunk/getdata/man/gd_constants.3
===================================================================
--- trunk/getdata/man/gd_constants.3 2010-10-15 19:22:58 UTC (rev 450)
+++ trunk/getdata/man/gd_constants.3 2010-10-16 01:41:34 UTC (rev 451)
@@ -13,7 +13,7 @@
.\" Texts. A copy of the license is included in the `COPYING.DOC' file
.\" as part of this distribution.
.\"
-.TH gd_constants 3 "15 July 2010" "Version 0.7.0" "GETDATA"
+.TH gd_constants 3 "15 October 2010" "Version 0.7.0" "GETDATA"
.SH NAME
gd_constants \(em retrieve a list of constant values from a dirfile
.SH SYNOPSIS
@@ -65,7 +65,7 @@
.BR gd_constants ()
is called again with the same arguments, or until the dirfile's metadata is
modified (by adding, modifying or deleting an entry), or until the array is
-deallocated by a call to
+de-allocated by a call to
.BR gd_close (3).
A corresponding list of names for these fields may be obtained by calling
Modified: trunk/getdata/man/gd_dirfile_standards.3
===================================================================
--- trunk/getdata/man/gd_dirfile_standards.3 2010-10-15 19:22:58 UTC (rev 450)
+++ trunk/getdata/man/gd_dirfile_standards.3 2010-10-16 01:41:34 UTC (rev 451)
@@ -13,7 +13,7 @@
.\" Texts. A copy of the license is included in the `COPYING.DOC' file
.\" as part of this distribution.
.\"
-.TH gd_dirfile_standards 3 "24 July 2010" "Version 0.7.0" "GETDATA"
+.TH gd_dirfile_standards 3 "15 October 2010" "Version 0.7.0" "GETDATA"
.SH NAME
gd_dirfile_standards \(em change or report the current Dirfile Standards Version
for a DirFile
@@ -32,7 +32,7 @@
.I dirfile
to the value specified by
.IR version ,
-if possible, and then reports the current Standards Version. Metadata writen to
+if possible, and then reports the current Standards Version. Metadata written to
disk for
.I dirfile
will conform to the current Standards Version.
Modified: trunk/getdata/man/gd_entry.3
===================================================================
--- trunk/getdata/man/gd_entry.3 2010-10-15 19:22:58 UTC (rev 450)
+++ trunk/getdata/man/gd_entry.3 2010-10-16 01:41:34 UTC (rev 451)
@@ -13,7 +13,7 @@
.\" Texts. A copy of the license is included in the `COPYING.DOC' file
.\" as part of this distribution.
.\"
-.TH gd_entry 3 "21 July 2010" "Version 0.7.0" "GETDATA"
+.TH gd_entry 3 "15 October 2010" "Version 0.7.0" "GETDATA"
.SH NAME
gd_entry \(em retrieve a dirfile field's metadata
.SH SYNOPSIS
@@ -55,7 +55,7 @@
.BR gd_entry ()
and should not point to allocated memory locations before calling this function.
Only strings provided by the gd_entry_t for the particular field type described
-will be allocated. These strings should be deallocated with
+will be allocated. These strings should be de-allocated with
.BR free (3)
by the caller once they are no longer needed. The
.BR gd_free_entry_strings (3)
@@ -318,7 +318,7 @@
member is an array of length twice
.B GD_MAX_LINCOM
containing the field codes specifying the slope factors and offset terms for the
-field, or NULLs if numberical literal parameters were used.
+field, or NULLs if numerical literal parameters were used.
The first
.B GD_MAX_LINCOM
array elements contain the scale factors. The remaining
@@ -523,7 +523,7 @@
member is an array of length one more than
.B GD_MAX_POLYORD
containing the field codes specifying the co-efficients for the field, or NULLs
-if numberical literal parameters were used.
+if numerical literal parameters were used.
Only the first
.I poly_ord
+ 1
Modified: trunk/getdata/man/gd_eof.3
===================================================================
--- trunk/getdata/man/gd_eof.3 2010-10-15 19:22:58 UTC (rev 450)
+++ trunk/getdata/man/gd_eof.3 2010-10-16 01:41:34 UTC (rev 451)
@@ -13,7 +13,7 @@
.\" Texts. A copy of the license is included in the `COPYING.DOC' file
.\" as part of this distribution.
.\"
-.TH gd_eof 3 "22 July 2010" "Version 0.7.0" "GETDATA"
+.TH gd_eof 3 "15 October 2010" "Version 0.7.0" "GETDATA"
.SH NAME
gd_eof \(em report the number of samples in a dirfile field
.SH SYNOPSIS
@@ -32,8 +32,8 @@
and returns the sample number of the end-of-field marker for the vector field
given by
.IR field_code .
-This is effectively the total number of samples available for the field, taking
-into account the frame offset of the field.
+This is effectively the total number of samples available for the field,
+including any frame offset.
The caller should not assume that this is equivalent (when accounting for the samples-per-frame of the indicated field) to the number of frames in the database
returned by
@@ -51,8 +51,8 @@
The end-of-field marker for a field containing no data is in the same location
as, or before, its beginning-of-field marker (see
-.BR gd_bof (3)),
-which will be non-zero, if the frame offset for the field is non-zero. For a
+.BR gd_bof (3)).
+For a
.B RAW
field, the difference between the locations of the beginning- and end-of-field
markers indicates the number of samples of data actually stored on disk.
@@ -78,7 +78,7 @@
The supplied dirfile was invalid.
.TP
.B GD_E_BAD_FIELD_TYPE
-The location of the non-existant end-of-field marker for the special field
+The location of the non-existent end-of-field marker for the special field
.I INDEX
was requested, possibly as a result of the field specified by
.I field_code
Modified: trunk/getdata/man/gd_field_list.3
===================================================================
--- trunk/getdata/man/gd_field_list.3 2010-10-15 19:22:58 UTC (rev 450)
+++ trunk/getdata/man/gd_field_list.3 2010-10-16 01:41:34 UTC (rev 451)
@@ -13,7 +13,7 @@
.\" Texts. A copy of the license is included in the `COPYING.DOC' file
.\" as part of this distribution.
.\"
-.TH gd_field_list 3 "15 July 2010" "Version 0.7.0" "GETDATA"
+.TH gd_field_list 3 "15 October 2010" "Version 0.7.0" "GETDATA"
.SH NAME
gd_field_list \(em retrieve a list of fields in a dirfile
.SH SYNOPSIS
@@ -48,7 +48,7 @@
so may cause database corruption. The pointer returned is guaranteed to be
valid until
.BR gd_field_list ()
-is called again on the same DIRFILE object, or until the array is deallocated by
+is called again on the same DIRFILE object, or until the array is de-allocated by
a call to
.BR gd_close (3).
Modified: trunk/getdata/man/gd_field_list_by_type.3
===================================================================
--- trunk/getdata/man/gd_field_list_by_type.3 2010-10-15 19:22:58 UTC (rev 450)
+++ trunk/getdata/man/gd_field_list_by_type.3 2010-10-16 01:41:34 UTC (rev 451)
@@ -13,7 +13,7 @@
.\" Texts. A copy of the license is included in the `COPYING.DOC' file
.\" as part of this distribution.
.\"
-.TH gd_field_list_by_type 3 "15 July 2010" "Version 0.7.0" "GETDATA"
+.TH gd_field_list_by_type 3 "15 October 2010" "Version 0.7.0" "GETDATA"
.SH NAME
gd_field_list_by_type \(em retrieve a list of fields in a dirfile
.SH SYNOPSIS
@@ -65,7 +65,7 @@
.BR gd_field_list_by_type ()
is called again on the same DIRFILE object with the same
.I type
-argument, or until the array is deallocated by a call to
+argument, or until the array is de-allocated by a call to
.BR gd_close (3).
For
Modified: trunk/getdata/man/gd_framenum_subset.3
===================================================================
--- trunk/getdata/man/gd_framenum_subset.3 2010-10-15 19:22:58 UTC (rev 450)
+++ trunk/getdata/man/gd_framenum_subset.3 2010-10-16 01:41:34 UTC (rev 451)
@@ -13,7 +13,7 @@
.\" Texts. A copy of the license is included in the `COPYING.DOC' file
.\" as part of this distribution.
.\"
-.TH gd_framenum_subset 3 "21 July 2010" "Version 0.7.0" "GETDATA"
+.TH gd_framenum_subset 3 "15 October 2010" "Version 0.7.0" "GETDATA"
.SH NAME
gd_framenum_subset, gd_framenum \(em perform a reverse look-up on a
monotonic dirfile field
@@ -93,7 +93,7 @@
On success, these functions return the fractional frame number at which the
given function would attain the supplied value, based only on that portion of
the field between the given limits. This might be any number, even values
-outside of the supplied limits, up to and including positive or negaitve
+outside of the supplied limits, up to and including positive or negative
infinity.
On error, these functions return an IEEE-754 conforming not-a-number (NaN), and
Modified: trunk/getdata/man/gd_include.3
===================================================================
--- trunk/getdata/man/gd_include.3 2010-10-15 19:22:58 UTC (rev 450)
+++ trunk/getdata/man/gd_include.3 2010-10-16 01:41:34 UTC (rev 451)
@@ -13,7 +13,7 @@
.\" Texts. A copy of the license is included in the `COPYING.DOC' file
.\" as part of this distribution.
.\"
-.TH gd_include 3 "24 July 2010" "Version 0.7.0" "GETDATA"
+.TH gd_include 3 "15 October 2010" "Version 0.7.0" "GETDATA"
.SH NAME
gd_include \(em add a format specification fragment to a dirfile
.SH SYNOPSIS
@@ -276,7 +276,7 @@
A descriptive error string for the last error encountered can be obtained from
a call to
.BR gd_error_string (3).
-When finished with it, the DIRFILE object may be deallocated with a call to
+When finished with it, the DIRFILE object may be de-allocated with a call to
.BR gd_close (3),
even if the open failed.
.SH BUGS
Modified: trunk/getdata/man/gd_invalid_dirfile.3
===================================================================
--- trunk/getdata/man/gd_invalid_dirfile.3 2010-10-15 19:22:58 UTC (rev 450)
+++ trunk/getdata/man/gd_invalid_dirfile.3 2010-10-16 01:41:34 UTC (rev 451)
@@ -13,7 +13,7 @@
.\" Texts. A copy of the license is included in the `COPYING.DOC' file
.\" as part of this distribution.
.\"
-.TH gd_invalid_dirfile 3 "17 September 2010" "Version 0.7.0" "GETDATA"
+.TH gd_invalid_dirfile 3 "15 October 2010" "Version 0.7.0" "GETDATA"
.SH NAME
gd_invalid_dirfile \(em obtain an pointer to an invalid DIRFILE object
.SH SYNOPSIS
@@ -28,14 +28,14 @@
The
.BR gd_invalid_dirfile ()
returns a pointer to a newly allocated, invalid DIRFILE object. Like any
-other DIRFILE object, the invalid DIRFILE object should be deallocated by
+other DIRFILE object, the invalid DIRFILE object should be de-allocated by
calling
.BR gd_close (3)
or
.BR gd_discard (3)
when it is no longer needed.
-The DIRFILE object reutrned may be passed to any other GetData function which
+The DIRFILE object returned may be passed to any other GetData function which
requires one, but doing so will inevitably result in that function failing
with the
.B GD_BAD_DIRFILE
Modified: trunk/getdata/man/gd_mconstants.3
===================================================================
--- trunk/getdata/man/gd_mconstants.3 2010-10-15 19:22:58 UTC (rev 450)
+++ trunk/getdata/man/gd_mconstants.3 2010-10-16 01:41:34 UTC (rev 451)
@@ -13,7 +13,7 @@
.\" Texts. A copy of the license is included in the `COPYING.DOC' file
.\" as part of this distribution.
.\"
-.TH gd_mconstants 3 "15 July May 2010" "Version 0.7.0" "GETDATA"
+.TH gd_mconstants 3 "15 October 2010" "Version 0.7.0" "GETDATA"
.SH NAME
gd_mconstants \(em retrieve a list of constant values from a dirfile
.SH SYNOPSIS
@@ -58,7 +58,7 @@
so may cause database corruption. The pointer returned is guaranteed to be
valid until
.BR gd_mconstants ()
-is called again with the same arguments, or until the array is deallocated by
+is called again with the same arguments, or until the array is de-allocated by
a call to
.BR gd_close (3).
Modified: trunk/getdata/man/gd_mfield_list.3
===================================================================
--- trunk/getdata/man/gd_mfield_list.3 2010-10-15 19:22:58 UTC (rev 450)
+++ trunk/getdata/man/gd_mfield_list.3 2010-10-16 01:41:34 UTC (rev 451)
@@ -13,7 +13,7 @@
.\" Texts. A copy of the license is included in the `COPYING.DOC' file
.\" as part of this distribution.
.\"
-.TH gd_mfield_list 3 "15 July 2010" "Version 0.7.0" "GETDATA"
+.TH gd_mfield_list 3 "15 October 2010" "Version 0.7.0" "GETDATA"
.SH NAME
gd_mfield_list \(em retrieve a list of fields in a dirfile
.SH SYNOPSIS
@@ -49,7 +49,7 @@
so may cause database corruption. The pointer returned is guaranteed to be
valid until
.BR gd_mfield_list ()
-is called again with the same arguments, or until the array is deallocated by
+is called again with the same arguments, or until the array is de-allocated by
a call to
.BR gd_close (3).
Modified: trunk/getdata/man/gd_mfield_list_by_type.3
===================================================================
--- trunk/getdata/man/gd_mfield_list_by_type.3 2010-10-15 19:22:58 UTC (rev 450)
+++ trunk/getdata/man/gd_mfield_list_by_type.3 2010-10-16 01:41:34 UTC (rev 451)
@@ -13,7 +13,7 @@
.\" Texts. A copy of the license is included in the `COPYING.DOC' file
.\" as part of this distribution.
.\"
-.TH gd_mfield_list_by_type 3 "16 July 2010" "Version 0.7.0" "GETDATA"
+.TH gd_mfield_list_by_type 3 "15 October 2010" "Version 0.7.0" "GETDATA"
.SH NAME
gd_mfield_list_by_type \(em retrieve a list of fields in a dirfile
.SH SYNOPSIS
@@ -62,7 +62,7 @@
so may cause database corruption. The pointer returned is guaranteed to be
valid until
.BR gd_mfield_list_by_type ()
-is called again with the same arguments, or until the array is deallocated by a
+is called again with the same arguments, or until the array is de-allocated by a
call to
.BR gd_close (3).
Modified: trunk/getdata/man/gd_mstrings.3
===================================================================
--- trunk/getdata/man/gd_mstrings.3 2010-10-15 19:22:58 UTC (rev 450)
+++ trunk/getdata/man/gd_mstrings.3 2010-10-16 01:41:34 UTC (rev 451)
@@ -13,7 +13,7 @@
.\" Texts. A copy of the license is included in the `COPYING.DOC' file
.\" as part of this distribution.
.\"
-.TH gd_mstrings 3 "16 July 2010" "Version 0.7.0" "GETDATA"
+.TH gd_mstrings 3 "15 October 2010" "Version 0.7.0" "GETDATA"
.SH NAME
gd_mstrings \(em retrieve a list of string values from a dirfile
.SH SYNOPSIS
@@ -56,7 +56,7 @@
so may cause database corruption. The pointer returned is guaranteed to be
valid until
.BR gd_mstrings ()
-is called again with the same arguments, or until the array is deallocated by
+is called again with the same arguments, or until the array is de-allocated by
a call to
.BR gd_close (3).
Modified: trunk/getdata/man/gd_mvector_list.3
===================================================================
--- trunk/getdata/man/gd_mvector_list.3 2010-10-15 19:22:58 UTC (rev 450)
+++ trunk/getdata/man/gd_mvector_list.3 2010-10-16 01:41:34 UTC (rev 451)
@@ -13,7 +13,7 @@
.\" Texts. A copy of the license is included in the `COPYING.DOC' file
.\" as part of this distribution.
.\"
-.TH gd_mvector_list 3 "16 July 2010" "Version 0.7.0" "GETDATA"
+.TH gd_mvector_list 3 "15 October 2010" "Version 0.7.0" "GETDATA"
.SH NAME
gd_mvector_list \(em retrieve a list of vector fields in a dirfile
.SH SYNOPSIS
@@ -53,7 +53,7 @@
so may cause database corruption. The pointer returned is guaranteed to be
valid until
.BR gd_mvector_list ()
-is called again with the same arguments, or until the array is deallocated by
+is called again with the same arguments, or until the array is de-allocated by
a call to
.BR gd_close (3).
Modified: trunk/getdata/man/gd_rewrite_fragment.3
===================================================================
--- trunk/getdata/man/gd_rewrite_fragment.3 2010-10-15 19:22:58 UTC (rev 450)
+++ trunk/getdata/man/gd_rewrite_fragment.3 2010-10-16 01:41:34 UTC (rev 451)
@@ -13,7 +13,7 @@
.\" Texts. A copy of the license is included in the `COPYING.DOC' file
.\" as part of this distribution.
.\"
-.TH gd_rewrite_fragment 3 "24 July 2010" "Version 0.7.0" "GETDATA"
+.TH gd_rewrite_fragment 3 "15 October 2010" "Version 0.7.0" "GETDATA"
.SH NAME
gd_rewrite_fragment \(em re-write a dirfile format specification fragment
.SH SYNOPSIS
@@ -36,7 +36,7 @@
.I fragment_index
may also be the special value
.BR GD_ALL_FRAGMENTS ,
-which indicates that all fragments should be rewriten.
+which indicates that all fragments should be rewritten.
.P
Metadata is written to disk using the current Standards Version as stored in the
.I dirfile
Modified: trunk/getdata/man/gd_strings.3
===================================================================
--- trunk/getdata/man/gd_strings.3 2010-10-15 19:22:58 UTC (rev 450)
+++ trunk/getdata/man/gd_strings.3 2010-10-16 01:41:34 UTC (rev 451)
@@ -13,7 +13,7 @@
.\" Texts. A copy of the license is included in the `COPYING.DOC' file
.\" as part of this distribution.
.\"
-.TH gd_strings 3 "16 July 2010" "Version 0.7.0" "GETDATA"
+.TH gd_strings 3 "15 October 2010" "Version 0.7.0" "GETDATA"
.SH NAME
gd_strings \(em retrieve a list of string values from a dirfile
.SH SYNOPSIS
@@ -55,7 +55,7 @@
so may cause database corruption. The pointer returned is guaranteed to be
valid until
.BR gd_strings ()
-is called again with the same arguments, or until the array is deallocated by
+is called again with the same arguments, or until the array is de-allocated by
a call to
.BR gd_close (3).
Modified: trunk/getdata/man/gd_uninclude.3
===================================================================
--- trunk/getdata/man/gd_uninclude.3 2010-10-15 19:22:58 UTC (rev 450)
+++ trunk/getdata/man/gd_uninclude.3 2010-10-16 01:41:34 UTC (rev 451)
@@ -13,7 +13,7 @@
.\" Texts. A copy of the license is included in the `COPYING.DOC' file
.\" as part of this distribution.
.\"
-.TH gd_uninclude 3 "24 July 2010" "Version 0.7.0" "GETDATA"
+.TH gd_uninclude 3 "15 October 2010" "Version 0.7.0" "GETDATA"
.SH NAME
gd_uninclude \(em remove a format specification fragment from a dirfile
.SH SYNOPSIS
@@ -88,7 +88,7 @@
A descriptive error string for the last error encountered can be obtained from
a call to
.BR gd_error_string (3).
-When finished with it, the DIRFILE object may be deallocated with a call to
+When finished with it, the DIRFILE object may be de-allocated with a call to
.BR gd_close (3),
even if the open failed.
.SH NOTES
Modified: trunk/getdata/man/gd_vector_list.3
===================================================================
--- trunk/getdata/man/gd_vector_list.3 2010-10-15 19:22:58 UTC (rev 450)
+++ trunk/getdata/man/gd_vector_list.3 2010-10-16 01:41:34 UTC (rev 451)
@@ -13,7 +13,7 @@
.\" Texts. A copy of the license is included in the `COPYING.DOC' file
.\" as part of this distribution.
.\"
-.TH gd_vector_list 3 "16 July 2010" "Version 0.7.0" "GETDATA"
+.TH gd_vector_list 3 "15 October 2010" "Version 0.7.0" "GETDATA"
.SH NAME
gd_vector_list \(em retrieve a list of vector fields in a dirfile
.SH SYNOPSIS
@@ -53,7 +53,7 @@
so may cause database corruption. The pointer returned is guaranteed to be
valid until
.BR gd_vector_list ()
-is called again on the same DIRFILE object, or until the array is deallocated by
+is called again on the same DIRFILE object, or until the array is de-allocated by
a call to
.BR gd_close (3).
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ket...@us...> - 2010-10-15 19:23:05
|
Revision: 450
http://getdata.svn.sourceforge.net/getdata/?rev=450&view=rev
Author: ketiltrout
Date: 2010-10-15 19:22:58 +0000 (Fri, 15 Oct 2010)
Log Message:
-----------
configure documentation
Modified Paths:
--------------
trunk/getdata/configure.ac
trunk/getdata/m4/encoding.m4
Modified: trunk/getdata/configure.ac
===================================================================
--- trunk/getdata/configure.ac 2010-10-14 07:23:31 UTC (rev 449)
+++ trunk/getdata/configure.ac 2010-10-15 19:22:58 UTC (rev 450)
@@ -486,7 +486,8 @@
[gd_msvcrt=no])
AC_MSG_RESULT([$gd_msvcrt])
-
+dnl 64-bit stat() requires MSVCRT 6.1 or later. This may prohibit using
+dnl GetData on Windows95. Oh no!
if test "$gd_msvcrt" = "yes"; then
AC_DEFINE([__MSVCRT_VERSION__], [0x601],
[ If compiling aginst the MSVCRT, define to 0x601 ])
Modified: trunk/getdata/m4/encoding.m4
===================================================================
--- trunk/getdata/m4/encoding.m4 2010-10-14 07:23:31 UTC (rev 449)
+++ trunk/getdata/m4/encoding.m4 2010-10-15 19:22:58 UTC (rev 450)
@@ -38,15 +38,16 @@
m4_divert_once([HELP_WITH], AS_HELP_STRING([--without-lib$2],
[disable encodings supported by lib$2, even if the library is present]))
+echo
+echo "*** Configuring $1 support"
+echo
+
if test "x$no_extern" = "xyes"; then
use_$1="no";
fi
if test "x$use_$1" = "xyes"; then
dnl search for library
- echo
- echo "*** Configuring $1 support"
- echo
saved_ldflags=$LDFLAGS
saved_libs=$LIBS
if test "x$[]$1_prefix" != "x"; then
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ket...@us...> - 2010-10-14 07:23:37
|
Revision: 449
http://getdata.svn.sourceforge.net/getdata/?rev=449&view=rev
Author: ketiltrout
Date: 2010-10-14 07:23:31 +0000 (Thu, 14 Oct 2010)
Log Message:
-----------
Clean compiler warnings.
Modified Paths:
--------------
trunk/getdata/bindings/python/pyentry.c
Modified: trunk/getdata/bindings/python/pyentry.c
===================================================================
--- trunk/getdata/bindings/python/pyentry.c 2010-09-18 01:00:35 UTC (rev 448)
+++ trunk/getdata/bindings/python/pyentry.c 2010-10-14 07:23:31 UTC (rev 449)
@@ -391,7 +391,7 @@
{
dtrace("%p, %p, \"%s\"", E, parms, name);
- PyObject* tuple;
+ PyObject* tuple = Py_None;
const char* key[3];
int i, size = 0;
@@ -468,8 +468,6 @@
case GD_STRING_ENTRY:
case GD_NO_ENTRY:
case GD_INDEX_ENTRY:
- tuple = Py_None;
- size = 0;
break;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ket...@us...> - 2010-09-18 01:00:44
|
Revision: 448
http://getdata.svn.sourceforge.net/getdata/?rev=448&view=rev
Author: ketiltrout
Date: 2010-09-18 01:00:35 +0000 (Sat, 18 Sep 2010)
Log Message:
-----------
Added gd_invalid_dirfile(). Flag const member functions in C++ bindings.
Modified Paths:
--------------
trunk/getdata/ChangeLog
trunk/getdata/bindings/cxx/bitentry.cpp
trunk/getdata/bindings/cxx/dirfile.cpp
trunk/getdata/bindings/cxx/entry.cpp
trunk/getdata/bindings/cxx/fragment.cpp
trunk/getdata/bindings/cxx/getdata/bitentry.h
trunk/getdata/bindings/cxx/getdata/constentry.h
trunk/getdata/bindings/cxx/getdata/dirfile.h
trunk/getdata/bindings/cxx/getdata/divideentry.h
trunk/getdata/bindings/cxx/getdata/entry.h
trunk/getdata/bindings/cxx/getdata/fragment.h
trunk/getdata/bindings/cxx/getdata/indexentry.h
trunk/getdata/bindings/cxx/getdata/lincomentry.h
trunk/getdata/bindings/cxx/getdata/linterpentry.h
trunk/getdata/bindings/cxx/getdata/multiplyentry.h
trunk/getdata/bindings/cxx/getdata/phaseentry.h
trunk/getdata/bindings/cxx/getdata/polynomentry.h
trunk/getdata/bindings/cxx/getdata/rawentry.h
trunk/getdata/bindings/cxx/getdata/recipentry.h
trunk/getdata/bindings/cxx/getdata/sbitentry.h
trunk/getdata/bindings/cxx/getdata/stringentry.h
trunk/getdata/bindings/cxx/lincomentry.cpp
trunk/getdata/bindings/cxx/polynomentry.cpp
trunk/getdata/bindings/cxx/sbitentry.cpp
trunk/getdata/bindings/f77/fgetdata.c
trunk/getdata/bindings/idl/getdata.c
trunk/getdata/bindings/python/pydirfile.c
trunk/getdata/configure.ac
trunk/getdata/man/Makefile.am
trunk/getdata/man/gd_parser_callback.3
trunk/getdata/src/getdata.h.in
trunk/getdata/src/legacy.c
trunk/getdata/src/open.c
Added Paths:
-----------
trunk/getdata/man/gd_invalid_dirfile.3
Modified: trunk/getdata/ChangeLog
===================================================================
--- trunk/getdata/ChangeLog 2010-09-17 20:17:08 UTC (rev 447)
+++ trunk/getdata/ChangeLog 2010-09-18 01:00:35 UTC (rev 448)
@@ -1,3 +1,18 @@
+2010-09-18 D. V. Wiebe <ge...@ke...> svn:448
+ * bindings/python/pydirfile.c (gdpy_dirfile_close gdpy_dirfile_discard)
+ bindings/cxx/dirfile.cpp (Dirfile::Discard Dirfile::Close)
+ bindings/f77/fgetdata.c (_GDF_InitDirfiles) bindings/idl/getdata.c
+ (gdidl_init_dirfile): Call gd_invalid_dirfile() instead of using
+ GetData C internals.
+ * src/open.c (gd_invalid_dirfile): Added.
+
+ * src/cxx/: Declare const member functions.
+
+ * configure.ac: Fix mkdir check for C++ compilers masquerading as C
+ compilers.
+
+ * src/legacy.c: Humanely initialise _GD_GlobalErrors when possible.
+
2010-09-17 D. V. Wiebe <ge...@ke...> svn:447
* test/Makefile.am src/Makefile.am bindings/python/Makefile.am
bindings/cxx/Makefile.am bindings/f77/test/Makefile.am
Modified: trunk/getdata/bindings/cxx/bitentry.cpp
===================================================================
--- trunk/getdata/bindings/cxx/bitentry.cpp 2010-09-17 20:17:08 UTC (rev 447)
+++ trunk/getdata/bindings/cxx/bitentry.cpp 2010-09-18 01:00:35 UTC (rev 448)
@@ -76,7 +76,7 @@
return 0;
}
-const char *BitEntry::Scalar(int index)
+const char *BitEntry::Scalar(int index) const
{
if (index != 0 && index != 1)
return NULL;
Modified: trunk/getdata/bindings/cxx/dirfile.cpp
===================================================================
--- trunk/getdata/bindings/cxx/dirfile.cpp 2010-09-17 20:17:08 UTC (rev 447)
+++ trunk/getdata/bindings/cxx/dirfile.cpp 2010-09-18 01:00:35 UTC (rev 448)
@@ -53,31 +53,31 @@
gd_close(D);
}
-int Dirfile::Add(GetData::Entry &entry)
+int Dirfile::Add(GetData::Entry &entry) const
{
int ret = gd_add(D, &entry.E);
entry.SetDirfile(this);
return ret;
}
-int Dirfile::AddSpec(const char *spec, int format_file)
+int Dirfile::AddSpec(const char *spec, int format_file) const
{
return gd_add_spec(D, spec, format_file);
}
-int Dirfile::MAdd(GetData::Entry &entry, const char *parent)
+int Dirfile::MAdd(GetData::Entry &entry, const char *parent) const
{
int ret = gd_madd(D, &entry.E, parent);
entry.SetDirfile(this);
return ret;
}
-int Dirfile::MAddSpec(const char *spec, const char *parent)
+int Dirfile::MAddSpec(const char *spec, const char *parent) const
{
return gd_madd_spec(D, spec, parent);
}
-Entry *Dirfile::Entry(const char* field_code)
+Entry *Dirfile::Entry(const char* field_code) const
{
GetData::EntryType type = (GetData::EntryType)gd_entry_type(D, field_code);
@@ -115,17 +115,17 @@
return NULL;
}
-int Dirfile::Flush(const char* field_code)
+int Dirfile::Flush(const char* field_code) const
{
return gd_flush(D, field_code);
}
-int Dirfile::MetaFlush()
+int Dirfile::MetaFlush() const
{
return gd_metaflush(D);
}
-int Dirfile::Error()
+int Dirfile::Error() const
{
return gd_error(D);
}
@@ -142,149 +142,151 @@
}
int Dirfile::Include(const char* file, int format_file, unsigned long flags)
+ const
{
return gd_include(D, file, format_file, flags);
}
-unsigned int Dirfile::SamplesPerFrame(const char* field_code)
+unsigned int Dirfile::SamplesPerFrame(const char* field_code) const
{
return gd_spf(D, field_code);
}
-unsigned int Dirfile::NFields()
+unsigned int Dirfile::NFields() const
{
return gd_nfields(D);
}
-unsigned int Dirfile::NFieldsByType(EntryType type)
+unsigned int Dirfile::NFieldsByType(EntryType type) const
{
return gd_nfields_by_type(D, (gd_entype_t)type);
}
-const char** Dirfile::FieldListByType(EntryType type)
+const char** Dirfile::FieldListByType(EntryType type) const
{
return gd_field_list_by_type(D, (gd_entype_t)type);
}
-unsigned int Dirfile::NMFields(const char *parent)
+unsigned int Dirfile::NMFields(const char *parent) const
{
return gd_nmfields(D, parent);
}
-unsigned int Dirfile::NMFieldsByType(const char *parent, EntryType type)
+unsigned int Dirfile::NMFieldsByType(const char *parent, EntryType type) const
{
return gd_nmfields_by_type(D, parent, (gd_entype_t)type);
}
-const char** Dirfile::MFieldListByType(const char *parent, EntryType type)
+const char** Dirfile::MFieldListByType(const char *parent, EntryType type) const
{
return gd_mfield_list_by_type(D, parent, (gd_entype_t)type);
}
-const void *Dirfile::Constants(DataType type)
+const void *Dirfile::Constants(DataType type) const
{
return gd_constants(D, (gd_type_t)type);
}
-const char **Dirfile::Strings()
+const char **Dirfile::Strings() const
{
return gd_strings(D);
}
-const void *Dirfile::MConstants(const char *parent, DataType type)
+const void *Dirfile::MConstants(const char *parent, DataType type) const
{
return gd_mconstants(D, parent, (gd_type_t)type);
}
-const char **Dirfile::MStrings(const char *parent)
+const char **Dirfile::MStrings(const char *parent) const
{
return gd_mstrings(D, parent);
}
-const char** Dirfile::FieldList()
+const char** Dirfile::FieldList() const
{
return gd_field_list(D);
}
-const char** Dirfile::MFieldList(const char *parent)
+const char** Dirfile::MFieldList(const char *parent) const
{
return gd_mfield_list(D, parent);
}
-unsigned int Dirfile::NVectors()
+unsigned int Dirfile::NVectors() const
{
return gd_nvectors(D);
}
-const char** Dirfile::VectorList()
+const char** Dirfile::VectorList() const
{
return gd_vector_list(D);
}
-unsigned int Dirfile::NMVectors(const char *parent)
+unsigned int Dirfile::NMVectors(const char *parent) const
{
return gd_nmvectors(D, parent);
}
-const char** Dirfile::MVectorList(const char *parent)
+const char** Dirfile::MVectorList(const char *parent) const
{
return gd_mvector_list(D, parent);
}
-off_t Dirfile::NFrames()
+off_t Dirfile::NFrames() const
{
return gd_nframes(D);
}
-off_t Dirfile::EoF(const char *field_code)
+off_t Dirfile::EoF(const char *field_code) const
{
return gd_eof(D, field_code);
}
-off_t Dirfile::BoF(const char *field_code)
+off_t Dirfile::BoF(const char *field_code) const
{
return gd_bof(D, field_code);
}
size_t Dirfile::GetConstant(const char *field_code, DataType type,
- void *data_out)
+ void *data_out) const
{
return gd_get_constant(D, field_code, (gd_type_t)type, data_out);
}
size_t Dirfile::GetData(const char* field_code, off_t first_frame,
off_t first_sample, size_t num_frames, size_t num_samples,
- DataType type, void* data_out)
+ DataType type, void* data_out) const
{
return gd_getdata(D, field_code, first_frame, first_sample, num_frames,
num_samples, (gd_type_t)type, data_out);
}
size_t Dirfile::GetString(const char *field_code, size_t len, char* data_out)
+ const
{
return gd_get_string(D, field_code, len, data_out);
}
size_t Dirfile::PutConstant(const char *field_code, DataType type,
- const void *data_in)
+ const void *data_in) const
{
return gd_put_constant(D, field_code, (gd_type_t)type, data_in);
}
size_t Dirfile::PutData(const char* field_code, off_t first_frame,
off_t first_sample, size_t num_frames, size_t num_samples,
- DataType type, const void* data_in)
+ DataType type, const void* data_in) const
{
return gd_putdata(D, field_code, first_frame, first_sample, num_frames,
num_samples, (gd_type_t)type, data_in);
}
-size_t Dirfile::PutString(const char *field_code, const char* data_in)
+size_t Dirfile::PutString(const char *field_code, const char* data_in) const
{
return gd_put_string(D, field_code, data_in);
}
-GetData::Fragment* Dirfile::Fragment(int index)
+GetData::Fragment* Dirfile::Fragment(int index) const
{
if (index < 0 || index >= gd_nfragments(D))
return NULL;
@@ -292,12 +294,12 @@
return new GetData::Fragment(this, index);
}
-int Dirfile::NFragments()
+int Dirfile::NFragments() const
{
return gd_nfragments(D);
}
-const char* Dirfile::ReferenceFilename()
+const char* Dirfile::ReferenceFilename() const
{
const char* ref = gd_reference(D, NULL);
@@ -312,7 +314,7 @@
int ret = gd_discard(D);
if (!ret)
- D = NULL;
+ D = gd_invalid_dirfile();
return ret;
}
@@ -322,17 +324,17 @@
int ret = gd_close(D);
if (!ret)
- D = NULL;
+ D = gd_invalid_dirfile();
return ret;
}
-void Dirfile::SetCallback(gd_parser_callback_t sehandler, void* extra)
+void Dirfile::SetCallback(gd_parser_callback_t sehandler, void* extra) const
{
gd_parser_callback(D, sehandler, extra);
}
-RawEntry* Dirfile::Reference(const char* field_code)
+RawEntry* Dirfile::Reference(const char* field_code) const
{
const char* ref = gd_reference(D, field_code);
@@ -342,48 +344,48 @@
return new RawEntry(this, ref);
}
-int Dirfile::AlterSpec(const char *line, int recode)
+int Dirfile::AlterSpec(const char *line, int recode) const
{
return gd_alter_spec(D, line, recode);
}
-int Dirfile::MAlterSpec(const char* line, const char *parent, int recode)
+int Dirfile::MAlterSpec(const char* line, const char *parent, int recode) const
{
return gd_malter_spec(D, line, parent, recode);
}
-int Dirfile::Delete(const char* field_code, int flags)
+int Dirfile::Delete(const char* field_code, int flags) const
{
return gd_delete(D, field_code, flags);
}
-int Dirfile::UnInclude(int fragment_index, int del)
+int Dirfile::UnInclude(int fragment_index, int del) const
{
return gd_uninclude(D, fragment_index, del);
}
-DataType Dirfile::NativeType(const char* field_code)
+DataType Dirfile::NativeType(const char* field_code) const
{
return (DataType)gd_native_type(D, field_code);
}
-int Dirfile::Validate(const char* field_code)
+int Dirfile::Validate(const char* field_code) const
{
return gd_validate(D, field_code);
}
double Dirfile::FrameNum(const char* field_code, double value,
- off_t frame_start, off_t frame_end)
+ off_t frame_start, off_t frame_end) const
{
return gd_framenum_subset(D, field_code, value, frame_start, frame_end);
}
-int Dirfile::FragmentIndex(const char* field_code)
+int Dirfile::FragmentIndex(const char* field_code) const
{
return gd_fragment_index(D, field_code);
}
-const char* Dirfile::Name()
+const char* Dirfile::Name() const
{
return gd_dirfilename(D);
}
Modified: trunk/getdata/bindings/cxx/entry.cpp
===================================================================
--- trunk/getdata/bindings/cxx/entry.cpp 2010-09-17 20:17:08 UTC (rev 447)
+++ trunk/getdata/bindings/cxx/entry.cpp 2010-09-18 01:00:35 UTC (rev 448)
@@ -35,7 +35,7 @@
D = NULL;
}
-Entry::Entry(GetData::Dirfile *dirfile, const char* field_code)
+Entry::Entry(const GetData::Dirfile *dirfile, const char* field_code)
{
D = dirfile;
gd_entry(D->D, field_code, &E);
@@ -114,7 +114,7 @@
return ret;
}
-void Entry::SetDirfile(GetData::Dirfile* dirfile)
+void Entry::SetDirfile(const GetData::Dirfile* dirfile)
{
D = dirfile;
}
@@ -129,7 +129,7 @@
this->Move(fragment_index);
}
-const char *Entry::Scalar(int index)
+const char *Entry::Scalar(int index) const
{
if (index < 0)
return NULL;
Modified: trunk/getdata/bindings/cxx/fragment.cpp
===================================================================
--- trunk/getdata/bindings/cxx/fragment.cpp 2010-09-17 20:17:08 UTC (rev 447)
+++ trunk/getdata/bindings/cxx/fragment.cpp 2010-09-18 01:00:35 UTC (rev 448)
@@ -29,7 +29,7 @@
using namespace GetData;
-Fragment::Fragment(GetData::Dirfile *dirfile, int index)
+Fragment::Fragment(const GetData::Dirfile *dirfile, int index)
{
D = dirfile;
@@ -38,16 +38,16 @@
end = gd_endianness(D->D, index);
off = gd_frameoffset(D->D, index);
prot = gd_protection(D->D, index);
- name = strdup(gd_fragmentname(D->D, index));
+ name = gd_fragmentname(D->D, index);
parent = (index == 0) ? -1 : gd_parent_fragment(D->D, index);
}
Fragment::~Fragment()
{
- free(name);
+ ;
}
-int Fragment::ReWrite()
+int Fragment::ReWrite() const
{
return gd_rewrite_fragment(D->D, ind);
}
Modified: trunk/getdata/bindings/cxx/getdata/bitentry.h
===================================================================
--- trunk/getdata/bindings/cxx/getdata/bitentry.h 2010-09-17 20:17:08 UTC (rev 447)
+++ trunk/getdata/bindings/cxx/getdata/bitentry.h 2010-09-18 01:00:35 UTC (rev 448)
@@ -22,16 +22,6 @@
#ifndef GETDATA_BITENTRY_H
#define GETDATA_BITENTRY_H
-#ifndef _FILE_OFFSET_BITS
-# define _FILE_OFFSET_BITS 64
-#endif
-
-#define GD_NO_LEGACY_API
-#define GD_C89_API
-
-extern "C" {
-#include <getdata.h>
-}
#include <getdata/entry.h>
namespace GetData {
@@ -47,17 +37,11 @@
BitEntry(const char* field_code, const char* in_field, gd_bit_t bitnum,
gd_bit_t numbits = 1, int fragment_index = 0);
- virtual const char *Input() {
- return E.in_fields[0];
- };
+ virtual const char *Input() const { return E.in_fields[0]; };
- virtual gd_bit_t FirstBit() {
- return E.u.bit.bitnum;
- };
+ virtual gd_bit_t FirstBit() const { return E.u.bit.bitnum; };
- virtual gd_bit_t NumBits() {
- return E.u.bit.numbits;
- };
+ virtual gd_bit_t NumBits() const { return E.u.bit.numbits; };
int SetInput(const char* field);
int SetFirstBit(gd_bit_t first_bit);
@@ -65,10 +49,10 @@
int SetNumBits(gd_bit_t num_bits);
int SetNumBits(const char* num_bits);
- virtual const char *Scalar(int index = 0);
+ virtual const char *Scalar(int index = 0) const;
private:
- BitEntry(GetData::Dirfile *dirfile, const char* field_code) :
+ BitEntry(const GetData::Dirfile *dirfile, const char* field_code) :
Entry(dirfile, field_code) { };
};
}
Modified: trunk/getdata/bindings/cxx/getdata/constentry.h
===================================================================
--- trunk/getdata/bindings/cxx/getdata/constentry.h 2010-09-17 20:17:08 UTC (rev 447)
+++ trunk/getdata/bindings/cxx/getdata/constentry.h 2010-09-18 01:00:35 UTC (rev 448)
@@ -22,16 +22,6 @@
#ifndef GETDATA_CONSTENTRY_H
#define GETDATA_CONSTENTRY_H
-#ifndef _FILE_OFFSET_BITS
-# define _FILE_OFFSET_BITS 64
-#endif
-
-#define GD_NO_LEGACY_API
-#define GD_C89_API
-
-extern "C" {
-#include <getdata.h>
-}
#include <getdata/entry.h>
namespace GetData {
@@ -46,12 +36,12 @@
ConstEntry(const char* field_code, DataType type, int fragment_index = 0);
- virtual DataType ConstType() { return (DataType)E.u.cons.type; }
+ virtual DataType ConstType() const { return (DataType)E.u.cons.type; }
int SetType(DataType type);
private:
- ConstEntry(GetData::Dirfile *dirfile, const char* field_code) :
+ ConstEntry(const GetData::Dirfile *dirfile, const char* field_code) :
Entry(dirfile, field_code) { };
};
}
Modified: trunk/getdata/bindings/cxx/getdata/dirfile.h
===================================================================
--- trunk/getdata/bindings/cxx/getdata/dirfile.h 2010-09-17 20:17:08 UTC (rev 447)
+++ trunk/getdata/bindings/cxx/getdata/dirfile.h 2010-09-18 01:00:35 UTC (rev 448)
@@ -79,116 +79,120 @@
~Dirfile();
- int Add(GetData::Entry &entry);
+ int Add(GetData::Entry &entry) const;
- int AddSpec(const char *spec, int fragment_index = 0);
+ int AddSpec(const char *spec, int fragment_index = 0) const;
- int AlterSpec(const char* spec, int recode = 0);
+ int AlterSpec(const char* spec, int recode = 0) const;
- off_t BoF(const char *field_code);
+ off_t BoF(const char *field_code) const;
int Close();
- const void *Constants(DataType type = Float64);
+ const void *Constants(DataType type = Float64) const;
- int Delete(const char* field_code, int flags = 0);
+ int Delete(const char* field_code, int flags = 0) const;
int Discard();
- GetData::Entry* Entry(const char *field_code);
+ GetData::Entry* Entry(const char *field_code) const;
- off_t EoF(const char *field_code);
+ off_t EoF(const char *field_code) const;
- int Error();
+ int Error() const;
const char *ErrorString(size_t len = 4096);
- const char **FieldList();
+ const char **FieldList() const;
- const char **FieldListByType(EntryType type);
+ const char **FieldListByType(EntryType type) const;
- int Flush(const char *field_code = NULL);
+ int Flush(const char *field_code = NULL) const;
- GetData::Fragment *Fragment(int index);
+ GetData::Fragment *Fragment(int index) const;
- int FragmentIndex(const char* field_code);
+ int FragmentIndex(const char* field_code) const;
double FrameNum(const char* field_code, double value,
- off_t frame_start = 0, off_t frame_end = 0);
+ off_t frame_start = 0, off_t frame_end = 0) const;
- size_t GetConstant(const char *field_code, DataType type, void *data_out);
+ size_t GetConstant(const char *field_code, DataType type, void *data_out)
+ const;
size_t GetData(const char *field_code, off_t first_frame,
off_t first_sample, size_t num_frames, size_t num_samples,
- DataType type, void* data_out);
+ DataType type, void* data_out) const;
- size_t GetString(const char *field_code, size_t len, char *data_out);
+ size_t GetString(const char *field_code, size_t len, char *data_out)
+ const;
int Include(const char *file, int fragment_index = 0,
- unsigned long flags = 0);
+ unsigned long flags = 0) const;
- int MAdd(GetData::Entry &entry, const char *parent);
+ int MAdd(GetData::Entry &entry, const char *parent) const;
- int MAddSpec(const char *spec, const char *parent);
+ int MAddSpec(const char *spec, const char *parent) const;
- int MAlterSpec(const char *line, const char *parent, int recode = 0);
+ int MAlterSpec(const char *line, const char *parent, int recode = 0)
+ const;
- const void *MConstants(const char *parent, DataType type = Float64);
+ const void *MConstants(const char *parent, DataType type = Float64) const;
- int MetaFlush();
+ int MetaFlush() const;
- const char **MFieldList(const char *parent);
+ const char **MFieldList(const char *parent) const;
- const char **MFieldListByType(const char *parent, EntryType type);
+ const char **MFieldListByType(const char *parent, EntryType type) const;
- const char **MStrings(const char *parent);
+ const char **MStrings(const char *parent) const;
- const char **MVectorList(const char *parent);
+ const char **MVectorList(const char *parent) const;
- unsigned int NFields();
+ unsigned int NFields() const;
- unsigned int NFieldsByType(EntryType type);
+ unsigned int NFieldsByType(EntryType type) const;
- unsigned int NMFields(const char *parent);
+ unsigned int NMFields(const char *parent) const;
- unsigned int NMFieldsByType(const char *parent, EntryType type);
+ unsigned int NMFieldsByType(const char *parent, EntryType type) const;
- unsigned int NMVectors(const char *parent);
+ unsigned int NMVectors(const char *parent) const;
- const char* Name();
+ const char* Name() const;
- DataType NativeType(const char* field_code);
+ DataType NativeType(const char* field_code) const;
- int NFragments();
+ int NFragments() const;
- off_t NFrames();
+ off_t NFrames() const;
- unsigned int NVectors();
+ unsigned int NVectors() const;
size_t PutConstant(const char *field_code, DataType type,
- const void *data_in);
+ const void *data_in) const;
size_t PutData(const char *field_code, off_t first_frame,
off_t first_sample, size_t num_frames, size_t num_samples,
- DataType type, const void* data_in);
+ DataType type, const void* data_in) const;
- size_t PutString(const char *field_code, const char *data_in);
+ size_t PutString(const char *field_code, const char *data_in) const;
- GetData::RawEntry *Reference(const char* field_code = NULL);
+ GetData::RawEntry *Reference(const char* field_code = NULL) const;
- const char *ReferenceFilename();
+ const char *ReferenceFilename() const;
- unsigned int SamplesPerFrame(const char *field_code);
+ unsigned int SamplesPerFrame(const char *field_code) const;
- void SetCallback(gd_parser_callback_t sehandler, void* extra = NULL);
+ void SetCallback(gd_parser_callback_t sehandler, void* extra = NULL)
+ const;
- const char **Strings();
+ const char **Strings() const;
- int UnInclude(int fragment_index, int del = 0);
+ int UnInclude(int fragment_index, int del = 0) const;
- int Validate(const char* field_code);
+ int Validate(const char* field_code) const;
- const char **VectorList();
+ const char **VectorList() const;
private:
DIRFILE* D;
Modified: trunk/getdata/bindings/cxx/getdata/divideentry.h
===================================================================
--- trunk/getdata/bindings/cxx/getdata/divideentry.h 2010-09-17 20:17:08 UTC (rev 447)
+++ trunk/getdata/bindings/cxx/getdata/divideentry.h 2010-09-18 01:00:35 UTC (rev 448)
@@ -22,16 +22,6 @@
#ifndef GETDATA_DIVIDEENTRY_H
#define GETDATA_DIVIDEENTRY_H
-#ifndef _FILE_OFFSET_BITS
-# define _FILE_OFFSET_BITS 64
-#endif
-
-#define GD_NO_LEGACY_API
-#define GD_C89_API
-
-extern "C" {
-#include <getdata.h>
-}
#include <getdata/entry.h>
namespace GetData {
@@ -47,14 +37,14 @@
DivideEntry(const char* field_code, const char* in_field1,
const char* in_field2, int fragment_index = 0);
- virtual const char *Input(int index = 0) {
+ virtual const char *Input(int index = 0) const {
return E.in_fields[(index == 0) ? 0 : 1];
};
int SetInput(const char* field, int index);
private:
- DivideEntry(GetData::Dirfile *dirfile, const char* field_code) :
+ DivideEntry(const GetData::Dirfile *dirfile, const char* field_code) :
Entry(dirfile, field_code) { };
};
}
Modified: trunk/getdata/bindings/cxx/getdata/entry.h
===================================================================
--- trunk/getdata/bindings/cxx/getdata/entry.h 2010-09-17 20:17:08 UTC (rev 447)
+++ trunk/getdata/bindings/cxx/getdata/entry.h 2010-09-18 01:00:35 UTC (rev 448)
@@ -75,117 +75,125 @@
virtual ~Entry();
/* Generic data */
- int Associated() { return (D != NULL); };
+ int Associated() const { return (D != NULL); };
- const char *Name() { return E.field; };
+ const char *Name() const { return E.field; };
- EntryType Type() { return (EntryType)E.field_type; };
+ EntryType Type() const { return (EntryType)E.field_type; };
void Dissociate() { D = NULL; };
- int FragmentIndex() { return E.fragment_index; };
+ int FragmentIndex() const { return E.fragment_index; };
int Move(int new_fragment, int move_data = 0);
int Rename(const char* new_name, int move_data = 0);
/* Specific data */
- virtual const char *Input(int index = 0) {
+ virtual const char *Input(int index = 0) const {
return (CheckIndex(E.field_type, E.u.lincom.n_fields, index)) ?
E.in_fields[index] : NULL;
};
- virtual int ComplexScalars() {
+ virtual int ComplexScalars() const {
return (E.field_type == GD_LINCOM_ENTRY ||
E.field_type == GD_POLYNOM_ENTRY) ? E.comp_scal : 0;
}
- virtual const char *Scalar(int index = 0);
+ virtual const char *Scalar(int index = 0) const;
/* RAW methods */
- virtual gd_spf_t SamplesPerFrame() {
+ virtual gd_spf_t SamplesPerFrame() const {
return (E.field_type == GD_RAW_ENTRY) ? E.u.raw.spf : 0;
};
- virtual DataType RawType() {
- return (E.field_type == GD_RAW_ENTRY) ? (DataType)E.u.raw.type : Unknown;
+ virtual DataType RawType() const {
+ return (E.field_type == GD_RAW_ENTRY) ? (DataType)E.u.raw.type :
+ Unknown;
};
/* LINCOM methods */
- virtual int NFields() {
+ virtual int NFields() const {
return (E.field_type == GD_LINCOM_ENTRY) ? E.u.lincom.n_fields : 0;
};
- virtual double Scale(int index = 0) {
+ virtual double Scale(int index = 0) const {
return (E.field_type == GD_LINCOM_ENTRY &&
- CheckIndex(E.field_type, E.u.lincom.n_fields, index)) ? E.u.lincom.m[index] : 0;
+ CheckIndex(E.field_type, E.u.lincom.n_fields, index)) ?
+ E.u.lincom.m[index] : 0;
}
- virtual std::complex<double> CScale(int index = 0) {
+ virtual std::complex<double> CScale(int index = 0) const {
return (E.field_type == GD_LINCOM_ENTRY &&
CheckIndex(E.field_type, E.u.lincom.n_fields, index))
- ? std::complex<double>(E.u.lincom.cm[index][0], E.u.lincom.cm[index][1]) : 0;
+ ? std::complex<double>(E.u.lincom.cm[index][0],
+ E.u.lincom.cm[index][1]) : 0;
}
- virtual double Offset(int index = 0) {
+ virtual double Offset(int index = 0) const {
return (E.field_type == GD_LINCOM_ENTRY &&
- CheckIndex(E.field_type, E.u.lincom.n_fields, index)) ? E.u.lincom.b[index] : 0;
+ CheckIndex(E.field_type, E.u.lincom.n_fields, index)) ?
+ E.u.lincom.b[index] : 0;
}
- virtual std::complex<double> COffset(int index = 0) {
+ virtual std::complex<double> COffset(int index = 0) const {
return (E.field_type == GD_LINCOM_ENTRY &&
CheckIndex(E.field_type, E.u.lincom.n_fields, index))
- ? std::complex<double>(E.u.lincom.cb[index][0], E.u.lincom.cb[index][1]) : 0;
+ ? std::complex<double>(E.u.lincom.cb[index][0],
+ E.u.lincom.cb[index][1]) : 0;
}
/* LINTERP methods */
- virtual const char *Table() {
+ virtual const char *Table() const {
return (E.field_type == GD_LINTERP_ENTRY) ? E.u.linterp.table : NULL;
};
/* (S)BIT methods */
- virtual gd_bit_t FirstBit() {
+ virtual gd_bit_t FirstBit() const {
return (E.field_type == GD_BIT_ENTRY) ? E.u.bit.bitnum : -1;
};
- virtual gd_bit_t NumBits() {
+ virtual gd_bit_t NumBits() const {
return (E.field_type == GD_BIT_ENTRY) ? E.u.bit.numbits : -1;
};
/* PHASE methods */
- virtual gd_shift_t Shift() {
+ virtual gd_shift_t Shift() const {
return (E.field_type == GD_PHASE_ENTRY) ? E.u.phase.shift : 0;
};
/* CONST methods */
- virtual DataType ConstType() {
+ virtual DataType ConstType() const {
return (E.field_type == GD_CONST_ENTRY) ? (DataType)E.u.cons.type :
Unknown;
};
/* POLYNOM methods */
- virtual int PolyOrd() {
+ virtual int PolyOrd() const {
return (E.field_type == GD_POLYNOM_ENTRY) ? E.u.polynom.poly_ord : 0;
};
- virtual double Coefficient(int index = 0) {
- return (E.field_type == GD_POLYNOM_ENTRY && index <= E.u.polynom.poly_ord)
- ? E.u.polynom.a[index] : 0;
+ virtual double Coefficient(int index = 0) const {
+ return (E.field_type == GD_POLYNOM_ENTRY && index <=
+ E.u.polynom.poly_ord) ? E.u.polynom.a[index] : 0;
}
- virtual std::complex<double> CCoefficient(int index = 0) {
- return (E.field_type == GD_POLYNOM_ENTRY && index <= E.u.polynom.poly_ord)
- ? std::complex<double>(E.u.polynom.ca[index][0], E.u.polynom.ca[index][1]) : 0;
+ virtual std::complex<double> CCoefficient(int index = 0) const {
+ return (E.field_type == GD_POLYNOM_ENTRY && index <=
+ E.u.polynom.poly_ord) ?
+ std::complex<double>(E.u.polynom.ca[index][0],
+ E.u.polynom.ca[index][1]) : 0;
}
/* RECIP methods */
- virtual double Dividend() {
+ virtual double Dividend() const {
return (E.field_type == GD_RECIP_ENTRY) ? E.u.recip.dividend : 0;
};
- virtual std::complex<double> CDividend() {
+ virtual std::complex<double> CDividend() const {
return (E.field_type == GD_RECIP_ENTRY) ?
- std::complex<double>(E.u.recip.cdividend[0], E.u.recip.cdividend[1]) : 0;
+ std::complex<double>(E.u.recip.cdividend[0], E.u.recip.cdividend[1]) :
+ 0;
};
void SetName(const char* name);
@@ -193,14 +201,14 @@
void SetFragmentIndex(int fragment_index);
protected:
- Entry(Dirfile *dirfile, const char* field_code);
+ Entry(const Dirfile *dirfile, const char* field_code);
static int CheckIndex(gd_entype_t field_type, int n_fields, int index);
- void SetDirfile(GetData::Dirfile* dirfile);
+ void SetDirfile(const GetData::Dirfile* dirfile);
gd_entry_t E;
- Dirfile* D;
+ const Dirfile* D;
};
}
Modified: trunk/getdata/bindings/cxx/getdata/fragment.h
===================================================================
--- trunk/getdata/bindings/cxx/getdata/fragment.h 2010-09-17 20:17:08 UTC (rev 447)
+++ trunk/getdata/bindings/cxx/getdata/fragment.h 2010-09-18 01:00:35 UTC (rev 448)
@@ -52,21 +52,21 @@
public:
virtual ~Fragment();
- EncodingScheme Encoding() { return enc; };
+ EncodingScheme Encoding() const { return enc; };
- unsigned long Endianness() { return end; };
+ unsigned long Endianness() const { return end; };
- off_t FrameOffset() { return (off_t)off; };
+ off_t FrameOffset() const { return (off_t)off; };
- int Index() { return ind; }
+ int Index() const { return ind; }
- const char* Name() { return name; }
+ const char* Name() const { return name; }
- int Parent() { return parent; }
+ int Parent() const { return parent; }
- int Protection() { return prot; }
+ int Protection() const { return prot; }
- int ReWrite();
+ int ReWrite() const;
int SetEncoding(EncodingScheme encoding, int recode = 0);
@@ -77,15 +77,15 @@
int SetProtection(int protection_level);
protected:
- Fragment(Dirfile *dirfile, int index);
+ Fragment(const Dirfile *dirfile, int index);
- Dirfile* D;
+ const Dirfile *D;
EncodingScheme enc;
unsigned long end;
int ind;
int prot;
off_t off;
- char* name;
+ const char* name;
int parent;
};
}
Modified: trunk/getdata/bindings/cxx/getdata/indexentry.h
===================================================================
--- trunk/getdata/bindings/cxx/getdata/indexentry.h 2010-09-17 20:17:08 UTC (rev 447)
+++ trunk/getdata/bindings/cxx/getdata/indexentry.h 2010-09-18 01:00:35 UTC (rev 448)
@@ -22,16 +22,6 @@
#ifndef GETDATA_INDEXENTRY_H
#define GETDATA_INDEXENTRY_H
-#ifndef _FILE_OFFSET_BITS
-# define _FILE_OFFSET_BITS 64
-#endif
-
-#define GD_NO_LEGACY_API
-#define GD_C89_API
-
-extern "C" {
-#include <getdata.h>
-}
#include <getdata/entry.h>
namespace GetData {
@@ -42,7 +32,7 @@
friend class Dirfile;
private:
- IndexEntry(GetData::Dirfile *dirfile, const char* field_code) :
+ IndexEntry(const GetData::Dirfile *dirfile, const char* field_code) :
Entry(dirfile, field_code) { };
};
}
Modified: trunk/getdata/bindings/cxx/getdata/lincomentry.h
===================================================================
--- trunk/getdata/bindings/cxx/getdata/lincomentry.h 2010-09-17 20:17:08 UTC (rev 447)
+++ trunk/getdata/bindings/cxx/getdata/lincomentry.h 2010-09-18 01:00:35 UTC (rev 448)
@@ -22,16 +22,6 @@
#ifndef GETDATA_LINCOMENTRY_H
#define GETDATA_LINCOMENTRY_H
-#ifndef _FILE_OFFSET_BITS
-# define _FILE_OFFSET_BITS 64
-#endif
-
-#define GD_NO_LEGACY_API
-#define GD_C89_API
-
-extern "C" {
-#include <getdata.h>
-}
#include <getdata/entry.h>
namespace GetData {
@@ -51,38 +41,38 @@
std::complex<double>* cm, std::complex<double>* cb,
int fragment_index = 0);
- virtual const char *Input(int index = 0) {
+ virtual const char *Input(int index = 0) const {
return (CheckIndex(E.field_type, E.u.lincom.n_fields, index)) ?
E.in_fields[index] : NULL;
};
- virtual int ComplexScalars() {
- return E.comp_scal;
- }
+ virtual int ComplexScalars() const { return E.comp_scal; }
- virtual int NFields() {
- return E.u.lincom.n_fields;
- };
+ virtual int NFields() const { return E.u.lincom.n_fields; };
- virtual double Scale(int index = 0) {
- return (CheckIndex(E.field_type, E.u.lincom.n_fields, index)) ? E.u.lincom.m[index] : 0;
+ virtual double Scale(int index = 0) const {
+ return (CheckIndex(E.field_type, E.u.lincom.n_fields, index)) ?
+ E.u.lincom.m[index] : 0;
};
- virtual std::complex<double> CScale(int index = 0) {
+ virtual std::complex<double> CScale(int index = 0) const {
return (CheckIndex(E.field_type, E.u.lincom.n_fields, index))
- ? std::complex<double>(E.u.lincom.cm[index][0], E.u.lincom.cm[index][1]) : 0;
+ ? std::complex<double>(E.u.lincom.cm[index][0],
+ E.u.lincom.cm[index][1]) : 0;
};
- virtual double Offset(int index = 0) {
- return (CheckIndex(E.field_type, E.u.lincom.n_fields, index)) ? E.u.lincom.b[index] : 0;
+ virtual double Offset(int index = 0) const {
+ return (CheckIndex(E.field_type, E.u.lincom.n_fields, index)) ?
+ E.u.lincom.b[index] : 0;
};
- virtual std::complex<double> COffset(int index = 0) {
+ virtual std::complex<double> COffset(int index = 0) const {
return (CheckIndex(E.field_type, E.u.lincom.n_fields, index))
- ? std::complex<double>(E.u.lincom.cb[index][0], E.u.lincom.cb[index][1]) : 0;
+ ? std::complex<double>(E.u.lincom.cb[index][0],
+ E.u.lincom.cb[index][1]) : 0;
};
- virtual const char *Scalar(int index = 0);
+ virtual const char *Scalar(int index = 0) const;
int SetNFields(int nfields);
int SetInput(const char* field, int index = 0);
@@ -94,7 +84,7 @@
int SetOffset(std::complex<double> offset, int index = 0);
private:
- LincomEntry(GetData::Dirfile *dirfile, const char* field_code) :
+ LincomEntry(const GetData::Dirfile *dirfile, const char* field_code) :
Entry(dirfile, field_code) { };
};
}
Modified: trunk/getdata/bindings/cxx/getdata/linterpentry.h
===================================================================
--- trunk/getdata/bindings/cxx/getdata/linterpentry.h 2010-09-17 20:17:08 UTC (rev 447)
+++ trunk/getdata/bindings/cxx/getdata/linterpentry.h 2010-09-18 01:00:35 UTC (rev 448)
@@ -22,16 +22,6 @@
#ifndef GETDATA_LINTERPENTRY_H
#define GETDATA_LINTERPENTRY_H
-#ifndef _FILE_OFFSET_BITS
-# define _FILE_OFFSET_BITS 64
-#endif
-
-#define GD_NO_LEGACY_API
-#define GD_C89_API
-
-extern "C" {
-#include <getdata.h>
-}
#include <getdata/entry.h>
namespace GetData {
@@ -47,19 +37,15 @@
LinterpEntry(const char* field_code, const char* in_field,
const char* table, int fragment_index = 0);
- virtual const char *Input() {
- return E.in_fields[0];
- };
+ virtual const char *Input() const { return E.in_fields[0]; };
- virtual const char *Table() {
- return E.u.linterp.table;
- };
+ virtual const char *Table() const { return E.u.linterp.table; };
int SetInput(const char* field);
int SetTable(const char* table, int move_table = 0);
private:
- LinterpEntry(GetData::Dirfile *dirfile, const char* field_code) :
+ LinterpEntry(const GetData::Dirfile *dirfile, const char* field_code) :
Entry(dirfile, field_code) { };
};
}
Modified: trunk/getdata/bindings/cxx/getdata/multiplyentry.h
===================================================================
--- trunk/getdata/bindings/cxx/getdata/multiplyentry.h 2010-09-17 20:17:08 UTC (rev 447)
+++ trunk/getdata/bindings/cxx/getdata/multiplyentry.h 2010-09-18 01:00:35 UTC (rev 448)
@@ -22,16 +22,6 @@
#ifndef GETDATA_MULTIPLYENTRY_H
#define GETDATA_MULTIPLYENTRY_H
-#ifndef _FILE_OFFSET_BITS
-# define _FILE_OFFSET_BITS 64
-#endif
-
-#define GD_NO_LEGACY_API
-#define GD_C89_API
-
-extern "C" {
-#include <getdata.h>
-}
#include <getdata/entry.h>
namespace GetData {
@@ -47,14 +37,14 @@
MultiplyEntry(const char* field_code, const char* in_field1,
const char* in_field2, int fragment_index = 0);
- virtual const char *Input(int index = 0) {
+ virtual const char *Input(int index = 0) const {
return E.in_fields[(index == 0) ? 0 : 1];
};
int SetInput(const char* field, int index);
private:
- MultiplyEntry(GetData::Dirfile *dirfile, const char* field_code) :
+ MultiplyEntry(const GetData::Dirfile *dirfile, const char* field_code) :
Entry(dirfile, field_code) { };
};
}
Modified: trunk/getdata/bindings/cxx/getdata/phaseentry.h
===================================================================
--- trunk/getdata/bindings/cxx/getdata/phaseentry.h 2010-09-17 20:17:08 UTC (rev 447)
+++ trunk/getdata/bindings/cxx/getdata/phaseentry.h 2010-09-18 01:00:35 UTC (rev 448)
@@ -22,16 +22,6 @@
#ifndef GETDATA_PHASEENTRY_H
#define GETDATA_PHASEENTRY_H
-#ifndef _FILE_OFFSET_BITS
-# define _FILE_OFFSET_BITS 64
-#endif
-
-#define GD_NO_LEGACY_API
-#define GD_C89_API
-
-extern "C" {
-#include <getdata.h>
-}
#include <getdata/entry.h>
namespace GetData {
@@ -47,24 +37,18 @@
PhaseEntry(const char* field_code, const char* in_field, gd_shift_t shift,
int fragment_index = 0);
- virtual const char *Input() {
- return E.in_fields[0];
- };
+ virtual const char *Input() const { return E.in_fields[0]; };
- virtual gd_shift_t Shift() {
- return E.u.phase.shift;
- };
+ virtual gd_shift_t Shift() const { return E.u.phase.shift; };
int SetInput(const char* field);
int SetShift(gd_shift_t shift);
int SetShift(const char* shift);
- const char *Scalar() {
- return E.scalar[0];
- };
+ const char *Scalar() const { return E.scalar[0]; };
private:
- PhaseEntry(GetData::Dirfile *dirfile, const char* field_code) :
+ PhaseEntry(const GetData::Dirfile *dirfile, const char* field_code) :
Entry(dirfile, field_code) { };
};
}
Modified: trunk/getdata/bindings/cxx/getdata/polynomentry.h
===================================================================
--- trunk/getdata/bindings/cxx/getdata/polynomentry.h 2010-09-17 20:17:08 UTC (rev 447)
+++ trunk/getdata/bindings/cxx/getdata/polynomentry.h 2010-09-18 01:00:35 UTC (rev 448)
@@ -22,16 +22,6 @@
#ifndef GETDATA_POLYNOMENTRY_H
#define GETDATA_POLYNOMENTRY_H
-#ifndef _FILE_OFFSET_BITS
-# define _FILE_OFFSET_BITS 64
-#endif
-
-#define GD_NO_LEGACY_API
-#define GD_C89_API
-
-extern "C" {
-#include <getdata.h>
-}
#include <getdata/entry.h>
namespace GetData {
@@ -50,28 +40,23 @@
PolynomEntry(const char* field_code, int poly_ord, const char* in_field,
std::complex<double>* ca, int fragment_index = 0);
- virtual const char *Input() {
- return E.in_fields[0];
- };
+ virtual const char *Input() const { return E.in_fields[0]; };
- virtual int ComplexScalars() {
- return E.comp_scal;
- }
+ virtual int ComplexScalars() const { return E.comp_scal; }
- virtual int PolyOrd() {
- return E.u.polynom.poly_ord;
- };
+ virtual int PolyOrd() const { return E.u.polynom.poly_ord; };
- virtual double Coefficient(int index = 0) {
+ virtual double Coefficient(int index = 0) const {
return (index <= E.u.polynom.poly_ord) ? E.u.polynom.a[index] : 0;
};
- virtual std::complex<double> CCoefficient(int index = 0) {
+ virtual std::complex<double> CCoefficient(int index = 0) const {
return (index <= E.u.polynom.poly_ord)
- ? std::complex<double>(E.u.polynom.ca[index][0], E.u.polynom.ca[index][1]) : 0;
+ ? std::complex<double>(E.u.polynom.ca[index][0],
+ E.u.polynom.ca[index][1]) : 0;
};
- virtual const char *Scalar(int index = 0);
+ virtual const char *Scalar(int index = 0) const;
int SetPolyOrd(int poly_ord);
int SetInput(const char* field);
@@ -80,7 +65,7 @@
int SetCoefficient(std::complex<double> coeff, int index = 0);
private:
- PolynomEntry(GetData::Dirfile *dirfile, const char* field_code) :
+ PolynomEntry(const GetData::Dirfile *dirfile, const char* field_code) :
Entry(dirfile, field_code) { };
};
}
Modified: trunk/getdata/bindings/cxx/getdata/rawentry.h
===================================================================
--- trunk/getdata/bindings/cxx/getdata/rawentry.h 2010-09-17 20:17:08 UTC (rev 447)
+++ trunk/getdata/bindings/cxx/getdata/rawentry.h 2010-09-18 01:00:35 UTC (rev 448)
@@ -22,16 +22,6 @@
#ifndef GETDATA_RAWENTRY_H
#define GETDATA_RAWENTRY_H
-#ifndef _FILE_OFFSET_BITS
-# define _FILE_OFFSET_BITS 64
-#endif
-
-#define GD_NO_LEGACY_API
-#define GD_C89_API
-
-extern "C" {
-#include <getdata.h>
-}
#include <getdata/entry.h>
namespace GetData {
@@ -47,25 +37,19 @@
RawEntry(const char* field_code, DataType data_type, gd_spf_t spf,
int fragment_index = 0);
- virtual gd_spf_t SamplesPerFrame() {
- return E.u.raw.spf;
- };
+ virtual gd_spf_t SamplesPerFrame() const { return E.u.raw.spf; };
- virtual DataType RawType() {
- return (DataType)E.u.raw.type;
- };
+ virtual DataType RawType() const { return (DataType)E.u.raw.type; };
const char* FileName();
int SetSamplesPerFrame(gd_spf_t spf, int recode = 0);
int SetSamplesPerFrame(const char *spf, int recode = 0);
int SetType(DataType type, int recode = 0);
- virtual const char *Scalar() {
- return E.scalar[0];
- };
+ virtual const char *Scalar() const { return E.scalar[0]; };
private:
- RawEntry(GetData::Dirfile *dirfile, const char* field_code) :
+ RawEntry(const GetData::Dirfile *dirfile, const char* field_code) :
Entry(dirfile, field_code) { };
};
}
Modified: trunk/getdata/bindings/cxx/getdata/recipentry.h
===================================================================
--- trunk/getdata/bindings/cxx/getdata/recipentry.h 2010-09-17 20:17:08 UTC (rev 447)
+++ trunk/getdata/bindings/cxx/getdata/recipentry.h 2010-09-18 01:00:35 UTC (rev 448)
@@ -22,16 +22,6 @@
#ifndef GETDATA_RECIPENTRY_H
#define GETDATA_RECIPENTRY_H
-#ifndef _FILE_OFFSET_BITS
-# define _FILE_OFFSET_BITS 64
-#endif
-
-#define GD_NO_LEGACY_API
-#define GD_C89_API
-
-extern "C" {
-#include <getdata.h>
-}
#include <getdata/entry.h>
namespace GetData {
@@ -50,24 +40,17 @@
RecipEntry(const char* field_code, const char* in_field,
std::complex<double> cdividend, int fragment_index = 0);
- virtual const char *Input() {
- return E.in_fields[0];
- };
+ virtual const char *Input() const { return E.in_fields[0]; };
- virtual const char *Scalar() {
- return E.scalar[0];
- }
+ virtual const char *Scalar() const { return E.scalar[0]; }
- virtual int ComplexScalars() {
- return E.comp_scal;
- }
+ virtual int ComplexScalars() const { return E.comp_scal; }
- virtual double Dividend() {
- return E.u.recip.dividend;
- };
+ virtual double Dividend() const { return E.u.recip.dividend; };
- virtual std::complex<double> CDividend() {
- return std::complex<double>(E.u.recip.cdividend[0], E.u.recip.cdividend[1]);
+ virtual std::complex<double> CDividend() const {
+ return std::complex<double>(E.u.recip.cdividend[0],
+ E.u.recip.cdividend[1]);
};
virtual int SetInput(const char* field);
@@ -76,7 +59,7 @@
virtual int SetDividend(std::complex<double> coeff);
private:
- RecipEntry(GetData::Dirfile *dirfile, const char* field_code) :
+ RecipEntry(const GetData::Dirfile *dirfile, const char* field_code) :
Entry(dirfile, field_code) { };
};
}
Modified: trunk/getdata/bindings/cxx/getdata/sbitentry.h
===================================================================
--- trunk/getdata/bindings/cxx/getdata/sbitentry.h 2010-09-17 20:17:08 UTC (rev 447)
+++ trunk/getdata/bindings/cxx/getdata/sbitentry.h 2010-09-18 01:00:35 UTC (rev 448)
@@ -22,16 +22,6 @@
#ifndef GETDATA_SBITENTRY_H
#define GETDATA_SBITENTRY_H
-#ifndef _FILE_OFFSET_BITS
-# define _FILE_OFFSET_BITS 64
-#endif
-
-#define GD_NO_LEGACY_API
-#define GD_C89_API
-
-extern "C" {
-#include <getdata.h>
-}
#include <getdata/entry.h>
namespace GetData {
@@ -47,17 +37,11 @@
SBitEntry(const char* field_code, const char* in_field, gd_bit_t bitnum,
gd_bit_t numbits = 1, int fragment_index = 0);
- virtual const char *Input() {
- return E.in_fields[0];
- };
+ virtual const char *Input() const { return E.in_fields[0]; };
- virtual gd_bit_t FirstBit() {
- return E.u.bit.bitnum;
- };
+ virtual gd_bit_t FirstBit() const { return E.u.bit.bitnum; };
- virtual gd_bit_t NumBits() {
- return E.u.bit.numbits;
- };
+ virtual gd_bit_t NumBits() const { return E.u.bit.numbits; };
int SetInput(const char* field);
int SetFirstBit(gd_bit_t first_bit);
@@ -65,10 +49,10 @@
int SetNumBits(gd_bit_t num_bits);
int SetNumBits(const char* num_bits);
- virtual const char *Scalar(int index = 0);
+ virtual const char *Scalar(int index = 0) const;
private:
- SBitEntry(GetData::Dirfile *dirfile, const char* field_code) :
+ SBitEntry(const GetData::Dirfile *dirfile, const char* field_code) :
Entry(dirfile, field_code) { };
};
}
Modified: trunk/getdata/bindings/cxx/getdata/stringentry.h
===================================================================
--- trunk/getdata/bindings/cxx/getdata/stringentry.h 2010-09-17 20:17:08 UTC (rev 447)
+++ trunk/getdata/bindings/cxx/getdata/stringentry.h 2010-09-18 01:00:35 UTC (rev 448)
@@ -22,16 +22,6 @@
#ifndef GETDATA_STRINGENTRY_H
#define GETDATA_STRINGENTRY_H
-#ifndef _FILE_OFFSET_BITS
-# define _FILE_OFFSET_BITS 64
-#endif
-
-#define GD_NO_LEGACY_API
-#define GD_C89_API
-
-extern "C" {
-#include <getdata.h>
-}
#include <getdata/entry.h>
namespace GetData {
@@ -47,7 +37,7 @@
StringEntry(const char* field_code, int fragment_index = 0);
private:
- StringEntry(GetData::Dirfile *dirfile, const char* field_code) :
+ StringEntry(const GetData::Dirfile *dirfile, const char* field_code) :
Entry(dirfile, field_code) { };
};
}
Modified: trunk/getdata/bindings/cxx/lincomentry.cpp
===================================================================
--- trunk/getdata/bindings/cxx/lincomentry.cpp 2010-09-17 20:17:08 UTC (rev 447)
+++ trunk/getdata/bindings/cxx/lincomentry.cpp 2010-09-18 01:00:35 UTC (rev 448)
@@ -221,7 +221,7 @@
return 0;
}
-const char *LincomEntry::Scalar(int index)
+const char *LincomEntry::Scalar(int index) const
{
if (index < 0 || index >= E.u.lincom.n_fields)
return NULL;
Modified: trunk/getdata/bindings/cxx/polynomentry.cpp
===================================================================
--- trunk/getdata/bindings/cxx/polynomentry.cpp 2010-09-17 20:17:08 UTC (rev 447)
+++ trunk/getdata/bindings/cxx/polynomentry.cpp 2010-09-18 01:00:35 UTC (rev 448)
@@ -155,7 +155,7 @@
return 0;
}
-const char *PolynomEntry::Scalar(int index)
+const char *PolynomEntry::Scalar(int index) const
{
if (index < 0 || index > E.u.polynom.poly_ord)
return NULL;
Modified: trunk/getdata/bindings/cxx/sbitentry.cpp
===================================================================
--- trunk/getdata/bindings/cxx/sbitentry.cpp 2010-09-17 20:17:08 UTC (rev 447)
+++ trunk/getdata/bindings/cxx/sbitentry.cpp 2010-09-18 01:00:35 UTC (rev 448)
@@ -76,7 +76,7 @@
return 0;
}
-const char *SBitEntry::Scalar(int index)
+const char *SBitEntry::Scalar(int index) const
{
if (index != 0 && index != 1)
return NULL;
Modified: trunk/getdata/bindings/f77/fgetdata.c
===================================================================
--- trunk/getdata/bindings/f77/fgetdata.c 2010-09-17 20:17:08 UTC (rev 447)
+++ trunk/getdata/bindings/f77/fgetdata.c 2010-09-18 01:00:35 UTC (rev 448)
@@ -42,9 +42,7 @@
/* we keep entry zero as a generic, invalid dirfile to return if
* dirfile lookup fails */
- f77dirfiles[0] = (DIRFILE*)malloc(sizeof(DIRFILE));
- memset(f77dirfiles[0], 0, sizeof(DIRFILE));
- f77dirfiles[0]->flags = GD_INVALID;
+ f77dirfiles[0] = gd_invalid_dirfile();
f77dirfiles_initialised = 1;
dreturnvoid();
Modified: trunk/getdata/bindings/idl/getdata.c
===================================================================
--- trunk/getdata/bindings/idl/getdata.c 2010-09-17 20:17:08 UTC (rev 447)
+++ trunk/getdata/bindings/idl/getdata.c 2010-09-18 01:00:35 UTC (rev 448)
@@ -90,9 +90,7 @@
/* we keep entry zero as a generic, invalid dirfile to return if
* dirfile lookup fails */
- idldirfiles[0] = (DIRFILE*)malloc(sizeof(DIRFILE));
- memset(idldirfiles[0], 0, sizeof(DIRFILE));
- idldirfiles[0]->flags = GD_INVALID;
+ idldirfiles[0] = gd_invalid_dirfile();
idldirfiles_initialised = 1;
dreturnvoid();
Modified: trunk/getdata/bindings/python/pydirfile.c
===================================================================
--- trunk/getdata/bindings/python/pydirfile.c 2010-09-17 20:17:08 UTC (rev 447)
+++ trunk/getdata/bindings/python/pydirfile.c 2010-09-18 01:00:35 UTC (rev 448)
@@ -296,13 +296,7 @@
PYGD_CHECK_ERROR(self->D, NULL);
- /* Here we replace D with an empty, invalid dirfile object. The following
- * uses getdata internals, but this could be done just as simply (but with
- * more overhead) using the public API by calling gd_open("", 0)
- */
- self->D = malloc(sizeof(struct _GD_DIRFILE));
- memset(self->D, 0, sizeof(struct _GD_DIRFILE));
- self->D->flags = GD_INVALID;
+ self->D = gd_invalid_dirfile();
Py_INCREF(Py_None);
dreturn("%p", Py_None);
@@ -342,13 +336,8 @@
PYGD_CHECK_ERROR(self->D, NULL);
- /* Here we replace D with an empty, invalid dirfile object. The following
- * uses getdata internals, but this could be done just as simply (but with
- * more overhead) using the public API by calling gd_open("", 0)
- */
- self->D = malloc(sizeof(struct _GD_DIRFILE));
- memset(self->D, 0, sizeof(struct _GD_DIRFILE));
- self->D->flags = GD_INVALID;
+ /* Here we replace D with an empty, invalid dirfile object. */
+ self->D = gd_invalid_dirfile();
Py_INCREF(Py_None);
dreturn("%p", Py_None);
Modified: trunk/getdata/configure.ac
===================================================================
--- trunk/getdata/configure.ac 2010-09-17 20:17:08 UTC (rev 447)
+++ trunk/getdata/configure.ac 2010-09-18 01:00:35 UTC (rev 448)
@@ -539,6 +539,12 @@
AC_MSG_CHECKING([whether mkdir accepts two arguments])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
+#if HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
#if HAVE_IO_H
#include <io.h>
#endif
Modified: trunk/getdata/man/Makefile.am
===================================================================
--- trunk/getdata/man/Makefile.am 2010-09-17 20:17:08 UTC (rev 447)
+++ trunk/getdata/man/Makefile.am 2010-09-18 01:00:35 UTC (rev 448)
@@ -37,9 +37,9 @@
gd_field_list.3 gd_field_list_by_type.3 gd_flush.3 \
gd_fragment_index.3 gd_fragmentname.3 gd_framenum_subset.3 \
gd_frameoffset.3 gd_free_entry_strings.3 gd_include.3 \
- gd_madd_bit.3 gd_mconstants.3 gd_metaflush.3 \
- gd_mfield_list.3 gd_mfield_list_by_type.3 gd_move.3 \
- gd_mstrings.3 gd_mvector_list.3 gd_dirfilename.3 \
+ gd_invalid_dirfile.3 gd_madd_bit.3 gd_mconstants.3 \
+ gd_metaflush.3 gd_mfield_list.3 gd_mfield_list_by_type.3 \
+ gd_move.3 gd_mstrings.3 gd_mvector_list.3 gd_dirfilename.3 \
gd_native_type.3 gd_nfields.3 gd_nfields_by_type.3 \
gd_nfragments.3 gd_nframes.3 gd_nmfields.3 \
gd_nmfields_by_type.3 gd_nmvectors.3 gd_nvectors.3 \
Added: trunk/getdata/man/gd_invalid_dirfile.3
===================================================================
--- trunk/getdata/man/gd_invalid_dirfile.3 (rev 0)
+++ trunk/getdata/man/gd_invalid_dirfile.3 2010-09-18 01:00:35 UTC (rev 448)
@@ -0,0 +1,71 @@
+.\" gd_invalid_dirfile.3. The gd_invalid_dirfile man page.
+.\"
+.\" (C) 2010 D. V. Wiebe
+.\"
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.\"
+.\" This file is part of the GetData project.
+.\"
+.\" Permission is granted to copy, distribute and/or modify this document
+.\" under the terms of the GNU Free Documentation License, Version 1.2 or
+.\" any later version published by the Free Software Foundation; with no
+.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
+.\" Texts. A copy of the license is included in the `COPYING.DOC' file
+.\" as part of this distribution.
+.\"
+.TH gd_invalid_dirfile 3 "17 September 2010" "Version 0.7.0" "GETDATA"
+.SH NAME
+gd_invalid_dirfile \(em obtain an pointer to an invalid DIRFILE object
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "DIRFILE* gd_invalid_dirfile(void);
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_invalid_dirfile ()
+returns a pointer to a newly allocated, invalid DIRFILE object. Like any
+other DIRFILE object, the invalid DIRFILE object should be deallocated by
+calling
+.BR gd_close (3)
+or
+.BR gd_discard (3)
+when it is no longer needed.
+
+The DIRFILE object reutrned may be passed to any other GetData function which
+requires one, but doing so will inevitably result in that function failing
+with the
+.B GD_BAD_DIRFILE
+error.
+
+A similar effect can be achieved by making an invalid
+.BR gd_open (3)
+call, such as:
+.HP
+.in +2n
+.nf
+.fam C
+.BR gd_open( """""" ,\~ 0 );
+.fam
+.fi
+.in
+.PP
+which also returns a pointer to an invalid DIRFILE object. The difference
+is that an invalid DIRFILE created in this way has a non-zero Dirfile
+error (obtainable with
+.BR gd_error (3)),
+while the dirfile error of the invalid DIRFILE returned by
+.BR gd_invalid_dirfile (3)
+is zero (indicating success).
+
+.SH RETURN VALUE
+This function always returns a pointer to a newly allocated, invalid DIRFILE
+object.
+
+.SH SEE ALSO
+.BR gd_close (3),
+.BR gd_discard (3),
+.BR gd_open (3)
Modified: trunk/getdata/man/gd_parser_callback.3
===================================================================
--- trunk/getdata/man/gd_parser_callback.3 2010-09-17 20:17:08 UTC (rev 447)
+++ trunk/getdata/man/gd_parser_callback.3 2010-09-18 01:00:35 UTC (rev 448)
@@ -13,7 +13,7 @@
.\" Texts. A copy of the license is included in the `COPYING.DOC' file
.\" as part of this distribution.
.\"
-.TH gd_parser_callback 3 "21 July 2010" "Version 0.7.0" "GETDATA"
+.TH gd_parser_callback 3 "17 September 2010" "Version 0.7.0" "GETDATA"
.SH NAME
gd_parser_callback \(em set the syntax error callback handler for a dirfile
.SH SYNOPSIS
@@ -28,7 +28,7 @@
.SH DESCRIPTION
The
.BR gd_parser_callback ()
-updates the syntax error callback function of the DIRFILE object
+function updates the syntax error callback function of the DIRFILE object
.I dirfile
to be
.IR sehandler ,
Modified: trunk/getdata/src/getdata.h.in
===================================================================
--- trunk/getdata/src/getdata.h.in 2010-09-17 20:17:08 UTC (rev 447)
+++ trunk/getdata/src/getdata.h.in 2010-09-18 01:00:35 UTC (rev 448)
@@ -513,6 +513,8 @@
extern const char *gd_fragmentname(DIRFILE *dirfile,
int index) gd_nothrow gd_nonnull ((1));
+DIRFILE* gd_invalid_dirfile(void) gd_nothrow;
+
extern int gd_madd(DIRFILE *dirfile, const gd_entry_t *entry,
const char *parent) gd_nothrow gd_nonnull ((1,2,3));
Modified: trunk/getdata/src/legacy.c
===================================================================
--- trunk/getdata/src/legacy.c 2010-09-17 20:17:08 UTC (rev 447)
+++ trunk/getdata/src/legacy.c 2010-09-18 01:00:35 UTC (rev 448)
@@ -36,7 +36,16 @@
static char _GD_GlobalErrorString[GD_MAX_LINE_LENGTH];
static char _GD_GlobalErrorFile[GD_MAX_LINE_LENGTH];
static DIRFILE _GD_GlobalErrors = {
+#ifndef GD_NO_C99_API
+ .error = 0,
+ .suberror = 0,
+ .error_string = _GD_GlobalErrorString,
+ .error_file = _GD_GlobalErrorFile,
+ .error_line = 0,
+ .flags = GD_INVALID,
+#else
0, 0, _GD_GlobalErrorString, _GD_GlobalErrorFile, 0, GD_INVALID
+#endif
};
/* old error strings */
@@ -81,7 +90,7 @@
static struct FormatType Format;
/* _GD_CopyGlobalError: Copy the last error message to the global error buffer.
- */
+*/
static int _GD_CopyGlobalError(DIRFILE* D)
{
dtrace("%p", D);
@@ -96,7 +105,7 @@
}
/* legacy wrapper for gd_error_string()
- */
+*/
char *GetDataErrorString(char* buffer, size_t buflen) gd_nothrow
{
return gd_error_string(&_GD_GlobalErrors, buffer, buflen);
@@ -176,7 +185,7 @@
}
R->field = E->field;
-
+
switch(E->u.raw.type) {
case GD_UINT8:
R->type = 'c';
@@ -356,7 +365,7 @@
dreturn("%p", NULL);
return NULL;
}
-
+
memset(&Format, sizeof(Format), 0);
/* fill the structure -- like everything about the legacy API, this is
Modified: trunk/getdata/src/open.c
===================================================================
--- trunk/getdata/src/open.c 2010-09-17 20:17:08 UTC (rev 447)
+++ trunk/getdata/src/open.c 2010-09-18 01:00:35 UTC (rev 448)
@@ -199,6 +199,20 @@
dreturnvoid();
}
+DIRFILE* gd_invalid_dirfile(void) gd_nothrow
+{
+ DIRFILE *D;
+
+ dtracevoid();
+
+ D = (DIRFILE *)malloc(sizeof(DIRFILE));
+ memset(D, 0, sizeof(DIRFILE));
+ D->flags = GD_INVALID;
+
+ dreturn("%p", D);
+ return D;
+}
+
/* dirfile_cbopen: open (or, perhaps, create) and parse the specified dirfile
*/
DIRFILE* gd_cbopen(const char* filedir, unsigned long flags,
This was sent by the SourceForge.net collaborative development platform, the wo...
[truncated message content] |
|
From: <ket...@us...> - 2010-09-17 20:17:14
|
Revision: 447
http://getdata.svn.sourceforge.net/getdata/?rev=447&view=rev
Author: ketiltrout
Date: 2010-09-17 20:17:08 +0000 (Fri, 17 Sep 2010)
Log Message:
-----------
Remove hardcoded -Wall.
Modified Paths:
--------------
trunk/getdata/ChangeLog
trunk/getdata/bindings/cxx/Makefile.am
trunk/getdata/bindings/cxx/test/Makefile.am
trunk/getdata/bindings/cxx/test/big_test.cpp
trunk/getdata/bindings/f77/Makefile.am
trunk/getdata/bindings/f77/test/Makefile.am
trunk/getdata/bindings/idl/Makefile.am
trunk/getdata/bindings/python/Makefile.am
trunk/getdata/configure.ac
trunk/getdata/m4/compiler.m4
trunk/getdata/src/Makefile.am
trunk/getdata/test/Makefile.am
trunk/getdata/util/Makefile.am
Property Changed:
----------------
trunk/getdata/
Property changes on: trunk/getdata
___________________________________________________________________
Modified: svn:ignore
- Makefile
Makefile.in
aclocal.m4
autom4te.cache
config.log
config.guess
config.status
config.sub
configure
depcomp
getdata-*.tar.gz
getdata-*.tar.bz2
getdata-*.sig
install-sh
libtool
ltmain.sh
missing
*.swp
libltdl
RELEASE_NOTES-*
config.lt
+ Makefile
Makefile.in
aclocal.m4
autom4te.cache
config.log
config.guess
config.status
config.sub
configure
depcomp
getdata-*.tar.gz
getdata-*.tar.bz2
getdata-*.sig
install-sh
libtool
ltmain.sh
missing
*.swp
libltdl
RELEASE_NOTES-*
config.lt
compile
Modified: trunk/getdata/ChangeLog
===================================================================
--- trunk/getdata/ChangeLog 2010-09-15 00:14:49 UTC (rev 446)
+++ trunk/getdata/ChangeLog 2010-09-17 20:17:08 UTC (rev 447)
@@ -1,3 +1,14 @@
+2010-09-17 D. V. Wiebe <ge...@ke...> svn:447
+ * test/Makefile.am src/Makefile.am bindings/python/Makefile.am
+ bindings/cxx/Makefile.am bindings/f77/test/Makefile.am
+ bindings/f77/Makefile.am bindings/idl/Makefile.am util/Makefile.am: Remove
+ hardcoded -Wall.
+ * m4/compiler.m4 (GD_PROG_CC_WALL GD_PROG_CXX_WALL GD_PROG_FC_WALL
+ GD_PROG_F77_WALL): Added.
+ * configure.ac: Check whether the compilers accept -Wall
+
+ * bindings/cxx/big_test.cpp: Fix for renamed functions.
+
2010-09-15 D. V. Wiebe <ge...@ke...> svn:446
* bindings/cxx/dirfile.cpp (Dirfile::EoF Dirfile::BoF): Renamed.
@@ -7,7 +18,6 @@
* util/dirfile2ascii.c: Unroll type_data initialisation some more.
-
2010-09-11 D. V. Wiebe <ge...@ke...> svn:444
* test/ src/ bindings/ util/: ANSI-C-ify.
* src/getdata.h.in: Define GD_NO_C99_API when the C99-compliant API has been
Modified: trunk/getdata/bindings/cxx/Makefile.am
===================================================================
--- trunk/getdata/bindings/cxx/Makefile.am 2010-09-15 00:14:49 UTC (rev 446)
+++ trunk/getdata/bindings/cxx/Makefile.am 2010-09-17 20:17:08 UTC (rev 447)
@@ -21,11 +21,15 @@
AUTOMAKE_OPTIONS = foreign
getdata_includedir = ${includedir}/getdata
+if CXX_WALL
+WALL=-Wall
+endif
+
if CXX_WEXTRA
WEXTRA=-Wextra
endif
-INCLUDES = -Wall $(WEXTRA) -I$(top_srcdir)/src
+INCLUDES = ${WALL} $(WEXTRA) -I$(top_srcdir)/src
SUBDIRS=test
Modified: trunk/getdata/bindings/cxx/test/Makefile.am
===================================================================
--- trunk/getdata/bindings/cxx/test/Makefile.am 2010-09-15 00:14:49 UTC (rev 446)
+++ trunk/getdata/bindings/cxx/test/Makefile.am 2010-09-17 20:17:08 UTC (rev 447)
@@ -20,11 +20,15 @@
#
AUTOMAKE_OPTIONS = foreign
+if CXX_WALL
+WALL=-Wall
+endif
+
if CXX_WEXTRA
WEXTRA=-Wextra
endif
-INCLUDES = -Wall $(WEXTRA) -I$(srcdir)/.. -I$(top_srcdir)/src -D__TEST__=\"$@\"
+INCLUDES = ${WALL} $(WEXTRA) -I$(srcdir)/.. -I$(top_srcdir)/src -D__TEST__=\"$@\"
LDADD=../libgetdata++.la
TESTS=big_test
Modified: trunk/getdata/bindings/cxx/test/big_test.cpp
===================================================================
--- trunk/getdata/bindings/cxx/test/big_test.cpp 2010-09-15 00:14:49 UTC (rev 446)
+++ trunk/getdata/bindings/cxx/test/big_test.cpp 2010-09-17 20:17:08 UTC (rev 447)
@@ -1029,13 +1029,13 @@
CHECK_OK(101);
CHECK_DOUBLE(101,dp,37.0375);
- // 86: Dirfile::EOF check
- n = d->EOF("lincom");
+ // 86: Dirfile::EoF check
+ n = d->EoF("lincom");
CHECK_OK(86);
CHECK_INT(86,n,344);
- // 142: Dirfile::BOF check
- n = d->BOF("lincom");
+ // 142: Dirfile::BoF check
+ n = d->BoF("lincom");
CHECK_OK(142);
CHECK_INT(142,n,264);
Modified: trunk/getdata/bindings/f77/Makefile.am
===================================================================
--- trunk/getdata/bindings/f77/Makefile.am 2010-09-15 00:14:49 UTC (rev 446)
+++ trunk/getdata/bindings/f77/Makefile.am 2010-09-17 20:17:08 UTC (rev 447)
@@ -25,13 +25,20 @@
if FC_WEXTRA
FC_WEXTRA=-Wextra
+endif
+
+if FC_WALL
FC_WALL=-Wall
endif
if CC_WEXTRA
-C_WEXTRA=-Wextra
+CC_WEXTRA=-Wextra
endif
+if CC_WALL
+CC_WALL=-Wall
+endif
+
if MAKE_F95BINDINGS
F95_INC=getdata.mod
F95_LIB=libf95getdata.la
@@ -52,7 +59,7 @@
nodist_include_HEADERS=getdata.f $(F95_INC)
lib_LTLIBRARIES=libfgetdata.la $(F95_LIB)
-libfgetdata_la_CPPFLAGS = -Wall $(C_WEXTRA)
+libfgetdata_la_CPPFLAGS = ${CC_WALL} $(CC_WEXTRA)
libfgetdata_la_SOURCES = fgetdata.c fgetdata.h $(DEBUG_C)
libfgetdata_la_LIBADD=../../src/libgetdata.la
libfgetdata_la_LDFLAGS = -version-info @FGETDATA_VERSION@
Modified: trunk/getdata/bindings/f77/test/Makefile.am
===================================================================
--- trunk/getdata/bindings/f77/test/Makefile.am 2010-09-15 00:14:49 UTC (rev 446)
+++ trunk/getdata/bindings/f77/test/Makefile.am 2010-09-17 20:17:08 UTC (rev 447)
@@ -20,11 +20,11 @@
#
AUTOMAKE_OPTIONS = foreign
-if FC_WEXTRA
+if FC_WALL
FC_WALL=-Wall
endif
-if F77_WEXTRA
+if F77_WALL
F77_WALL=-Wall
endif
Modified: trunk/getdata/bindings/idl/Makefile.am
===================================================================
--- trunk/getdata/bindings/idl/Makefile.am 2010-09-15 00:14:49 UTC (rev 446)
+++ trunk/getdata/bindings/idl/Makefile.am 2010-09-17 20:17:08 UTC (rev 447)
@@ -20,6 +20,10 @@
#
AUTOMAKE_OPTIONS = foreign
+if CC_WALL
+WALL=-Wall
+endif
+
if GETDATA_DEBUG
DEBUG_C = ../../src/debug.c
endif
@@ -30,7 +34,7 @@
idl_HEADERS = idl_getdata.dlm
# idl makes heavy use of type punning, ergo -fno-strict-aliasing
-AM_CFLAGS = -Wall $(IDL_CFLAGS) -fno-strict-aliasing
+AM_CFLAGS = ${WALL} $(IDL_CFLAGS) -fno-strict-aliasing
BUILT_SOURCES=sublist.c constants.c
idl_getdata_la_LDFLAGS = -module -avoid-version -export-symbols-regex IDL_Load \
-precious-files-regex 'idl_getdata\.dlm'
Modified: trunk/getdata/bindings/python/Makefile.am
===================================================================
--- trunk/getdata/bindings/python/Makefile.am 2010-09-15 00:14:49 UTC (rev 446)
+++ trunk/getdata/bindings/python/Makefile.am 2010-09-17 20:17:08 UTC (rev 447)
@@ -20,6 +20,10 @@
#
AUTOMAKE_OPTIONS = foreign
+if CC_WALL
+WALL=-Wall
+endif
+
if GETDATA_DEBUG
DEBUG_C = ../../src/debug.c
endif
@@ -29,7 +33,7 @@
python_LTLIBRARIES = pygetdata.la
BUILT_SOURCES = pyconstants.c
-AM_CFLAGS = -Wall -fno-strict-aliasing
+AM_CFLAGS = ${WALL} -fno-strict-aliasing
AM_CPPFLAGS = $(CPPFLAGS) $(PYTHON_CPPFLAGS) $(NUMPY_CPPFLAGS)
pygetdata_la_LDFLAGS = -module -avoid-version \
-export-symbols-regex initpygetdata
Modified: trunk/getdata/configure.ac
===================================================================
--- trunk/getdata/configure.ac 2010-09-15 00:14:49 UTC (rev 446)
+++ trunk/getdata/configure.ac 2010-09-17 20:17:08 UTC (rev 447)
@@ -451,18 +451,22 @@
echo "*** Checking additional compiler characteristics"
echo
AC_C_INLINE
+GD_PROG_CC_WALL
GD_PROG_CC_WEXTRA
if test "x$make_c++bindings" != "xno"; then
+ GD_PROG_CXX_WALL
GD_PROG_CXX_WEXTRA
fi
if test "x$make_f77bindings" != "xno"; then
+ GD_PROG_F77_WALL
GD_PROG_F77_WEXTRA
GD_LANG_F77_COMPILER_INTEL
fi
if test "x$make_f95bindings" != "xno"; then
+ GD_PROG_FC_WALL
GD_PROG_FC_WEXTRA
GD_LANG_FC_COMPILER_INTEL
fi
@@ -777,6 +781,10 @@
dnl Automake conditionals
AM_CONDITIONAL(GETDATA_DEBUG, [test "x$enable_debug" == "xyes"])
+AM_CONDITIONAL(CC_WALL, [test "x$gd_cv_prog_cc_wall" == "xyes"])
+AM_CONDITIONAL(CXX_WALL, [test "x$gd_cv_prog_cxx_wall" == "xyes"])
+AM_CONDITIONAL(F77_WALL, [test "x$gd_cv_prog_f77_wall" == "xyes"])
+AM_CONDITIONAL(FC_WALL, [test "x$gd_cv_prog_fc_wall" == "xyes"])
AM_CONDITIONAL(CC_WEXTRA, [test "x$gd_cv_prog_cc_wextra" == "xyes"])
AM_CONDITIONAL(CXX_WEXTRA, [test "x$gd_cv_prog_cxx_wextra" == "xyes"])
AM_CONDITIONAL(F77_WEXTRA, [test "x$gd_cv_prog_f77_wextra" == "xyes"])
Modified: trunk/getdata/m4/compiler.m4
===================================================================
--- trunk/getdata/m4/compiler.m4 2010-09-15 00:14:49 UTC (rev 446)
+++ trunk/getdata/m4/compiler.m4 2010-09-17 20:17:08 UTC (rev 447)
@@ -114,6 +114,59 @@
AC_LANG_POP([Fortran 77])])
FCFLAGS=$gd_saved_FCFLAGS])
+dnl GD_PROG_CC_WALL
+dnl -------------------------------------------------------------
+dnl Check whether the C compiler accepts -Wall
+AC_DEFUN([GD_PROG_CC_WALL],
+[gd_saved_CFLAGS=$CFLAGS
+AC_CACHE_CHECK([whether $CC accepts -Wall], gd_cv_prog_cc_wall,
+[CFLAGS="-Wall"
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [gd_cv_prog_cc_wall=yes],
+[gd_cv_prog_cc_wall=no])])
+CFLAGS=$gd_saved_CFLAGS])
+
+
+dnl GD_PROG_CXX_WALL
+dnl -------------------------------------------------------------
+dnl Check whether the C++ compiler accepts -Wall
+AC_DEFUN([GD_PROG_CXX_WALL],
+[gd_saved_CXXFLAGS=$CXXFLAGS
+AC_CACHE_CHECK([whether $CXX accepts -Wall], gd_cv_prog_cxx_wall,
+[CXXFLAGS="-Wall"
+AC_LANG_PUSH([C++])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [gd_cv_prog_cxx_wall=yes],
+[gd_cv_prog_cxx_wall=no])
+AC_LANG_POP([C++])])
+CXXFLAGS=$gd_saved_CXXFLAGS])
+
+
+dnl GD_PROG_F77_WALL
+dnl -------------------------------------------------------------
+dnl Check whether the Fotran-77 compiler accepts -Wall
+AC_DEFUN([GD_PROG_F77_WALL],
+[gd_saved_FFLAGS=$FFLAGS
+AC_CACHE_CHECK([whether $F77 accepts -Wall], gd_cv_prog_f77_wall,
+[FFLAGS="-Wall"
+AC_LANG_PUSH([Fortran 77])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [gd_cv_prog_f77_wall=yes],
+[gd_cv_prog_f77_wall=no])
+AC_LANG_POP([Fortran 77])])
+FFLAGS=$gd_saved_FFLAGS])
+
+
+dnl GD_PROG_FC_WALL
+dnl -------------------------------------------------------------
+dnl Check whether the free-form Fotran compiler accepts -Wall
+AC_DEFUN([GD_PROG_FC_WALL],
+[gd_saved_FCFLAGS=$FCFLAGS
+AC_CACHE_CHECK([whether $FC accepts -Wall], gd_cv_prog_fc_wall,
+[FCFLAGS="-Wall"
+AC_LANG_PUSH([Fortran 77])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [gd_cv_prog_fc_wall=yes],
+[gd_cv_prog_fc_wall=no])
+AC_LANG_POP([Fortran 77])])
+FCFLAGS=$gd_saved_FCFLAGS])
+
dnl GD_C_FLOATORDERING
dnl -----------------------------------------------------------
dnl Attempt to determine the ordering of double precision floats
Modified: trunk/getdata/src/Makefile.am
===================================================================
--- trunk/getdata/src/Makefile.am 2010-09-15 00:14:49 UTC (rev 446)
+++ trunk/getdata/src/Makefile.am 2010-09-17 20:17:08 UTC (rev 447)
@@ -20,6 +20,10 @@
#
AUTOMAKE_OPTIONS = foreign
+if CC_WALL
+WALL=-Wall
+endif
+
if CC_WEXTRA
WEXTRA=-Wextra
endif
@@ -86,7 +90,7 @@
endif
pkgconfigdir = @libdir@/pkgconfig
-AM_CFLAGS = -Wall ${WEXTRA}
+AM_CFLAGS = ${WALL} ${WEXTRA}
AM_CPPFLAGS = $(LTDLINCL) $(EXTERNAL_CPPFLAGS)
BUILT_SOURCES = getdata.h
Modified: trunk/getdata/test/Makefile.am
===================================================================
--- trunk/getdata/test/Makefile.am 2010-09-15 00:14:49 UTC (rev 446)
+++ trunk/getdata/test/Makefile.am 2010-09-17 20:17:08 UTC (rev 447)
@@ -20,6 +20,10 @@
#
AUTOMAKE_OPTIONS = foreign
+if CC_WALL
+WALL=-Wall
+endif
+
if CC_WEXTRA
WEXTRA=-Wextra
endif
@@ -34,7 +38,7 @@
endif
LDADD=../src/libgetdata.la
-INCLUDES=-Wall $(WEXTRA) -I$(top_srcdir)/src -D__TEST__=\"$@\"
+INCLUDES=${WALL} $(WEXTRA) -I$(top_srcdir)/src -D__TEST__=\"$@\"
EXTRA_DIST=test.h
Modified: trunk/getdata/util/Makefile.am
===================================================================
--- trunk/getdata/util/Makefile.am 2010-09-15 00:14:49 UTC (rev 446)
+++ trunk/getdata/util/Makefile.am 2010-09-17 20:17:08 UTC (rev 447)
@@ -20,12 +20,16 @@
#
AUTOMAKE_OPTIONS = foreign
+if CC_WALL
+WALL=-Wall
+endif
+
if CC_WEXTRA
WEXTRA=-Wextra
endif
LDADD=../src/libgetdata.la
-INCLUDES=-Wall $(WEXTRA) -I$(top_srcdir)/src
+INCLUDES=${WALL} $(WEXTRA) -I$(top_srcdir)/src
if MAKE_CHECKDIRFILE
CHECKDIRFILE=checkdirfile dirfile2ascii
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ket...@us...> - 2010-09-15 00:14:56
|
Revision: 446
http://getdata.svn.sourceforge.net/getdata/?rev=446&view=rev
Author: ketiltrout
Date: 2010-09-15 00:14:49 +0000 (Wed, 15 Sep 2010)
Log Message:
-----------
As Ted points out, EOF isn't really a good member name.
Modified Paths:
--------------
trunk/getdata/ChangeLog
trunk/getdata/bindings/cxx/dirfile.cpp
trunk/getdata/bindings/cxx/getdata/dirfile.h
Modified: trunk/getdata/ChangeLog
===================================================================
--- trunk/getdata/ChangeLog 2010-09-11 19:37:39 UTC (rev 445)
+++ trunk/getdata/ChangeLog 2010-09-15 00:14:49 UTC (rev 446)
@@ -1,3 +1,6 @@
+2010-09-15 D. V. Wiebe <ge...@ke...> svn:446
+ * bindings/cxx/dirfile.cpp (Dirfile::EoF Dirfile::BoF): Renamed.
+
2010-09-11 D. V. Wiebe <ge...@ke...> svn:445
* bindings/f77/fgetdata.c (GDFNSS): Don't call the explicitly 64-bit
version of gd_framenum_subset.
Modified: trunk/getdata/bindings/cxx/dirfile.cpp
===================================================================
--- trunk/getdata/bindings/cxx/dirfile.cpp 2010-09-11 19:37:39 UTC (rev 445)
+++ trunk/getdata/bindings/cxx/dirfile.cpp 2010-09-15 00:14:49 UTC (rev 446)
@@ -236,12 +236,12 @@
return gd_nframes(D);
}
-off_t Dirfile::EOF(const char *field_code)
+off_t Dirfile::EoF(const char *field_code)
{
return gd_eof(D, field_code);
}
-off_t Dirfile::BOF(const char *field_code)
+off_t Dirfile::BoF(const char *field_code)
{
return gd_bof(D, field_code);
}
Modified: trunk/getdata/bindings/cxx/getdata/dirfile.h
===================================================================
--- trunk/getdata/bindings/cxx/getdata/dirfile.h 2010-09-11 19:37:39 UTC (rev 445)
+++ trunk/getdata/bindings/cxx/getdata/dirfile.h 2010-09-15 00:14:49 UTC (rev 446)
@@ -29,9 +29,7 @@
// C99 _Complex keyword
#define GD_C89_API
-extern "C" {
#include <getdata.h>
-}
#include <getdata/fragment.h>
#include <getdata/entry.h>
@@ -87,7 +85,7 @@
int AlterSpec(const char* spec, int recode = 0);
- off_t BOF(const char *field_code);
+ off_t BoF(const char *field_code);
int Close();
@@ -99,7 +97,7 @@
GetData::Entry* Entry(const char *field_code);
- off_t EOF(const char *field_code);
+ off_t EoF(const char *field_code);
int Error();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ket...@us...> - 2010-09-11 19:37:45
|
Revision: 445
http://getdata.svn.sourceforge.net/getdata/?rev=445&view=rev
Author: ketiltrout
Date: 2010-09-11 19:37:39 +0000 (Sat, 11 Sep 2010)
Log Message:
-----------
More mingw fixes.
Modified Paths:
--------------
trunk/getdata/ChangeLog
trunk/getdata/bindings/f77/fgetdata.c
trunk/getdata/util/dirfile2ascii.c
Modified: trunk/getdata/ChangeLog
===================================================================
--- trunk/getdata/ChangeLog 2010-09-11 08:35:40 UTC (rev 444)
+++ trunk/getdata/ChangeLog 2010-09-11 19:37:39 UTC (rev 445)
@@ -1,3 +1,10 @@
+2010-09-11 D. V. Wiebe <ge...@ke...> svn:445
+ * bindings/f77/fgetdata.c (GDFNSS): Don't call the explicitly 64-bit
+ version of gd_framenum_subset.
+
+ * util/dirfile2ascii.c: Unroll type_data initialisation some more.
+
+
2010-09-11 D. V. Wiebe <ge...@ke...> svn:444
* test/ src/ bindings/ util/: ANSI-C-ify.
* src/getdata.h.in: Define GD_NO_C99_API when the C99-compliant API has been
Modified: trunk/getdata/bindings/f77/fgetdata.c
===================================================================
--- trunk/getdata/bindings/f77/fgetdata.c 2010-09-11 08:35:40 UTC (rev 444)
+++ trunk/getdata/bindings/f77/fgetdata.c 2010-09-11 19:37:39 UTC (rev 445)
@@ -2478,7 +2478,7 @@
*field_code_l, *value, *start, *end);
char *fc = (char *)malloc(*field_code_l + 1);
- *framenum = gd_framenum_subset64(_GDF_GetDirfile(*dirfile),
+ *framenum = gd_framenum_subset(_GDF_GetDirfile(*dirfile),
_GDF_CString(fc, field_code, *field_code_l), *value, *start, *end);
free(fc);
Modified: trunk/getdata/util/dirfile2ascii.c
===================================================================
--- trunk/getdata/util/dirfile2ascii.c 2010-09-11 08:35:40 UTC (rev 444)
+++ trunk/getdata/util/dirfile2ascii.c 2010-09-11 19:37:39 UTC (rev 445)
@@ -181,19 +181,32 @@
int t;
const char* f;
} type_data[0x7f];
- type_data[(int)'a'] = { READ_AS_DOUBLE, "a" };
- type_data[(int)'A'] = { READ_AS_DOUBLE, "A" };
- type_data[(int)'e'] = { READ_AS_DOUBLE, "e" };
- type_data[(int)'E'] = { READ_AS_DOUBLE, "E" };
- type_data[(int)'f'] = { READ_AS_DOUBLE, "f" };
- type_data[(int)'F'] = { READ_AS_DOUBLE, "F" };
- type_data[(int)'g'] = { READ_AS_DOUBLE, "g" };
- type_data[(int)'G'] = { READ_AS_DOUBLE, "G" };
- type_data[(int)'i'] = { READ_AS_INT, PRIi64 };
- type_data[(int)'o'] = { READ_AS_UINT, PRIo64 };
- type_data[(int)'u'] = { READ_AS_UINT, PRIu64 };
- type_data[(int)'x'] = { READ_AS_UINT, PRIx64 };
- type_data[(int)'X'] = { READ_AS_UINT, PRIX64 };
+ type_data[(int)'a'].t = READ_AS_DOUBLE;
+ type_data[(int)'a'].f = "a";
+ type_data[(int)'A'].t = READ_AS_DOUBLE;
+ type_data[(int)'A'].f = "A";
+ type_data[(int)'e'].t = READ_AS_DOUBLE;
+ type_data[(int)'e'].f = "e";
+ type_data[(int)'E'].t = READ_AS_DOUBLE;
+ type_data[(int)'E'].f = "E";
+ type_data[(int)'f'].t = READ_AS_DOUBLE;
+ type_data[(int)'f'].f = "f";
+ type_data[(int)'F'].t = READ_AS_DOUBLE;
+ type_data[(int)'F'].f = "F";
+ type_data[(int)'g'].t = READ_AS_DOUBLE;
+ type_data[(int)'g'].f = "g";
+ type_data[(int)'G'].t = READ_AS_DOUBLE;
+ type_data[(int)'G'].f = "G";
+ type_data[(int)'i'].t = READ_AS_INT;
+ type_data[(int)'i'].f = PRIi64;
+ type_data[(int)'o'].t = READ_AS_UINT;
+ type_data[(int)'o'].f = PRIo64;
+ type_data[(int)'u'].t = READ_AS_UINT;
+ type_data[(int)'u'].f = PRIu64;
+ type_data[(int)'x'].t = READ_AS_UINT;
+ type_data[(int)'x'].f = PRIx64;
+ type_data[(int)'X'].t = READ_AS_UINT;
+ type_data[(int)'X'].f = PRIX64;
while ((c = getopt_long(argc, argv,
"-f:n:d:x:X:g:G:e:E:a:A:F:i:o:p:s:bvqh?", longopts, &optind)) != -1)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ket...@us...> - 2010-09-11 08:35:52
|
Revision: 444
http://getdata.svn.sourceforge.net/getdata/?rev=444&view=rev
Author: ketiltrout
Date: 2010-09-11 08:35:40 +0000 (Sat, 11 Sep 2010)
Log Message:
-----------
ANSI-C-ify. Also make work with a C++ compiler.
Modified Paths:
--------------
trunk/getdata/ChangeLog
trunk/getdata/bindings/cxx/bitentry.cpp
trunk/getdata/bindings/cxx/constentry.cpp
trunk/getdata/bindings/cxx/entry.cpp
trunk/getdata/bindings/cxx/getdata/bitentry.h
trunk/getdata/bindings/cxx/getdata/constentry.h
trunk/getdata/bindings/cxx/getdata/entry.h
trunk/getdata/bindings/cxx/getdata/lincomentry.h
trunk/getdata/bindings/cxx/getdata/linterpentry.h
trunk/getdata/bindings/cxx/getdata/phaseentry.h
trunk/getdata/bindings/cxx/getdata/polynomentry.h
trunk/getdata/bindings/cxx/getdata/rawentry.h
trunk/getdata/bindings/cxx/getdata/recipentry.h
trunk/getdata/bindings/cxx/getdata/sbitentry.h
trunk/getdata/bindings/cxx/lincomentry.cpp
trunk/getdata/bindings/cxx/linterpentry.cpp
trunk/getdata/bindings/cxx/phaseentry.cpp
trunk/getdata/bindings/cxx/polynomentry.cpp
trunk/getdata/bindings/cxx/rawentry.cpp
trunk/getdata/bindings/cxx/recipentry.cpp
trunk/getdata/bindings/cxx/sbitentry.cpp
trunk/getdata/bindings/f77/fgetdata.c
trunk/getdata/bindings/f77/fgetdata.h
trunk/getdata/bindings/idl/getdata.c
trunk/getdata/bindings/idl/test/Makefile.am
trunk/getdata/bindings/python/pyentry.c
trunk/getdata/bindings/python/pygetdata.c
trunk/getdata/configure.ac
trunk/getdata/src/Makefile.am
trunk/getdata/src/add.c
trunk/getdata/src/ascii.c
trunk/getdata/src/bzip.c
trunk/getdata/src/common.c
trunk/getdata/src/constant.c
trunk/getdata/src/debug.c
trunk/getdata/src/del.c
trunk/getdata/src/encoding.c
trunk/getdata/src/endian.c
trunk/getdata/src/entry.c
trunk/getdata/src/errors.c
trunk/getdata/src/field_list.c
trunk/getdata/src/flimits.c
trunk/getdata/src/flush.c
trunk/getdata/src/fragment.c
trunk/getdata/src/getdata.c
trunk/getdata/src/getdata.h.in
trunk/getdata/src/globals.c
trunk/getdata/src/include.c
trunk/getdata/src/internal.h
trunk/getdata/src/legacy.c
trunk/getdata/src/lzma.c
trunk/getdata/src/meta_list.c
trunk/getdata/src/mod.c
trunk/getdata/src/move.c
trunk/getdata/src/name.c
trunk/getdata/src/native.c
trunk/getdata/src/nfields.c
trunk/getdata/src/nframes.c
trunk/getdata/src/nmeta.c
trunk/getdata/src/open.c
trunk/getdata/src/parse.c
trunk/getdata/src/protect.c
trunk/getdata/src/putdata.c
trunk/getdata/src/slim.c
trunk/getdata/src/spf.c
trunk/getdata/src/string.c
trunk/getdata/src/types.c
trunk/getdata/test/add.c
trunk/getdata/test/add_bit.c
trunk/getdata/test/add_clincom.c
trunk/getdata/test/add_code.c
trunk/getdata/test/add_const.c
trunk/getdata/test/add_cpolynom.c
trunk/getdata/test/add_crecip.c
trunk/getdata/test/add_crecip89.c
trunk/getdata/test/add_duplicate.c
trunk/getdata/test/add_format.c
trunk/getdata/test/add_invalid.c
trunk/getdata/test/add_lincom.c
trunk/getdata/test/add_linterp.c
trunk/getdata/test/add_phase.c
trunk/getdata/test/add_polynom.c
trunk/getdata/test/add_protect.c
trunk/getdata/test/add_raw.c
trunk/getdata/test/add_rdonly.c
trunk/getdata/test/add_recip.c
trunk/getdata/test/add_sbit.c
trunk/getdata/test/add_scalar.c
trunk/getdata/test/add_sort.c
trunk/getdata/test/add_spec.c
trunk/getdata/test/add_spec_meta.c
trunk/getdata/test/add_type.c
trunk/getdata/test/alter_cpolynom.c
trunk/getdata/test/alter_crecip.c
trunk/getdata/test/alter_crecip89.c
trunk/getdata/test/alter_entry.c
trunk/getdata/test/alter_entry_recode.c
trunk/getdata/test/alter_entry_scalar2a.c
trunk/getdata/test/alter_entry_scalar2n.c
trunk/getdata/test/alter_entry_scalar3.c
trunk/getdata/test/alter_entry_scalar4.c
trunk/getdata/test/alter_linterp.c
trunk/getdata/test/alter_polynom_coeff.c
trunk/getdata/test/convert_complex128_complex64.c
trunk/getdata/test/convert_complex128_float64.c
trunk/getdata/test/convert_complex128_int64.c
trunk/getdata/test/convert_complex128_uint64.c
trunk/getdata/test/convert_complex64_complex128.c
trunk/getdata/test/convert_complex64_float64.c
trunk/getdata/test/convert_complex64_int64.c
trunk/getdata/test/convert_complex64_uint64.c
trunk/getdata/test/convert_float32_complex128.c
trunk/getdata/test/convert_float32_complex64.c
trunk/getdata/test/convert_float64_complex128.c
trunk/getdata/test/convert_float64_complex64.c
trunk/getdata/test/convert_int16_complex128.c
trunk/getdata/test/convert_int16_complex64.c
trunk/getdata/test/convert_int32_complex128.c
trunk/getdata/test/convert_int32_complex64.c
trunk/getdata/test/convert_int64_complex128.c
trunk/getdata/test/convert_int64_complex64.c
trunk/getdata/test/convert_int8_complex128.c
trunk/getdata/test/convert_int8_complex64.c
trunk/getdata/test/convert_uint16_complex128.c
trunk/getdata/test/convert_uint16_complex64.c
trunk/getdata/test/convert_uint32_complex128.c
trunk/getdata/test/convert_uint32_complex64.c
trunk/getdata/test/convert_uint64_complex128.c
trunk/getdata/test/convert_uint64_complex64.c
trunk/getdata/test/convert_uint8_complex128.c
trunk/getdata/test/convert_uint8_complex64.c
trunk/getdata/test/entry_bit.c
trunk/getdata/test/entry_bit_scalar.c
trunk/getdata/test/entry_lincom.c
trunk/getdata/test/entry_lincom_scalar.c
trunk/getdata/test/entry_linterp.c
trunk/getdata/test/entry_phase.c
trunk/getdata/test/entry_phase_scalar.c
trunk/getdata/test/entry_polynom.c
trunk/getdata/test/entry_polynom_scalar.c
trunk/getdata/test/entry_raw.c
trunk/getdata/test/entry_raw_scalar.c
trunk/getdata/test/entry_scalar_repr.c
trunk/getdata/test/flush_spec.c
trunk/getdata/test/get_clincom.c
trunk/getdata/test/get_complex128.c
trunk/getdata/test/get_complex64.c
trunk/getdata/test/get_const_complex.c
trunk/getdata/test/get_const_repr.c
trunk/getdata/test/get_cpolynom.c
trunk/getdata/test/get_endian_complex128_arm.c
trunk/getdata/test/get_endian_complex128_big.c
trunk/getdata/test/get_endian_complex128_little.c
trunk/getdata/test/get_endian_complex64_arm.c
trunk/getdata/test/get_endian_complex64_big.c
trunk/getdata/test/get_endian_complex64_little.c
trunk/getdata/test/header_complex.c
trunk/getdata/test/legacy_get.c
trunk/getdata/test/legacy_get_put.c
trunk/getdata/test/legacy_get_rofs.c
trunk/getdata/test/legacy_nframes.c
trunk/getdata/test/legacy_nonexistent.c
trunk/getdata/test/legacy_put.c
trunk/getdata/test/legacy_spf.c
trunk/getdata/test/madd.c
trunk/getdata/test/madd_bit.c
trunk/getdata/test/madd_clincom.c
trunk/getdata/test/madd_const.c
trunk/getdata/test/madd_cpolynom.c
trunk/getdata/test/madd_crecip.c
trunk/getdata/test/madd_crecip89.c
trunk/getdata/test/madd_lincom.c
trunk/getdata/test/madd_linterp.c
trunk/getdata/test/madd_phase.c
trunk/getdata/test/madd_polynom.c
trunk/getdata/test/madd_recip.c
trunk/getdata/test/madd_sbit.c
trunk/getdata/test/madd_spec.c
trunk/getdata/test/nframes.c
trunk/getdata/test/put_complex128.c
trunk/getdata/test/put_complex64.c
trunk/getdata/test/put_endian_complex128_arm.c
trunk/getdata/test/put_endian_complex128_big.c
trunk/getdata/test/put_endian_complex128_little.c
trunk/getdata/test/put_endian_complex64_arm.c
trunk/getdata/test/put_endian_complex64_big.c
trunk/getdata/test/put_endian_complex64_little.c
trunk/getdata/test/repr_a.c
trunk/getdata/test/repr_float32.c
trunk/getdata/test/repr_float64.c
trunk/getdata/test/repr_i.c
trunk/getdata/test/repr_int16.c
trunk/getdata/test/repr_int32.c
trunk/getdata/test/repr_int64.c
trunk/getdata/test/repr_int8.c
trunk/getdata/test/repr_m.c
trunk/getdata/test/repr_r.c
trunk/getdata/test/repr_real_a.c
trunk/getdata/test/repr_real_i.c
trunk/getdata/test/repr_real_m.c
trunk/getdata/test/repr_real_r.c
trunk/getdata/test/repr_uint16.c
trunk/getdata/test/repr_uint32.c
trunk/getdata/test/repr_uint64.c
trunk/getdata/test/repr_uint8.c
trunk/getdata/test/slim_nframes.c
trunk/getdata/test/test.h
trunk/getdata/util/dirfile2ascii.c
Modified: trunk/getdata/ChangeLog
===================================================================
--- trunk/getdata/ChangeLog 2010-08-11 00:59:43 UTC (rev 443)
+++ trunk/getdata/ChangeLog 2010-09-11 08:35:40 UTC (rev 444)
@@ -1,3 +1,32 @@
+2010-09-11 D. V. Wiebe <ge...@ke...> svn:444
+ * test/ src/ bindings/ util/: ANSI-C-ify.
+ * src/getdata.h.in: Define GD_NO_C99_API when the C99-compliant API has been
+ disabled at build time.
+ * src/getdata.h.in src/internal.h: ANSI C does not permit anonymous union
+ and structures, so name all the sub-bits of gd_entry_t and gd_private_entry.
+
+ * src/getdata.h.in: Encompass everything in an extern "C" block
+ for C++ compilers.
+
+ * src/: include gd_throw in definition of functions.
+
+ * src/debug.c src/common.c src/Makefile.am: Move gd_col_count and
+ gd_debug_col to common.c to remove the need for GDLIB.
+
+ * test/legacy_get_rofs.c test/legacy_get.c test/legacy_nonexistent.c
+ test/legacy_put.c: Fix skip test.
+
+ * test/flush_spec.c: Skip the blank line.
+
+ * test/slim_nframes.c: Add missing r.
+
+ * bindings/idl/test/Makefile.am: Use DL_LIBRARY_PATH in TESTS_ENVIRONMENT.
+
+ * configure.ac: Add --enable-ansi-c, which will disable Python and IDL.
+ A fail of AC_PROG_CC_C99 will also cause this to be asserted.
+
+ * configure.ac: Fix lfs_transitional_api check.
+
2010-08-10 D. V. Wiebe <ge...@ke...> svn:443
* src/common.c (_GD_BadInput): Check the propper entry for scalarness.
Modified: trunk/getdata/bindings/cxx/bitentry.cpp
===================================================================
--- trunk/getdata/bindings/cxx/bitentry.cpp 2010-08-11 00:59:43 UTC (rev 443)
+++ trunk/getdata/bindings/cxx/bitentry.cpp 2010-09-11 08:35:40 UTC (rev 444)
@@ -35,8 +35,8 @@
E.field = strdup(field_code);
E.field_type = GD_BIT_ENTRY;
E.in_fields[0] = strdup(in_field);
- E.bitnum = bitnum;
- E.numbits = numbits;
+ E.u.bit.bitnum = bitnum;
+ E.u.bit.numbits = numbits;
E.fragment_index = fragment_index;
}
@@ -58,7 +58,7 @@
int BitEntry::SetFirstBit(gd_bit_t first_bit)
{
- E.bitnum = first_bit;
+ E.u.bit.bitnum = first_bit;
if (D != NULL)
return gd_alter_entry(D->D, E.field, &E, 0);
@@ -68,7 +68,7 @@
int BitEntry::SetNumBits(gd_bit_t num_bits)
{
- E.numbits = num_bits;
+ E.u.bit.numbits = num_bits;
if (D != NULL)
return gd_alter_entry(D->D, E.field, &E, 0);
@@ -98,7 +98,7 @@
r = gd_alter_entry(D->D, E.field, &E, 0);
if (!r)
- r = gd_get_constant(D->D, first_bit, GD_INT16, &E.bitnum);
+ r = gd_get_constant(D->D, first_bit, GD_INT16, &E.u.bit.bitnum);
}
return r;
@@ -118,7 +118,7 @@
r = gd_alter_entry(D->D, E.field, &E, 0);
if (!r)
- r = gd_get_constant(D->D, num_bits, GD_INT16, &E.numbits);
+ r = gd_get_constant(D->D, num_bits, GD_INT16, &E.u.bit.numbits);
}
return r;
Modified: trunk/getdata/bindings/cxx/constentry.cpp
===================================================================
--- trunk/getdata/bindings/cxx/constentry.cpp 2010-08-11 00:59:43 UTC (rev 443)
+++ trunk/getdata/bindings/cxx/constentry.cpp 2010-09-11 08:35:40 UTC (rev 444)
@@ -33,13 +33,13 @@
{
E.field = strdup(field_code);
E.field_type = GD_CONST_ENTRY;
- E.const_type = (gd_type_t)data_type;
+ E.u.cons.type = (gd_type_t)data_type;
E.fragment_index = fragment_index;
}
int ConstEntry::SetType(DataType type)
{
- E.const_type = (gd_type_t)type;
+ E.u.cons.type = (gd_type_t)type;
if (D != NULL)
return gd_alter_entry(D->D, E.field, &E, 0);
Modified: trunk/getdata/bindings/cxx/entry.cpp
===================================================================
--- trunk/getdata/bindings/cxx/entry.cpp 2010-08-11 00:59:43 UTC (rev 443)
+++ trunk/getdata/bindings/cxx/entry.cpp 2010-09-11 08:35:40 UTC (rev 444)
@@ -136,14 +136,14 @@
switch (E.field_type) {
case GD_LINCOM_ENTRY:
- if (index >= GD_MAX_LINCOM + E.n_fields ||
- (index >= E.n_fields && index < GD_MAX_LINCOM))
+ if (index >= GD_MAX_LINCOM + E.u.lincom.n_fields ||
+ (index >= E.u.lincom.n_fields && index < GD_MAX_LINCOM))
{
return NULL;
}
break;
case GD_POLYNOM_ENTRY:
- if (index > E.poly_ord)
+ if (index > E.u.polynom.poly_ord)
return NULL;
break;
case GD_BIT_ENTRY:
Modified: trunk/getdata/bindings/cxx/getdata/bitentry.h
===================================================================
--- trunk/getdata/bindings/cxx/getdata/bitentry.h 2010-08-11 00:59:43 UTC (rev 443)
+++ trunk/getdata/bindings/cxx/getdata/bitentry.h 2010-09-11 08:35:40 UTC (rev 444)
@@ -52,11 +52,11 @@
};
virtual gd_bit_t FirstBit() {
- return E.bitnum;
+ return E.u.bit.bitnum;
};
virtual gd_bit_t NumBits() {
- return E.numbits;
+ return E.u.bit.numbits;
};
int SetInput(const char* field);
Modified: trunk/getdata/bindings/cxx/getdata/constentry.h
===================================================================
--- trunk/getdata/bindings/cxx/getdata/constentry.h 2010-08-11 00:59:43 UTC (rev 443)
+++ trunk/getdata/bindings/cxx/getdata/constentry.h 2010-09-11 08:35:40 UTC (rev 444)
@@ -46,7 +46,7 @@
ConstEntry(const char* field_code, DataType type, int fragment_index = 0);
- virtual DataType ConstType() { return (DataType)E.const_type; }
+ virtual DataType ConstType() { return (DataType)E.u.cons.type; }
int SetType(DataType type);
Modified: trunk/getdata/bindings/cxx/getdata/entry.h
===================================================================
--- trunk/getdata/bindings/cxx/getdata/entry.h 2010-08-11 00:59:43 UTC (rev 443)
+++ trunk/getdata/bindings/cxx/getdata/entry.h 2010-09-11 08:35:40 UTC (rev 444)
@@ -91,7 +91,7 @@
/* Specific data */
virtual const char *Input(int index = 0) {
- return (CheckIndex(E.field_type, E.n_fields, index)) ?
+ return (CheckIndex(E.field_type, E.u.lincom.n_fields, index)) ?
E.in_fields[index] : NULL;
};
@@ -104,88 +104,88 @@
/* RAW methods */
virtual gd_spf_t SamplesPerFrame() {
- return (E.field_type == GD_RAW_ENTRY) ? E.spf : 0;
+ return (E.field_type == GD_RAW_ENTRY) ? E.u.raw.spf : 0;
};
virtual DataType RawType() {
- return (E.field_type == GD_RAW_ENTRY) ? (DataType)E.data_type : Unknown;
+ return (E.field_type == GD_RAW_ENTRY) ? (DataType)E.u.raw.type : Unknown;
};
/* LINCOM methods */
virtual int NFields() {
- return (E.field_type == GD_LINCOM_ENTRY) ? E.n_fields : 0;
+ return (E.field_type == GD_LINCOM_ENTRY) ? E.u.lincom.n_fields : 0;
};
virtual double Scale(int index = 0) {
return (E.field_type == GD_LINCOM_ENTRY &&
- CheckIndex(E.field_type, E.n_fields, index)) ? E.m[index] : 0;
+ CheckIndex(E.field_type, E.u.lincom.n_fields, index)) ? E.u.lincom.m[index] : 0;
}
virtual std::complex<double> CScale(int index = 0) {
return (E.field_type == GD_LINCOM_ENTRY &&
- CheckIndex(E.field_type, E.n_fields, index))
- ? std::complex<double>(E.cm[index][0], E.cm[index][1]) : 0;
+ CheckIndex(E.field_type, E.u.lincom.n_fields, index))
+ ? std::complex<double>(E.u.lincom.cm[index][0], E.u.lincom.cm[index][1]) : 0;
}
virtual double Offset(int index = 0) {
return (E.field_type == GD_LINCOM_ENTRY &&
- CheckIndex(E.field_type, E.n_fields, index)) ? E.b[index] : 0;
+ CheckIndex(E.field_type, E.u.lincom.n_fields, index)) ? E.u.lincom.b[index] : 0;
}
virtual std::complex<double> COffset(int index = 0) {
return (E.field_type == GD_LINCOM_ENTRY &&
- CheckIndex(E.field_type, E.n_fields, index))
- ? std::complex<double>(E.cb[index][0], E.cb[index][1]) : 0;
+ CheckIndex(E.field_type, E.u.lincom.n_fields, index))
+ ? std::complex<double>(E.u.lincom.cb[index][0], E.u.lincom.cb[index][1]) : 0;
}
/* LINTERP methods */
virtual const char *Table() {
- return (E.field_type == GD_LINTERP_ENTRY) ? E.table : NULL;
+ return (E.field_type == GD_LINTERP_ENTRY) ? E.u.linterp.table : NULL;
};
/* (S)BIT methods */
virtual gd_bit_t FirstBit() {
- return (E.field_type == GD_BIT_ENTRY) ? E.bitnum : -1;
+ return (E.field_type == GD_BIT_ENTRY) ? E.u.bit.bitnum : -1;
};
virtual gd_bit_t NumBits() {
- return (E.field_type == GD_BIT_ENTRY) ? E.numbits : -1;
+ return (E.field_type == GD_BIT_ENTRY) ? E.u.bit.numbits : -1;
};
/* PHASE methods */
virtual gd_shift_t Shift() {
- return (E.field_type == GD_PHASE_ENTRY) ? E.shift : 0;
+ return (E.field_type == GD_PHASE_ENTRY) ? E.u.phase.shift : 0;
};
/* CONST methods */
virtual DataType ConstType() {
- return (E.field_type == GD_CONST_ENTRY) ? (DataType)E.const_type :
+ return (E.field_type == GD_CONST_ENTRY) ? (DataType)E.u.cons.type :
Unknown;
};
/* POLYNOM methods */
virtual int PolyOrd() {
- return (E.field_type == GD_POLYNOM_ENTRY) ? E.poly_ord : 0;
+ return (E.field_type == GD_POLYNOM_ENTRY) ? E.u.polynom.poly_ord : 0;
};
virtual double Coefficient(int index = 0) {
- return (E.field_type == GD_POLYNOM_ENTRY && index <= E.poly_ord)
- ? E.a[index] : 0;
+ return (E.field_type == GD_POLYNOM_ENTRY && index <= E.u.polynom.poly_ord)
+ ? E.u.polynom.a[index] : 0;
}
virtual std::complex<double> CCoefficient(int index = 0) {
- return (E.field_type == GD_POLYNOM_ENTRY && index <= E.poly_ord)
- ? std::complex<double>(E.ca[index][0], E.ca[index][1]) : 0;
+ return (E.field_type == GD_POLYNOM_ENTRY && index <= E.u.polynom.poly_ord)
+ ? std::complex<double>(E.u.polynom.ca[index][0], E.u.polynom.ca[index][1]) : 0;
}
/* RECIP methods */
virtual double Dividend() {
- return (E.field_type == GD_RECIP_ENTRY) ? E.dividend : 0;
+ return (E.field_type == GD_RECIP_ENTRY) ? E.u.recip.dividend : 0;
};
virtual std::complex<double> CDividend() {
return (E.field_type == GD_RECIP_ENTRY) ?
- std::complex<double>(E.cdividend[0], E.cdividend[1]) : 0;
+ std::complex<double>(E.u.recip.cdividend[0], E.u.recip.cdividend[1]) : 0;
};
void SetName(const char* name);
Modified: trunk/getdata/bindings/cxx/getdata/lincomentry.h
===================================================================
--- trunk/getdata/bindings/cxx/getdata/lincomentry.h 2010-08-11 00:59:43 UTC (rev 443)
+++ trunk/getdata/bindings/cxx/getdata/lincomentry.h 2010-09-11 08:35:40 UTC (rev 444)
@@ -52,7 +52,7 @@
int fragment_index = 0);
virtual const char *Input(int index = 0) {
- return (CheckIndex(E.field_type, E.n_fields, index)) ?
+ return (CheckIndex(E.field_type, E.u.lincom.n_fields, index)) ?
E.in_fields[index] : NULL;
};
@@ -61,25 +61,25 @@
}
virtual int NFields() {
- return E.n_fields;
+ return E.u.lincom.n_fields;
};
virtual double Scale(int index = 0) {
- return (CheckIndex(E.field_type, E.n_fields, index)) ? E.m[index] : 0;
+ return (CheckIndex(E.field_type, E.u.lincom.n_fields, index)) ? E.u.lincom.m[index] : 0;
};
virtual std::complex<double> CScale(int index = 0) {
- return (CheckIndex(E.field_type, E.n_fields, index))
- ? std::complex<double>(E.cm[index][0], E.cm[index][1]) : 0;
+ return (CheckIndex(E.field_type, E.u.lincom.n_fields, index))
+ ? std::complex<double>(E.u.lincom.cm[index][0], E.u.lincom.cm[index][1]) : 0;
};
virtual double Offset(int index = 0) {
- return (CheckIndex(E.field_type, E.n_fields, index)) ? E.b[index] : 0;
+ return (CheckIndex(E.field_type, E.u.lincom.n_fields, index)) ? E.u.lincom.b[index] : 0;
};
virtual std::complex<double> COffset(int index = 0) {
- return (CheckIndex(E.field_type, E.n_fields, index))
- ? std::complex<double>(E.cb[index][0], E.cb[index][1]) : 0;
+ return (CheckIndex(E.field_type, E.u.lincom.n_fields, index))
+ ? std::complex<double>(E.u.lincom.cb[index][0], E.u.lincom.cb[index][1]) : 0;
};
virtual const char *Scalar(int index = 0);
Modified: trunk/getdata/bindings/cxx/getdata/linterpentry.h
===================================================================
--- trunk/getdata/bindings/cxx/getdata/linterpentry.h 2010-08-11 00:59:43 UTC (rev 443)
+++ trunk/getdata/bindings/cxx/getdata/linterpentry.h 2010-09-11 08:35:40 UTC (rev 444)
@@ -52,7 +52,7 @@
};
virtual const char *Table() {
- return E.table;
+ return E.u.linterp.table;
};
int SetInput(const char* field);
Modified: trunk/getdata/bindings/cxx/getdata/phaseentry.h
===================================================================
--- trunk/getdata/bindings/cxx/getdata/phaseentry.h 2010-08-11 00:59:43 UTC (rev 443)
+++ trunk/getdata/bindings/cxx/getdata/phaseentry.h 2010-09-11 08:35:40 UTC (rev 444)
@@ -52,7 +52,7 @@
};
virtual gd_shift_t Shift() {
- return E.shift;
+ return E.u.phase.shift;
};
int SetInput(const char* field);
Modified: trunk/getdata/bindings/cxx/getdata/polynomentry.h
===================================================================
--- trunk/getdata/bindings/cxx/getdata/polynomentry.h 2010-08-11 00:59:43 UTC (rev 443)
+++ trunk/getdata/bindings/cxx/getdata/polynomentry.h 2010-09-11 08:35:40 UTC (rev 444)
@@ -59,16 +59,16 @@
}
virtual int PolyOrd() {
- return E.poly_ord;
+ return E.u.polynom.poly_ord;
};
virtual double Coefficient(int index = 0) {
- return (index <= E.poly_ord) ? E.a[index] : 0;
+ return (index <= E.u.polynom.poly_ord) ? E.u.polynom.a[index] : 0;
};
virtual std::complex<double> CCoefficient(int index = 0) {
- return (index <= E.poly_ord)
- ? std::complex<double>(E.ca[index][0], E.ca[index][1]) : 0;
+ return (index <= E.u.polynom.poly_ord)
+ ? std::complex<double>(E.u.polynom.ca[index][0], E.u.polynom.ca[index][1]) : 0;
};
virtual const char *Scalar(int index = 0);
Modified: trunk/getdata/bindings/cxx/getdata/rawentry.h
===================================================================
--- trunk/getdata/bindings/cxx/getdata/rawentry.h 2010-08-11 00:59:43 UTC (rev 443)
+++ trunk/getdata/bindings/cxx/getdata/rawentry.h 2010-09-11 08:35:40 UTC (rev 444)
@@ -48,11 +48,11 @@
int fragment_index = 0);
virtual gd_spf_t SamplesPerFrame() {
- return E.spf;
+ return E.u.raw.spf;
};
virtual DataType RawType() {
- return (DataType)E.data_type;
+ return (DataType)E.u.raw.type;
};
const char* FileName();
Modified: trunk/getdata/bindings/cxx/getdata/recipentry.h
===================================================================
--- trunk/getdata/bindings/cxx/getdata/recipentry.h 2010-08-11 00:59:43 UTC (rev 443)
+++ trunk/getdata/bindings/cxx/getdata/recipentry.h 2010-09-11 08:35:40 UTC (rev 444)
@@ -63,11 +63,11 @@
}
virtual double Dividend() {
- return E.dividend;
+ return E.u.recip.dividend;
};
virtual std::complex<double> CDividend() {
- return std::complex<double>(E.cdividend[0], E.cdividend[1]);
+ return std::complex<double>(E.u.recip.cdividend[0], E.u.recip.cdividend[1]);
};
virtual int SetInput(const char* field);
Modified: trunk/getdata/bindings/cxx/getdata/sbitentry.h
===================================================================
--- trunk/getdata/bindings/cxx/getdata/sbitentry.h 2010-08-11 00:59:43 UTC (rev 443)
+++ trunk/getdata/bindings/cxx/getdata/sbitentry.h 2010-09-11 08:35:40 UTC (rev 444)
@@ -52,11 +52,11 @@
};
virtual gd_bit_t FirstBit() {
- return E.bitnum;
+ return E.u.bit.bitnum;
};
virtual gd_bit_t NumBits() {
- return E.numbits;
+ return E.u.bit.numbits;
};
int SetInput(const char* field);
Modified: trunk/getdata/bindings/cxx/lincomentry.cpp
===================================================================
--- trunk/getdata/bindings/cxx/lincomentry.cpp 2010-08-11 00:59:43 UTC (rev 443)
+++ trunk/getdata/bindings/cxx/lincomentry.cpp 2010-09-11 08:35:40 UTC (rev 444)
@@ -37,13 +37,13 @@
E.field = strdup(field_code);
E.field_type = GD_LINCOM_ENTRY;
- E.n_fields = n_fields;
+ E.u.lincom.n_fields = n_fields;
E.fragment_index = fragment_index;
E.comp_scal = 0;
for (i = 0; i < n_fields; ++i) {
E.in_fields[i] = strdup(in_fields[i]);
- E.m[i] = m[i];
- E.b[i] = b[i];
+ E.u.lincom.m[i] = m[i];
+ E.u.lincom.b[i] = b[i];
}
}
@@ -55,15 +55,15 @@
E.field = strdup(field_code);
E.field_type = GD_LINCOM_ENTRY;
- E.n_fields = n_fields;
+ E.u.lincom.n_fields = n_fields;
E.fragment_index = fragment_index;
E.comp_scal = 1;
for (i = 0; i < n_fields; ++i) {
E.in_fields[i] = strdup(in_fields[i]);
- E.cm[i][0] = cm[i].real();
- E.cm[i][1] = cm[i].imag();
- E.cb[i][0] = cb[i].real();
- E.cb[i][1] = cb[i].imag();
+ E.u.lincom.cm[i][0] = cm[i].real();
+ E.u.lincom.cm[i][1] = cm[i].imag();
+ E.u.lincom.cb[i][0] = cb[i].real();
+ E.u.lincom.cb[i][1] = cb[i].imag();
}
}
@@ -91,8 +91,8 @@
if (index < 0 || index >= GD_MAX_LINCOM)
return -1;
- E.cm[index][0] = E.m[index] = scale;
- E.cm[index][1] = 0;
+ E.u.lincom.cm[index][0] = E.u.lincom.m[index] = scale;
+ E.u.lincom.cm[index][1] = 0;
if (D != NULL)
return gd_alter_entry(D->D, E.field, &E, 0);
@@ -118,8 +118,8 @@
r = gd_alter_entry(D->D, E.field, &E, 0);
if (!r) {
- r = gd_get_constant(D->D, scale, GD_COMPLEX128, E.cm + index);
- E.m[index] = E.cm[index][0];
+ r = gd_get_constant(D->D, scale, GD_COMPLEX128, E.u.lincom.cm + index);
+ E.u.lincom.m[index] = E.u.lincom.cm[index][0];
}
}
@@ -131,8 +131,8 @@
if (index < 0 || index >= GD_MAX_LINCOM)
return -1;
- E.m[index] = E.cm[index][0] = scale.real();
- E.cm[index][1] = scale.imag();
+ E.u.lincom.m[index] = E.u.lincom.cm[index][0] = scale.real();
+ E.u.lincom.cm[index][1] = scale.imag();
E.comp_scal = 1;
if (D != NULL)
@@ -146,8 +146,8 @@
if (index < 0 || index >= GD_MAX_LINCOM)
return -1;
- E.cb[index][0] = E.b[index] = offset;
- E.cb[index][1] = 0;
+ E.u.lincom.cb[index][0] = E.u.lincom.b[index] = offset;
+ E.u.lincom.cb[index][1] = 0;
if (D != NULL)
return gd_alter_entry(D->D, E.field, &E, 0);
@@ -173,8 +173,8 @@
r = gd_alter_entry(D->D, E.field, &E, 0);
if (!r) {
- r = gd_get_constant(D->D, scale, GD_COMPLEX128, E.cb + index);
- E.b[index] = E.cb[index][0];
+ r = gd_get_constant(D->D, scale, GD_COMPLEX128, E.u.lincom.cb + index);
+ E.u.lincom.b[index] = E.u.lincom.cb[index][0];
}
}
@@ -186,8 +186,8 @@
if (index < 0 || index >= GD_MAX_LINCOM)
return -1;
- E.b[index] = E.cb[index][0] = offset.real();
- E.cb[index][1] = offset.imag();
+ E.u.lincom.b[index] = E.u.lincom.cb[index][0] = offset.real();
+ E.u.lincom.cb[index][1] = offset.imag();
E.comp_scal = 1;
if (D != NULL)
@@ -198,7 +198,7 @@
int LincomEntry::SetNFields(int nfields)
{
- int old_n = E.n_fields;
+ int old_n = E.u.lincom.n_fields;
if (nfields < 1 || nfields > GD_MAX_LINCOM)
return -1;
@@ -209,11 +209,11 @@
for (i = old_n; i < nfields; ++i) {
free(E.in_fields[i]);
E.in_fields[i] = strdup("INDEX");
- E.m[i] = E.b[i] = 0;
+ E.u.lincom.m[i] = E.u.lincom.b[i] = 0;
}
}
- E.n_fields = nfields;
+ E.u.lincom.n_fields = nfields;
if (D != NULL)
return gd_alter_entry(D->D, E.field, &E, 0);
@@ -223,7 +223,7 @@
const char *LincomEntry::Scalar(int index)
{
- if (index < 0 || index >= E.n_fields)
+ if (index < 0 || index >= E.u.lincom.n_fields)
return NULL;
return E.scalar[index];
Modified: trunk/getdata/bindings/cxx/linterpentry.cpp
===================================================================
--- trunk/getdata/bindings/cxx/linterpentry.cpp 2010-08-11 00:59:43 UTC (rev 443)
+++ trunk/getdata/bindings/cxx/linterpentry.cpp 2010-09-11 08:35:40 UTC (rev 444)
@@ -35,7 +35,7 @@
E.field = strdup(field_code);
E.field_type = GD_LINTERP_ENTRY;
E.in_fields[0] = strdup(in_field);
- E.table = strdup(table);
+ E.u.linterp.table = strdup(table);
E.fragment_index = fragment_index;
}
@@ -62,8 +62,8 @@
if (ptr == NULL)
return 0;
- free(E.table);
- E.table = ptr;
+ free(E.u.linterp.table);
+ E.u.linterp.table = ptr;
if (D != NULL)
return gd_alter_entry(D->D, E.field, &E, move_table);
Modified: trunk/getdata/bindings/cxx/phaseentry.cpp
===================================================================
--- trunk/getdata/bindings/cxx/phaseentry.cpp 2010-08-11 00:59:43 UTC (rev 443)
+++ trunk/getdata/bindings/cxx/phaseentry.cpp 2010-09-11 08:35:40 UTC (rev 444)
@@ -35,7 +35,7 @@
E.field = strdup(field_code);
E.field_type = GD_PHASE_ENTRY;
E.in_fields[0] = strdup(in_field);
- E.shift = shift;
+ E.u.phase.shift = shift;
E.fragment_index = fragment_index;
}
@@ -57,7 +57,7 @@
int PhaseEntry::SetShift(gd_shift_t shift)
{
- E.shift = shift;
+ E.u.phase.shift = shift;
if (D != NULL)
return gd_alter_entry(D->D, E.field, &E, 0);
@@ -79,7 +79,7 @@
r = gd_alter_entry(D->D, E.field, &E, 0);
if (!r)
- r = gd_get_constant(D->D, shift, GD_INT64, &E.shift);
+ r = gd_get_constant(D->D, shift, GD_INT64, &E.u.phase.shift);
}
return r;
Modified: trunk/getdata/bindings/cxx/polynomentry.cpp
===================================================================
--- trunk/getdata/bindings/cxx/polynomentry.cpp 2010-08-11 00:59:43 UTC (rev 443)
+++ trunk/getdata/bindings/cxx/polynomentry.cpp 2010-09-11 08:35:40 UTC (rev 444)
@@ -36,12 +36,12 @@
E.field = strdup(field_code);
E.field_type = GD_POLYNOM_ENTRY;
- E.poly_ord = poly_ord;
+ E.u.polynom.poly_ord = poly_ord;
E.fragment_index = fragment_index;
E.comp_scal = 0;
E.in_fields[0] = strdup(in_field);
for (i = 0; i <= poly_ord; ++i)
- E.a[i] = a[i];
+ E.u.polynom.a[i] = a[i];
}
PolynomEntry::PolynomEntry(const char* field_code, int poly_ord,
@@ -52,13 +52,13 @@
E.field = strdup(field_code);
E.field_type = GD_POLYNOM_ENTRY;
- E.poly_ord = poly_ord;
+ E.u.polynom.poly_ord = poly_ord;
E.fragment_index = fragment_index;
E.comp_scal = 1;
E.in_fields[0] = strdup(in_field);
for (i = 0; i <= poly_ord; ++i) {
- E.ca[i][0] = ca[i].real();
- E.ca[i][1] = ca[i].imag();
+ E.u.polynom.ca[i][0] = ca[i].real();
+ E.u.polynom.ca[i][1] = ca[i].imag();
}
}
@@ -83,8 +83,8 @@
if (index < 0 || index > GD_MAX_POLYORD)
return -1;
- E.ca[index][0] = E.a[index] = coeff;
- E.ca[index][1] = 0;
+ E.u.polynom.ca[index][0] = E.u.polynom.a[index] = coeff;
+ E.u.polynom.ca[index][1] = 0;
if (D != NULL)
return gd_alter_entry(D->D, E.field, &E, 0);
@@ -110,8 +110,8 @@
r = gd_alter_entry(D->D, E.field, &E, 0);
if (!r) {
- r = gd_get_constant(D->D, scale, GD_COMPLEX128, E.ca + index);
- E.a[index] = E.ca[index][0];
+ r = gd_get_constant(D->D, scale, GD_COMPLEX128, E.u.polynom.ca + index);
+ E.u.polynom.a[index] = E.u.polynom.ca[index][0];
}
}
@@ -123,8 +123,8 @@
if (index < 0 || index > GD_MAX_POLYORD)
return -1;
- E.a[index] = E.ca[index][0] = coeff.real();
- E.ca[index][1] = coeff.imag();
+ E.u.polynom.a[index] = E.u.polynom.ca[index][0] = coeff.real();
+ E.u.polynom.ca[index][1] = coeff.imag();
E.comp_scal = 1;
if (D != NULL)
@@ -135,7 +135,7 @@
int PolynomEntry::SetPolyOrd(int poly_ord)
{
- int old_n = E.poly_ord;
+ int old_n = E.u.polynom.poly_ord;
if (poly_ord < 2 || poly_ord > GD_MAX_POLYORD)
return -1;
@@ -144,10 +144,10 @@
int i;
for (i = old_n + 1; i <= poly_ord; ++i)
- E.a[i] = 0;
+ E.u.polynom.a[i] = 0;
}
- E.poly_ord = poly_ord;
+ E.u.polynom.poly_ord = poly_ord;
if (D != NULL)
return gd_alter_entry(D->D, E.field, &E, 0);
@@ -157,7 +157,7 @@
const char *PolynomEntry::Scalar(int index)
{
- if (index < 0 || index > E.poly_ord)
+ if (index < 0 || index > E.u.polynom.poly_ord)
return NULL;
return E.scalar[index];
Modified: trunk/getdata/bindings/cxx/rawentry.cpp
===================================================================
--- trunk/getdata/bindings/cxx/rawentry.cpp 2010-08-11 00:59:43 UTC (rev 443)
+++ trunk/getdata/bindings/cxx/rawentry.cpp 2010-09-11 08:35:40 UTC (rev 444)
@@ -35,14 +35,14 @@
{
E.field = strdup(field_code);
E.field_type = GD_RAW_ENTRY;
- E.spf = spf;
- E.data_type = (gd_type_t)data_type;
+ E.u.raw.spf = spf;
+ E.u.raw.type = (gd_type_t)data_type;
E.fragment_index = fragment_index;
}
int RawEntry::SetSamplesPerFrame(gd_spf_t spf, int recode)
{
- E.spf = spf;
+ E.u.raw.spf = spf;
if (D != NULL)
return gd_alter_entry(D->D, E.field, &E, recode);
@@ -64,7 +64,7 @@
r = gd_alter_entry(D->D, E.field, &E, recode);
if (!r)
- r = gd_get_constant(D->D, spf, GD_UINT16, &E.spf);
+ r = gd_get_constant(D->D, spf, GD_UINT16, &E.u.raw.spf);
}
return r;
@@ -72,7 +72,7 @@
int RawEntry::SetType(DataType type, int recode)
{
- E.data_type = (gd_type_t)type;
+ E.u.raw.type = (gd_type_t)type;
if (D != NULL)
return gd_alter_entry(D->D, E.field, &E, recode);
Modified: trunk/getdata/bindings/cxx/recipentry.cpp
===================================================================
--- trunk/getdata/bindings/cxx/recipentry.cpp 2010-08-11 00:59:43 UTC (rev 443)
+++ trunk/getdata/bindings/cxx/recipentry.cpp 2010-09-11 08:35:40 UTC (rev 444)
@@ -36,8 +36,8 @@
E.field_type = GD_RECIP_ENTRY;
E.in_fields[0] = strdup(in_field1);
E.scalar[0] = 0;
- E.cdividend[0] = E.dividend = dividend;
- E.cdividend[1] = 0;
+ E.u.recip.cdividend[0] = E.u.recip.dividend = dividend;
+ E.u.recip.cdividend[1] = 0;
E.comp_scal = 0;
E.fragment_index = fragment_index;
}
@@ -49,8 +49,8 @@
E.field_type = GD_RECIP_ENTRY;
E.in_fields[0] = strdup(in_field1);
E.scalar[0] = 0;
- E.cdividend[0] = E.dividend = dividend.real();
- E.cdividend[1] = dividend.imag();
+ E.u.recip.cdividend[0] = E.u.recip.dividend = dividend.real();
+ E.u.recip.cdividend[1] = dividend.imag();
E.comp_scal = 1;
E.fragment_index = fragment_index;
}
@@ -73,8 +73,8 @@
int RecipEntry::SetDividend(double dividend)
{
- E.cdividend[0] = E.dividend = dividend;
- E.cdividend[1] = 0;
+ E.u.recip.cdividend[0] = E.u.recip.dividend = dividend;
+ E.u.recip.cdividend[1] = 0;
if (D != NULL)
return gd_alter_entry(D->D, E.field, &E, 0);
@@ -97,8 +97,8 @@
r = gd_alter_entry(D->D, E.field, &E, 0);
if (!r) {
- r = gd_get_constant(D->D, scale, GD_COMPLEX128, &E.cdividend);
- E.dividend = E.cdividend[0];
+ r = gd_get_constant(D->D, scale, GD_COMPLEX128, &E.u.recip.cdividend);
+ E.u.recip.dividend = E.u.recip.cdividend[0];
}
}
@@ -107,8 +107,8 @@
int RecipEntry::SetDividend(std::complex<double> dividend)
{
- E.dividend = E.cdividend[0] = dividend.real();
- E.cdividend[1] = dividend.imag();
+ E.u.recip.dividend = E.u.recip.cdividend[0] = dividend.real();
+ E.u.recip.cdividend[1] = dividend.imag();
E.comp_scal = 1;
if (D != NULL)
Modified: trunk/getdata/bindings/cxx/sbitentry.cpp
===================================================================
--- trunk/getdata/bindings/cxx/sbitentry.cpp 2010-08-11 00:59:43 UTC (rev 443)
+++ trunk/getdata/bindings/cxx/sbitentry.cpp 2010-09-11 08:35:40 UTC (rev 444)
@@ -35,8 +35,8 @@
E.field = strdup(field_code);
E.field_type = GD_BIT_ENTRY;
E.in_fields[0] = strdup(in_field);
- E.bitnum = bitnum;
- E.numbits = numbits;
+ E.u.bit.bitnum = bitnum;
+ E.u.bit.numbits = numbits;
E.fragment_index = fragment_index;
}
@@ -58,7 +58,7 @@
int SBitEntry::SetFirstBit(gd_bit_t first_bit)
{
- E.bitnum = first_bit;
+ E.u.bit.bitnum = first_bit;
if (D != NULL)
return gd_alter_entry(D->D, E.field, &E, 0);
@@ -68,7 +68,7 @@
int SBitEntry::SetNumBits(gd_bit_t num_bits)
{
- E.numbits = num_bits;
+ E.u.bit.numbits = num_bits;
if (D != NULL)
return gd_alter_entry(D->D, E.field, &E, 0);
@@ -98,7 +98,7 @@
r = gd_alter_entry(D->D, E.field, &E, 0);
if (!r)
- r = gd_get_constant(D->D, first_bit, GD_INT16, &E.bitnum);
+ r = gd_get_constant(D->D, first_bit, GD_INT16, &E.u.bit.bitnum);
}
return r;
@@ -118,7 +118,7 @@
r = gd_alter_entry(D->D, E.field, &E, 0);
if (!r)
- r = gd_get_constant(D->D, num_bits, GD_INT16, &E.numbits);
+ r = gd_get_constant(D->D, num_bits, GD_INT16, &E.u.bit.numbits);
}
return r;
Modified: trunk/getdata/bindings/f77/fgetdata.c
===================================================================
--- trunk/getdata/bindings/f77/fgetdata.c 2010-08-11 00:59:43 UTC (rev 443)
+++ trunk/getdata/bindings/f77/fgetdata.c 2010-09-11 08:35:40 UTC (rev 444)
@@ -170,7 +170,7 @@
void F77_FUNC(gdopen, GDOPEN) (int* dirfile, const char* dirfilename,
const int* dirfilename_l, const int* flags)
{
- char* out = malloc(*dirfilename_l + 1);
+ char* out = (char *)malloc(*dirfilename_l + 1);
*dirfile = _GDF_SetDirfile(gd_open(_GDF_CString(out, dirfilename,
*dirfilename_l), *flags));
@@ -197,7 +197,7 @@
if (field_code_l == 0)
gd_flush(_GDF_GetDirfile(*dirfile), NULL);
else {
- out = malloc(*field_code_l + 1);
+ out = (char *)malloc(*field_code_l + 1);
gd_flush(_GDF_GetDirfile(*dirfile), _GDF_CString(out, field_code,
*field_code_l));
free(out);
@@ -211,7 +211,7 @@
const int* num_frames, const int* num_samples, const int* return_type,
void* data_out)
{
- char* out = malloc(*field_code_l + 1);
+ char* out = (char *)malloc(*field_code_l + 1);
*n_read = gd_getdata(_GDF_GetDirfile(*dirfile), _GDF_CString(out, field_code,
*field_code_l), *first_frame, *first_sample, *num_frames,
*num_samples, (gd_type_t)*return_type, data_out);
@@ -243,7 +243,7 @@
size_t len = 0;
DIRFILE* D = _GDF_GetDirfile(*dirfile);
- char* pa = malloc(*parent_l + 1);
+ char* pa = (char *)malloc(*parent_l + 1);
_GDF_CString(pa, parent, *parent_l);
unsigned int i, nfields = gd_nmfields(D, pa);
@@ -288,7 +288,7 @@
const char** fl;
DIRFILE* D = _GDF_GetDirfile(*dirfile);
- char* pa = malloc(*parent_l + 1);
+ char* pa = (char *)malloc(*parent_l + 1);
_GDF_CString(pa, parent, *parent_l);
unsigned int nfields = gd_nmfields(D, pa);
@@ -316,7 +316,7 @@
void F77_FUNC(gdgbof, GDGBOF) (int* bof, const int* dirfile,
const char* field_code, const int* field_code_l)
{
- char *fc = malloc(*field_code_l + 1);
+ char *fc = (char *)malloc(*field_code_l + 1);
*bof = gd_bof(_GDF_GetDirfile(*dirfile), _GDF_CString(fc, field_code,
*field_code_l));
free(fc);
@@ -326,7 +326,7 @@
void F77_FUNC(gdgeof, GDGEOF) (int* eof, const int* dirfile,
const char* field_code, const int* field_code_l)
{
- char *fc = malloc(*field_code_l + 1);
+ char *fc = (char *)malloc(*field_code_l + 1);
*eof = gd_eof(_GDF_GetDirfile(*dirfile), _GDF_CString(fc, field_code,
*field_code_l));
free(fc);
@@ -342,7 +342,7 @@
void F77_FUNC(gdgspf, GDGSPF) (int* spf, const int* dirfile,
const char* field_code, const int* field_code_l)
{
- char* out = malloc(*field_code_l + 1);
+ char* out = (char *)malloc(*field_code_l + 1);
*spf = gd_spf(_GDF_GetDirfile(*dirfile),
_GDF_CString(out, field_code, *field_code_l));
free(out);
@@ -354,7 +354,7 @@
const int* first_sample, const int* num_frames, const int* num_samples,
const int* data_type, const void* data_in)
{
- char* out = malloc(*field_code_l + 1);
+ char* out = (char *)malloc(*field_code_l + 1);
*n_wrote = gd_putdata(_GDF_GetDirfile(*dirfile), _GDF_CString(out, field_code,
*field_code_l), *first_frame, *first_sample, *num_frames,
*num_samples, (gd_type_t)*data_type, data_in);
@@ -391,7 +391,7 @@
{
dtrace("%p, %i, %p, %i", type, *dirfile, field_code, *field_code_l);
- char* fc = malloc(*field_code_l + 1);
+ char* fc = (char *)malloc(*field_code_l + 1);
*type = (int)gd_entry_type(_GDF_GetDirfile(*dirfile), _GDF_CString(fc,
field_code, *field_code_l));
@@ -408,15 +408,15 @@
dtrace("%p, %p, %p, %i, %p, %i", spf, dtype, fragment_index, *dirfile,
field_code, *field_code_l);
- char* out = malloc(*field_code_l + 1);
+ char* out = (char *)malloc(*field_code_l + 1);
gd_entry_t E;
if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(out, field_code,
*field_code_l), &E) || E.field_type != GD_RAW_ENTRY)
*spf = 0;
else {
- *spf = E.spf;
- *dtype = E.data_type;
+ *spf = E.u.raw.spf;
+ *dtype = E.u.raw.type;
*fragment_index = E.fragment_index;
gd_free_entry_strings(&E);
}
@@ -439,30 +439,30 @@
infield3, infield3_l, m3, b3, fragment_index, *dirfile, field_code,
*field_code_l);
- char* out = malloc(*field_code_l + 1);
+ char* out = (char *)malloc(*field_code_l + 1);
gd_entry_t E;
if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(out, field_code,
*field_code_l), &E) || E.field_type != GD_LINCOM_ENTRY)
*nfields = 0;
else {
- *nfields = E.n_fields;
+ *nfields = E.u.lincom.n_fields;
*fragment_index = E.fragment_index;
_GDF_FString(infield1, infield1_l, E.in_fields[0]);
- *m1 = E.m[0];
- *b1 = E.b[0];
+ *m1 = E.u.lincom.m[0];
+ *b1 = E.u.lincom.b[0];
- if (E.n_fields > 1) {
+ if (E.u.lincom.n_fields > 1) {
_GDF_FString(infield2, infield2_l, E.in_fields[1]);
- *m2 = E.m[1];
- *b2 = E.b[1];
+ *m2 = E.u.lincom.m[1];
+ *b2 = E.u.lincom.b[1];
}
- if (E.n_fields > 2) {
+ if (E.u.lincom.n_fields > 2) {
_GDF_FString(infield3, infield3_l, E.in_fields[2]);
- *m3 = E.m[2];
- *b3 = E.b[2];
+ *m3 = E.u.lincom.m[2];
+ *b3 = E.u.lincom.b[2];
}
gd_free_entry_strings(&E);
@@ -473,9 +473,9 @@
}
void F77_FUNC(gdgecl, GDGECL) (int* nfields,
- char* infield1, int* infield1_l, double complex* m1, double complex* b1,
- char* infield2, int* infield2_l, double complex* m2, double complex* b2,
- char* infield3, int* infield3_l, double complex* m3, double complex* b3,
+ char* infield1, int* infield1_l, GD_DCOMPLEXP(m1), GD_DCOMPLEXP(b1),
+ char* infield2, int* infield2_l, GD_DCOMPLEXP(m2), GD_DCOMPLEXP(b2),
+ char* infield3, int* infield3_l, GD_DCOMPLEXP(m3), GD_DCOMPLEXP(b3),
int* fragment_index, const int* dirfile, const char* field_code,
const int* field_code_l)
{
@@ -484,7 +484,7 @@
infield3, infield3_l, m3, b3, fragment_index, *dirfile, field_code,
*field_code_l);
- char* fc = malloc(*field_code_l + 1);
+ char* fc = (char *)malloc(*field_code_l + 1);
gd_entry_t E;
if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(fc, field_code,
@@ -494,23 +494,23 @@
*nfields = 0;
gd_free_entry_strings(&E);
} else {
- *nfields = E.n_fields;
+ *nfields = E.u.lincom.n_fields;
*fragment_index = E.fragment_index;
_GDF_FString(infield1, infield1_l, E.in_fields[0]);
- *m1 = E.cm[0];
- *b1 = E.cb[0];
+ _gd_c2cp(m1, E.u.lincom.cm[0]);
+ _gd_c2cp(b1, E.u.lincom.cb[0]);
- if (E.n_fields > 1) {
+ if (E.u.lincom.n_fields > 1) {
_GDF_FString(infield2, infield2_l, E.in_fields[1]);
- *m2 = E.cm[1];
- *b2 = E.cb[1];
+ _gd_c2cp(m2, E.u.lincom.cm[1]);
+ _gd_c2cp(b2, E.u.lincom.cb[1]);
}
- if (E.n_fields > 2) {
+ if (E.u.lincom.n_fields > 2) {
_GDF_FString(infield3, infield3_l, E.in_fields[2]);
- *m3 = E.cm[2];
- *b3 = E.cb[2];
+ _gd_c2cp(m3, E.u.lincom.cm[2]);
+ _gd_c2cp(b3, E.u.lincom.cb[2]);
}
gd_free_entry_strings(&E);
}
@@ -530,30 +530,30 @@
infield, *infield_l, a0, a1, a2, a3, a4, a5, fragment_index, *dirfile,
field_code, *field_code_l);
- char* out = malloc(*field_code_l + 1);
+ char* out = (char *)malloc(*field_code_l + 1);
gd_entry_t E;
if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(out, field_code,
*field_code_l), &E) || E.field_type != GD_POLYNOM_ENTRY)
*poly_ord = 0;
else {
- *poly_ord = E.poly_ord;
+ *poly_ord = E.u.polynom.poly_ord;
*fragment_index = E.fragment_index;
_GDF_FString(infield, infield_l, E.in_fields[0]);
- switch (E.poly_ord) {
+ switch (E.u.polynom.poly_ord) {
case 5:
- *a5 = E.a[5];
+ *a5 = E.u.polynom.a[5];
case 4:
- *a4 = E.a[4];
+ *a4 = E.u.polynom.a[4];
case 3:
- *a3 = E.a[3];
+ *a3 = E.u.polynom.a[3];
case 2:
- *a2 = E.a[2];
+ *a2 = E.u.polynom.a[2];
case 1:
- *a1 = E.a[1];
- *a0 = E.a[0];
+ *a1 = E.u.polynom.a[1];
+ *a0 = E.u.polynom.a[0];
}
gd_free_entry_strings(&E);
}
@@ -563,8 +563,8 @@
}
void F77_FUNC(gdgecp, GDGECP) (int* poly_ord, char* infield, int* infield_l,
- double complex* a0, double complex* a1, double complex* a2,
- double complex* a3, double complex* a4, double complex* a5,
+ GD_DCOMPLEXP(a0), GD_DCOMPLEXP(a1), GD_DCOMPLEXP(a2),
+ GD_DCOMPLEXP(a3), GD_DCOMPLEXP(a4), GD_DCOMPLEXP(a5),
int* fragment_index, const int* dirfile, const char* field_code,
const int* field_code_l)
{
@@ -572,30 +572,30 @@
infield, *infield_l, a0, a1, a2, a3, a4, a5, fragment_index, *dirfile,
field_code, *field_code_l);
- char* out = malloc(*field_code_l + 1);
+ char* out = (char *)malloc(*field_code_l + 1);
gd_entry_t E;
if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(out, field_code,
*field_code_l), &E) || E.field_type != GD_POLYNOM_ENTRY)
*poly_ord = 0;
else {
- *poly_ord = E.poly_ord;
+ *poly_ord = E.u.polynom.poly_ord;
*fragment_index = E.fragment_index;
_GDF_FString(infield, infield_l, E.in_fields[0]);
- switch (E.poly_ord) {
+ switch (E.u.polynom.poly_ord) {
case 5:
- *a5 = E.ca[5];
+ _gd_c2cp(a5, E.u.polynom.ca[5]);
case 4:
- *a4 = E.ca[4];
+ _gd_c2cp(a4, E.u.polynom.ca[4]);
case 3:
- *a3 = E.ca[3];
+ _gd_c2cp(a3, E.u.polynom.ca[3]);
case 2:
- *a2 = E.ca[2];
+ _gd_c2cp(a2, E.u.polynom.ca[2]);
case 1:
- *a1 = E.ca[1];
- *a0 = E.ca[0];
+ _gd_c2cp(a1, E.u.polynom.ca[1]);
+ _gd_c2cp(a0, E.u.polynom.ca[0]);
}
gd_free_entry_strings(&E);
}
@@ -613,14 +613,14 @@
dtrace("%p, %i, %p, %i, %p, %i, %p, %i", in_field, *in_field_l, table,
*table_l, fragment_index, *dirfile, field_code, *field_code_l);
- char* out = malloc(*field_code_l + 1);
+ char* out = (char *)malloc(*field_code_l + 1);
gd_entry_t E;
if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(out, field_code,
*field_code_l), &E) || E.field_type != GD_LINTERP_ENTRY)
*in_field_l = 0;
else {
- _GDF_FString(table, table_l, E.table);
+ _GDF_FString(table, table_l, E.u.linterp.table);
_GDF_FString(in_field, in_field_l, E.in_fields[0]);
*fragment_index = E.fragment_index;
gd_free_entry_strings(&E);
@@ -638,7 +638,7 @@
dtrace("%p, %i, %p, %p, %p, %i, %p, %i", in_field, *in_field_l, bitnum,
numbits, fragment_index, *dirfile, field_code, *field_code_l);
- char* out = malloc(*field_code_l + 1);
+ char* out = (char *)malloc(*field_code_l + 1);
gd_entry_t E;
if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(out, field_code,
@@ -646,8 +646,8 @@
*in_field_l = 0;
else {
_GDF_FString(in_field, in_field_l, E.in_fields[0]);
- *bitnum = E.bitnum;
- *numbits = E.numbits;
+ *bitnum = E.u.bit.bitnum;
+ *numbits = E.u.bit.numbits;
*fragment_index = E.fragment_index;
gd_free_entry_strings(&E);
}
@@ -664,7 +664,7 @@
dtrace("%p, %i, %p, %p, %p, %i, %p, %i", in_field, *in_field_l, bitnum,
numbits, fragment_index, *dirfile, field_code, *field_code_l);
- char* out = malloc(*field_code_l + 1);
+ char* out = (char *)malloc(*field_code_l + 1);
gd_entry_t E;
if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(out, field_code,
@@ -672,8 +672,8 @@
*in_field_l = 0;
else {
_GDF_FString(in_field, in_field_l, E.in_fields[0]);
- *bitnum = E.bitnum;
- *numbits = E.numbits;
+ *bitnum = E.u.bit.bitnum;
+ *numbits = E.u.bit.numbits;
*fragment_index = E.fragment_index;
gd_free_entry_strings(&E);
}
@@ -691,7 +691,7 @@
in_field2, *in_field2_l, fragment_index, *dirfile, field_code,
*field_code_l);
- char* out = malloc(*field_code_l + 1);
+ char* out = (char *)malloc(*field_code_l + 1);
gd_entry_t E;
if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(out, field_code,
@@ -717,7 +717,7 @@
in_field2, *in_field2_l, fragment_index, *dirfile, field_code,
*field_code_l);
- char* out = malloc(*field_code_l + 1);
+ char* out = (char *)malloc(*field_code_l + 1);
gd_entry_t E;
if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(out, field_code,
@@ -743,7 +743,7 @@
dtrace("%p, %i, %p, %p, %i, %p, %i", in_field, *in_field_l, dividend,
fragment_index, *dirfile, field_code, *field_code_l);
- char* out = malloc(*field_code_l + 1);
+ char* out = (char *)malloc(*field_code_l + 1);
gd_entry_t E;
if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(out, field_code,
@@ -751,7 +751,7 @@
*in_field_l = 0;
else {
_GDF_FString(in_field, in_field_l, E.in_fields[0]);
- *dividend = E.dividend;
+ *dividend = E.u.recip.dividend;
*fragment_index = E.fragment_index;
gd_free_entry_strings(&E);
}
@@ -762,13 +762,13 @@
}
void F77_FUNC(gdgecr, GDGECR) (char* in_field, int* in_field_l,
- complex double* cdividend, int* fragment_index, const int* dirfile,
+ GD_DCOMPLEXP(cdividend), int* fragment_index, const int* dirfile,
const char* field_code, const int* field_code_l)
{
dtrace("%p, %i, %p, %p, %i, %p, %i", in_field, *in_field_l, cdividend,
fragment_index, *dirfile, field_code, *field_code_l);
- char* out = malloc(*field_code_l + 1);
+ char* out = (char *)malloc(*field_code_l + 1);
gd_entry_t E;
if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(out, field_code,
@@ -776,7 +776,7 @@
*in_field_l = 0;
else {
_GDF_FString(in_field, in_field_l, E.in_fields[0]);
- *cdividend = E.cdividend;
+ _gd_c2cp(cdividend, E.u.recip.cdividend);
*fragment_index = E.fragment_index;
gd_free_entry_strings(&E);
}
@@ -794,7 +794,7 @@
dtrace("%p, %i, %p, %p, %i, %p, %i", in_field, *in_field_l, shift,
fragment_index, *dirfile, field_code, *field_code_l);
- char* out = malloc(*field_code_l + 1);
+ char* out = (char *)malloc(*field_code_l + 1);
gd_entry_t E;
if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(out, field_code,
@@ -802,7 +802,7 @@
*in_field_l = 0;
else {
_GDF_FString(in_field, in_field_l, E.in_fields[0]);
- *shift = E.shift;
+ *shift = E.u.phase.shift;
*fragment_index = E.fragment_index;
gd_free_entry_strings(&E);
}
@@ -818,14 +818,14 @@
dtrace("%p, %p, %i, %p, %i", data_type, fragment_index, *dirfile, field_code,
*field_code_l);
- char* out = malloc(*field_code_l + 1);
+ char* out = (char *)malloc(*field_code_l + 1);
gd_entry_t E;
if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(out, field_code,
*field_code_l), &E) || E.field_type != GD_CONST_ENTRY)
*data_type = 0;
else {
- *data_type = E.const_type;
+ *data_type = E.u.cons.type;
*fragment_index = E.fragment_index;
gd_free_entry_strings(&E);
}
@@ -838,7 +838,7 @@
void F77_FUNC(gdfrgi, GDFRGI) (int* fragment_index, const int* dirfile,
const char* field_code, const int* field_code_l)
{
- char* fc = malloc(*field_code_l + 1);
+ char* fc = (char *)malloc(*field_code_l + 1);
*fragment_index = gd_fragment_index(_GDF_GetDirfile(*dirfile),
_GDF_CString(fc, field_code, *field_code_l));
@@ -851,7 +851,7 @@
const int* field_code_l, const int* data_type, const int* spf,
const int* fragment_index)
{
- char* out = malloc(*field_code_l + 1);
+ char* out = (char *)malloc(*field_code_l + 1);
gd_add_raw(_GDF_GetDirfile(*dirfile), _GDF_CString(out, field_code,
*field_code_l), (gd_type_t)(*data_type), (gd_spf_t)*spf,
*fragment_index);
@@ -866,28 +866,28 @@
const double* b2, const char* in_field3, const int* in_field3_l,
const double* m3, const double* b3, const int* fragment_index)
{
- char* fc = malloc(*field_code_l + 1);
+ char* fc = (char *)malloc(*field_code_l + 1);
char* in_fields[3] = {NULL, NULL, NULL};
double m[3] = {0, 0, 0};
double b[3] = {0, 0, 0};
int nf = *n_fields;
if (nf > 0) {
- in_fields[0] = malloc(*in_field1_l + 1);
+ in_fields[0] = (char *)malloc(*in_field1_l + 1);
_GDF_CString(in_fields[0], in_field1, *in_field1_l);
m[0] = *m1;
b[0] = *b1;
}
if (nf > 1) {
- in_fields[1] = malloc(*in_field2_l + 1);
+ in_fields[1] = (char *)malloc(*in_field2_l + 1);
_GDF_CString(in_fields[1], in_field2, *in_field2_l);
m[1] = *m2;
b[1] = *b2;
}
if (nf > 2) {
- in_fields[2] = malloc(*in_field3_l + 1);
+ in_fields[2] = (char *)malloc(*in_field3_l + 1);
_GDF_CString(in_fields[2], in_field3, *in_field3_l);
m[2] = *m3;
b[2] = *b3;
@@ -903,37 +903,42 @@
void F77_FUNC(gdadcl, GDADCL) (const int* dirfile, const char* field_code,
const int* field_code_l, const int* n_fields, const char* in_field1,
- const int* in_field1_l, const double complex* m1, const double complex* b1,
- const char* in_field2, const int* in_field2_l, const double complex* m2,
- const double complex* b2, const char* in_field3, const int* in_field3_l,
- const double complex* m3, const double complex* b3,
+ const int* in_field1_l, const GD_DCOMPLEXP(m1), const GD_DCOMPLEXP(b1),
+ const char* in_field2, const int* in_field2_l, const GD_DCOMPLEXP(m2),
+ const GD_DCOMPLEXP(b2), const char* in_field3, const int* in_field3_l,
+ const GD_DCOMPLEXP(m3), const GD_DCOMPLEXP(b3),
const int* fragment_index)
{
- char* fc = malloc(*field_code_l + 1);
+ char* fc = (char *)malloc(*field_code_l + 1);
char* in_fields[3] = {NULL, NULL, NULL};
+#ifdef GD_NO_C99_API
+ double cm[6] = {0, 0, 0, 0, 0, 0};
+ double cb[6] = {0, 0, 0, 0, 0, 0};
+#else
double complex cm[3] = {0, 0, 0};
double complex cb[3] = {0, 0, 0};
+#endif
int nf = *n_fields;
if (nf > 0) {
- in_fields[0] = malloc(*in_field1_l + 1);
+ in_fields[0] = (char *)malloc(*in_field1_l + 1);
_GDF_CString(in_fields[0], in_field1, *in_field1_l);
- cm[0] = *m1;
- cb[0] = *b1;
+ _gd_cp2ca(cm, 0, m1);
+ _gd_cp2ca(cb, 0, b1);
}
if (nf > 1) {
- in_fields[1] = malloc(*in_field2_l + 1);
+ in_fields[1] = (char *)malloc(*in_field2_l + 1);
_GDF_CString(in_fields[1], in_field2, *in_field2_l);
- cm[1] = *m2;
- cb[1] = *b2;
+ _gd_cp2ca(cm, 1, m2);
+ _gd_cp2ca(cb, 1, b2);
}
if (nf > 2) {
- in_fields[2] = malloc(*in_field3_l + 1);
+ in_fields[2] = (char *)malloc(*in_field3_l + 1);
_GDF_CString(in_fields[2], in_field3, *in_field3_l);
- cm[2] = *m3;
- cb[2] = *b3;
+ _gd_cp2ca(cm, 2, m3);
+ _gd_cp2ca(cb, 2, b3);
}
gd_add_clincom(_GDF_GetDirfile(*dirfile), _GDF_CString(fc, field_code,
@@ -951,14 +956,14 @@
const double* a3, const double* a4, const double* a5,
const int* fragment_index)
{
- char* fc = malloc(*field_code_l + 1);
+ char* fc = (char *)malloc(*field_code_l + 1);
char* inf = NULL;
double a[6] = {0, 0, 0, 0, 0, 0};
int po = *poly_ord;
if (po > 5)
po = 5;
- inf = malloc(*in_field_l + 1);
+ inf = (char *)malloc(*in_field_l + 1);
_GDF_CString(inf, in_field, *in_field_l);
switch (po) {
@@ -983,33 +988,37 @@
void F77_FUNC(gdadcp, GDADCP) (const int* dirfile, const char* field_code,
const int* field_code_l, const int* poly_ord, const char* in_field,
- const int* in_field_l, const double complex* a0, const double complex* a1,
- const double complex* a2, const double complex* a3,
- const double complex* a4, const double complex* a5,
+ const int* in_field_l, const GD_DCOMPLEXP(a0), const GD_DCOMPLEXP(a1),
+ const GD_DCOMPLEXP(a2), const GD_DCOMPLEXP(a3),
+ const GD_DCOMPLEXP(a4), const GD_DCOMPLEXP(a5),
const int* fragment_index)
{
- char* fc = malloc(*field_code_l + 1);
+ char* fc = (char *)malloc(*field_code_l + 1);
char* inf = NULL;
+#ifdef GD_NO_C99_API
+ double ca[12] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+#else
double complex ca[6] = {0, 0, 0, 0, 0, 0};
+#endif
int po = *poly_ord;
if (po > 5)
po = 5;
- inf = malloc(*in_field_l + 1);
+ inf = (char *)malloc(*in_field_l + 1);
_GDF_CString(inf, in_field, *in_field_l);
switch (po) {
case 5:
- ca[5] = *a5;
+ _gd_cp2ca(ca, 5, a5);
case 4:
- ca[4] = *a4;
+ _gd_cp2ca(ca, 4, a4);
case 3:
- ca[3] = *a3;
+ _gd_cp2ca(ca, 3, a3);
case 2:
- ca[2] = *a2;
+ _gd_cp2ca(ca, 2, a2);
case 1:
- ca[1] = *a1;
- ca[0] = *a0;
+ _gd_cp2ca(ca, 1, a1);
+ _gd_cp2ca(ca, 0, a0);
}
gd_add_cpolynom(_GDF_GetDirfile(*dirfile), _GDF_CString(fc, field_code,
@@ -1023,9 +1032,9 @@
const int* field_code_l, const char* in_field, const int* in_field_l,
const char* table, const int* table_l, const int* fragment_index)
{
- char* fc = malloc(*field_code_l + 1);
- char* in = malloc(*in_field_l + 1);
- char* tab = malloc(*table_l + 1);
+ char* fc = (char *)malloc(*field_code_l + 1);
+ char* in = (char *)malloc(*in_field_l + 1);
+ char* tab = (char *)malloc(*table_l + 1);
gd_add_linterp(_GDF_GetDirfile(*dirfile), _GDF_CString(fc, field_code,
*field_code_l), _GDF_CString(in, in_field, *in_field_l),
@@ -1040,8 +1049,8 @@
const int* field_code_l, const char* in_field, const int* in_field_l,
const int* bitnum, const int* numbits, const int* fragment_index)
{
- char* fc = malloc(*field_code_l + 1);
- char* in = malloc(*in_field_l + 1);
+ char* fc = (char *)malloc(*field_code_l + 1);
+ char* in = (char *)malloc(*in_field_l + 1);
gd_add_bit(_GDF_GetDirfile(*dirfile), _GDF_CString(fc, field_code,
*field_code_l), _GDF_CString(in, in_field, *in_field_l),
@@ -1055,8 +1064,8 @@
const int* field_code_l, const char* in_field, const int* in_field_l,
const int* bitnum, const int* numbits, const int* fragment_index)
{
- char* fc = malloc(*field_code_l + 1);
- char* in = malloc(*in_field_l + 1);
+ char* fc = (char *)malloc(*field_code_l + 1);
+ char* in = (char *)malloc(*in_field_l + 1);
gd_add_sbit(_GDF_GetDirfile(*dirfile), _GDF_CString(fc, field_code,
*field_code_l), _GDF_CString(in, in_field, *in_field_l),
@@ -1070,9 +1079,9 @@
const int* field_code_l, const char* in_field1, const int* in_field1_l,
const char* in_field2, const int* in_field2_l, const int* fragment_index)
{
- char* fc = malloc(*field_code_l + 1);
- char* in1 = malloc(*in_field1_l + 1);
- char* in2 = malloc(*in_field2_l + 1);
+ char* fc = (char *)malloc(*field_code_l + 1);
+ char* in1 = (char *)m...
[truncated message content] |