diff options
author | Thomas Schwinge <tschwinge@gnu.org> | 2009-06-23 00:27:28 +0200 |
---|---|---|
committer | Thomas Schwinge <tschwinge@gnu.org> | 2009-06-23 14:54:09 +0200 |
commit | c6c9d7a69dea26e04bba7010582e7bcd612e710c (patch) | |
tree | 99d5d3aa08af80e5a94213377fd26e7ddd5e53b3 | |
parent | 2772f5c6a6a51cf946fd95bf6ffe254273157a21 (diff) |
Use static inline where appropriate.
* console-client/timer.h (fetch_jiffies): Use static inline instead of extern
inline.
* ext2fs/ext2fs.h (test_bit, set_bit, clear_bit, dino, global_block_modified)
(record_global_poke, sync_global_ptr, record_indir_poke, sync_global)
(alloc_sync): Likewise.
* libftpconn/priv.h (unexpected_reply): Likewise.
* term/term.h (qsize, qavail, clear_queue, dequeue_quote, dequeue)
(enqueue_internal, enqueue, enqueue_quote, unquote_char, char_quoted_p)
(queue_erase): Likewise.
* ufs/ufs.h (dino, indir_block, cg_locate, sync_disk_blocks, sync_dinode)
(swab_short, swab_long, swab_long_long): Likewise.
* term/munge.c (poutput): Use static inline instead of inline.
-rw-r--r-- | console-client/timer.h | 6 | ||||
-rw-r--r-- | ext2fs/ext2fs.h | 28 | ||||
-rw-r--r-- | libftpconn/priv.h | 8 | ||||
-rw-r--r-- | term/munge.c | 5 | ||||
-rw-r--r-- | term/term.h | 26 | ||||
-rw-r--r-- | ufs/ufs.h | 18 |
6 files changed, 45 insertions, 46 deletions
diff --git a/console-client/timer.h b/console-client/timer.h index 4204192e..5e64e97b 100644 --- a/console-client/timer.h +++ b/console-client/timer.h @@ -1,5 +1,7 @@ /* timer.h - Interface to a timer module for Mach. - Copyright (C) 1995,96,2000,02 Free Software Foundation, Inc. + + Copyright (C) 1995, 1996, 2000, 2002, 2009 Free Software Foundation, Inc. + Written by Michael I. Bushnell, p/BSG and Marcus Brinkmann. This file is part of the GNU Hurd. @@ -54,7 +56,7 @@ int timer_remove (struct timer_list *timer); /* Change the expiration time of the timer TIMER to EXPIRES. */ void timer_change (struct timer_list *timer, long long expires); -extern inline long long +static inline long long fetch_jiffies () { extern volatile struct mapped_time_value *timer_mapped_time; diff --git a/ext2fs/ext2fs.h b/ext2fs/ext2fs.h index 1d490861..f141bc9a 100644 --- a/ext2fs/ext2fs.h +++ b/ext2fs/ext2fs.h @@ -1,6 +1,8 @@ /* Common definitions for the ext2 filesystem translator - Copyright (C) 1995, 1996, 1999, 2002, 2004 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1999, 2002, 2004, 2009 Free Software Foundation, + Inc. + Written by Miles Bader <miles@gnu.org> This program is free software; you can redistribute it and/or @@ -101,17 +103,13 @@ void pokel_flush (struct pokel *pokel); /* Transfer all regions from FROM to POKEL, which must have the same pager. */ void pokel_inherit (struct pokel *pokel, struct pokel *from); -#ifndef EXT2FS_EI -#define EXT2FS_EI extern inline -#endif - /* ---------------------------------------------------------------- */ /* Bitmap routines. */ #include <stdint.h> /* Returns TRUE if bit NUM is set in BITMAP. */ -EXT2FS_EI int +static inline int test_bit (unsigned num, char *bitmap) { const uint32_t *const bw = (uint32_t *) bitmap + (num >> 5); @@ -121,7 +119,7 @@ test_bit (unsigned num, char *bitmap) /* Sets bit NUM in BITMAP, and returns the previous state of the bit. Unlike the linux version, this function is NOT atomic! */ -EXT2FS_EI int +static inline int set_bit (unsigned num, char *bitmap) { uint32_t *const bw = (uint32_t *) bitmap + (num >> 5); @@ -131,7 +129,7 @@ set_bit (unsigned num, char *bitmap) /* Clears bit NUM in BITMAP, and returns the previous state of the bit. Unlike the linux version, this function is NOT atomic! */ -EXT2FS_EI int +static inline int clear_bit (unsigned num, char *bitmap) { uint32_t *const bw = (uint32_t *) bitmap + (num >> 5); @@ -295,7 +293,7 @@ struct ext2_group_desc *group_desc_image; #define inode_group_num(inum) (((inum) - 1) / sblock->s_inodes_per_group) /* Convert an inode number to the dinode on disk. */ -EXT2FS_EI struct ext2_inode * +static inline struct ext2_inode * dino (ino_t inum) { unsigned long inodes_per_group = sblock->s_inodes_per_group; @@ -337,7 +335,7 @@ spin_lock_t modified_global_blocks_lock; think it may have been clean before (but we may not be sure). Note that this isn't enough to cause the block to be synced; you must call record_global_poke to do that. */ -EXT2FS_EI int +static inline int global_block_modified (block_t block) { if (modified_global_blocks) @@ -353,7 +351,7 @@ global_block_modified (block_t block) } /* This records a modification to a non-file block. */ -EXT2FS_EI void +static inline void record_global_poke (void *ptr) { int boffs = trunc_block (bptr_offs (ptr)); @@ -362,7 +360,7 @@ record_global_poke (void *ptr) } /* This syncs a modification to a non-file block. */ -EXT2FS_EI void +static inline void sync_global_ptr (void *bptr, int wait) { vm_offset_t boffs = trunc_block (bptr_offs (bptr)); @@ -371,7 +369,7 @@ sync_global_ptr (void *bptr, int wait) } /* This records a modification to one of a file's indirect blocks. */ -EXT2FS_EI void +static inline void record_indir_poke (struct node *node, void *ptr) { int boffs = trunc_block (bptr_offs (ptr)); @@ -381,14 +379,14 @@ record_indir_poke (struct node *node, void *ptr) /* ---------------------------------------------------------------- */ -EXT2FS_EI void +static inline void sync_global (int wait) { pokel_sync (&global_pokel, wait); } /* Sync all allocation information and node NP if diskfs_synchronous. */ -EXT2FS_EI void +static inline void alloc_sync (struct node *np) { if (diskfs_synchronous) diff --git a/libftpconn/priv.h b/libftpconn/priv.h index fb4dae50..27842033 100644 --- a/libftpconn/priv.h +++ b/libftpconn/priv.h @@ -1,6 +1,6 @@ /* libftpconn private definitions - Copyright (C) 1997 Free Software Foundation, Inc. + Copyright (C) 1997, 2009 Free Software Foundation, Inc. Written by Miles Bader <miles@gnu.ai.mit.edu> @@ -20,10 +20,6 @@ #ifndef __FTPCONN_PRIV_H__ #define __FTPCONN_PRIV_H__ - -#ifndef FTP_CONN_EI -# define FTP_CONN_EI extern inline -#endif /* Ftp reply codes. */ #define REPLY_DELAY 120 /* Service ready in nnn minutes */ @@ -61,7 +57,7 @@ #define REPLY_IS_TRANSIENT(rep) ((rep) >= 400 && (rep) < 500) #define REPLY_IS_FAILURE(rep) ((rep) >= 500 && (rep) < 600) -FTP_CONN_EI error_t +static inline error_t unexpected_reply (struct ftp_conn *conn, int reply, const char *reply_txt, const error_t *poss_errs) { diff --git a/term/munge.c b/term/munge.c index 74d82888..8a42d19b 100644 --- a/term/munge.c +++ b/term/munge.c @@ -1,5 +1,6 @@ /* - Copyright (C) 1995, 1996, 1999, 2002 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1999, 2002, 2009 Free Software Foundation, Inc. + Written by Michael I. Bushnell, p/BSG. This file is part of the GNU Hurd. @@ -38,7 +39,7 @@ int output_psize; /* Actually drop character onto output queue. This should be the only place where we actually enqueue characters on the output queue; it is responsible for keeping track of cursor positions. */ -inline void +static inline void poutput (int c) { if (termflags & FLUSH_OUTPUT) diff --git a/term/term.h b/term/term.h index 8448d78e..1c85bf6c 100644 --- a/term/term.h +++ b/term/term.h @@ -1,5 +1,7 @@ /* - Copyright (C) 1995,96,98,99, 2002 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1998, 1999, 2002, 2009 Free Software Foundation, + Inc. + Written by Michael I. Bushnell, p/BSG. This file is part of the GNU Hurd. @@ -185,21 +187,21 @@ struct queue struct queue *create_queue (int size, int lowat, int hiwat); /* Return the number of characters in Q. */ -extern inline int +static inline int qsize (struct queue *q) { return q->ce - q->cs; } /* Return nonzero if characters can be added to Q. */ -extern inline int +static inline int qavail (struct queue *q) { return !q->susp; } /* Flush all the characters from Q. */ -extern inline void +static inline void clear_queue (struct queue *q) { q->susp = 0; @@ -211,7 +213,7 @@ clear_queue (struct queue *q) void call_asyncs (int dir); /* Return the next character off Q; leave the quoting bit on. */ -extern inline quoted_char +static inline quoted_char dequeue_quote (struct queue *q) { int beep = 0; @@ -234,7 +236,7 @@ dequeue_quote (struct queue *q) } /* Return the next character off Q. */ -extern inline char +static inline char dequeue (struct queue *q) { return dequeue_quote (q) & ~QUEUE_QUOTE_MARK; @@ -243,7 +245,7 @@ dequeue (struct queue *q) struct queue *reallocate_queue (struct queue *); /* Add C to *QP. */ -extern inline void +static inline void enqueue_internal (struct queue **qp, quoted_char c) { struct queue *q = *qp; @@ -265,28 +267,28 @@ enqueue_internal (struct queue **qp, quoted_char c) } /* Add C to *QP. */ -extern inline void +static inline void enqueue (struct queue **qp, char c) { enqueue_internal (qp, c); } /* Add C to *QP, marking it with a quote. */ -extern inline void +static inline void enqueue_quote (struct queue **qp, char c) { enqueue_internal (qp, c | QUEUE_QUOTE_MARK); } /* Return the unquoted version of a quoted_char. */ -extern inline char +static inline char unquote_char (quoted_char c) { return c & ~QUEUE_QUOTE_MARK; } /* Tell if a quoted_char is actually quoted. */ -extern inline int +static inline int char_quoted_p (quoted_char c) { return c & QUEUE_QUOTE_MARK; @@ -294,7 +296,7 @@ char_quoted_p (quoted_char c) /* Remove the most recently enqueue character from Q; leaving the quote mark on. */ -extern inline short +static inline short queue_erase (struct queue *q) { short answer; @@ -1,5 +1,5 @@ /* - Copyright (C) 1994, 1995, 1996, 1997, 1999 Free Software Foundation + Copyright (C) 1994, 1995, 1996, 1997, 1999, 2009 Free Software Foundation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -151,7 +151,7 @@ unsigned log2_dev_blocks_per_dev_bsize; /* Functions for looking inside disk_image */ /* Convert an inode number to the dinode on disk. */ -extern inline struct dinode * +static inline struct dinode * dino (ino_t inum) { return (struct dinode *) @@ -161,28 +161,28 @@ dino (ino_t inum) } /* Convert a indirect block number to a daddr_t table. */ -extern inline daddr_t * +static inline daddr_t * indir_block (daddr_t bno) { return (daddr_t *) (disk_image + fsaddr (sblock, bno)); } /* Convert a cg number to the cylinder group. */ -extern inline struct cg * +static inline struct cg * cg_locate (int ncg) { return (struct cg *) (disk_image + fsaddr (sblock, cgtod (sblock, ncg))); } /* Sync part of the disk */ -extern inline void +static inline void sync_disk_blocks (daddr_t blkno, size_t nbytes, int wait) { pager_sync_some (diskfs_disk_pager, fsaddr (sblock, blkno), nbytes, wait); } /* Sync an disk inode */ -extern inline void +static inline void sync_dinode (int inum, int wait) { sync_disk_blocks (ino_to_fsba (sblock, inum), sblock->fs_fsize, wait); @@ -190,21 +190,21 @@ sync_dinode (int inum, int wait) /* Functions for byte swapping */ -extern inline short +static inline short swab_short (short arg) { return (((arg & 0xff) << 8) | ((arg & 0xff00) >> 8)); } -extern inline long +static inline long swab_long (long arg) { return (((long) swab_short (arg & 0xffff) << 16) | swab_short ((arg & 0xffff0000) >> 16)); } -extern inline long long +static inline long long swab_long_long (long long arg) { return (((long long) swab_long (arg & 0xffffffff) << 32) |