1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788
|
#! /bin/sh /usr/share/dpatch/dpatch-run
## 119-fix-compiler-warnings.dpatch by <kmccarty@debian.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Fix numerous minor compiler warnings. Patch from Harald Vogt,
## DP: 2006-07-20, and Lifeng Sun, 2011-03-18.
@DPATCH@
diff --git a/src/graflib/dzdoc/dzdkern/dzdcod.F b/src/graflib/dzdoc/dzdkern/dzdcod.F
index 31fd498..25d80ff 100644
--- a/src/graflib/dzdoc/dzdkern/dzdcod.F
+++ b/src/graflib/dzdoc/dzdkern/dzdcod.F
@@ -90,7 +90,9 @@
CALL DZDPLN(LUN,' ',99)
ELSE
* do MZBOOKS
- CALL DZDCO1(CHBANK,3,CHOINT,' ',LUN)
+* bad Fortran convention, add dummy IFI,ILI arguments in this case
+ccc CALL DZDCO1(CHBANK,3,CHOINT,' ',LUN)
+ CALL DZDCO1(CHBANK,3,CHOINT,' ',LUN,IFI,ILI)
* finish line with bookings
CALL DZDPLN(LUN,' ',99)
ENDIF
diff --git a/src/graflib/higz/higzcc/gifencode.c b/src/graflib/higz/higzcc/gifencode.c
index cd00c48..dd1bcfb 100644
--- a/src/graflib/higz/higzcc/gifencode.c
+++ b/src/graflib/higz/higzcc/gifencode.c
@@ -12,6 +12,7 @@
/*-- Author : E.Chernyaev 19/01/94*/
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#ifdef __STDC__
#define ARGS(alist) alist
diff --git a/src/graflib/higz/higzcc/imgpickpalette.c b/src/graflib/higz/higzcc/imgpickpalette.c
index 9419d63..0e1f1d1 100644
--- a/src/graflib/higz/higzcc/imgpickpalette.c
+++ b/src/graflib/higz/higzcc/imgpickpalette.c
@@ -30,6 +30,7 @@
#if defined(CERNLIB_GIF)
#include <X11/Xlib.h>
#include <stdio.h>
+#include <stdlib.h>
void CollectImageColors(unsigned long, unsigned long **, int *, int *);
int FindColor(unsigned long, unsigned long *, int);
diff --git a/src/graflib/higz/higzcc/rotated.c b/src/graflib/higz/higzcc/rotated.c
index c291bbd..2ffb186 100644
--- a/src/graflib/higz/higzcc/rotated.c
+++ b/src/graflib/higz/higzcc/rotated.c
@@ -35,7 +35,9 @@
#include <X11/Xutil.h>
#include <X11/Xatom.h>
#include <stdio.h>
+#include <stdlib.h>
#include <math.h>
+#include <string.h>
/* ************************************************************************ *
*
@@ -482,10 +484,10 @@ static int XRotPaintAlignedString(dpy, font, angle, drawable, gc, x, y, text,
/* get a rotated bitmap */
item=XRotRetrieveFromCache(dpy, font, angle, text, align);
- if(item==NULL) return (int)NULL;
+ if(item==NULL) return 0;
/* this gc has similar properties to the user's gc */
- my_gc=XCreateGC(dpy, drawable, NULL, 0);
+ my_gc=XCreateGC(dpy, drawable, 0, NULL);
XCopyGC(dpy, gc, GCForeground|GCBackground|GCFunction|GCPlaneMask,
my_gc);
@@ -549,7 +551,7 @@ static int XRotPaintAlignedString(dpy, font, angle, drawable, gc, x, y, text,
empty_stipple=XCreatePixmap(dpy, drawable, 1, 1, 1);
- depth_one_gc=XCreateGC(dpy, empty_stipple, NULL, 0);
+ depth_one_gc=XCreateGC(dpy, empty_stipple, 0, NULL);
XSetForeground(dpy, depth_one_gc, 0);
XFillRectangle(dpy, empty_stipple, depth_one_gc, 0, 0, 2, 2);
@@ -605,7 +607,7 @@ static int XRotPaintAlignedString(dpy, font, angle, drawable, gc, x, y, text,
item->cols_out, item->rows_out, 1);
/* create a GC */
- depth_one_gc=XCreateGC(dpy, new_bitmap, NULL, 0);
+ depth_one_gc=XCreateGC(dpy, new_bitmap, 0, NULL);
XSetForeground(dpy, depth_one_gc, 1);
XSetBackground(dpy, depth_one_gc, 0);
@@ -705,7 +707,7 @@ static int XRotDrawHorizontalString(dpy, font, drawable, gc, x, y, text,
DEBUG_PRINT1("**\nHorizontal text.\n");
/* this gc has similar properties to the user's gc (including stipple) */
- my_gc=XCreateGC(dpy, drawable, NULL, 0);
+ my_gc=XCreateGC(dpy, drawable, 0, NULL);
XCopyGC(dpy, gc,
GCForeground|GCBackground|GCFunction|GCStipple|GCFillStyle|
GCTileStipXOrigin|GCTileStipYOrigin|GCPlaneMask, my_gc);
@@ -918,7 +920,7 @@ static RotatedTextItem *XRotRetrieveFromCache(dpy, font, angle, text, align)
item->cols_out, item->rows_out, 1);
/* depth one gc */
- depth_one_gc=XCreateGC(dpy, item->bitmap, NULL, 0);
+ depth_one_gc=XCreateGC(dpy, item->bitmap, 0, NULL);
XSetBackground(dpy, depth_one_gc, 0);
XSetForeground(dpy, depth_one_gc, 1);
@@ -1032,7 +1034,7 @@ static RotatedTextItem *XRotCreateTextItem(dpy, font, angle, text, align)
item->cols_in, item->rows_in, 1);
/* create a GC for the bitmap */
- font_gc=XCreateGC(dpy, canvas, NULL, 0);
+ font_gc=XCreateGC(dpy, canvas, 0, NULL);
XSetBackground(dpy, font_gc, 0);
XSetFont(dpy, font_gc, font->fid);
diff --git a/src/graflib/higz/higzcc/x11int.c b/src/graflib/higz/higzcc/x11int.c
index 9a186a0..ac0d20b 100644
--- a/src/graflib/higz/higzcc/x11int.c
+++ b/src/graflib/higz/higzcc/x11int.c
@@ -1172,8 +1172,8 @@ int *flag;
*/
cws->drawing = cws->window;
cws->buffer = (Drawable)NULL;
- cws->double_buffer = (int)NULL;
- cws->clip = (int)NULL;
+ cws->double_buffer = 0;
+ cws->clip = 0;
cws->width = wval;
cws->height = hval;
@@ -1509,7 +1509,7 @@ Drawable *pix;
void
ixclsds()
{
- int Motif = (int)NULL;
+ int Motif = 0;
int i;
if (display == NULL) return;
@@ -1529,12 +1529,12 @@ void
for ( i = 0; i < MAXCOL; i++ ) {
if( colors[i].defined == 1 ) {
colors[i].defined = 0;
- XFreeColors(display, colormap, &colors[i].pixel, 1, (int)NULL);
+ XFreeColors(display, colormap, &colors[i].pixel, 1, 0);
}
}
#if !defined(CERNLIB_TK_WINDOWS)
- if(display != NULL && Motif == (int)NULL) XCloseDisplay( display );
+ if(display != NULL && Motif == 0) XCloseDisplay( display );
#endif
display = NULL;
cws = NULL;
@@ -1567,7 +1567,7 @@ void
XFlush( display );
- cws->open = (int)NULL;
+ cws->open = 0;
for( wid = 0; wid < MAXWN; wid++ )
if( windows[wid].open ) {
@@ -1886,7 +1886,7 @@ int *wid;
int i;
tws = &windows[*wid];
- tws->clip = (int)NULL;
+ tws->clip = 0;
for( i = 0; i < MAXGC; i++ )
XSetClipMask( display, gclist[i], None );
@@ -1916,9 +1916,9 @@ float *r, *g, *b;
xcol.flags = DoRed || DoGreen || DoBlue;
if( colors[*cindex].defined == 1 ) {
colors[*cindex].defined = 0;
- XFreeColors(display, colormap, &colors[*cindex].pixel, 1, (int)NULL);
+ XFreeColors(display, colormap, &colors[*cindex].pixel, 1, 0);
}
- if( XAllocColor( display, colormap, &xcol ) != (Status)NULL ) {
+ if( XAllocColor( display, colormap, &xcol ) != (Status)0 ) {
colors[*cindex].defined = 1;
colors[*cindex].pixel = xcol.pixel;
colors[*cindex].red = *r;
diff --git a/src/packlib/cspack/sysreq/log.c b/src/packlib/cspack/sysreq/log.c
index e7bc025..2dac5d2 100644
--- a/src/packlib/cspack/sysreq/log.c
+++ b/src/packlib/cspack/sysreq/log.c
@@ -31,6 +31,7 @@ Hemmer";
#include <stdio.h> /* standard input/output definitions */
#if !defined(vms)
#include <fcntl.h> /* file control */
+#include <string.h> /* string manipulation functions */
#else
#include <stdlib.h> /* general utility definitions */
#include <unixio.h> /* VMS's unix-emulation I/O */
diff --git a/src/packlib/cspack/sysreq/netreq.c b/src/packlib/cspack/sysreq/netreq.c
index 0d0e06e..29aa17e 100644
--- a/src/packlib/cspack/sysreq/netreq.c
+++ b/src/packlib/cspack/sysreq/netreq.c
@@ -25,6 +25,7 @@ static char sccsid[] = "@(#)netreq.c 1.18 10/14/94 CERN CN-PDP/CS F. Hemmer";
#include <netinet/in.h> /* Internet data types */
#include <arpa/inet.h> /* Arpa internet routines */
#include <stdio.h> /* Standard Input/Output */
+#include <string.h> /* string manipulation functions */
#if defined(vms)
#include <pwd_vms.h>
#else
diff --git a/src/packlib/cspack/sysreq/serror.c b/src/packlib/cspack/sysreq/serror.c
index 3667c42..0df67f0 100644
--- a/src/packlib/cspack/sysreq/serror.c
+++ b/src/packlib/cspack/sysreq/serror.c
@@ -177,7 +177,7 @@ int n;
else {
#if !defined(vms)
if ((n>0) && (n<sys_nerr)) {
- return(sys_errlist[n]);
+ return((char*)sys_errlist[n]);
}
else {
(void) sprintf(buf,"%s: %d\n",
diff --git a/src/packlib/cspack/sysreq/socket.c b/src/packlib/cspack/sysreq/socket.c
index ceb5bd6..ff9c01d 100644
--- a/src/packlib/cspack/sysreq/socket.c
+++ b/src/packlib/cspack/sysreq/socket.c
@@ -144,7 +144,10 @@ static int rtimeout=READTIMEOUTVALUE;
#include <errno.h>
#include <setjmp.h>
#include <signal.h>
+
+#if !defined(linux)
extern char* malloc();
+#endif /* linux */
#if defined(vms)
#if defined(TWG) && (TWG == 1)
@@ -412,7 +415,7 @@ char *
s_errmsg() /* return last error message */
{
#if !defined(vms)
- return(sys_errlist[errno]);
+ return((char*)sys_errlist[errno]);
#else /* vms */
#if defined(MULTINET) && (MULTINET == 1)
return(vms_errno_string());
diff --git a/src/packlib/cspack/sysreq/sysreq.h b/src/packlib/cspack/sysreq/sysreq.h
index b501e3f..661a829 100644
--- a/src/packlib/cspack/sysreq/sysreq.h
+++ b/src/packlib/cspack/sysreq/sysreq.h
@@ -88,7 +88,7 @@ typedef struct { /* SYSREQ reply header */
*/
#ifndef VM
-extern char *malloc(); /* Memory allocation */
+#include <stdlib.h> /* standard C library defs */
#endif /* VM */
extern char *getenv(); /* Get environment info */
diff --git a/src/packlib/cspack/sysreq/xdr.c b/src/packlib/cspack/sysreq/xdr.c
index f22ef78..742943f 100644
--- a/src/packlib/cspack/sysreq/xdr.c
+++ b/src/packlib/cspack/sysreq/xdr.c
@@ -52,7 +52,7 @@ Hemmer";
#endif /* min */
#ifndef VM
-extern char *malloc();
+#include <stdlib.h> /* standard C library defs */
#endif /* VM */
#ifdef VM
diff --git a/src/packlib/cspack/tcpaw/Imakefile b/src/packlib/cspack/tcpaw/Imakefile
index 2a52b5c..5b519d4 100644
--- a/src/packlib/cspack/tcpaw/Imakefile
+++ b/src/packlib/cspack/tcpaw/Imakefile
@@ -49,4 +49,9 @@ DEFINES:= $(DEFINES) -DDECC
#endif
#endif
+#if defined(CERNLIB_LINUX) && defined(__GNUC__)
+ /* This is to avoid warnings in code not used for linux */
+CCOPTIONS+=-trigraphs
+#endif
+
SubdirLibraryTarget(NullParameter,NullParameter)
diff --git a/src/packlib/cspack/tcpaw/tcpaw.c b/src/packlib/cspack/tcpaw/tcpaw.c
index 579fc75..5b835d6 100644
--- a/src/packlib/cspack/tcpaw/tcpaw.c
+++ b/src/packlib/cspack/tcpaw/tcpaw.c
@@ -307,6 +307,7 @@
#ifndef IBMRT
/* this is a kludge, one ought to fix the "prototypes" in this file */
#include <string.h>
+#include <stdlib.h> /* needed for linux gcc4 */
#endif /* IBMRT */
#endif /* WIN32 */
#endif /* IBM */
@@ -487,7 +488,7 @@ int *out;
#endif /* VMS */
#ifdef AUTHENT
- unsigned char idbuf[100];
+ char idbuf[100];
char usbuf[20], pwbuf[20];
char *user = usbuf, *passwd = pwbuf;
register int i, len;
@@ -496,7 +497,7 @@ int *out;
#ifdef SOCKETS
struct hostent *hp; /* host info for remote host */
struct sockaddr_in peeraddr_in; /* for peer socket address */
- int peerlen;
+ unsigned peerlen;
#endif /* SOCKETS */
#ifdef WIN32
@@ -530,7 +531,7 @@ int *out;
#ifdef SOCKETS
memset ((char *)&peeraddr_in, 0, sizeof(struct sockaddr_in));
peerlen = sizeof(peeraddr_in);
- if (getpeername(s, &peeraddr_in, &peerlen) == SOCKET_ERROR) {
+ if (getpeername(s, (struct sockaddr *)&peeraddr_in, &peerlen) == SOCKET_ERROR) {
#ifdef LOGFILE
fprintf(logfile, "%s: getpeername failed\n", Prog_Name);
#endif /* LOGFILE */
@@ -667,7 +668,7 @@ int ssetup(isock, osock) /* OS9 */
SOCKET *isock, *osock;
{
#ifdef AUTHENT
- unsigned char idbuf[100];
+ char idbuf[100];
char usbuf[20], pwbuf[20];
char *user = usbuf, *passwd = pwbuf;
register int i, len;
@@ -736,7 +737,7 @@ int *port; /* VM */
unsigned short sport = *port; /* VM */
#if defined ( _WIN32) && defined (AUTHENT)
- unsigned char idbuf[100];
+ char idbuf[100];
char usbuf[20], pwbuf[20];
char *user = usbuf, *passwd = pwbuf;
register int i, len;
@@ -809,7 +810,7 @@ int *port; /* VM */
}
#endif
/* Bind the listen address to the socket. */
- if (bind(ls, &myaddr_in, sizeof(struct sockaddr_in)) == SOCKET_ERROR) {
+ if (bind(ls, (struct sockaddr *)&myaddr_in, sizeof(struct sockaddr_in)) == SOCKET_ERROR) {
#if defined(IBM) || defined(_WIN32)
tcperror("server_sock_setup: bind(ls,...)");
#else
@@ -838,7 +839,7 @@ int *port; /* VM */
exit(1);
}
addrlen = sizeof(struct sockaddr_in);
- s = accept(ls, &peeraddr_in, &addrlen);
+ s = accept(ls, (struct sockaddr *)&peeraddr_in, (socklen_t *)&addrlen);
if ( s == INVALID_SOCKET) {
fprintf(stderr, "%s: accept error\n", "server_sock_setup");
return(-1);
@@ -993,7 +994,7 @@ char *srvc;
char *user = NULL, *passwd = NULL;
int port;
#if defined(AUTHENT)
- unsigned char idbuf[100];
+ char idbuf[100];
#endif /* AUTHENT */
#ifdef VMS
@@ -1299,7 +1300,7 @@ vmagain:
/* Try to connect to the remote server at the address
* which was just built into peeraddr.
*/
- if (connect(s, &peeraddr_in, sizeof(struct sockaddr_in)) == SOCKET_ERROR) {
+ if (connect(s, (struct sockaddr *)&peeraddr_in, sizeof(struct sockaddr_in)) == SOCKET_ERROR) {
#ifndef _WIN32
close(s);
#else
@@ -1322,7 +1323,7 @@ vmagain:
}
addrlen = sizeof(struct sockaddr_in);
- if (getsockname(s, &myaddr_in, &addrlen) == SOCKET_ERROR) {
+ if (getsockname(s, (struct sockaddr *)&myaddr_in, (socklen_t *)&addrlen) == SOCKET_ERROR) {
#if defined(IBM) || defined(_WIN32)
tcperror("client_sock_setup");
#else
@@ -2714,7 +2715,7 @@ retry:
((struct in_addr *)(hp->h_addr))->s_addr;
/* bcopy(hp->h_addr, (caddr_t)&sin.sin_addr, hp->h_length); */
}
- if (connect(s, &sin, sizeof(struct sockaddr_in)) == SOCKET_ERROR ) {
+ if (connect(s, (struct sockaddr *)&sin, sizeof(struct sockaddr_in)) == SOCKET_ERROR ) {
#ifndef _WIN32
if (errno == ECONNREFUSED && timo <= 16) {
(void) close(s);
@@ -3378,7 +3379,7 @@ retry:
((struct in_addr *)(hp->h_addr))->s_addr;
/* bcopy(hp->h_addr, (caddr_t)&sin.sin_addr, hp->h_length); */
}
- if (connect(s, &sin, sizeof(struct sockaddr_in)) == SOCKET_ERROR) {
+ if (connect(s, (struct sockaddr *)&sin, sizeof(struct sockaddr_in)) == SOCKET_ERROR) {
#ifndef WIN32
if (errno == ECONNREFUSED && timo <= 16) {
(void) close(s);
@@ -3512,7 +3513,7 @@ bad:
}
getstr(sock,buf, cnt, errmesg)
-int *sock;
+int sock;
char *buf;
int cnt; /* sizeof() the char array */
char *errmesg; /* in case error message required */
diff --git a/src/packlib/fatmen/fmc/faexit.c b/src/packlib/fatmen/fmc/faexit.c
index f65be80..cfaf808 100644
--- a/src/packlib/fatmen/fmc/faexit.c
+++ b/src/packlib/fatmen/fmc/faexit.c
@@ -27,6 +27,7 @@
void faexit(icode)
#endif
#if defined(CERNLIB_QX_SC)
+#include <stdlib.h> /* standard C library defs */
void faexit_(icode)
#endif
int *icode;
diff --git a/src/packlib/kernlib/kernbit/z268/systems.c b/src/packlib/kernlib/kernbit/z268/systems.c
index 9845945..24af735 100644
--- a/src/packlib/kernlib/kernbit/z268/systems.c
+++ b/src/packlib/kernlib/kernbit/z268/systems.c
@@ -134,7 +134,7 @@ int *ovflw;
#endif /* hpux */
if ( (ps=(FILE *)popen(command,"r"))==NULL ) {
- fprintf(stderr,"systems(): popen(): %s\n",sys_errlist[errno] );
+ fprintf(stderr,"systems(): popen(): %s\n",strerror(errno));
*rc= -errno;
*chars=0 ;
*l=0 ;
@@ -144,7 +144,7 @@ int *ovflw;
rcode = fread(buf, 1, buflen , ps );
if ( rcode < 0 ) {
fprintf(stderr,"systems(): pipe fread(): %s\n",
- sys_errlist[errno] );
+ strerror(errno));
buf[0]='\n';
*rc= -errno;
*chars=0 ;
diff --git a/src/packlib/kernlib/kerngen/ccgen/abend.c b/src/packlib/kernlib/kerngen/ccgen/abend.c
index ef20498..80b1145 100644
--- a/src/packlib/kernlib/kerngen/ccgen/abend.c
+++ b/src/packlib/kernlib/kerngen/ccgen/abend.c
@@ -19,6 +19,7 @@
CERN PROGLIB# Z035 ABEND .VERSION KERNFOR 4.31 911111
*/
#if defined(CERNLIB_QX_SC)
+#include <stdlib.h>
void type_of_call abend_()
#endif
#if defined(CERNLIB_QXNO_SC)
diff --git a/src/packlib/kernlib/kerngen/ccgen/accesi.c b/src/packlib/kernlib/kerngen/ccgen/accesi.c
index 38c0b9e..52f4484 100644
--- a/src/packlib/kernlib/kerngen/ccgen/accesi.c
+++ b/src/packlib/kernlib/kerngen/ccgen/accesi.c
@@ -40,6 +40,7 @@
file can be searched and the file exists.
*/
#include <stdio.h>
+#include <stdlib.h>
#include "kerngen/fortchar.h"
#if defined(CERNLIB_QX_SC)
int type_of_call accesi_(fname, mode, lgname)
diff --git a/src/packlib/kernlib/kerngen/ccgen/chdiri.c b/src/packlib/kernlib/kerngen/ccgen/chdiri.c
index 0934113..293ab21 100644
--- a/src/packlib/kernlib/kerngen/ccgen/chdiri.c
+++ b/src/packlib/kernlib/kerngen/ccgen/chdiri.c
@@ -29,6 +29,7 @@
ISTAT returns zero if successful
*/
#include <stdio.h>
+#include <stdlib.h>
#ifdef WIN32
#include <direct.h>
# ifndef chdir
diff --git a/src/packlib/kernlib/kerngen/ccgen/ctimef.c b/src/packlib/kernlib/kerngen/ccgen/ctimef.c
index da36e10..3d3ffc8 100644
--- a/src/packlib/kernlib/kerngen/ccgen/ctimef.c
+++ b/src/packlib/kernlib/kerngen/ccgen/ctimef.c
@@ -24,6 +24,8 @@
STIME decoded time string of length 24 (CHARACTER*24 STIME)
*/
#if defined(CERNLIB_QX_SC)
+#include <stdlib.h>
+#include <string.h>
void type_of_call ctimef_(clock, stime)
#endif
#if defined(CERNLIB_QXNO_SC)
diff --git a/src/packlib/kernlib/kerngen/ccgen/exitf.c b/src/packlib/kernlib/kerngen/ccgen/exitf.c
index 32a2545..53537bb 100644
--- a/src/packlib/kernlib/kerngen/ccgen/exitf.c
+++ b/src/packlib/kernlib/kerngen/ccgen/exitf.c
@@ -19,6 +19,7 @@
CERN PROGLIB# Z035 EXITF .VERSION KERNFOR 4.39 940228
*/
#if defined(CERNLIB_QX_SC)
+#include <stdlib.h>
void type_of_call exitf_(st)
#endif
#if defined(CERNLIB_QXNO_SC)
diff --git a/src/packlib/kernlib/kerngen/ccgen/geteni.c b/src/packlib/kernlib/kerngen/ccgen/geteni.c
index 3bc009e..956f250 100644
--- a/src/packlib/kernlib/kerngen/ccgen/geteni.c
+++ b/src/packlib/kernlib/kerngen/ccgen/geteni.c
@@ -30,6 +30,7 @@
ISLATE(1) returns its length
*/
#include <stdio.h>
+#include <stdlib.h>
#include "kerngen/fortchar.h"
#if defined(CERNLIB_QX_SC)
void type_of_call geteni_(fname, ftext, lgtext, lgname)
diff --git a/src/packlib/kernlib/kerngen/ccgen/getwdi.c b/src/packlib/kernlib/kerngen/ccgen/getwdi.c
index f2d3934..e295558 100644
--- a/src/packlib/kernlib/kerngen/ccgen/getwdi.c
+++ b/src/packlib/kernlib/kerngen/ccgen/getwdi.c
@@ -29,6 +29,7 @@
ISLATE(1) returns its lenth NTEXT
*/
#include <stdio.h>
+#include <stdlib.h>
#ifdef WIN32
#include <direct.h>
# ifndef getcwd
@@ -58,7 +59,7 @@ void type_of_call getwdi(fname, lgname)
#endif
int *lgname;
{
- char *malloc();
+/* char *malloc(); - see above "#include <stdlib.h>" */
char *ptalc, *pttext;
int fchput();
int nalc;
diff --git a/src/packlib/kernlib/kerngen/ccgen/lstati.c b/src/packlib/kernlib/kerngen/ccgen/lstati.c
index af48dce..47b1f60 100644
--- a/src/packlib/kernlib/kerngen/ccgen/lstati.c
+++ b/src/packlib/kernlib/kerngen/ccgen/lstati.c
@@ -26,6 +26,7 @@ C ORIG. 24/03/91, RDM + JZ
Fortran interface routine to lstat
*/
#include <stdio.h>
+#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "kerngen/fortchar.h"
@@ -56,7 +57,7 @@ int LSTATI(fname, info, lgname, slate)
ptname = fchtak(fname,*lgname);
if (ptname == NULL) goto out1;
- buf = (struct stat *) malloc(sizeof (struct stat));
+ buf = malloc(sizeof (struct stat));
if (buf == NULL) goto out2;
istat = lstat(ptname, buf);
diff --git a/src/packlib/kernlib/kerngen/ccgen/perroi.c b/src/packlib/kernlib/kerngen/ccgen/perroi.c
index 38563e3..f656da9 100644
--- a/src/packlib/kernlib/kerngen/ccgen/perroi.c
+++ b/src/packlib/kernlib/kerngen/ccgen/perroi.c
@@ -28,6 +28,7 @@
TEXT the text to be printed before the error message
*/
#include <stdio.h>
+#include <stdlib.h>
#include "kerngen/fortchar.h"
#if defined(CERNLIB_QX_SC)
void type_of_call perroi_(ftext, lgtext)
diff --git a/src/packlib/kernlib/kerngen/ccgen/readlni.c b/src/packlib/kernlib/kerngen/ccgen/readlni.c
index 2fec638..5d7d776 100644
--- a/src/packlib/kernlib/kerngen/ccgen/readlni.c
+++ b/src/packlib/kernlib/kerngen/ccgen/readlni.c
@@ -27,6 +27,7 @@
NCH returns the length of the value
*/
#include <stdio.h>
+#include <stdlib.h>
#include "kerngen/fortchar.h"
#if defined(CERNLIB_QX_SC)
int type_of_call readlni_(fname, ftext, lgtext, lgname)
diff --git a/src/packlib/kernlib/kerngen/ccgen/renami.c b/src/packlib/kernlib/kerngen/ccgen/renami.c
index 9447854..59bb1e1 100644
--- a/src/packlib/kernlib/kerngen/ccgen/renami.c
+++ b/src/packlib/kernlib/kerngen/ccgen/renami.c
@@ -27,6 +27,7 @@
ISTAT zero if successful
*/
#include <stdio.h>
+#include <stdlib.h>
#include "kerngen/fortchar.h"
#if defined(CERNLIB_QX_SC)
int type_of_call renami_(frpath, topath, lgfr, lgto)
diff --git a/src/packlib/kernlib/kerngen/ccgen/setenvsy5.c b/src/packlib/kernlib/kerngen/ccgen/setenvsy5.c
index 5a740b6..fc00519 100644
--- a/src/packlib/kernlib/kerngen/ccgen/setenvsy5.c
+++ b/src/packlib/kernlib/kerngen/ccgen/setenvsy5.c
@@ -23,6 +23,7 @@
TEXT the value to be assigned
*/
#include <stdio.h>
+#include <stdlib.h>
#include "kerngen/fortchar.h"
#include "kerngen/fortranc.h"
diff --git a/src/packlib/kernlib/kerngen/ccgen/sigprnt.c b/src/packlib/kernlib/kerngen/ccgen/sigprnt.c
index 67e4c1a..12c7ff2 100644
--- a/src/packlib/kernlib/kerngen/ccgen/sigprnt.c
+++ b/src/packlib/kernlib/kerngen/ccgen/sigprnt.c
@@ -34,7 +34,7 @@ void type_of_call SIGPRNT()
#ifndef CERNLIB_WINNT
sigset_t oldmask;
- sigprocmask (NULL, NULL, &oldmask);
+ sigprocmask ( 0, NULL, &oldmask);
printf (" blocked signals are: %x\n", oldmask);
#else
diff --git a/src/packlib/kernlib/kerngen/ccgen/stati.c b/src/packlib/kernlib/kerngen/ccgen/stati.c
index 4595bd6..87ed227 100644
--- a/src/packlib/kernlib/kerngen/ccgen/stati.c
+++ b/src/packlib/kernlib/kerngen/ccgen/stati.c
@@ -26,6 +26,7 @@ C ORIG. 14/03/91, RDM
Fortran interface routine to stat
*/
#include <stdio.h>
+#include <stdlib.h>
#if defined(CERNLIB_QMVAX)||defined(CERNLIB_QMOS9)
#include <types.h>
#include <stat.h>
@@ -72,7 +73,7 @@ int type_of_call stati(fname, info, lgname)
if (ptname == NULL) goto out1;
#ifndef WIN32
- buf = (struct stat *) malloc(sizeof (struct stat));
+ buf = malloc(sizeof (struct stat));
#else
buf = (struct _stat *) malloc(sizeof (struct _stat));
#endif
diff --git a/src/packlib/kernlib/kerngen/ccgen/systei.c b/src/packlib/kernlib/kerngen/ccgen/systei.c
index 7498487..6ee89e9 100644
--- a/src/packlib/kernlib/kerngen/ccgen/systei.c
+++ b/src/packlib/kernlib/kerngen/ccgen/systei.c
@@ -29,6 +29,7 @@
ISTAT returns zero if successful
*/
#include <stdio.h>
+#include <stdlib.h>
#include "kerngen/fortchar.h"
#if defined(CERNLIB_QX_SC)
diff --git a/src/packlib/kernlib/kerngen/ccgen/timel.c b/src/packlib/kernlib/kerngen/ccgen/timel.c
index 6e7085a..79e2276 100644
--- a/src/packlib/kernlib/kerngen/ccgen/timel.c
+++ b/src/packlib/kernlib/kerngen/ccgen/timel.c
@@ -30,6 +30,7 @@
#include <sys/param.h>
#include <sys/time.h>
#include <sys/resource.h>
+#include <unistd.h> /* For ia64... */
#ifndef CLOCKS_PER_SEC
#define CLOCKS_PER_SEC CLK_TCK
diff --git a/src/packlib/kernlib/kerngen/ccgen/unlini.c b/src/packlib/kernlib/kerngen/ccgen/unlini.c
index f7b187d..45de871 100644
--- a/src/packlib/kernlib/kerngen/ccgen/unlini.c
+++ b/src/packlib/kernlib/kerngen/ccgen/unlini.c
@@ -29,6 +29,7 @@
ISTAT returns zero if successful
*/
#include <stdio.h>
+#include <stdlib.h>
#include "kerngen/fortchar.h"
#if defined(CERNLIB_QX_SC)
int type_of_call unlini_(fname,lgname)
diff --git a/src/packlib/kernlib/kerngen/ccgencf/cfopei.c b/src/packlib/kernlib/kerngen/ccgencf/cfopei.c
index e554034..f718d91 100644
--- a/src/packlib/kernlib/kerngen/ccgencf/cfopei.c
+++ b/src/packlib/kernlib/kerngen/ccgencf/cfopei.c
@@ -45,6 +45,7 @@
*/
#include "kerngen/cf_open.h"
#include <errno.h>
+#include <stdlib.h>
#include "kerngen/cf_xaft.h"
#include "kerngen/fortchar.h"
#include "kerngen/wordsizc.h"
diff --git a/src/packlib/kernlib/kerngen/ccgenci/ciopei.c b/src/packlib/kernlib/kerngen/ccgenci/ciopei.c
index 9729f30..ef7ff72 100644
--- a/src/packlib/kernlib/kerngen/ccgenci/ciopei.c
+++ b/src/packlib/kernlib/kerngen/ccgenci/ciopei.c
@@ -38,9 +38,8 @@
#include "kerngen/cf_open.h"
#ifndef WIN32
# include <errno.h>
-#else
-# include <stdlib.h>
#endif
+#include <stdlib.h>
#include "kerngen/cf_xaft.h"
#include "kerngen/fortchar.h"
int ciopen_perm = 0;
diff --git a/src/packlib/kernlib/kerngen/ccgenu/fchtak.c b/src/packlib/kernlib/kerngen/ccgenu/fchtak.c
index bdb1af8..f9dc666 100644
--- a/src/packlib/kernlib/kerngen/ccgenu/fchtak.c
+++ b/src/packlib/kernlib/kerngen/ccgenu/fchtak.c
@@ -16,6 +16,7 @@
return the memory pointer
*/
#include <stdio.h>
+#include <stdlib.h>
#include "kerngen/fortchar.h"
char *fchtak(ftext,lgtext)
#if defined(CERNLIB_QMCRY)
@@ -26,7 +27,7 @@ char *fchtak(ftext,lgtext)
#endif
int lgtext;
{
- char *malloc();
+ /* char *malloc(); - see above "#include <stdlib.h>" */
char *ptalc, *ptuse;
char *utext;
int nalc;
diff --git a/src/packlib/kuip/code_kuip/getline.c b/src/packlib/kuip/code_kuip/getline.c
index 8bc4d73..cb07af0 100644
--- a/src/packlib/kuip/code_kuip/getline.c
+++ b/src/packlib/kuip/code_kuip/getline.c
@@ -585,7 +585,7 @@ int c;
static void
gl_puts(buf)
-char *buf;
+const char *buf;
{
/*
int len = strlen(buf);
@@ -1351,7 +1351,7 @@ static char *
static char *
hist_save(p)
-char *p;
+const char *p;
/* makes a copy of the string */
{
char *s;
diff --git a/src/packlib/kuip/code_motif/iconwidget.c b/src/packlib/kuip/code_motif/iconwidget.c
index f454574..be0c44e 100644
--- a/src/packlib/kuip/code_motif/iconwidget.c
+++ b/src/packlib/kuip/code_motif/iconwidget.c
@@ -289,7 +289,7 @@ static void DrawShadow (iw, really)
Boolean in = (iw->icon.armed && really) ||
iw->icon.shadow_type == XmSHADOW_IN;
- if ((iw->primitive.shadow_thickness) > 0 && XtIsRealized (iw)) {
+ if ((iw->primitive.shadow_thickness) > 0 && XtIsRealized ((Widget)iw)) {
_XmDrawShadow (XtDisplay (iw), XtWindow (iw),
in ? iw->primitive.bottom_shadow_GC :
iw->primitive.top_shadow_GC,
@@ -377,7 +377,7 @@ static void Enter (iw, event)
#endif
if (iw->icon.armed)
- DrawShadow ((Widget) iw, True);
+ DrawShadow (iw, True);
}
/************************************************************************
diff --git a/src/packlib/zebra/test/fqtest/fqnameda.inc b/src/packlib/zebra/test/fqtest/fqnameda.inc
index 022da36..66b6b9c 100644
--- a/src/packlib/zebra/test/fqtest/fqnameda.inc
+++ b/src/packlib/zebra/test/fqtest/fqnameda.inc
@@ -17,5 +17,5 @@
#elif defined(CERNLIB_QMIBMD)
DATA FQNAME / '/ZXTEST DAT1', '/ZXTEST DAT2', '/ZXTEST DAT3' /
#elif 1
- DATA FQNAME / 'zxtest1.dat ', 'zxtest2.dat ', 'zxtest3.dat ' /
+ DATA FQNAME / 'zxtest1.dat ', 'zxtest2.dat ', 'zxtest3.dat ' /
#endif
|