Changeset 9640


Ignore:
Timestamp:
Nov 30, 2009, 1:31:05 AM (12 years ago)
Author:
livings124
Message:

inline tr_removeElementFromArray()

Location:
trunk/libtransmission
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/transmission.h

    r9627 r9640  
    11681168
    11691169/**
    1170  * Returns the the root directory of where the torrent is.
     1170 * Returns the root directory of where the torrent is.
    11711171 *
    11721172 * This will usually be the downloadDir.  However if the torrent
  • trunk/libtransmission/utils.c

    r9621 r9640  
    14071407    return 0;
    14081408}
    1409 
    1410 /***
    1411 ****
    1412 ***/
    1413 
    1414 void
    1415 tr_removeElementFromArray( void * array, int index_to_remove,
    1416                            size_t sizeof_element, size_t nmemb )
    1417 {
    1418     char * a = array;
    1419 
    1420     memmove( a + sizeof_element * index_to_remove,
    1421              a + sizeof_element * ( index_to_remove  + 1 ),
    1422              sizeof_element * ( --nmemb - index_to_remove ) );
    1423 }
  • trunk/libtransmission/utils.h

    r9604 r9640  
    435435                 tr_bool * renamed ) TR_GNUC_NONNULL(1,2);
    436436
    437 void tr_removeElementFromArray( void * array, int index_to_remove,
    438                                 size_t sizeof_element, size_t nmemb );
     437static TR_INLINE void tr_removeElementFromArray( void * array, int index_to_remove,
     438                                size_t sizeof_element, size_t nmemb )
     439{
     440    char * a = array;
     441
     442    memmove( a + sizeof_element * index_to_remove,
     443             a + sizeof_element * ( index_to_remove  + 1 ),
     444             sizeof_element * ( --nmemb - index_to_remove ) );
     445}
    439446
    440447/***
Note: See TracChangeset for help on using the changeset viewer.