Ignore:
Timestamp:
04/10/14 01:24:05 (8 years ago)
Author:
Richard Sanger <rsangerarj@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
df668eb
Parents:
fb1fd42
Message:

Use size_t rather than int for the data structures. Export vector, deque and ring_buffer for testing and use in programs.
Remove some inlines for now since these result in lots of compile warnings when also exported, the compiler is probably smart enough anyway.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/data-struct/vector.h

    rd6a56b6 read9478  
    77
    88typedef struct libtrace_vector {
    9         int max_size;
    10         int size;
    11         int element_size;
     9        size_t max_size;
     10        size_t size;
     11        size_t element_size;
    1212        char *elements; // Means we can use array indexing
    1313        pthread_mutex_t lock;
    1414} libtrace_vector_t;
    1515
    16 DLLEXPORT inline void libtrace_vector_init(libtrace_vector_t *v, int element_size);
     16DLLEXPORT inline void libtrace_vector_init(libtrace_vector_t *v, size_t element_size);
    1717DLLEXPORT inline void libtrace_vector_push_back(libtrace_vector_t *v, void *d);
    18 DLLEXPORT inline int libtrace_vector_get_size(libtrace_vector_t *v);
    19 DLLEXPORT inline int libtrace_vector_get(libtrace_vector_t *v, int location, void *d);
     18DLLEXPORT inline size_t libtrace_vector_get_size(libtrace_vector_t *v);
     19DLLEXPORT inline int libtrace_vector_get(libtrace_vector_t *v, size_t location, void *d);
    2020DLLEXPORT inline void libtrace_vector_append(libtrace_vector_t *dest, libtrace_vector_t *src);
    2121DLLEXPORT inline void libtrace_vector_destroy(libtrace_vector_t *v);
Note: See TracChangeset for help on using the changeset viewer.