Skip to content

Commit 521f560

Browse files
committed
compilation
1 parent 9b223c7 commit 521f560

File tree

5 files changed

+13
-7
lines changed

5 files changed

+13
-7
lines changed

pens/main/gdpen.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ static AVCodecContext *codec_ctx = NULL;
6666
static AVFrame *mpeg_frame = NULL;
6767
#if LIBAVCODEC_VERSION_MAJOR >= 54
6868
static AVPacket mpeg_pkt;
69+
static AVPacket *mpeg_pnt = NULL;
6970
static int mpeg_gout;
7071
#else
7172
static int frame_out_size;
@@ -529,14 +530,18 @@ static void ffmpeg_write (void) {
529530
frame_out_size = avcodec_encode_video (codec_ctx, frame_outbuf,
530531
frame_outbuf_size, mpeg_frame);
531532
fwrite (frame_outbuf, 1, frame_out_size, pltout);
532-
#else
533+
#else
534+
#if LIBAVCODEC_VERSION_MAJOR < 58
533535
av_init_packet (&mpeg_pkt);
534536
mpeg_pkt.data = NULL;
535537
mpeg_pkt.size = 0;
536-
#if LIBAVCODEC_VERSION_MAJOR < 58
537538
if (avcodec_encode_video2 (codec_ctx, &mpeg_pkt, mpeg_frame, &mpeg_gout) < 0)
538539
ERR (FATAL, name, "MPEG encoding error\n");
539540
#else
541+
mpeg_pnt = av_packet_alloc();
542+
mpeg_pkt = *mpeg_pnt;
543+
mpeg_pkt.data = NULL;
544+
mpeg_pkt.size = 0;
540545
if (avcodec_send_frame(codec_ctx, mpeg_frame) < 0)
541546
ERR (FATAL, name, "MPEG send frame error\n");
542547
mpeg_gout = avcodec_receive_packet(codec_ctx, &mpeg_pkt);

pens/main/xtpen.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1282,7 +1282,7 @@ void actionGoto(Widget w, XEvent *ev, String *p, Cardinal *np)
12821282
void set_mode_label(const char *newlab)
12831283
{
12841284
Arg arg[1];
1285-
char text[32];
1285+
char text[33];
12861286

12871287
if( wantLabels ){
12881288
strncpy( text, newlab, 32 );

system/main/mpi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ int main(int argc, char* argv[])
5252
commands = sf_split(inp,axis,nodes,&jobs,ndim,n,argc,argv);
5353

5454
for (job=0; job < jobs; job++) {
55-
strncpy(cmdline,commands[job],SF_CMDLEN);
55+
memcpy(cmdline,commands[job],SF_CMDLEN);
5656
MPI_Send(cmdline, SF_CMDLEN, MPI_CHAR, job+1, 0, MPI_COMM_WORLD);
5757
}
5858

system/main/rtoc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ int main(int argc, char* argv[])
5555
cformat = sf_charalloc(strlen(rformat)+1
5656
-strlen("float")
5757
+strlen("complex"));
58-
strncpy(cformat,rformat,strlen(rformat));
58+
memcpy(cformat,rformat,strlen(rformat));
5959
strcpy(strstr(cformat,"float"),"complex");
6060
sf_setformat(cmplx,cformat);
6161

system/seismic/Msegywrite.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ int main(int argc, char *argv[])
4141
" http://www.ahay.org/"};
4242
sf_file in=NULL, hdr=NULL;
4343
size_t nsegy;
44-
int format=1, i, ns, nk, itr, ntr, *itrace=NULL;
44+
unsigned int i;
45+
int format=1, ns, nk, itr, ntr, *itrace=NULL;
4546
FILE *head=NULL, *file=NULL;
4647
float *ftrace=NULL, dt, t0;
4748

@@ -96,7 +97,7 @@ int main(int argc, char *argv[])
9697
} else {
9798
for (i=0; i < SF_EBCBYTES/80; i++) {
9899
snprintf(count,4,"C%-2d",i+1);
99-
snprintf(ahead+i*80,81,"%s %-76s\n",count,
100+
snprintf(ahead+i*80,82,"%s %-76s\n",count,
100101
(i < 3)? myheader[i]:"");
101102
}
102103
if (verbose) sf_warning("ASCII header created on the fly");

0 commit comments

Comments
 (0)