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
|
Author: Andreas Beckmann <anbe@debian.org>
Description: fix building with GCC 15
--- a/alloc.c
+++ b/alloc.c
@@ -26,9 +26,10 @@ unsigned int n;
return x;
}
-void alloc_free(x)
-char *x;
+void alloc_free(xx)
+void *xx;
{
+ char *x = xx;
if (x >= space)
if (x < space + SPACE)
return; /* XXX: assuming that pointers are flat */
--- a/alloc.h
+++ b/alloc.h
@@ -1,8 +1,8 @@
#ifndef ALLOC_H
#define ALLOC_H
-extern /*@null@*//*@out@*/char *alloc();
-extern void alloc_free();
-extern int alloc_re();
+extern /*@null@*//*@out@*/char *alloc(unsigned int);
+extern void alloc_free(void *);
+extern int alloc_re(char **, unsigned int, unsigned int);
#endif
--- a/byte.h
+++ b/byte.h
@@ -1,11 +1,11 @@
#ifndef BYTE_H
#define BYTE_H
-extern unsigned int byte_chr();
+extern unsigned int byte_chr(char *, unsigned int, int);
extern unsigned int byte_rchr();
-extern void byte_copy();
-extern void byte_copyr();
-extern int byte_diff();
+extern void byte_copy(void *, unsigned int, void *);
+extern void byte_copyr(char *, unsigned int, char *);
+extern int byte_diff(char *, unsigned int, char *);
extern void byte_zero();
#define byte_equal(s,n,t) (!byte_diff((s),(n),(t)))
--- a/byte_copy.c
+++ b/byte_copy.c
@@ -1,10 +1,12 @@
#include "byte.h"
-void byte_copy(to,n,from)
-register char *to;
+void byte_copy(xto,n,xfrom)
+register void *xto;
register unsigned int n;
-register char *from;
+register void *xfrom;
{
+ char *from = xfrom;
+ char *to = xto;
for (;;) {
if (!n) return; *to++ = *from++; --n;
if (!n) return; *to++ = *from++; --n;
--- a/case.h
+++ b/case.h
@@ -2,7 +2,7 @@
#define CASE_H
extern void case_lowers();
-extern void case_lowerb();
+extern void case_lowerb(char *, unsigned int);
extern int case_diffs();
extern int case_diffb();
extern int case_starts();
--- a/cdb.h
+++ b/cdb.h
@@ -4,10 +4,10 @@
#include <unistd.h>
#include "uint32.h"
-extern uint32 cdb_hash();
-extern uint32 cdb_unpack();
+extern uint32 cdb_hash(unsigned char *, unsigned int);
+extern uint32 cdb_unpack(unsigned char *);
-extern int cdb_bread();
-extern int cdb_seek();
+extern int cdb_bread(int, char *, int);
+extern int cdb_seek(int, char *, unsigned int, uint32 *);
#endif
--- a/cdbmake.h
+++ b/cdbmake.h
@@ -23,13 +23,15 @@ struct cdbmake {
uint32 numentries;
} ;
-extern void cdbmake_pack();
+typedef char *(*cdbmake_alloc_cb)(unsigned int);
+
+extern void cdbmake_pack(unsigned char *, uint32);
#define CDBMAKE_HASHSTART ((uint32) 5381)
-extern uint32 cdbmake_hashadd();
+extern uint32 cdbmake_hashadd(uint32, unsigned int);
-extern void cdbmake_init();
-extern int cdbmake_add();
-extern int cdbmake_split();
-extern uint32 cdbmake_throw();
+extern void cdbmake_init(struct cdbmake *);
+extern int cdbmake_add(struct cdbmake *, uint32, uint32, cdbmake_alloc_cb);
+extern int cdbmake_split(struct cdbmake *, cdbmake_alloc_cb);
+extern uint32 cdbmake_throw(struct cdbmake *, uint32, int);
#endif
--- a/cdbmake_add.c
+++ b/cdbmake_add.c
@@ -14,7 +14,7 @@ int cdbmake_add(cdbm,h,p,alloc)
struct cdbmake *cdbm;
uint32 h;
uint32 p;
-char *(*alloc)();
+cdbmake_alloc_cb alloc;
{
struct cdbmake_hplist *head;
@@ -35,7 +35,7 @@ char *(*alloc)();
int cdbmake_split(cdbm,alloc)
struct cdbmake *cdbm;
-char *(*alloc)();
+cdbmake_alloc_cb alloc;
{
int i;
uint32 u;
--- a/coe.h
+++ b/coe.h
@@ -1,6 +1,6 @@
#ifndef COE_H
#define COE_H
-extern int coe();
+extern int coe(int);
#endif
--- a/control.c
+++ b/control.c
@@ -60,7 +60,7 @@ char *fn;
fd = open_read(fn);
if (fd == -1) { if (errno == error_noent) return 0; return -1; }
- substdio_fdbuf(&ss,read,fd,inbuf,sizeof(inbuf));
+ substdio_fdbuf(&ss,(substdio_op)read,fd,inbuf,sizeof(inbuf));
if (getln(&ss,sa,&match,'\n') == -1) { close(fd); return -1; }
@@ -112,7 +112,7 @@ int flagme;
return -1;
}
- substdio_fdbuf(&ss,read,fd,inbuf,sizeof(inbuf));
+ substdio_fdbuf(&ss,(substdio_op)read,fd,inbuf,sizeof(inbuf));
for (;;)
{
--- a/control.h
+++ b/control.h
@@ -2,9 +2,9 @@
#define CONTROL_H
extern int control_init();
-extern int control_readline();
-extern int control_rldef();
-extern int control_readint();
-extern int control_readfile();
+extern int control_readline(stralloc *, char *);
+extern int control_rldef(stralloc *, char *, int, char *);
+extern int control_readint(int *, char *);
+extern int control_readfile(stralloc *, char *, int);
#endif
--- a/env.h
+++ b/env.h
@@ -7,10 +7,10 @@ extern int env_init();
extern int env_put();
extern int env_put2();
extern int env_unset();
-extern /*@null@*/char *env_get();
+extern /*@null@*/char *env_get(char *);
extern char *env_pick();
extern void env_clear();
-extern char *env_findeq();
+extern char *env_findeq(char *);
extern char **environ;
--- a/error.h
+++ b/error.h
@@ -17,7 +17,7 @@ extern int error_pipe;
extern int error_perm;
extern int error_acces;
-extern char *error_str();
+extern char *error_str(int);
extern int error_temp();
#endif
--- a/exit.h
+++ b/exit.h
@@ -1,6 +1,6 @@
#ifndef EXIT_H
#define EXIT_H
-extern void _exit();
+#include <unistd.h>
#endif
--- a/fd.h
+++ b/fd.h
@@ -3,7 +3,7 @@
#include <unistd.h>
-extern int fd_copy();
-extern int fd_move();
+extern int fd_copy(int, int);
+extern int fd_move(int, int);
#endif
--- a/fmt.h
+++ b/fmt.h
@@ -11,7 +11,7 @@ extern unsigned int fmt_nbbint();
extern unsigned int fmt_ushort();
extern unsigned int fmt_xshort();
extern unsigned int fmt_nbbshort();
-extern unsigned int fmt_ulong();
+extern unsigned int fmt_ulong(char *, unsigned long);
extern unsigned int fmt_xlong();
extern unsigned int fmt_nbblong();
--- a/gen_allocdefs.h
+++ b/gen_allocdefs.h
@@ -8,7 +8,7 @@ int ta_ready(x,n) register ta *x; regist
i = x->a; \
if (n > i) { \
x->a = base + n + (n >> 3); \
- if (alloc_re(&x->field,i * sizeof(type),x->a * sizeof(type))) return 1; \
+ if (alloc_re((char **)&x->field,i * sizeof(type),x->a * sizeof(type))) return 1; \
x->a = i; return 0; } \
return 1; } \
x->len = 0; \
@@ -21,7 +21,7 @@ int ta_rplus(x,n) register ta *x; regist
i = x->a; n += x->len; \
if (n > i) { \
x->a = base + n + (n >> 3); \
- if (alloc_re(&x->field,i * sizeof(type),x->a * sizeof(type))) return 1; \
+ if (alloc_re((char **)&x->field,i * sizeof(type),x->a * sizeof(type))) return 1; \
x->a = i; return 0; } \
return 1; } \
x->len = 0; \
--- a/getln.h
+++ b/getln.h
@@ -1,7 +1,10 @@
#ifndef GETLN_H
#define GETLN_H
-extern int getln();
-extern int getln2();
+#include "substdio.h"
+#include "stralloc.h"
+
+extern int getln(substdio *, stralloc *, int *, int);
+extern int getln2(substdio *, stralloc *, char **, unsigned int *, int);
#endif
--- a/newaliases.c
+++ b/newaliases.c
@@ -282,7 +282,7 @@ void main()
fd = open_read("/etc/aliases");
if (fd == -1) readerr();
- substdio_fdbuf(&ssin,read,fd,inbuf,sizeof inbuf);
+ substdio_fdbuf(&ssin,(substdio_op)read,fd,inbuf,sizeof inbuf);
fd = open_trunc("/etc/aliases.tmp");
if (fd == -1) strerr_die2sys(111,FATAL,"unable to create /etc/aliases.tmp: ");
--- a/newinclude.c
+++ b/newinclude.c
@@ -292,7 +292,7 @@ char **argv;
fd = open_read(fnlist);
if (fd == -1) readerr();
- substdio_fdbuf(&sslist,read,fd,listbuf,sizeof listbuf);
+ substdio_fdbuf(&sslist,(substdio_op)read,fd,listbuf,sizeof listbuf);
fd = open_trunc(fntmp);
if (fd == -1) writeerr();
--- a/open.h
+++ b/open.h
@@ -1,10 +1,10 @@
#ifndef OPEN_H
#define OPEN_H
-extern int open_read();
+extern int open_read(char *);
extern int open_excl();
extern int open_append();
-extern int open_trunc();
+extern int open_trunc(char *);
extern int open_write();
#endif
--- a/qmail.h
+++ b/qmail.h
@@ -12,13 +12,13 @@ struct qmail {
char buf[1024];
} ;
-extern int qmail_open();
-extern void qmail_put();
-extern void qmail_puts();
-extern void qmail_from();
-extern void qmail_to();
-extern void qmail_fail();
-extern char *qmail_close();
-extern unsigned long qmail_qp();
+extern int qmail_open(struct qmail *);
+extern void qmail_put(struct qmail *, char *, int);
+extern void qmail_puts(struct qmail *, char *);
+extern void qmail_from(struct qmail *, char *);
+extern void qmail_to(struct qmail *, char *);
+extern void qmail_fail(struct qmail *);
+extern char *qmail_close(struct qmail *);
+extern unsigned long qmail_qp(struct qmail *);
#endif
--- a/scan.h
+++ b/scan.h
@@ -7,7 +7,7 @@ extern unsigned int scan_nbbint();
extern unsigned int scan_ushort();
extern unsigned int scan_xshort();
extern unsigned int scan_nbbshort();
-extern unsigned int scan_ulong();
+extern unsigned int scan_ulong(char *, unsigned long *);
extern unsigned int scan_xlong();
extern unsigned int scan_nbblong();
--- a/seek.h
+++ b/seek.h
@@ -7,7 +7,7 @@ typedef unsigned long seek_pos;
extern seek_pos seek_cur();
-extern int seek_set();
+extern int seek_set(int, seek_pos);
extern int seek_end();
extern int seek_trunc();
--- a/sgetopt.h
+++ b/sgetopt.h
@@ -1,6 +1,8 @@
#ifndef SGETOPT_H
#define SGETOPT_H
+#include <unistd.h>
+
#ifndef SGETOPTNOSHORT
#define getopt sgetoptmine
#define optarg subgetoptarg
@@ -14,7 +16,7 @@
#include "subgetopt.h"
-extern int sgetoptmine();
+extern int sgetoptmine(int, char **, char *);
extern int sgetopterr;
extern char *sgetoptprogname;
--- a/sig.h
+++ b/sig.h
@@ -1,7 +1,7 @@
#ifndef SIG_H
#define SIG_H
-extern void sig_catch();
+extern void sig_catch(int, void (*)(int));
extern void sig_block();
extern void sig_unblock();
extern void sig_blocknone();
--- a/sig_catch.c
+++ b/sig_catch.c
@@ -4,7 +4,7 @@
void sig_catch(sig,f)
int sig;
-void (*f)();
+void (*f)(int);
{
#ifdef HASSIGACTION
struct sigaction sa;
--- a/slurpclose.h
+++ b/slurpclose.h
@@ -1,6 +1,8 @@
#ifndef SLURPCLOSE_H
#define SLURPCLOSE_H
-extern int slurpclose();
+#include "stralloc.h"
+
+extern int slurpclose(int, stralloc*, int);
#endif
--- a/str.h
+++ b/str.h
@@ -1,12 +1,12 @@
#ifndef STR_H
#define STR_H
-extern unsigned int str_copy();
-extern int str_diff();
-extern int str_diffn();
-extern unsigned int str_len();
-extern unsigned int str_chr();
-extern unsigned int str_rchr();
+extern unsigned int str_copy(char *, char *);
+extern int str_diff(char *, char *);
+extern int str_diffn(char *, char *, unsigned int);
+extern unsigned int str_len(char *);
+extern unsigned int str_chr(char *, int);
+extern unsigned int str_rchr(char *, int);
extern int str_start();
#define str_equal(s,t) (!str_diff((s),(t)))
--- a/stralloc.h
+++ b/stralloc.h
@@ -5,16 +5,16 @@
GEN_ALLOC_typedef(stralloc,char,s,len,a)
-extern int stralloc_ready();
-extern int stralloc_readyplus();
-extern int stralloc_copy();
-extern int stralloc_cat();
-extern int stralloc_copys();
-extern int stralloc_cats();
-extern int stralloc_copyb();
-extern int stralloc_catb();
-extern int stralloc_append(); /* beware: this takes a pointer to 1 char */
-extern int stralloc_starts();
+extern int stralloc_ready(stralloc *, unsigned int);
+extern int stralloc_readyplus(stralloc *, unsigned int);
+extern int stralloc_copy(stralloc *, stralloc *);
+extern int stralloc_cat(stralloc *, stralloc *);
+extern int stralloc_copys(stralloc *, char *);
+extern int stralloc_cats(stralloc *, char *);
+extern int stralloc_copyb(stralloc *, char *, unsigned int);
+extern int stralloc_catb(stralloc *, char *, unsigned int);
+extern int stralloc_append(stralloc *, char *); /* beware: this takes a pointer to 1 char */
+extern int stralloc_starts(stralloc *, char *);
#define stralloc_0(sa) stralloc_append(sa,"")
--- a/strerr.h
+++ b/strerr.h
@@ -14,8 +14,8 @@ extern struct strerr strerr_sys;
extern void strerr_sysinit();
extern char *strerr();
-extern void strerr_warn();
-extern void strerr_die();
+extern void strerr_warn(char *, char *, char *, char *, char *, char *, struct strerr *);
+extern void strerr_die(int, char *, char *, char *, char *, char *, char *, struct strerr *);
#define STRERR(r,se,a) \
{ se.who = 0; se.x = a; se.y = 0; se.z = 0; return r; }
--- a/strset.h
+++ b/strset.h
@@ -21,9 +21,9 @@ typedef struct
}
strset;
-extern uint32 strset_hash();
-extern int strset_init();
-extern char *strset_in();
-extern int strset_add();
+extern uint32 strset_hash(char *);
+extern int strset_init(strset *);
+extern char *strset_in(strset *, char *);
+extern int strset_add(strset *, char *);
#endif
--- a/subfd.h
+++ b/subfd.h
@@ -10,6 +10,6 @@ extern substdio *subfdoutsmall;
extern substdio *subfderr;
extern int subfd_read();
-extern ssize_t subfd_readsmall();
+extern ssize_t subfd_readsmall(int, void *, size_t);
#endif
--- a/subgetopt.h
+++ b/subgetopt.h
@@ -13,7 +13,7 @@
#define SUBGETOPTDONE -1
-extern int subgetopt();
+extern int subgetopt(int, char **, char *);
extern char *subgetoptarg;
extern int subgetoptind;
extern int subgetoptpos;
--- a/substdi.c
+++ b/substdi.c
@@ -3,7 +3,7 @@
#include "error.h"
static int oneread(op,fd,buf,len)
-register int (*op)();
+register int (*op)(int, char *, int);
register int fd;
register char *buf;
register int len;
--- a/substdio.h
+++ b/substdio.h
@@ -15,22 +15,22 @@ typedef struct substdio {
#define SUBSTDIO_FDBUF(op,fd,buf,len) { (buf), 0, (len), (fd), (op) }
-extern void substdio_fdbuf();
+extern void substdio_fdbuf(substdio *s, substdio_op, int, char *, int);
-extern int substdio_flush();
-extern int substdio_put();
-extern int substdio_bput();
-extern int substdio_putflush();
-extern int substdio_puts();
-extern int substdio_bputs();
-extern int substdio_putsflush();
-
-extern int substdio_get();
-extern int substdio_bget();
-extern int substdio_feed();
+extern int substdio_flush(substdio *);
+extern int substdio_put(substdio *, char *, int);
+extern int substdio_bput(substdio *, char *, int);
+extern int substdio_putflush(substdio *, char *, int);
+extern int substdio_puts(substdio *, char *);
+extern int substdio_bputs(substdio *, char *);
+extern int substdio_putsflush(substdio *, char *);
+
+extern int substdio_get(substdio *, char *, int);
+extern int substdio_bget(substdio *, char *, int);
+extern int substdio_feed(substdio *);
-extern char *substdio_peek();
-extern void substdio_seek();
+extern char *substdio_peek(substdio *);
+extern void substdio_seek(substdio *, int);
#define substdio_fileno(s) ((s)->fd)
@@ -46,6 +46,6 @@ extern void substdio_seek();
: substdio_bput((s),&(c),1) \
)
-extern int substdio_copy();
+extern int substdio_copy(substdio *, substdio *);
#endif
--- a/substdo.c
+++ b/substdo.c
@@ -4,7 +4,7 @@
#include "error.h"
static int allwrite(op,fd,buf,len)
-register int (*op)();
+register substdio_op op;
register int fd;
register char *buf;
register int len;
--- a/token822.c
+++ b/token822.c
@@ -401,7 +401,7 @@ stralloc *buf;
static int gotaddr(taout,taaddr,callback)
token822_alloc *taout;
token822_alloc *taaddr;
-int (*callback)();
+int (*callback)(token822_alloc *);
{
int i;
--- a/token822.h
+++ b/token822.h
@@ -12,15 +12,15 @@ struct token822
#include "gen_alloc.h"
GEN_ALLOC_typedef(token822_alloc,struct token822,t,len,a)
-extern int token822_parse();
-extern int token822_addrlist();
-extern int token822_unquote();
-extern int token822_unparse();
+extern int token822_parse(token822_alloc *, stralloc *, stralloc *);
+extern int token822_addrlist(token822_alloc *, token822_alloc *, token822_alloc *, int (*callback)());
+extern int token822_unquote(stralloc *, token822_alloc *);
+extern int token822_unparse(stralloc *, token822_alloc *, unsigned int);
extern void token822_free();
-extern void token822_reverse();
-extern int token822_ready();
-extern int token822_readyplus();
-extern int token822_append();
+extern void token822_reverse(token822_alloc *);
+extern int token822_ready(token822_alloc *, unsigned int);
+extern int token822_readyplus(token822_alloc *, unsigned int);
+extern int token822_append(token822_alloc *, struct token822 *);
#define TOKEN822_ATOM 1
#define TOKEN822_QUOTE 2
--- a/wait.h
+++ b/wait.h
@@ -1,7 +1,7 @@
#ifndef WAIT_H
#define WAIT_H
-extern int wait_pid();
+extern int wait_pid(int *, int);
extern int wait_nohang();
extern int wait_stop();
extern int wait_stopnohang();
|