Skip to content

Commit 4314359

Browse files
author
chad-iris
committed
Fix small compiler warnings
1 parent b917108 commit 4314359

File tree

6 files changed

+18
-26
lines changed

6 files changed

+18
-26
lines changed

ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2022.087: 2.19.8
2+
- Update numsamples and samplecnt consistently in mst_addmsr(), #33 @pn2200
3+
- Fix small compiler warnings.
4+
15
2022.075: 2.19.7
26
- Avoid braceless multiple statements MS_SWAPBTIME macro usage.
37
- Fix statement macros by @QuLogic. #73

example/msrepack.c

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
* output file.
99
*
1010
* Written by Chad Trabant, IRIS Data Management Center
11-
*
12-
* modified 2012.105
1311
***************************************************************************/
1412

1513
#include <stdio.h>
@@ -18,11 +16,6 @@
1816
#include <time.h>
1917
#include <errno.h>
2018

21-
#ifndef WIN32
22-
#include <signal.h>
23-
static void term_handler (int sig);
24-
#endif
25-
2619
#include <libmseed.h>
2720

2821
#define VERSION "[libmseed " LIBMSEED_VERSION " example]"
@@ -44,7 +37,10 @@ static int convertsamples (MSRecord *msr, int packencoding);
4437
static int parameter_proc (int argcount, char **argvec);
4538
static void record_handler (char *record, int reclen, void *ptr);
4639
static void usage (void);
47-
static void term_handler (int sig);
40+
#ifndef WIN32
41+
#include <signal.h>
42+
static void term_handler (int sig);
43+
#endif
4844

4945
int
5046
main (int argc, char **argv)
@@ -141,7 +137,7 @@ main (int argc, char **argv)
141137

142138
/* Replace network code */
143139
if ( netcode )
144-
strncpy (msr->network, netcode, sizeof(msr->network));
140+
strncpy (msr->network, netcode, sizeof(msr->network) - 1);
145141

146142
/* If no samples in the record just pack the header */
147143
if ( outfile && msr->numsamples == 0 )

example/msview.c

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
* details for each record.
88
*
99
* Written by Chad Trabant, ORFEUS/EC-Project MEREDIAN
10-
*
11-
* modified 2016.233
1210
***************************************************************************/
1311

1412
#include <errno.h>
@@ -17,11 +15,6 @@
1715
#include <string.h>
1816
#include <time.h>
1917

20-
#ifndef WIN32
21-
#include <signal.h>
22-
static void term_handler (int sig);
23-
#endif
24-
2518
#include <libmseed.h>
2619

2720
#define VERSION "[libmseed " LIBMSEED_VERSION " example]"
@@ -36,7 +29,10 @@ static char *inputfile = 0;
3629

3730
static int parameter_proc (int argcount, char **argvec);
3831
static void usage (void);
39-
static void term_handler (int sig);
32+
#ifndef WIN32
33+
#include <signal.h>
34+
static void term_handler (int sig);
35+
#endif
4036

4137
int
4238
main (int argc, char **argv)
@@ -238,7 +234,7 @@ usage (void)
238234
#ifndef WIN32
239235
/***************************************************************************
240236
* term_handler:
241-
* Signal handler routine.
237+
* Signal handler routine.
242238
***************************************************************************/
243239
static void
244240
term_handler (int sig)

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.7"
32-
#define LIBMSEED_RELEASE "2022.075"
31+
#define LIBMSEED_VERSION "2.19.8"
32+
#define LIBMSEED_RELEASE "2022.087"
3333

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

msrutils.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
* Written by Chad Trabant
77
* ORFEUS/EC-Project MEREDIAN
88
* IRIS Data Management Center
9-
*
10-
* modified: 2016.283
119
***************************************************************************/
1210

1311
#include <stdio.h>
@@ -254,7 +252,7 @@ msr_normalize_header (MSRecord *msr, flag verbose)
254252
struct blkt_link_s *cur_blkt;
255253
hptime_t hptimems;
256254
int8_t usecoffset;
257-
char seqnum[11];
255+
char seqnum[16];
258256
int offset = 0;
259257
int blktcnt = 0;
260258
int reclenexp = 0;

pack.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
*
77
* Written by Chad Trabant,
88
* IRIS Data Management Center
9-
*
10-
* modified: 2015.273
119
***************************************************************************/
1210

1311
#include <stdio.h>
@@ -847,7 +845,7 @@ msr_update_header (MSRecord *msr, char *rawrec, flag swapflag,
847845
struct fsdh_s *fsdh;
848846
hptime_t hptimems;
849847
int8_t usecoffset;
850-
char seqnum[11];
848+
char seqnum[16];
851849

852850
if (!msr || !rawrec)
853851
return -1;

0 commit comments

Comments
 (0)