Changeset cf7cce6b4a6915f84afd4c8a3729e93b71fc0afe

Show
Ignore:
Timestamp:
11/26/08 12:24:27 (6 weeks ago)
Author:
David Balmain <dbalmain@…>
git-author:
Eduardo Habkost <ehabkost@raisama.net> / 2008-11-15T14:18:33Z-0200
Parents:
8fe5fa557a9b1dee97f6a4e2e8fa0cdeb3c37291
git-committer:
David Balmain <dbalmain@gmail.com> / 2008-11-26T12:24:27Z+1100
Message:

Compile fixes for inline-only functions on header files

gcc 4.3.0-8 from Fedora 9 complains about duplicated definitions here,
if using 'extern line'. Changing to use 'static inline' instead.

Signed-off-by: Eduardo Habkost <ehabkost@…>

Location:
c/include
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • c/include/bitvector.h

    ref412e rcf7cce  
    7979 * on the fact that size is accurate. 
    8080 */ 
    81 extern FRT_ATTR_ALWAYS_INLINE 
     81static FRT_ATTR_ALWAYS_INLINE 
    8282void frt_bv_set_value(FrtBitVector *bv, int bit, bool value) 
    8383{ 
     
    125125 * @param index the index of the bit to set 
    126126 */ 
    127 extern FRT_ATTR_ALWAYS_INLINE 
     127static FRT_ATTR_ALWAYS_INLINE 
    128128void frt_bv_set(FrtBitVector *bv, int bit) 
    129129{ 
     
    158158 * @param index the index of the bit to set 
    159159 */ 
    160 extern FRT_ATTR_ALWAYS_INLINE 
     160static FRT_ATTR_ALWAYS_INLINE 
    161161void frt_bv_set_fast(FrtBitVector *bv, int bit) 
    162162{ 
     
    175175 * @return 1 if the bit was set, 0 otherwise 
    176176 */ 
    177 extern FRT_ATTR_ALWAYS_INLINE 
     177static FRT_ATTR_ALWAYS_INLINE 
    178178int frt_bv_get(FrtBitVector *bv, int bit) 
    179179{ 
     
    193193 * @param index the index of the bit to unset 
    194194 */ 
    195 extern FRT_ATTR_ALWAYS_INLINE 
     195static FRT_ATTR_ALWAYS_INLINE 
    196196void frt_bv_unset(FrtBitVector *bv, int bit) 
    197197{ 
     
    218218 *   set 
    219219 */ 
    220 extern FRT_ATTR_ALWAYS_INLINE 
     220static FRT_ATTR_ALWAYS_INLINE 
    221221int frt_bv_recount(FrtBitVector *bv) 
    222222{ 
     
    268268 * @return the next set bit's index or -1 if no more bits are set 
    269269 */ 
    270 extern FRT_ATTR_ALWAYS_INLINE 
     270static FRT_ATTR_ALWAYS_INLINE 
    271271int frt_bv_scan_next_from(FrtBitVector *bv, const int bit) 
    272272{ 
     
    304304 * @return the next set bits index or -1 if no more bits are set 
    305305 */ 
    306 extern FRT_ATTR_ALWAYS_INLINE 
     306static FRT_ATTR_ALWAYS_INLINE 
    307307int frt_bv_scan_next(FrtBitVector *bv) 
    308308{ 
     
    318318 * @return the next unset bit's index or -1 if no more bits are unset 
    319319 */ 
    320 extern FRT_ATTR_ALWAYS_INLINE 
     320static FRT_ATTR_ALWAYS_INLINE 
    321321int frt_bv_scan_next_unset_from(FrtBitVector *bv, const int bit) 
    322322{ 
     
    354354 * @return the next unset bits index or -1 if no more bits are unset 
    355355 */ 
    356 extern FRT_ATTR_ALWAYS_INLINE 
     356static FRT_ATTR_ALWAYS_INLINE 
    357357int frt_bv_scan_next_unset(FrtBitVector *bv) 
    358358{ 
     
    377377extern unsigned long frt_bv_hash(FrtBitVector *bv); 
    378378 
    379 extern FRT_ATTR_ALWAYS_INLINE 
     379static FRT_ATTR_ALWAYS_INLINE 
    380380void frt_bv_capa(FrtBitVector *bv, int capa, int size) 
    381381{ 
     
    437437} while(0) 
    438438 
    439 extern FRT_ATTR_ALWAYS_INLINE 
     439static FRT_ATTR_ALWAYS_INLINE 
    440440FrtBitVector *frt_bv_and_i(FrtBitVector *bv, 
    441441                           FrtBitVector *a, FrtBitVector *b) 
     
    445445} 
    446446 
    447 extern FRT_ATTR_ALWAYS_INLINE 
     447static FRT_ATTR_ALWAYS_INLINE 
    448448FrtBitVector *frt_bv_or_i(FrtBitVector *bv, 
    449449                          FrtBitVector *a, FrtBitVector *b) 
     
    453453} 
    454454 
    455 extern FRT_ATTR_ALWAYS_INLINE 
     455static FRT_ATTR_ALWAYS_INLINE 
    456456FrtBitVector *frt_bv_xor_i(FrtBitVector *bv, 
    457457                           FrtBitVector *a, FrtBitVector *b) 
     
    461461} 
    462462 
    463 extern FRT_ATTR_ALWAYS_INLINE 
     463static FRT_ATTR_ALWAYS_INLINE 
    464464FrtBitVector *frt_bv_not_i(FrtBitVector *bv, FrtBitVector *bv1) 
    465465{ 
     
    489489 * @return A FrtBitVector with all bits set that are set in both bv1 and bv2 
    490490 */ 
    491 extern FRT_ATTR_ALWAYS_INLINE 
     491static FRT_ATTR_ALWAYS_INLINE 
    492492FrtBitVector *frt_bv_and(FrtBitVector *bv1, FrtBitVector *bv2) 
    493493{ 
     
    503503 * @return A FrtBitVector with all bits set that are set in both bv1 and bv2 
    504504 */ 
    505 extern FRT_ATTR_ALWAYS_INLINE 
     505static FRT_ATTR_ALWAYS_INLINE 
    506506FrtBitVector *frt_bv_or(FrtBitVector *bv1, FrtBitVector *bv2) 
    507507{ 
     
    518518 * @return A FrtBitVector with all bits set that are equal in bv1 and bv2 
    519519 */ 
    520 extern FRT_ATTR_ALWAYS_INLINE 
     520static FRT_ATTR_ALWAYS_INLINE 
    521521FrtBitVector *frt_bv_xor(FrtBitVector *bv1, FrtBitVector *bv2) 
    522522{ 
     
    530530 * @return A FrtBitVector with all bits set that are set in both bv1 and bv2 
    531531 */ 
    532 extern FRT_ATTR_ALWAYS_INLINE 
     532static FRT_ATTR_ALWAYS_INLINE 
    533533FrtBitVector *frt_bv_not(FrtBitVector *bv) 
    534534{ 
     
    544544 * @return bv1 with all bits set that where set in both bv1 and bv2 
    545545 */ 
    546 extern FRT_ATTR_ALWAYS_INLINE 
     546static FRT_ATTR_ALWAYS_INLINE 
    547547FrtBitVector *frt_bv_and_x(FrtBitVector *bv1, FrtBitVector *bv2) 
    548548{ 
     
    557557 * @return bv1 
    558558 */ 
    559 extern FRT_ATTR_ALWAYS_INLINE 
     559static FRT_ATTR_ALWAYS_INLINE 
    560560FrtBitVector *frt_bv_or_x(FrtBitVector *bv1, FrtBitVector *bv2) 
    561561{ 
     
    570570 * @return bv1 
    571571 */ 
    572 extern FRT_ATTR_ALWAYS_INLINE 
     572static FRT_ATTR_ALWAYS_INLINE 
    573573FrtBitVector *frt_bv_xor_x(FrtBitVector *bv1, FrtBitVector *bv2) 
    574574{ 
     
    582582 * @return A +bv+ with all it's bits flipped 
    583583 */ 
    584 extern FRT_ATTR_ALWAYS_INLINE 
     584static FRT_ATTR_ALWAYS_INLINE 
    585585FrtBitVector *frt_bv_not_x(FrtBitVector *bv) 
    586586{ 
  • c/include/global.h

    ref412e rcf7cce  
    137137 * Returns the count of leading [MSB] 0 bits in +word+. 
    138138 */ 
    139 extern FRT_ATTR_ALWAYS_INLINE FRT_ATTR_CONST 
     139static FRT_ATTR_ALWAYS_INLINE FRT_ATTR_CONST 
    140140int frt_count_leading_zeros(frt_u32 word) 
    141141{ 
     
    170170} 
    171171 
    172 extern FRT_ATTR_ALWAYS_INLINE FRT_ATTR_CONST 
     172static FRT_ATTR_ALWAYS_INLINE FRT_ATTR_CONST 
    173173int frt_count_leading_ones(frt_u32 word) 
    174174{ 
     
    180180 */ 
    181181 
    182 extern FRT_ATTR_ALWAYS_INLINE FRT_ATTR_CONST 
     182static FRT_ATTR_ALWAYS_INLINE FRT_ATTR_CONST 
    183183int frt_count_trailing_zeros(frt_u32 word) 
    184184{ 
     
    213213} 
    214214 
    215 extern FRT_ATTR_ALWAYS_INLINE FRT_ATTR_CONST 
     215static FRT_ATTR_ALWAYS_INLINE FRT_ATTR_CONST 
    216216int frt_count_trailing_ones(frt_u32 word) 
    217217{ 
     
    219219} 
    220220 
    221 extern FRT_ATTR_ALWAYS_INLINE FRT_ATTR_CONST 
     221static FRT_ATTR_ALWAYS_INLINE FRT_ATTR_CONST 
    222222int frt_count_ones(frt_u32 word) 
    223223{ 
     
    250250} 
    251251 
    252 extern FRT_ATTR_ALWAYS_INLINE FRT_ATTR_CONST 
     252static FRT_ATTR_ALWAYS_INLINE FRT_ATTR_CONST 
    253253int frt_count_zeros(frt_u32 word) 
    254254{ 
     
    259259 * Round up to the next power of 2 
    260260 */ 
    261 extern FRT_ATTR_ALWAYS_INLINE FRT_ATTR_CONST 
     261static FRT_ATTR_ALWAYS_INLINE FRT_ATTR_CONST 
    262262int frt_round2(frt_u32 word) 
    263263{