Skip to content

Commit 60ead84

Browse files
author
chad-iris
committed
Update libmseed to 2.19.5, with fix for leap second calculation
1 parent 2d592d1 commit 60ead84

File tree

9 files changed

+34
-9
lines changed

9 files changed

+34
-9
lines changed

ChangeLog

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2017.283: 3.8
2+
- Update libmseed to 2.19.5, with fix for leap second calculation.
3+
14
2017.136: 3.7
25
- Update libmseed to 2.19.4.
36
- Remove Windows/Watcom build files and documentation, this will not build

libmseed/ChangeLog

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
2017.283: 2.19.5
2+
- msr_endtime(): calculate correct end time during a leap second.
3+
- Fixed signedness comparison warning.
4+
5+
2017.125:
6+
- Export LM_SIZEOF_OFF_T on Windows via libmseed.def.
7+
18
2017.118: 2.19.4
29
- Add global LM_SIZEOF_OFF_T variable that is set to the size of
310
the off_t data type as determined at compile time.

libmseed/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,5 @@ in the ChangeLog.
5656

5757
This library also uses code bits published in the public domain and
5858
acknowledgement is included in the code whenever possible.
59+
60+
With software provided by http://2038bug.com/ (site offline, checked Oct. 2017)

libmseed/doc/ms_time.3

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,10 @@ values.
191191
A special value defined as HPTERROR in libmseed.h is used to represent
192192
errors for routines returning hptime.
193193

194+
.SH ACKNOWLEDGEMENTS
195+
196+
With software provided by http://2038bug.com/ (site offline, checked Oct. 2017)
197+
194198
.SH AUTHOR
195199
.nf
196200
Chad Trabant

libmseed/libmseed.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,4 @@ EXPORTS
102102
ms_gswap2a
103103
ms_gswap4a
104104
ms_gswap8a
105+
LM_SIZEOF_OFF_T

libmseed/libmseed.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
extern "C" {
2929
#endif
3030

31-
#define LIBMSEED_VERSION "2.19.4"
32-
#define LIBMSEED_RELEASE "2017.118"
31+
#define LIBMSEED_VERSION "2.19.5"
32+
#define LIBMSEED_RELEASE "2017.283"
3333

3434
/* C99 standard headers */
3535
#include <stdlib.h>

libmseed/msrutils.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* ORFEUS/EC-Project MEREDIAN
88
* IRIS Data Management Center
99
*
10-
* modified: 2016.286
10+
* modified: 2016.283
1111
***************************************************************************/
1212

1313
#include <stdio.h>
@@ -571,6 +571,14 @@ msr_starttime_uc (MSRecord *msr)
571571
* actual last sample time and *not* the time "covered" by the last
572572
* sample.
573573
*
574+
* On the epoch time scale the value of a leap second is the same as
575+
* the second following the leap second, without external information
576+
* the values are ambiguous.
577+
*
578+
* Leap second handling: when a record completely contains a leap
579+
* second, starts before and ends after, the calculated end time will
580+
* be adjusted (reduced) by one second.
581+
*
574582
* Returns the time of the last sample as a high precision epoch time
575583
* on success and HPTERROR on error.
576584
***************************************************************************/
@@ -592,7 +600,7 @@ msr_endtime (MSRecord *msr)
592600
while (lslist)
593601
{
594602
if (lslist->leapsecond > msr->starttime &&
595-
lslist->leapsecond < (msr->starttime + span))
603+
lslist->leapsecond <= (msr->starttime + span - HPTMODULUS))
596604
{
597605
span -= HPTMODULUS;
598606
break;

libmseed/unpackdata.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* STEIM2, GEOSCOPE (24bit and gain ranged), CDSN, SRO and DWWSSN
44
* encoded data.
55
*
6-
* modified: 2017.053
6+
* modified: 2017.283
77
************************************************************************/
88

99
#include <memory.h>
@@ -628,7 +628,7 @@ msr_decode_geoscope (char *input, int samplecount, float *output,
628628
mantissa = sample32.i;
629629

630630
/* Take 2's complement for mantissa for overflow */
631-
if (mantissa > MAX24)
631+
if ((unsigned long)mantissa > MAX24)
632632
mantissa -= 2 * (MAX24 + 1);
633633

634634
/* Store */
@@ -851,7 +851,7 @@ msr_decode_sro (int16_t *input, int samplecount, int32_t *output,
851851
gainrange = (sint & SRO_GAINRANGE_MASK) >> SRO_SHIFT;
852852

853853
/* Take 2's complement for mantissa */
854-
if (mantissa > MAX12)
854+
if ((unsigned long)mantissa > MAX12)
855855
mantissa -= 2 * (MAX12 + 1);
856856

857857
/* Calculate exponent, SRO exponent = 0..10 */
@@ -902,7 +902,7 @@ msr_decode_dwwssn (int16_t *input, int samplecount, int32_t *output,
902902
sample = (int32_t)sint;
903903

904904
/* Take 2's complement for sample */
905-
if (sample > MAX16)
905+
if ((unsigned long)sample > MAX16)
906906
sample -= 2 * (MAX16 + 1);
907907

908908
/* Save sample in output array */

src/msi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ static int addfile (char *filename);
3131
static int addlistfile (char *filename);
3232
static void usage (void);
3333

34-
#define VERSION "3.7"
34+
#define VERSION "3.8"
3535
#define PACKAGE "msi"
3636

3737
static flag verbose = 0;

0 commit comments

Comments
 (0)