Skip to content

Commit eb45461

Browse files
Update libmseed to v3.1.1
1 parent 2a47d5a commit eb45461

27 files changed

+519
-470
lines changed

ChangeLog

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2024.024: 4.2
2+
- Update libmseed to v3.1.1.
3+
14
2024.006: 4.1
25
- Update libmseed to v3.0.18.
36

libmseed/ChangeLog

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
2024.024: 3.1.1
2+
- Change library compatibility version in Makefile to MAJOR.1.0, as this is now
3+
incompatible with the x.0.0 releases.
4+
5+
2024.024: 3.1.0
6+
BREAKING CHANGES, data structure and an API changes:
7+
- `MS3Record.encoding` now int16_t instead of int8_t.
8+
- `MS3Record.datalength` now uint32_t instead of uint16_t (change in 3.0.18).
9+
- `MS3Record.datasize` and `MS3TraceSeg.datasize` now uint64_t instead of size_t.
10+
- `ms3_detect()` now returns int64_t instead of int.
11+
- `mstl3_unpack_recordlist()`'s `outputsize` argument is now uint64_t instead of size_t.
12+
- `mseh_get_ptr_r()`'s `maxlength` is now uint32_t instead of size_t.
13+
14+
- Fix to handle full range of allowed encoding values from 0-255.
15+
- Fix to handle detection of huge record lengths beyond MAXRECLEN gracefully.
16+
- Add more checks to avoid writing impossible values to miniSEED v2 blockette fields.
17+
- Fix all compiler warnings at level -Wextra for clang, gcc, and \W3 for MSVC.
18+
19+
2024.015:
20+
- Fix build of DLL target on Windows by defining exports in libmseed.def.
21+
22+
2024.007:
23+
- Improve formatting of gap list produced by mstl3_printgaplist().
24+
125
2024.006: 3.0.18
226
- ms_nslc2sid() requires all codes except location to be set to reduce misuse.
327
- Fix raw, diagnostic generation of SIDs from miniSEED v2 when full codes are used.

libmseed/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# Extract version from libmseed.h, expected line should include LIBMSEED_VERSION "#.#.#"
1010
MAJOR_VER = $(shell grep LIBMSEED_VERSION libmseed.h | grep -Eo '[0-9]+.[0-9]+.[0-9]+' | cut -d . -f 1)
1111
FULL_VER = $(shell grep LIBMSEED_VERSION libmseed.h | grep -Eo '[0-9]+.[0-9]+.[0-9]+')
12-
COMPAT_VER = $(MAJOR_VER).0.0
12+
COMPAT_VER = $(MAJOR_VER).1.0
1313

1414
# Default settings for install target
1515
PREFIX ?= /usr/local

libmseed/Makefile.win

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ lib: $(OBJS)
3434
link.exe /lib /nologo /OUT:$(LM_LIB) $(OBJS)
3535

3636
dll: $(OBJS)
37-
link.exe /dll /nologo /OUT:$(LM_DLL) $(OBJS)
37+
link.exe /dll /nologo /DEF:$(LM_DEF) /OUT:$(LM_DLL) $(OBJS)
3838

3939
.c.obj:
4040
$(CC) /nologo $(CFLAGS) $(INCS) $(OPTS) /c $<

libmseed/example/Makefile.win

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ OPTS = /O2 /D_CRT_SECURE_NO_WARNINGS
99
SRCS = lm_pack.c \
1010
lm_pack_rollingbuffer.c \
1111
lm_parse.c \
12-
lm_read_buffer.c \
12+
lm_read_buffer.c \
1313
lm_read_recordlist.c \
1414
lm_read_selection.c \
1515
lm_sids.c \
@@ -25,4 +25,5 @@ all: $(BINS)
2525

2626
# Clean-up directives
2727
clean:
28-
-del *.obj *.exe *% *~
28+
-del *.obj *.exe *% *~
29+

