Sprinkling the source with static and attributes.

This commit is contained in:
Guus Sliepen 2003-07-06 23:16:29 +00:00
parent 0b9175e998
commit 1401faf608
28 changed files with 159 additions and 160 deletions

View file

@ -29,7 +29,7 @@
library for inclusion into tinc (http://tinc.nl.linux.org/) by
Guus Sliepen <guus@sliepen.eu.org>.
$Id: avl_tree.c,v 1.1.2.13 2003/06/11 19:39:02 guus Exp $
$Id: avl_tree.c,v 1.1.2.14 2003/07/06 23:16:27 guus Exp $
*/
#include <stdio.h>
@ -53,7 +53,9 @@
#endif
#ifndef AVL_DEPTH
int lg(unsigned int u)
static int lg(unsigned int u) __attribute__ ((const));
static int lg(unsigned int u)
{
int r = 1;
@ -89,7 +91,7 @@ int lg(unsigned int u)
/* Internal helper functions */
int avl_check_balance(avl_node_t *node)
static int avl_check_balance(avl_node_t *node)
{
#ifdef AVL_DEPTH
int d;
@ -117,7 +119,7 @@ int avl_check_balance(avl_node_t *node)
#endif
}
void avl_rebalance(avl_tree_t *tree, avl_node_t *node)
static void avl_rebalance(avl_tree_t *tree, avl_node_t *node)
{
avl_node_t *child;
avl_node_t *gchild;

View file

@ -1,4 +1,4 @@
/* $Id: fake-getaddrinfo.h,v 1.1.2.1 2002/07/12 11:45:21 guus Exp $ */
/* $Id: fake-getaddrinfo.h,v 1.1.2.2 2003/07/06 23:16:27 guus Exp $ */
#ifndef _FAKE_GETADDRINFO_H
#define _FAKE_GETADDRINFO_H
@ -22,6 +22,10 @@
# define NI_NUMERICSERV 8
#endif
#ifndef AI_NUMERICHOST
#define AI_NUMERICHOST 4
#endif
#ifndef HAVE_STRUCT_ADDRINFO
struct addrinfo {
int ai_flags; /* AI_PASSIVE, AI_CANONNAME */

View file

@ -17,7 +17,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
$Id: list.h,v 1.1.2.8 2002/09/09 22:32:27 guus Exp $
$Id: list.h,v 1.1.2.9 2003/07/06 23:16:28 guus Exp $
*/
#ifndef __TINC_LIST_H__
@ -47,7 +47,7 @@ typedef struct list_t {
/* (De)constructors */
extern list_t *list_alloc(list_action_t);
extern list_t *list_alloc(list_action_t) __attribute__ ((malloc));
extern void list_free(list_t *);
extern list_node_t *list_alloc_node(void);
extern void list_free_node(list_t *, list_node_t *);

View file

@ -18,9 +18,9 @@ extern char *const xalloc_msg_memory_exhausted;
/* FIXME: describe */
extern void (*xalloc_fail_func) ();
void *xmalloc PARAMS ((size_t n));
void *xmalloc_and_zero PARAMS ((size_t n));
void *xmalloc PARAMS ((size_t n)) __attribute__ ((malloc));
void *xmalloc_and_zero PARAMS ((size_t n)) __attribute__ ((malloc));
void *xcalloc PARAMS ((size_t n, size_t s));
void *xrealloc PARAMS ((void *p, size_t n));
void *xrealloc PARAMS ((void *p, size_t n)) __attribute__ ((malloc));
char *xstrdup PARAMS ((const char *s));
char *xstrdup PARAMS ((const char *s)) __attribute__ ((malloc));