[vlc-devel] commit: sccanf supports %p, use it instead of hacky %ju ( Rémi Denis-Courmont )

git version control git at videolan.org
Wed Jan 14 21:53:50 CET 2009


vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Wed Jan 14 22:53:30 2009 +0200| [765e932556da0ac0608d29f30c021b8a5ce298d4] | committer: Rémi Denis-Courmont 

sccanf supports %p, use it instead of hacky %ju

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=765e932556da0ac0608d29f30c021b8a5ce298d4
---

 src/control/mediacontrol_audio_video.c |    2 +-
 src/video_output/vout_intf.c           |    6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/control/mediacontrol_audio_video.c b/src/control/mediacontrol_audio_video.c
index 6f7028b..f783f51 100644
--- a/src/control/mediacontrol_audio_video.c
+++ b/src/control/mediacontrol_audio_video.c
@@ -86,7 +86,7 @@ mediacontrol_snapshot( mediacontrol_Instance *self,
         vlc_object_release( p_input );
         RAISE_NULL( mediacontrol_InternalException, "Out of memory" );
     }
-    snprintf( path, 255, "object:%ju", (uintmax_t)(uintptr_t)p_cache );
+    snprintf( path, 255, "object:%p", p_cache );
     var_SetString( p_vout, "snapshot-path", path );
     var_SetString( p_vout, "snapshot-format", "png" );
 
diff --git a/src/video_output/vout_intf.c b/src/video_output/vout_intf.c
index d19b9d6..d6cf11b 100644
--- a/src/video_output/vout_intf.c
+++ b/src/video_output/vout_intf.c
@@ -568,13 +568,13 @@ int vout_Snapshot( vout_thread_t *p_vout, picture_t *p_pic )
     DIR *path;
     int i_ret;
     bool b_embedded_snapshot;
-    uintmax_t i_id = (uintptr_t)NULL;
+    void *p_obj;
 
     /* */
     val.psz_string = var_GetNonEmptyString( p_vout, "snapshot-path" );
 
     /* Embedded snapshot : if snapshot-path == object:object_ptr */
-    if( val.psz_string && sscanf( val.psz_string, "object:%ju", &i_id ) > 0 )
+    if( val.psz_string && sscanf( val.psz_string, "object:%p", &p_obj ) > 0 )
         b_embedded_snapshot = true;
     else
         b_embedded_snapshot = false;
@@ -634,7 +634,7 @@ int vout_Snapshot( vout_thread_t *p_vout, picture_t *p_pic )
      */
     if( b_embedded_snapshot )
     {
-        vlc_object_t* p_dest = (vlc_object_t *)(uintptr_t)i_id;
+        vlc_object_t* p_dest = p_obj;
         block_t *p_block;
         snapshot_t *p_snapshot;
         size_t i_size;




More information about the vlc-devel mailing list