Wed Dec 8 17:06:35 2010 UTC ()
Use __c99inline from sys/cdefs.h


(joerg)
diff -r1.1 -r1.2 src/games/sail/array.h
diff -r1.1 -r0 src/games/sail/inlinedefs.h

cvs diff -r1.1 -r1.2 src/games/sail/array.h (expand / switch to unified diff)

--- src/games/sail/array.h 2009/03/15 03:33:56 1.1
+++ src/games/sail/array.h 2010/12/08 17:06:35 1.2
@@ -20,28 +20,26 @@ @@ -20,28 +20,26 @@
20 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 20 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
21 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 * POSSIBILITY OF SUCH DAMAGE. 27 * POSSIBILITY OF SUCH DAMAGE.
28 */ 28 */
29 29
30#ifndef ARRAY_H 30#ifndef ARRAY_H
31#define ARRAY_H 31#define ARRAY_H
32 32
33#include "inlinedefs.h" 
34 
35#define ARRAYS_CHECKED 33#define ARRAYS_CHECKED
36 34
37#ifdef ARRAYS_CHECKED 35#ifdef ARRAYS_CHECKED
38#include <assert.h> 36#include <assert.h>
39#define arrayassert assert 37#define arrayassert assert
40#else 38#else
41#define arrayassert(x) ((void)(x)) 39#define arrayassert(x) ((void)(x))
42#endif 40#endif
43 41
44//////////////////////////////////////////////////////////// 42////////////////////////////////////////////////////////////
45// type and base operations 43// type and base operations
46 44
47struct array { 45struct array {
@@ -55,27 +53,27 @@ void array_init(struct array *); @@ -55,27 +53,27 @@ void array_init(struct array *);
55void array_cleanup(struct array *); 53void array_cleanup(struct array *);
56unsigned array_num(const struct array *); 54unsigned array_num(const struct array *);
57void *array_get(const struct array *, unsigned index_); 55void *array_get(const struct array *, unsigned index_);
58void array_set(const struct array *, unsigned index_, void *val); 56void array_set(const struct array *, unsigned index_, void *val);
59int array_setsize(struct array *, unsigned num); 57int array_setsize(struct array *, unsigned num);
60int array_add(struct array *, void *val, unsigned *index_ret); 58int array_add(struct array *, void *val, unsigned *index_ret);
61int array_insert(struct array *a, unsigned index_); 59int array_insert(struct array *a, unsigned index_);
62void array_remove(struct array *a, unsigned index_); 60void array_remove(struct array *a, unsigned index_);
63 61
64//////////////////////////////////////////////////////////// 62////////////////////////////////////////////////////////////
65// inlining for base operations 63// inlining for base operations
66 64
67#ifndef ARRAYINLINE 65#ifndef ARRAYINLINE
68#define ARRAYINLINE INLINE 66#define ARRAYINLINE __c99inline
69#endif 67#endif
70 68
71ARRAYINLINE unsigned 69ARRAYINLINE unsigned
72array_num(const struct array *a) 70array_num(const struct array *a)
73{ 71{
74 return a->num; 72 return a->num;
75} 73}
76 74
77ARRAYINLINE void * 75ARRAYINLINE void *
78array_get(const struct array *a, unsigned index_) 76array_get(const struct array *a, unsigned index_)
79{ 77{
80 arrayassert(index_ < a->num); 78 arrayassert(index_ < a->num);
81 return a->v[index_]; 79 return a->v[index_];

File Deleted: src/games/sail/Attic/inlinedefs.h