[vlc-devel] commit: cmml: cleaning (remove dummy code). xarray will be removed one day. ( Rémi Duraffort )
git version control
git at videolan.org
Sun Nov 30 16:08:43 CET 2008
vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Sun Nov 30 15:27:37 2008 +0100| [8f633e5b25dac916d2b5c3c68c903a05dff3e301] | committer: Rémi Duraffort
cmml: cleaning (remove dummy code). xarray will be removed one day.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8f633e5b25dac916d2b5c3c68c903a05dff3e301
---
modules/codec/cmml/history.h | 1 -
modules/codec/cmml/xarray.c | 40 +++++++++++-----------------------------
modules/codec/cmml/xarray.h | 24 ++++++++++--------------
3 files changed, 21 insertions(+), 44 deletions(-)
diff --git a/modules/codec/cmml/history.h b/modules/codec/cmml/history.h
index 4de38dc..bfa8e92 100644
--- a/modules/codec/cmml/history.h
+++ b/modules/codec/cmml/history.h
@@ -27,7 +27,6 @@
#ifndef __VLC_HISTORY_H__
#define __VLC_HISTORY_H__
-#define XARRAY_EMBED_IN_HOST_C_FILE
#include "xarray.h"
struct history_item_t
diff --git a/modules/codec/cmml/xarray.c b/modules/codec/cmml/xarray.c
index 461de17..73eeb63 100644
--- a/modules/codec/cmml/xarray.c
+++ b/modules/codec/cmml/xarray.c
@@ -33,7 +33,7 @@
#include "xarray.h"
/* local prototypes */
-XSTATIC XArray * xarray_New (unsigned int);
+XArray * xarray_New (unsigned int);
#define XARRAY_ASSERT_NOT_NULL(xarray) \
@@ -54,7 +54,7 @@ XSTATIC XArray * xarray_New (unsigned int);
if (xarray->array == NULL) return XARRAY_ENOMEM; \
}
-XSTATIC XArray * xarray_New (unsigned int initial_size_hint)
+XArray * xarray_New (unsigned int initial_size_hint)
{
XArray *new_xarray = NULL;
void *inner_array;
@@ -82,28 +82,10 @@ XSTATIC XArray * xarray_New (unsigned int initial_size_hint)
new_xarray->array = inner_array;
- /* Make a dummy reference to other functions, so that we don't get
- * warnings about unused functions from the compiler. Ahem :) */
- while (0)
- {
- void *dummy_reference;
-
- dummy_reference = xarray_AddObject;
- dummy_reference = xarray_InsertObject;
- dummy_reference = xarray_RemoveLastObject;
- dummy_reference = xarray_RemoveObject;
- dummy_reference = xarray_RemoveObjects;
- dummy_reference = xarray_RemoveObjectsAfter;
- dummy_reference = xarray_ReplaceObject;
-
- dummy_reference = xarray_ObjectAtIndex;
- dummy_reference = xarray_Count;
- }
-
return new_xarray;
}
-XSTATIC int xarray_ObjectAtIndex (XArray *xarray, unsigned int index,
+int xarray_ObjectAtIndex (XArray *xarray, unsigned int index,
void **out_object)
{
XARRAY_ASSERT_NOT_NULL (xarray);
@@ -114,7 +96,7 @@ XSTATIC int xarray_ObjectAtIndex (XArray *xarray, unsigned int index,
return XARRAY_SUCCESS;
}
-XSTATIC int xarray_AddObject (XArray *xarray, void *object)
+int xarray_AddObject (XArray *xarray, void *object)
{
XARRAY_ASSERT_NOT_NULL (xarray);
@@ -129,7 +111,7 @@ XSTATIC int xarray_AddObject (XArray *xarray, void *object)
return XARRAY_SUCCESS;
}
-XSTATIC int xarray_InsertObject (XArray *xarray, void *object,
+int xarray_InsertObject (XArray *xarray, void *object,
unsigned int at_index)
{
XARRAY_ASSERT_NOT_NULL (xarray);
@@ -155,7 +137,7 @@ XSTATIC int xarray_InsertObject (XArray *xarray, void *object,
return XARRAY_SUCCESS;
}
-XSTATIC int xarray_RemoveLastObject (XArray *xarray)
+int xarray_RemoveLastObject (XArray *xarray)
{
XARRAY_ASSERT_NOT_NULL (xarray);
@@ -168,7 +150,7 @@ XSTATIC int xarray_RemoveLastObject (XArray *xarray)
return XARRAY_SUCCESS;
}
-XSTATIC int xarray_RemoveObject (XArray *xarray, unsigned int at_index)
+int xarray_RemoveObject (XArray *xarray, unsigned int at_index)
{
XARRAY_ASSERT_NOT_NULL (xarray);
XARRAY_BOUNDS_CHECK (xarray, at_index);
@@ -189,7 +171,7 @@ XSTATIC int xarray_RemoveObject (XArray *xarray, unsigned int at_index)
return XARRAY_SUCCESS;
}
-XSTATIC int xarray_RemoveObjects (XArray *xarray, unsigned int at_index,
+int xarray_RemoveObjects (XArray *xarray, unsigned int at_index,
int count)
{
int i;
@@ -211,7 +193,7 @@ XSTATIC int xarray_RemoveObjects (XArray *xarray, unsigned int at_index,
return XARRAY_SUCCESS;
}
-XSTATIC int xarray_RemoveObjectsAfter (XArray *xarray, unsigned int index)
+int xarray_RemoveObjectsAfter (XArray *xarray, unsigned int index)
{
XARRAY_ASSERT_NOT_NULL (xarray);
XARRAY_BOUNDS_CHECK (xarray, index);
@@ -227,7 +209,7 @@ XSTATIC int xarray_RemoveObjectsAfter (XArray *xarray, unsigned int index)
return XARRAY_SUCCESS;
}
-XSTATIC int xarray_ReplaceObject (XArray *xarray, unsigned int index,
+int xarray_ReplaceObject (XArray *xarray, unsigned int index,
void *new_object)
{
XARRAY_ASSERT_NOT_NULL (xarray);
@@ -238,7 +220,7 @@ XSTATIC int xarray_ReplaceObject (XArray *xarray, unsigned int index,
return XARRAY_SUCCESS;
}
-XSTATIC int xarray_Count (XArray *xarray, unsigned int *out_count)
+int xarray_Count (XArray *xarray, unsigned int *out_count)
{
XARRAY_ASSERT_NOT_NULL (xarray);
diff --git a/modules/codec/cmml/xarray.h b/modules/codec/cmml/xarray.h
index 3d772f2..2760538 100644
--- a/modules/codec/cmml/xarray.h
+++ b/modules/codec/cmml/xarray.h
@@ -27,11 +27,7 @@
#ifndef __XARRAY_H__
#define __XARRAY_H__
-/* define this to 'static' for static linkage */
-#define XSTATIC
-
#define XARRAY_DEFAULT_SIZE 69
-#define xarray_malloc malloc
/* Error codes */
enum xarray_errors
@@ -52,22 +48,22 @@ typedef struct
XArray;
/* Mutable methods */
-XSTATIC int xarray_AddObject (XArray *xarray, void *object);
-XSTATIC int xarray_InsertObject (XArray *xarray, void *object,
+int xarray_AddObject (XArray *xarray, void *object);
+int xarray_InsertObject (XArray *xarray, void *object,
unsigned int at_index);
-XSTATIC int xarray_RemoveLastObject (XArray *xarray);
-XSTATIC int xarray_RemoveObject (XArray *xarray, unsigned int at_index);
-XSTATIC int xarray_RemoveObjects (XArray *xarray, unsigned int at_index,
+int xarray_RemoveLastObject (XArray *xarray);
+int xarray_RemoveObject (XArray *xarray, unsigned int at_index);
+int xarray_RemoveObjects (XArray *xarray, unsigned int at_index,
int count);
-XSTATIC int xarray_RemoveObjectsAfter (XArray *xarray, unsigned int index);
-XSTATIC int xarray_ReplaceObject (XArray *xarray, unsigned int index,
+int xarray_RemoveObjectsAfter (XArray *xarray, unsigned int index);
+int xarray_ReplaceObject (XArray *xarray, unsigned int index,
void *new_object);
/* Immutable methods */
-XSTATIC XArray * xarray_New ();
-XSTATIC int xarray_ObjectAtIndex (XArray *xarray, unsigned int index,
+XArray * xarray_New ();
+int xarray_ObjectAtIndex (XArray *xarray, unsigned int index,
void **out_object);
-XSTATIC int xarray_Count (XArray *xarray, unsigned int *out_count);
+int xarray_Count (XArray *xarray, unsigned int *out_count);
#endif /* __XARRAY_H__ */
More information about the vlc-devel
mailing list