[vlc-devel] commit: Macro safety. ( Rémi Duraffort )
git version control
git at videolan.org
Wed Jul 15 14:41:32 CEST 2009
vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Wed Jul 15 13:21:36 2009 +0200| [5d81c9262197dcce270d8988b8d4c31f7dd29883] | committer: Rémi Duraffort
Macro safety.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5d81c9262197dcce270d8988b8d4c31f7dd29883
---
modules/demux/playlist/itml.c | 12 ++++++------
modules/demux/playlist/itml.h | 11 +++++------
2 files changed, 11 insertions(+), 12 deletions(-)
diff --git a/modules/demux/playlist/itml.c b/modules/demux/playlist/itml.c
index 53c7569..a9f89e8 100644
--- a/modules/demux/playlist/itml.c
+++ b/modules/demux/playlist/itml.c
@@ -423,12 +423,12 @@ static void free_track( track_elem_t *p_track )
if ( !p_track )
return;
- FREE( p_track->name )
- FREE( p_track->artist )
- FREE( p_track->album )
- FREE( p_track->genre )
- FREE( p_track->trackNum )
- FREE( p_track->location )
+ FREENULL( p_track->name );
+ FREENULL( p_track->artist );
+ FREENULL( p_track->album );
+ FREENULL( p_track->genre );
+ FREENULL( p_track->trackNum );
+ FREENULL( p_track->location );
p_track->duration = 0;
free( p_track );
}
diff --git a/modules/demux/playlist/itml.h b/modules/demux/playlist/itml.h
index c29fef3..58c7506 100644
--- a/modules/demux/playlist/itml.h
+++ b/modules/demux/playlist/itml.h
@@ -26,12 +26,11 @@
*/
/* defines */
-#define FREE(v) free(v);v=NULL;
-#define FREE_NAME() free(psz_name);psz_name=NULL;
-#define FREE_VALUE() free(psz_value);psz_value=NULL;
-#define FREE_KEY() free(psz_key);psz_key=NULL;
-#define FREE_ATT() FREE_NAME();FREE_VALUE()
-#define FREE_ATT_KEY() FREE_NAME();FREE_VALUE();FREE_KEY()
+#define FREE_NAME() FREENULL( psz_name )
+#define FREE_VALUE() FREENULL( psz_value )
+#define FREE_KEY() FREENULL( psz_key )
+#define FREE_ATT() do{ FREE_NAME();FREE_VALUE(); }while(0)
+#define FREE_ATT_KEY() do{ FREE_NAME();FREE_VALUE();FREE_KEY();} while(0)
#define UNKNOWN_CONTENT 0
#define SIMPLE_CONTENT 1
More information about the vlc-devel
mailing list