libmseed/example/lm_pack_rollingbuffer.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
void
3838
record_handler (char *record, int reclen, void *handlerdata)
3939
{
40+
(void)handlerdata;
4041
MS3Record *msr = NULL;
4142

4243
if (!msr3_parse (record, reclen, &msr, 0, 0))

libmseed/example/lm_read_recordlist.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@ main (int argc, char **argv)
4141
char fileptrstr[30];
4242
uint32_t flags = 0;
4343
int8_t verbose = 0;
44-
size_t idx;
44+
uint64_t idx;
4545
int rv;
4646

4747
char printdata = 0;
4848
int64_t unpacked;
4949
uint8_t samplesize;
5050
char sampletype;
51-
size_t lineidx;
52-
size_t lines;
51+
uint64_t lineidx;
52+
uint64_t lines;
5353
int col;
5454
void *sptr;
5555

@@ -62,7 +62,7 @@ main (int argc, char **argv)
6262
mseedfile = argv[1];
6363

6464
/* Simplistic argument parsing */
65-
for (idx = 2; idx < argc; idx++)
65+
for (idx = 2; (int)idx < argc; idx++)
6666
{
6767
if (strncmp (argv[idx], "-v", 2) == 0)
6868
verbose += strspn (&argv[idx][1], "v");
@@ -166,7 +166,7 @@ main (int argc, char **argv)
166166

167167
for (idx = 0, lineidx = 0; lineidx < lines; lineidx++)
168168
{
169-
for (col = 0; col < 6 && idx < seg->numsamples; col++)
169+
for (col = 0; col < 6 && (int64_t)idx < seg->numsamples; col++)
170170
{
171171
sptr = (char *)seg->datasamples + (idx * samplesize);
172172

libmseed/extraheaders.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ parse_json (char *jsonstring, size_t length, LM_PARSED_JSON *parsed)
148148
***************************************************************************/
149149
int
150150
mseh_get_ptr_r (const MS3Record *msr, const char *ptr,
151-
void *value, char type, size_t maxlength,
151+
void *value, char type, uint32_t maxlength,
152152
LM_PARSED_JSON **parsestate)
153153
{
154154
LM_PARSED_JSON *parsed = (parsestate) ? *parsestate : NULL;

libmseed/fileutils.c

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -768,6 +768,8 @@ int
768768
ms3_url_useragent (const char *program, const char *version)
769769
{
770770
#if !defined(LIBMSEED_URL)
771+
(void)program; /* Unused */
772+
(void)version; /* Unused */
771773
ms_log (2, "URL support not included in library\n");
772774
return -1;
773775
#else
@@ -796,6 +798,7 @@ int
796798
ms3_url_userpassword (const char *userpassword)
797799
{
798800
#if !defined(LIBMSEED_URL)
801+
(void) userpassword; /* Unused */
799802
ms_log (2, "URL support not included in library\n");
800803
return -1;
801804
#else
@@ -824,6 +827,7 @@ int
824827
ms3_url_addheader (const char *header)
825828
{
826829
#if !defined(LIBMSEED_URL)
830+
(void)header; /* Unused */
827831
ms_log (2, "URL support not included in library\n");
828832
return -1;
829833
#else
@@ -1008,12 +1012,12 @@ mstl3_writemseed (MS3TraceList *mstl, const char *mspath, int8_t overwrite,
10081012
char *
10091013
parse_pathname_range (const char *string, int64_t *start, int64_t *end)
10101014
{
1011-
char startstr[21] = {0}; /* Maximum of 20 digit value */
1012-
char endstr[21] = {0}; /* Maximum of 20 digit value */
1013-
int startdigits = 0;
1014-
int enddigits = 0;
1015-
char *dash = NULL;
1016-
char *at = NULL;
1015+
char startstr[21] = {0}; /* Maximum of 20 digit value */
1016+
char endstr[21] = {0}; /* Maximum of 20 digit value */
1017+
uint8_t startdigits = 0;
1018+
uint8_t enddigits = 0;
1019+
char *dash = NULL;
1020+
char *at = NULL;
10171021
char *ptr;
10181022

10191023
if (!string || (!start || !end))

libmseed/genutils.c

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ static const int monthdays_leap[] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30,
139139
#define VALIDSEC(sec) (sec >= 0 && sec <= 60)
140140

141141
/* Check that a nanosecond is in a valid range */
142-
#define VALIDNANOSEC(nanosec) (nanosec >= 0 && nanosec <= 999999999)
142+
#define VALIDNANOSEC(nanosec) (nanosec <= 999999999)
143143

144144
/** @endcond */
145145

@@ -314,6 +314,7 @@ int
314314
ms_nslc2sid (char *sid, int sidlen, uint16_t flags,
315315
const char *net, const char *sta, const char *loc, const char *chan)
316316
{
317+
(void)flags; /* Unused */
317318
char *sptr = sid;
318319
char xchan[6] = {0};
319320
int needed = 0;
@@ -411,7 +412,7 @@ ms_nslc2sid (char *sid, int sidlen, uint16_t flags,
411412
return -1;
412413
}
413414

414-
return (sptr - sid);
415+
return (int)(sptr - sid);
415416
} /* End of ms_nslc2sid() */
416417

417418
/**********************************************************************/ /**
@@ -1344,7 +1345,7 @@ ms_timestr2nstime (const char *timestr)
13441345
}
13451346
}
13461347

1347-
length = cp - timestr;
1348+
length = (int)(cp - timestr);
13481349

13491350
/* If the time string is all number-like characters assume it is an epoch time.
13501351
* Unless it is 4 characters, which could be a year, unless it starts with a sign. */
@@ -1431,15 +1432,15 @@ nstime_t
14311432
ms_mdtimestr2nstime (const char *timestr)
14321433
{
14331434
int fields;
1434-
int year = 0;
1435-
int mon = 1;
1436-
int mday = 1;
1437-
int yday = 1;
1438-
int hour = 0;
1439-
int min = 0;
1440-
int sec = 0;
1441-
double fsec = 0.0;
1442-
int nsec = 0;
1435+
int year = 0;
1436+
int mon = 1;
1437+
int mday = 1;
1438+
int yday = 1;
1439+
int hour = 0;
1440+
int min = 0;
1441+
int sec = 0;
1442+
double fsec = 0.0;
1443+
uint32_t nsec = 0;
14431444

14441445
if (!timestr)
14451446
{
@@ -1453,7 +1454,7 @@ ms_mdtimestr2nstime (const char *timestr)
14531454
/* Convert fractional seconds to nanoseconds */
14541455
if (fsec != 0.0)
14551456
{
1456-
nsec = (int)(fsec * 1000000000.0 + 0.5);
1457+
nsec = (uint32_t)(fsec * 1000000000.0 + 0.5);
14571458
}
14581459

14591460
if (fields < 1)
@@ -1500,7 +1501,7 @@ ms_mdtimestr2nstime (const char *timestr)
15001501

15011502
if (!VALIDNANOSEC (nsec))
15021503
{
1503-
ms_log (2, "fractional second (%d) is out of range\n", nsec);
1504+
ms_log (2, "fractional second (%u) is out of range\n", nsec);
15041505
return NSTERROR;
15051506
}
15061507

@@ -1539,13 +1540,13 @@ nstime_t
15391540
ms_seedtimestr2nstime (const char *seedtimestr)
15401541
{
15411542
int fields;
1542-
int year = 0;
1543-
int yday = 1;
1544-
int hour = 0;
1545-
int min = 0;
1546-
int sec = 0;
1547-
double fsec = 0.0;
1548-
int nsec = 0;
1543+
int year = 0;
1544+
int yday = 1;
1545+
int hour = 0;
1546+
int min = 0;
1547+
int sec = 0;
1548+
double fsec = 0.0;
1549+
uint32_t nsec = 0;
15491550

15501551
if (!seedtimestr)
15511552
{
@@ -1559,7 +1560,7 @@ ms_seedtimestr2nstime (const char *seedtimestr)
15591560
/* Convert fractional seconds to nanoseconds */
15601561
if (fsec != 0.0)
15611562
{
1562-
nsec = (int)(fsec * 1000000000.0 + 0.5);
1563+
nsec = (uint32_t)(fsec * 1000000000.0 + 0.5);
15631564
}
15641565

15651566
if (fields < 1)
@@ -1600,7 +1601,7 @@ ms_seedtimestr2nstime (const char *seedtimestr)
16001601

16011602
if (!VALIDNANOSEC (nsec))
16021603
{
1603-
ms_log (2, "fractional second (%d) is out of range\n", nsec);
1604+
ms_log (2, "fractional second (%u) is out of range\n", nsec);
16041605
return NSTERROR;
16051606
}
16061607

0 commit comments

Comments
 (0)