Ignore:
Timestamp:
Mar 14, 2011, 2:09:41 PM (11 years ago)
Author:
jordan
Message:

(trunk libT) make tr_ptrArrayNth() an inline function

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/ptrarray.h

    r12141 r12161  
    1717#ifndef _TR_PTR_ARRAY_H_
    1818#define _TR_PTR_ARRAY_H_
     19
     20#include <assert.h>
    1921
    2022#include "transmission.h"
     
    4951/** @brief Return the nth item in a tr_ptrArray
    5052    @return the nth item in a tr_ptrArray */
    51 void*         tr_ptrArrayNth( tr_ptrArray   * array,
    52                               int             nth );
     53static inline void*
     54tr_ptrArrayNth( tr_ptrArray * array, int i )
     55{
     56    assert( array );
     57    assert( i >= 0 );
     58    assert( i < array->n_items );
     59
     60    return array->items[i];
     61}
    5362
    5463/** @brief Remove the last item from the array and return it
Note: See TracChangeset for help on using the changeset viewer.