可爱动物萌图动漫图片:[转] C语言的一种老式写法

来源:百度文库 编辑:偶看新闻 时间:2024/04/28 04:19:17

/*
 * Space allocation routines.
 * These are also available as macros
 * for critical paths.
 */
struct mbuf *m_get(nowait, type)
int nowait, type;
{
 register struct mbuf *m;

 MGET(m, nowait, type);
 return (m);
}

 

 

void    ring_init(ring)
RING   *ring;
{
    ring->pred = ring->succ = ring;
}
后来注意到,ring的声明放在了函数的后面,而参数中并没有ring类型的声明,问了问别人才知道,这是一种C语言老式函数的写法。跟void ring_init(RING* ring){...} 一个意思。

孤陋寡闻了。