Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix compilation with warnings
[simgrid.git] / include / xbt / swag.h
index e406066..a0f6b3e 100644 (file)
@@ -24,6 +24,8 @@ SG_BEGIN_DECL()
  *  It is basically a fifo but with restrictions so that it can be used as a set. Any operation (add, remove, belongs)
  *  is O(1) and no call to malloc/free is done.
  *
+ *  @deprecated If you are using C++, you might want to use
+ *  `boost::intrusive::set` instead.
  */
 /** @defgroup XBT_swag_type Swag types
     @ingroup XBT_swag
@@ -65,12 +67,15 @@ typedef struct foo {
 */
 typedef s_xbt_swag_hookup_t *xbt_swag_hookup_t;
 
-typedef struct xbt_swag {
+struct xbt_swag {
   void *head;
   void *tail;
   size_t offset;
   int count;
-} s_xbt_swag_t, *xbt_swag_t;
+};
+typedef struct xbt_swag  s_xbt_swag_t;
+typedef struct xbt_swag* xbt_swag_t;
+
 /**< A typical swag */
 /* @} */
 
@@ -190,15 +195,4 @@ static inline void *xbt_swag_getFirst(xbt_swag_t swag)
 
 SG_END_DECL()
 
-#ifdef __cplusplus
-namespace simgrid {
-namespace xbt {
-  inline void destroy(xbt_swag_t s)
-  {
-    xbt_swag_free(s);
-  }
-}
-}
-#endif
-
 #endif                          /* _XBT_SWAG_H */