Skip to content

Commit

Permalink
Update libmseed to 2.19.5, with fix for leap second calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
Chad Trabant committed Oct 11, 2017
1 parent 23825d8 commit fbabb01
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 9 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
2017.283: 2.6
- Update libmseed to 2.19.5, with fix for leap second calculation.

2017.201: 2.5
- Update logic that identifies and replaces index rows for the same
or versioned file names to match the data time coverage +- 1 day.
Expand Down
7 changes: 7 additions & 0 deletions libmseed/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
2017.283: 2.19.5
- msr_endtime(): calculate correct end time during a leap second.
- Fixed signedness comparison warning.

2017.125:
- Export LM_SIZEOF_OFF_T on Windows via libmseed.def.

2017.118: 2.19.4
- Add global LM_SIZEOF_OFF_T variable that is set to the size of
the off_t data type as determined at compile time.
Expand Down
2 changes: 2 additions & 0 deletions libmseed/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,5 @@ in the ChangeLog.

This library also uses code bits published in the public domain and
acknowledgement is included in the code whenever possible.

With software provided by http://2038bug.com/ (site offline, checked Oct. 2017)
4 changes: 4 additions & 0 deletions libmseed/doc/ms_time.3
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,10 @@ values.
A special value defined as HPTERROR in libmseed.h is used to represent
errors for routines returning hptime.

.SH ACKNOWLEDGEMENTS

With software provided by http://2038bug.com/ (site offline, checked Oct. 2017)

.SH AUTHOR
.nf
Chad Trabant
Expand Down
1 change: 1 addition & 0 deletions libmseed/libmseed.def
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,4 @@ EXPORTS
ms_gswap2a
ms_gswap4a
ms_gswap8a
LM_SIZEOF_OFF_T
4 changes: 2 additions & 2 deletions libmseed/libmseed.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
extern "C" {
#endif

#define LIBMSEED_VERSION "2.19.4"
#define LIBMSEED_RELEASE "2017.118"
#define LIBMSEED_VERSION "2.19.5"
#define LIBMSEED_RELEASE "2017.283"

/* C99 standard headers */
#include <stdlib.h>
Expand Down
12 changes: 10 additions & 2 deletions libmseed/msrutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* ORFEUS/EC-Project MEREDIAN
* IRIS Data Management Center
*
* modified: 2016.286
* modified: 2016.283
***************************************************************************/

#include <stdio.h>
Expand Down Expand Up @@ -571,6 +571,14 @@ msr_starttime_uc (MSRecord *msr)
* actual last sample time and *not* the time "covered" by the last
* sample.
*
* On the epoch time scale the value of a leap second is the same as
* the second following the leap second, without external information
* the values are ambiguous.
*
* Leap second handling: when a record completely contains a leap
* second, starts before and ends after, the calculated end time will
* be adjusted (reduced) by one second.
*
* Returns the time of the last sample as a high precision epoch time
* on success and HPTERROR on error.
***************************************************************************/
Expand All @@ -592,7 +600,7 @@ msr_endtime (MSRecord *msr)
while (lslist)
{
if (lslist->leapsecond > msr->starttime &&
lslist->leapsecond < (msr->starttime + span))
lslist->leapsecond <= (msr->starttime + span - HPTMODULUS))
{
span -= HPTMODULUS;
break;
Expand Down
8 changes: 4 additions & 4 deletions libmseed/unpackdata.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* STEIM2, GEOSCOPE (24bit and gain ranged), CDSN, SRO and DWWSSN
* encoded data.
*
* modified: 2017.053
* modified: 2017.283
************************************************************************/

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

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

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

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

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

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

/* Save sample in output array */
Expand Down
2 changes: 1 addition & 1 deletion src/mseedindex.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@

#include "md5.h"

#define VERSION "2.5"
#define VERSION "2.6"
#define PACKAGE "mseedindex"

static flag verbose = 0;
Expand Down

0 comments on commit fbabb01

Please sign in to comment.