Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
7bca27a5
Commit
7bca27a5
authored
Dec 11, 2007
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify the version test dans remove useless things
parent
0761ae5e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
89 deletions
+33
-89
src/misc/update.c
src/misc/update.c
+33
-89
No files found.
src/misc/update.c
View file @
7bca27a5
...
@@ -47,8 +47,6 @@
...
@@ -47,8 +47,6 @@
* Misc defines
* Misc defines
*****************************************************************************/
*****************************************************************************/
//#define UPDATE_VLC_STATUS_URL "http://zen.via.ecp.fr/~ivoire/videolan/update"
#if defined( UNDER_CE )
#if defined( UNDER_CE )
# define UPDATE_VLC_STATUS_URL "http://update.videolan.org/vlc/status-ce"
# define UPDATE_VLC_STATUS_URL "http://update.videolan.org/vlc/status-ce"
#elif defined( WIN32 )
#elif defined( WIN32 )
...
@@ -74,7 +72,7 @@
...
@@ -74,7 +72,7 @@
*****************************************************************************/
*****************************************************************************/
static
void
EmptyRelease
(
update_t
*
p_update
);
static
void
EmptyRelease
(
update_t
*
p_update
);
static
void
GetUpdateFile
(
update_t
*
p_update
);
static
void
GetUpdateFile
(
update_t
*
p_update
);
static
int
cmp
(
int
i1
,
int
i
2
);
static
int
extracmp
(
char
*
psz_1
,
char
*
psz_
2
);
static
int
CompareReleases
(
const
struct
update_release_t
*
p1
,
static
int
CompareReleases
(
const
struct
update_release_t
*
p1
,
const
struct
update_release_t
*
p2
);
const
struct
update_release_t
*
p2
);
...
@@ -122,29 +120,10 @@ void update_Delete( update_t *p_update )
...
@@ -122,29 +120,10 @@ void update_Delete( update_t *p_update )
vlc_mutex_destroy
(
&
p_update
->
lock
);
vlc_mutex_destroy
(
&
p_update
->
lock
);
if
(
p_update
->
release
.
psz_svnrev
)
FREENULL
(
p_update
->
release
.
psz_svnrev
);
{
FREENULL
(
p_update
->
release
.
psz_extra
);
free
(
p_update
->
release
.
psz_svnrev
);
FREENULL
(
p_update
->
release
.
psz_url
);
p_update
->
release
.
psz_svnrev
=
NULL
;
FREENULL
(
p_update
->
release
.
psz_desc
);
}
if
(
p_update
->
release
.
psz_extra
)
{
free
(
p_update
->
release
.
psz_extra
);
p_update
->
release
.
psz_extra
=
NULL
;
}
if
(
p_update
->
release
.
psz_url
)
{
free
(
p_update
->
release
.
psz_url
);
p_update
->
release
.
psz_url
=
NULL
;
}
if
(
p_update
->
release
.
psz_desc
)
{
free
(
p_update
->
release
.
psz_desc
);
p_update
->
release
.
psz_desc
=
NULL
;
}
free
(
p_update
);
free
(
p_update
);
}
}
...
@@ -161,29 +140,10 @@ static void EmptyRelease( update_t *p_update )
...
@@ -161,29 +140,10 @@ static void EmptyRelease( update_t *p_update )
p_update
->
release
.
i_minor
=
0
;
p_update
->
release
.
i_minor
=
0
;
p_update
->
release
.
i_revision
=
0
;
p_update
->
release
.
i_revision
=
0
;
if
(
p_update
->
release
.
psz_svnrev
)
FREENULL
(
p_update
->
release
.
psz_svnrev
);
{
FREENULL
(
p_update
->
release
.
psz_extra
);
free
(
p_update
->
release
.
psz_svnrev
);
FREENULL
(
p_update
->
release
.
psz_url
);
p_update
->
release
.
psz_svnrev
=
NULL
;
FREENULL
(
p_update
->
release
.
psz_desc
);
}
if
(
p_update
->
release
.
psz_extra
)
{
free
(
p_update
->
release
.
psz_extra
);
p_update
->
release
.
psz_extra
=
NULL
;
}
if
(
p_update
->
release
.
psz_url
)
{
free
(
p_update
->
release
.
psz_url
);
p_update
->
release
.
psz_url
=
NULL
;
}
if
(
p_update
->
release
.
psz_desc
)
{
free
(
p_update
->
release
.
psz_desc
);
p_update
->
release
.
psz_desc
=
NULL
;
}
}
}
/**
/**
...
@@ -228,15 +188,8 @@ static void GetUpdateFile( update_t *p_update )
...
@@ -228,15 +188,8 @@ static void GetUpdateFile( update_t *p_update )
p_update
->
release
.
i_minor
=
i_minor
;
p_update
->
release
.
i_minor
=
i_minor
;
p_update
->
release
.
i_revision
=
i_revision
;
p_update
->
release
.
i_revision
=
i_revision
;
if
(
psz_svnrev
)
p_update
->
release
.
psz_svnrev
=
psz_svnrev
?
psz_svnrev
:
STRDUP
(
""
);
p_update
->
release
.
psz_svnrev
=
psz_svnrev
;
p_update
->
release
.
psz_extra
=
psz_extra
?
psz_extra
:
STRDUP
(
""
);
else
p_update
->
release
.
psz_svnrev
=
STRDUP
(
""
);
if
(
psz_extra
)
p_update
->
release
.
psz_extra
=
psz_extra
;
else
p_update
->
release
.
psz_extra
=
STRDUP
(
""
);
}
}
else
else
{
{
...
@@ -287,22 +240,29 @@ void update_Check( update_t *p_update )
...
@@ -287,22 +240,29 @@ void update_Check( update_t *p_update )
}
}
/**
/**
* Compare two
integers
* Compare two
extra
*
*
* \param p1 first integer
* \param p1 first integer
* \param p2 second integer
* \param p2 second integer
* \return like strcmp
* \return like strcmp
*/
*/
static
int
cmp
(
int
i1
,
int
i
2
)
static
int
extracmp
(
char
*
psz_1
,
char
*
psz_
2
)
{
{
if
(
i1
<
i2
)
if
(
psz_1
[
0
]
==
'-'
)
return
-
1
;
{
else
if
(
i1
==
i2
)
if
(
psz_2
[
0
]
==
'-'
)
return
0
;
return
strcmp
(
psz_1
,
psz_2
)
;
else
else
return
1
;
return
1
;
}
else
{
if
(
psz_2
[
0
]
==
'-'
)
return
-
1
;
else
return
strcmp
(
psz_1
,
psz_2
);
}
}
}
/**
/**
* Compare two release numbers
* Compare two release numbers
*
*
...
@@ -313,29 +273,13 @@ static int cmp( int i1, int i2 )
...
@@ -313,29 +273,13 @@ static int cmp( int i1, int i2 )
static
int
CompareReleases
(
const
struct
update_release_t
*
p1
,
static
int
CompareReleases
(
const
struct
update_release_t
*
p1
,
const
struct
update_release_t
*
p2
)
const
struct
update_release_t
*
p2
)
{
{
int
d
;
int32_t
d
;
if
(
(
d
=
cmp
(
p1
->
i_major
,
p2
->
i_major
)
)
)
;
d
=
(
p1
->
i_major
<<
24
)
+
(
p1
->
i_minor
<<
16
)
+
(
p1
->
i_revision
<<
8
);
else
if
(
(
d
=
cmp
(
p1
->
i_minor
,
p2
->
i_minor
)
)
)
;
d
=
d
-
(
p2
->
i_major
<<
24
)
-
(
p2
->
i_minor
<<
16
)
-
(
p2
->
i_revision
<<
8
);
else
if
(
(
d
=
cmp
(
p1
->
i_revision
,
p2
->
i_revision
)
)
)
;
d
+=
extracmp
(
p1
->
psz_extra
,
p2
->
psz_extra
);
else
{
if
(
p1
->
psz_extra
[
0
]
==
'-'
)
{
if
(
p2
->
psz_extra
[
0
]
==
'-'
)
d
=
strcmp
(
p1
->
psz_extra
,
p2
->
psz_extra
);
else
d
=
1
;
}
else
{
if
(
p2
->
psz_extra
[
0
]
==
'-'
)
d
=
-
1
;
else
d
=
strcmp
(
p1
->
psz_extra
,
p2
->
psz_extra
);
}
if
(
d
==
0
)
if
(
d
==
0
)
d
=
strcmp
(
p1
->
psz_svnrev
,
p2
->
psz_svnrev
);
d
=
strcmp
(
p1
->
psz_svnrev
,
p2
->
psz_svnrev
);
}
if
(
d
<
0
)
if
(
d
<
0
)
return
UpdateReleaseStatusOlder
;
return
UpdateReleaseStatusOlder
;
...
...
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