From 9e7fd816e02e66962d482b02209f112e1d5789fc Mon Sep 17 00:00:00 2001 From: dholland Date: Fri, 26 Aug 2011 06:18:16 +0000 Subject: Use __dead and __printflike instead of __attribute__. --- backgammon/common_source/back.h | 6 +++--- backgammon/common_source/save.c | 6 +++--- backgammon/teachgammon/tutor.h | 6 +++--- battlestar/extern.h | 8 ++++---- boggle/boggle/bog.c | 6 +++--- cribbage/cribbage.h | 10 ++++------ hack/extern.h | 23 +++++++++-------------- hangman/hangman.h | 4 ++-- larn/extern.h | 4 ++-- mille/mille.h | 6 +++--- rogue/inventory.c | 7 +++---- rogue/rogue.h | 17 ++++++++--------- rogue/score.c | 6 +++--- sail/extern.h | 19 ++++++++----------- sail/pl_7.c | 8 ++++---- 15 files changed, 62 insertions(+), 74 deletions(-) diff --git a/backgammon/common_source/back.h b/backgammon/common_source/back.h index ed56e81c..815a5ec2 100644 --- a/backgammon/common_source/back.h +++ b/backgammon/common_source/back.h @@ -1,4 +1,4 @@ -/* $NetBSD: back.h,v 1.17 2010/03/22 05:10:19 mrg Exp $ */ +/* $NetBSD: back.h,v 1.18 2011/08/26 06:18:16 dholland Exp $ */ /* * Copyright (c) 1980, 1993 @@ -139,14 +139,14 @@ void clend(void); void cline(void); int count(void); void curmove(int, int); -void errexit(const char *) __attribute__((__noreturn__)); +void errexit(const char *) __dead; void fancyc(int); void fboard(void); void fixtty(struct termios *); void getarg(char ***); int getcaps(const char *); void getmove(void); -void getout(int) __attribute__((__noreturn__)); +void getout(int) __dead; void gwrite(void); void init(void); int main(int, char *[]); diff --git a/backgammon/common_source/save.c b/backgammon/common_source/save.c index 2e7f29c1..57e8a054 100644 --- a/backgammon/common_source/save.c +++ b/backgammon/common_source/save.c @@ -1,4 +1,4 @@ -/* $NetBSD: save.c,v 1.13 2009/08/12 05:17:57 dholland Exp $ */ +/* $NetBSD: save.c,v 1.14 2011/08/26 06:18:16 dholland Exp $ */ /* * Copyright (c) 1980, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)save.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: save.c,v 1.13 2009/08/12 05:17:57 dholland Exp $"); +__RCSID("$NetBSD: save.c,v 1.14 2011/08/26 06:18:16 dholland Exp $"); #endif #endif /* not lint */ @@ -53,7 +53,7 @@ static const char type[] = "'.\nType \"backgammon "; static const char rec[] = "\" to recover your game.\n\n"; static const char cantrec[] = "Can't recover file: "; -static void norec(const char *) __attribute__((__noreturn__)); +static void norec(const char *) __dead; void save(int n) diff --git a/backgammon/teachgammon/tutor.h b/backgammon/teachgammon/tutor.h index ca5d2d1b..26e55e1f 100644 --- a/backgammon/teachgammon/tutor.h +++ b/backgammon/teachgammon/tutor.h @@ -1,4 +1,4 @@ -/* $NetBSD: tutor.h,v 1.9 2009/08/12 05:17:57 dholland Exp $ */ +/* $NetBSD: tutor.h,v 1.10 2011/08/26 06:18:16 dholland Exp $ */ /* * Copyright (c) 1980, 1993 @@ -62,5 +62,5 @@ extern const char *const stragy[]; extern const struct situatn test[]; -void leave(void) __attribute__((__noreturn__)); -void tutor(void) __attribute__((__noreturn__)); +void leave(void) __dead; +void tutor(void) __dead; diff --git a/battlestar/extern.h b/battlestar/extern.h index 9cad4606..a97aa3d7 100644 --- a/battlestar/extern.h +++ b/battlestar/extern.h @@ -1,4 +1,4 @@ -/* $NetBSD: extern.h,v 1.32 2009/08/12 05:20:38 dholland Exp $ */ +/* $NetBSD: extern.h,v 1.33 2011/08/26 06:18:17 dholland Exp $ */ /* * Copyright (c) 1983, 1993 @@ -333,8 +333,8 @@ int card(const char *, int); void chime(void); void crash(void); int cypher(void); -void die(void) __attribute__((__noreturn__)); -void diesig(int) __attribute__((__noreturn__)); +void die(void) __dead; +void diesig(int) __dead; void dig(void); void dooropen(void); int draw(void); @@ -353,7 +353,7 @@ void kiss(void); int land(void); int launch(void); void light(void); -void live(void) __attribute__((__noreturn__)); +void live(void) __dead; void love(void); int moveplayer(int, int); void murder(void); diff --git a/boggle/boggle/bog.c b/boggle/boggle/bog.c index a3502d1e..b56f568a 100644 --- a/boggle/boggle/bog.c +++ b/boggle/boggle/bog.c @@ -1,4 +1,4 @@ -/* $NetBSD: bog.c,v 1.26 2010/12/05 04:34:22 pgoyette Exp $ */ +/* $NetBSD: bog.c,v 1.27 2011/08/26 06:18:17 dholland Exp $ */ /*- * Copyright (c) 1993 @@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1993\ #if 0 static char sccsid[] = "@(#)bog.c 8.2 (Berkeley) 5/4/95"; #else -__RCSID("$NetBSD: bog.c,v 1.26 2010/12/05 04:34:22 pgoyette Exp $"); +__RCSID("$NetBSD: bog.c,v 1.27 2011/08/26 06:18:17 dholland Exp $"); #endif #endif /* not lint */ @@ -64,7 +64,7 @@ static int validword(const char *); static void checkdict(void); static void newgame(const char *); static int compar(const void *, const void *); -static void usage(void) __attribute__((__noreturn__)); +static void usage(void) __dead; struct dictindex dictindex[26]; diff --git a/cribbage/cribbage.h b/cribbage/cribbage.h index 5df12b14..d27d2bab 100644 --- a/cribbage/cribbage.h +++ b/cribbage/cribbage.h @@ -1,4 +1,4 @@ -/* $NetBSD: cribbage.h,v 1.15 2009/08/12 05:48:04 dholland Exp $ */ +/* $NetBSD: cribbage.h,v 1.16 2011/08/26 06:18:17 dholland Exp $ */ /* * Copyright (c) 1980, 1993 @@ -56,8 +56,7 @@ extern BOOLEAN quiet; /* if suppress random mess */ extern char explan[]; /* string for explanation */ -void addmsg(const char *, ...) - __attribute__((__format__(__printf__, 1, 2))); +void addmsg(const char *, ...) __printflike(1, 2); int adjust(const CARD [], CARD); int anymove(const CARD [], int, int); void bye(void); @@ -75,15 +74,14 @@ void instructions(void); int is_one(CARD, const CARD [], int); void makedeck(CARD []); void makeknown(const CARD [], int); -void msg(const char *, ...) - __attribute__((__format__(__printf__, 1, 2))); +void msg(const char *, ...) __printflike(1, 2); int msgcard(CARD, BOOLEAN); int number(int, int, const char *); int pegscore(CARD, const CARD [], int, int); int plyrhand(const CARD [], const char *); void prcard(WINDOW *, int, int, CARD, BOOLEAN); void prhand(const CARD [], int, WINDOW *, BOOLEAN); -void receive_intr(int) __attribute__((__noreturn__)); +void receive_intr(int) __dead; int scorehand(const CARD [], CARD, int, BOOLEAN, BOOLEAN); void shuffle(CARD []); void sorthand(CARD [], int); diff --git a/hack/extern.h b/hack/extern.h index 32bd5098..152536b4 100644 --- a/hack/extern.h +++ b/hack/extern.h @@ -1,4 +1,4 @@ -/* $NetBSD: extern.h,v 1.16 2011/08/06 20:18:26 dholland Exp $ */ +/* $NetBSD: extern.h,v 1.17 2011/08/26 06:18:17 dholland Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -137,7 +137,7 @@ void done1(int); void done_in_by(struct monst *); void done(const char *); void clearlocks(void); -void hang_up(int) __attribute__((__noreturn__)); +void hang_up(int) __dead; char *eos(char *); void charcat(char *, int); void prscore(int, char **); @@ -208,8 +208,7 @@ void mklev(void); /* hack.main.c */ void glo(int); void askname(void); -void impossible(const char *, ...) - __attribute__((__format__(__printf__, 1, 2))); +void impossible(const char *, ...) __printflike(1, 2); void stop_occupation(void); /* hack.makemon.c */ @@ -312,13 +311,12 @@ int dodip(void); /* hack.pri.c */ void swallowed(void); -void panic(const char *, ...) - __attribute__((__format__(__printf__, 1, 2))); +void panic(const char *, ...) __printflike(1, 2); void atl(int, int, int); void on_scr(int, int); void tmp_at(schar, schar); void Tmp_at(schar, schar); -void setclipped(void) __attribute__((__noreturn__)); +void setclipped(void) __dead; void at(xchar, xchar, int); void prme(void); int doredraw(void); @@ -423,10 +421,8 @@ void addtopl(const char *); void more(void); void cmore(const char *); void clrlin(void); -void pline(const char *, ...) - __attribute__((__format__(__printf__, 1, 2))); -void vpline(const char *, va_list) - __attribute__((__format__(__printf__, 1, 0))); +void pline(const char *, ...) __printflike(1, 2); +void vpline(const char *, va_list) __printflike(1, 0); void putsym(int); void putstr(const char *); @@ -453,15 +449,14 @@ void drown(void); void gettty(void); void settty(const char *); void setftty(void); -void error(const char *, ...) - __attribute__((__format__(__printf__, 1, 2),__noreturn__)); +void error(const char *, ...) __printflike(1, 2); void getlin(char *); void getret(void); void cgetret(const char *); void xwaitforspace(const char *); char *parse(void); char readchar(void); -void end_of_input(void) __attribute__((__noreturn__)); +void end_of_input(void) __dead; /* hack.u_init.c */ void u_init(void); diff --git a/hangman/hangman.h b/hangman/hangman.h index ba7d8d0f..1b24ba13 100644 --- a/hangman/hangman.h +++ b/hangman/hangman.h @@ -1,4 +1,4 @@ -/* $NetBSD: hangman.h,v 1.13 2004/01/27 20:30:29 jsm Exp $ */ +/* $NetBSD: hangman.h,v 1.14 2011/08/26 06:18:17 dholland Exp $ */ /* * Copyright (c) 1983, 1993 @@ -81,7 +81,7 @@ extern FILE *Dict; extern off_t Dict_size; -void die(int) __attribute__((__noreturn__)); +void die(int) __dead; void endgame(void); int main(int, char *[]); void getguess(void); diff --git a/larn/extern.h b/larn/extern.h index 88920c09..8b725b7b 100644 --- a/larn/extern.h +++ b/larn/extern.h @@ -1,4 +1,4 @@ -/* $NetBSD: extern.h,v 1.14 2009/10/21 01:07:45 snj Exp $ */ +/* $NetBSD: extern.h,v 1.15 2011/08/26 06:18:17 dholland Exp $ */ /* * Copyright (c) 1997 Christos Zoulas. All rights reserved. @@ -116,7 +116,7 @@ int ttgetch(void); void scbr(void); void sncbr(void); void newgame(void); -void lprintf(const char *, ...) __attribute__((__format__(__printf__, 1, 2))); +void lprintf(const char *, ...) __printflike(1, 2); void lprint(long); void lwrite(char *, int); long lgetc(void); diff --git a/mille/mille.h b/mille/mille.h index 10326d89..0121b0d6 100644 --- a/mille/mille.h +++ b/mille/mille.h @@ -1,4 +1,4 @@ -/* $NetBSD: mille.h,v 1.18 2011/08/16 11:14:04 christos Exp $ */ +/* $NetBSD: mille.h,v 1.19 2011/08/26 06:18:17 dholland Exp $ */ /* * Copyright (c) 1982, 1993 @@ -237,9 +237,9 @@ void calcmove(void); int canplay(const PLAY *, const PLAY *, CARD); int check_ext(bool); void check_more(void); -void die(int) __attribute__((__noreturn__)); +void die(int) __dead; void domove(void); -bool error(const char *, ...); +bool error(const char *, ...) __printflike(1,2); void extrapolate(PLAY *); void finalscore(PLAY *); CARD getcard(void); diff --git a/rogue/inventory.c b/rogue/inventory.c index 1f744bde..934e8aa3 100644 --- a/rogue/inventory.c +++ b/rogue/inventory.c @@ -1,4 +1,4 @@ -/* $NetBSD: inventory.c,v 1.14 2009/08/12 08:44:45 dholland Exp $ */ +/* $NetBSD: inventory.c,v 1.15 2011/08/26 06:18:17 dholland Exp $ */ /* * Copyright (c) 1988, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)inventory.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: inventory.c,v 1.14 2009/08/12 08:44:45 dholland Exp $"); +__RCSID("$NetBSD: inventory.c,v 1.15 2011/08/26 06:18:17 dholland Exp $"); #endif #endif /* not lint */ @@ -470,8 +470,7 @@ struct sbuf { static void sbuf_init(struct sbuf *s, char *buf, size_t maxlen); static void sbuf_addstr(struct sbuf *s, const char *str); -static void sbuf_addf(struct sbuf *s, const char *fmt, ...) - __attribute__((__format__(__printf__, 2, 3))); +static void sbuf_addf(struct sbuf *s, const char *fmt, ...) __printflike(2,3); static void desc_count(struct sbuf *s, int n); static void desc_called(struct sbuf *s, const object *); diff --git a/rogue/rogue.h b/rogue/rogue.h index d1bd8b5e..c1d860ba 100644 --- a/rogue/rogue.h +++ b/rogue/rogue.h @@ -1,4 +1,4 @@ -/* $NetBSD: rogue.h,v 1.21 2011/05/23 23:01:17 joerg Exp $ */ +/* $NetBSD: rogue.h,v 1.22 2011/08/26 06:18:17 dholland Exp $ */ /* * Copyright (c) 1988, 1993 @@ -466,7 +466,7 @@ void check_gold_seeker(object *); boolean check_imitator(object *); void check_message(void); int check_up(void); -void clean_up(const char *) __attribute__((__noreturn__)); +void clean_up(const char *) __dead; void clear_level(void); void cnfs(void); int coin_toss(void); @@ -483,7 +483,7 @@ void drop(void); int drop_check(void); void eat(void); void edit_opts(void); -void error_save(int) __attribute__((__noreturn__)); +void error_save(int) __dead; void fight(boolean); boolean flame_broil(object *); void free_object(object *); @@ -526,7 +526,7 @@ boolean is_direction(short, short *); boolean is_passable(int, int); boolean is_vowel(short); void kick_into_pack(void); -void killed_by(const object *, short) __attribute__((__noreturn__)); +void killed_by(const object *, short) __dead; long lget_number(const char *); void light_passage(int, int); void light_up_room(int); @@ -534,7 +534,7 @@ boolean m_confuse(object *); void make_level(void); void make_scroll_titles(void); boolean md_df(const char *); -void md_exit(int) __attribute__((__noreturn__)); +void md_exit(int) __dead; void md_gct(struct rogue_time *); int md_get_file_id(const char *); void md_gfmt(const char *, struct rogue_time *); @@ -547,8 +547,7 @@ void md_shell(const char *); void md_sleep(int); void md_slurp(void); /*void message(const char *, boolean);*/ -void messagef(boolean, const char *, ...) - __attribute__((__format__(__printf__, 2, 3))); +void messagef(boolean, const char *, ...) __printflike(2, 3); void mix_colors(void); int mon_can_go(const object *, short, short); int mon_damage(object *, short); @@ -577,7 +576,7 @@ void put_mons(void); void put_objects(void); void put_on_ring(void); void put_player(short); -void put_scores(const object *, short) __attribute__((__noreturn__)); +void put_scores(const object *, short) __dead; void put_stairs(void); void quaff(void); void quit(boolean); @@ -631,7 +630,7 @@ void wake_up(object *); void wanderer(void); void wear(void); void wield(void); -void win(void) __attribute__((__noreturn__)); +void win(void) __dead; void wizardize(void); long xxx(boolean); void xxxx(char *, short); diff --git a/rogue/score.c b/rogue/score.c index 231f0c6d..4bcf4e36 100644 --- a/rogue/score.c +++ b/rogue/score.c @@ -1,4 +1,4 @@ -/* $NetBSD: score.c,v 1.15 2009/08/12 08:44:45 dholland Exp $ */ +/* $NetBSD: score.c,v 1.16 2011/08/26 06:18:17 dholland Exp $ */ /* * Copyright (c) 1988, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)score.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: score.c,v 1.15 2009/08/12 08:44:45 dholland Exp $"); +__RCSID("$NetBSD: score.c,v 1.16 2011/08/26 06:18:17 dholland Exp $"); #endif #endif /* not lint */ @@ -61,7 +61,7 @@ static void center(short, const char *); static int get_value(const object *); static void id_all(void); static void sell_pack(void); -static void sf_error(void) __attribute__((__noreturn__)); +static void sf_error(void) __dead; void killed_by(const object *monster, short other) diff --git a/sail/extern.h b/sail/extern.h index f4509b29..dd477ea7 100644 --- a/sail/extern.h +++ b/sail/extern.h @@ -1,4 +1,4 @@ -/* $NetBSD: extern.h,v 1.36 2010/08/06 09:14:40 dholland Exp $ */ +/* $NetBSD: extern.h,v 1.37 2011/08/26 06:18:18 dholland Exp $ */ /* * Copyright (c) 1983, 1993 @@ -313,13 +313,13 @@ int boarding(struct ship *, int); void unboard(struct ship *, struct ship *, int); /* pl_1.c */ -void leave(int) __attribute__((__noreturn__)); -void choke(int) __attribute__((__noreturn__)); +void leave(int) __dead; +void choke(int) __dead; void child(int); /* pl_2.c */ void newturn(int); -void play(void) __attribute__((__noreturn__)); +void play(void) __dead; /* pl_3.c */ void acceptcombat(void); @@ -344,10 +344,8 @@ void loadplayer(void); /* pl_7.c */ void initscreen(void); void cleanupscreen(void); -void Signal(const char *, struct ship *, ...) - __attribute__((__format__(__printf__,1,3))); -void Msg(const char *, ...) - __attribute__((__format__(__printf__,1,2))); +void Signal(const char *, struct ship *, ...) __printflike(1,3); +void Msg(const char *, ...) __printflike(1,2); int sgetch(const char *, struct ship *, int); void sgetstr(const char *, char *, int); void centerview(void); @@ -365,9 +363,8 @@ void pl_main(void); /* sync.c */ void fmtship(char *, size_t, const char *, struct ship *); void makesignal(struct ship *, const char *, struct ship *, ...) - __attribute__((__format__(__printf__,2,4))); -void makemsg(struct ship *, const char *, ...) - __attribute__((__format__(__printf__,2,3))); + __printflike(2,4); +void makemsg(struct ship *, const char *, ...) __printflike(2, 3); int sync_exists(int); int sync_open(void); void sync_close(int); diff --git a/sail/pl_7.c b/sail/pl_7.c index 56e33ba2..a1ad8787 100644 --- a/sail/pl_7.c +++ b/sail/pl_7.c @@ -1,4 +1,4 @@ -/* $NetBSD: pl_7.c,v 1.41 2011/08/25 16:18:28 christos Exp $ */ +/* $NetBSD: pl_7.c,v 1.42 2011/08/26 06:18:18 dholland Exp $ */ /* * Copyright (c) 1983, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)pl_7.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: pl_7.c,v 1.41 2011/08/25 16:18:28 christos Exp $"); +__RCSID("$NetBSD: pl_7.c,v 1.42 2011/08/26 06:18:18 dholland Exp $"); #endif #endif /* not lint */ @@ -238,7 +238,7 @@ mvaddselstr(int y, int x0, int item, int curitem, /* * Likewise but a printf. */ -static void __attribute__((__format__(__printf__, 6, 7))) +static void __printflike(6, 7) mvselprintw(int y, int x0, int item, int curitem, size_t width, const char *fmt, ...) { @@ -296,7 +296,7 @@ down(int *posp, int *scrollp, int max, int visible) /* * Complain briefly. */ -static void __attribute__((__format__(__printf__, 3, 4))) +static void __printflike(3, 4) oops(int y, int x, const char *fmt, ...) { int oy, ox; -- cgit v1.2.3-56-ge451