]> git.sesse.net Git - vlc/blobdiff - src/misc/update.c
Support for creating object with custom type name and size.
[vlc] / src / misc / update.c
index 07f6375673d54d12d246d0bf59b95c1c2fac5505..871726d01ff724353eadb317287da88b8addff8f 100644 (file)
 #include <ctype.h>                                              /* tolower() */
 
 
-#include "vlc_update.h"
+#include <vlc_update.h>
 
-#include "vlc_block.h"
-#include "vlc_stream.h"
-#include "vlc_xml.h"
-#include "vlc_interaction.h"
-#include "charset.h"
+#include <vlc_block.h>
+#include <vlc_stream.h>
+#include <vlc_xml.h>
+#include <vlc_interface.h>
+#include <vlc_charset.h>
 
 /*****************************************************************************
  * Misc defines
@@ -221,16 +221,16 @@ void GetMirrorsList( update_t *p_update, vlc_bool_t b_force )
 
     xml_t *p_xml = NULL;
     xml_reader_t *p_xml_reader = NULL;
-
     char *psz_eltname = NULL;
     //char *psz_eltvalue = NULL;
     char *psz_name = NULL;
     char *psz_value = NULL;
-
-    struct update_mirror_t tmp_mirror = {0};
+    struct update_mirror_t tmp_mirror;
 
     vlc_mutex_lock( &p_update->lock );
 
+    memset( &tmp_mirror, 0, sizeof(struct update_mirror_t));
+
     if( p_update->b_mirrors && b_force == VLC_FALSE )
     {
         vlc_mutex_unlock( &p_update->lock );
@@ -399,11 +399,14 @@ void GetFilesList( update_t *p_update, vlc_bool_t b_force )
     char *psz_value = NULL;
 
     struct update_release_t *p_release = NULL;
-    struct update_release_t tmp_release = {0};
-    struct update_file_t tmp_file = {0};
+    struct update_release_t tmp_release;
+    struct update_file_t tmp_file;
 
     vlc_bool_t b_os = VLC_FALSE, b_arch = VLC_FALSE;
 
+    memset( &tmp_release, 0, sizeof(struct update_release_t) );
+    memset( &tmp_file, 0, sizeof(struct update_file_t) );
+
     tmp_release.i_type = UPDATE_RELEASE_TYPE_STABLE;
 
     vlc_mutex_lock( &p_update->lock );
@@ -546,7 +549,7 @@ void GetFilesList( update_t *p_update, vlc_bool_t b_force )
                     if( !strcmp( psz_eltname, "version" ) )
                     {
                         int i;
-                        /* look for a previous occurence of this release */
+                        /* look for a previous occurrence of this release */
                         for( i = 0; i < p_update->i_releases; i++ )
                         {
                             p_release = p_update->p_releases + i;
@@ -730,8 +733,10 @@ int CompareReleases( struct update_release_t *p1, struct update_release_t *p2 )
  */
 int CompareReleaseToCurrent( struct update_release_t *p )
 {
-    struct update_release_t c = {0};
+    struct update_release_t c;
     int r;
+
+    memset( &c, 0, sizeof(struct update_release_t) );
     c.psz_major = STRDUP( PACKAGE_VERSION_MAJOR );
     c.psz_minor = STRDUP( PACKAGE_VERSION_MINOR );
     c.psz_revision = STRDUP( PACKAGE_VERSION_REVISION );
@@ -1226,7 +1231,7 @@ void update_download( update_iterator_t *p_uit, char *psz_dest )
  * \param l_size the size in bytes
  * \return the size as a string
  */
-char *size_str( long int l_size )
+static char *size_str( long int l_size )
 {
     char *psz_tmp;
     if( l_size>> 30 )