Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
8f633e5b
Commit
8f633e5b
authored
Nov 30, 2008
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmml: cleaning (remove dummy code). xarray will be removed one day.
parent
f52d10e5
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
44 deletions
+21
-44
modules/codec/cmml/history.h
modules/codec/cmml/history.h
+0
-1
modules/codec/cmml/xarray.c
modules/codec/cmml/xarray.c
+11
-29
modules/codec/cmml/xarray.h
modules/codec/cmml/xarray.h
+10
-14
No files found.
modules/codec/cmml/history.h
View file @
8f633e5b
...
...
@@ -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
...
...
modules/codec/cmml/xarray.c
View file @
8f633e5b
...
...
@@ -33,7 +33,7 @@
#include "xarray.h"
/* local prototypes */
X
STATIC
X
Array
*
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; \
}
X
STATIC
X
Array
*
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
);
...
...
modules/codec/cmml/xarray.h
View file @
8f633e5b
...
...
@@ -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 */
X
STATIC
X
Array
*
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__ */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment