Compiler & warning related updates/fixes from Nelson
[sxemacs] / modules / ase / ase-neighbourhood.h
index f39a194..e4f365a 100644 (file)
@@ -5,7 +5,7 @@
   Author:  Sebastian Freundt <hroptatyr@sxemacs.org>
 
   * This file is part of SXEmacs.
-  * 
+  *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
@@ -131,34 +131,95 @@ extern Lisp_Object ase_neighbourhood_closure(Lisp_Object nbh);
 extern Lisp_Object ase_neighbourhood_interior(Lisp_Object nbh);
 
 /* predicates */
-static inline bool
+extern_inline bool
 ase_neighbourhood_contains_obj_p(ase_neighbourhood_t, Lisp_Object);
-static inline bool
+extern_inline bool
 ase_neighbourhood_contains_nbh_p(ase_neighbourhood_t, ase_neighbourhood_t);
-static inline bool ase_neighbourhood_open_p(ase_neighbourhood_t);
-static inline bool ase_neighbourhood_closed_p(ase_neighbourhood_t);
-static inline bool
+extern_inline bool ase_neighbourhood_open_p(ase_neighbourhood_t);
+extern_inline bool ase_neighbourhood_closed_p(ase_neighbourhood_t);
+extern_inline bool
 ase_neighbourhood_less_obj_p(ase_neighbourhood_t, Lisp_Object);
-static inline bool
+extern_inline bool
 ase_neighbourhood_less_nbh_p(ase_neighbourhood_t, ase_neighbourhood_t);
-static inline bool
+extern_inline bool
 ase_neighbourhood_greater_obj_p(ase_neighbourhood_t, Lisp_Object);
-static inline bool
+extern_inline bool
 ase_neighbourhood_greater_nbh_p(ase_neighbourhood_t, ase_neighbourhood_t);
 
-static inline Lisp_Object
+extern_inline Lisp_Object
 ase_neighbourhood_point(ase_neighbourhood_t);
-static inline Lisp_Object
+extern_inline Lisp_Object
 ase_neighbourhood_radius(ase_neighbourhood_t);
 
 /* measures */
-static inline Lisp_Object
+extern_inline Lisp_Object
 ase_neighbourhood_lebesgue_measure(ase_neighbourhood_t);
-static inline Lisp_Object
+extern_inline Lisp_Object
 ase_neighbourhood_rational_measure(ase_neighbourhood_t);
 
 /* inlines */
-static inline bool
+extern_inline Lisp_Object
+ase_neighbourhood_point(ase_neighbourhood_t n)
+{
+       return n->point;
+}
+
+extern_inline Lisp_Object
+ase_neighbourhood_radius(ase_neighbourhood_t n)
+{
+       return n->radius;
+}
+
+/* Measures */
+extern_inline void
+_ase_neighbourhood_update_rational(ase_neighbourhood_t n)
+{
+       if (n && NILP(n->rational_measure)) {
+               Lisp_Object i = n->ldata;
+               n->rational_measure = Fase_interval_rational_measure(i);
+       }
+       return;
+}
+
+extern_inline Lisp_Object
+_ase_neighbourhood_rational(ase_neighbourhood_t n)
+{
+       return n->rational_measure;
+}
+
+extern_inline Lisp_Object
+ase_neighbourhood_rational_measure(ase_neighbourhood_t n)
+{
+       _ase_neighbourhood_update_rational(n);
+       return _ase_neighbourhood_rational(n);
+}
+
+extern_inline void
+_ase_neighbourhood_update_lebesgue(ase_neighbourhood_t n)
+{
+       if (n && NILP(n->lebesgue_measure)) {
+               Lisp_Object i = n->ldata;
+               n->lebesgue_measure = Fase_interval_lebesgue_measure(i);
+       }
+       return;
+}
+
+extern_inline Lisp_Object
+_ase_neighbourhood_lebesgue(ase_neighbourhood_t n)
+{
+       return n->lebesgue_measure;
+}
+
+extern_inline Lisp_Object
+ase_neighbourhood_lebesgue_measure(ase_neighbourhood_t n)
+{
+       _ase_neighbourhood_update_lebesgue(n);
+       return _ase_neighbourhood_lebesgue(n);
+}
+
+
+
+extern_inline bool
 ase_neighbourhood_contains_obj_p(ase_neighbourhood_t n, Lisp_Object obj)
 {
        /* we _know_ atm that n->ldata points to an ase_interval_t */
@@ -166,7 +227,7 @@ ase_neighbourhood_contains_obj_p(ase_neighbourhood_t n, Lisp_Object obj)
        return !NILP(Fase_interval_contains_p(intv, obj));
 }
 
-static inline bool
+extern_inline bool
 ase_neighbourhood_contains_nbh_p(ase_neighbourhood_t n1, ase_neighbourhood_t n2)
 {
        /* we _know_ atm that {n1,n2}->data points to an ase_interval_t */
@@ -175,19 +236,19 @@ ase_neighbourhood_contains_nbh_p(ase_neighbourhood_t n1, ase_neighbourhood_t n2)
        return !NILP(Fase_interval_contains_p(i1, i2));
 }
 
-static inline bool
+extern_inline bool
 ase_neighbourhood_open_p(ase_neighbourhood_t n)
 {
        return n->open_p;
 }
 
-static inline bool
+extern_inline bool
 ase_neighbourhood_closed_p(ase_neighbourhood_t n)
 {
        return !n->open_p;
 }
 
-static inline bool
+extern_inline bool
 ase_neighbourhood_less_obj_p(ase_neighbourhood_t n, Lisp_Object obj)
 {
        /* we _know_ atm that {n1,n2}->data points to an ase_interval_t */
@@ -196,7 +257,7 @@ ase_neighbourhood_less_obj_p(ase_neighbourhood_t n, Lisp_Object obj)
        return (_ase_less_p(a->upper, obj) || _ase_equal_p(a->upper, obj));
 }
 
-static inline bool
+extern_inline bool
 ase_neighbourhood_less_nbh_p(ase_neighbourhood_t n1, ase_neighbourhood_t n2)
 {
        /* we _know_ atm that {n1,n2}->data points to an ase_interval_t */
@@ -206,7 +267,7 @@ ase_neighbourhood_less_nbh_p(ase_neighbourhood_t n1, ase_neighbourhood_t n2)
                _ase_equal_p(a1->upper, a2->lower));
 }
 
-static inline bool
+extern_inline bool
 ase_neighbourhood_greater_obj_p(ase_neighbourhood_t n, Lisp_Object obj)
 {
        /* we _know_ atm that {n1,n2}->data points to an ase_interval_t */
@@ -214,7 +275,7 @@ ase_neighbourhood_greater_obj_p(ase_neighbourhood_t n, Lisp_Object obj)
        return (_ase_less_p(obj, a->lower) || _ase_equal_p(obj, a->lower));
 }
 
-static inline bool
+extern_inline bool
 ase_neighbourhood_greater_nbh_p(ase_neighbourhood_t n1, ase_neighbourhood_t n2)
 {
        /* we _know_ atm that {n1,n2}->data points to an ase_interval_t */