]> granicus.if.org Git - handbrake/commitdiff
- cleanup gcc format warnings showing up on linux 64-bit
authorkonablend <kona8lend@gmail.com>
Thu, 25 Jun 2009 07:00:41 +0000 (07:00 +0000)
committerkonablend <kona8lend@gmail.com>
Thu, 25 Jun 2009 07:00:41 +0000 (07:00 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2619 b64f7644-9d1e-0410-96f1-a4d463321fa5

14 files changed:
libhb/decavcodec.c
libhb/decmetadata.c
libhb/decmpeg2.c
libhb/decsrtsub.c
libhb/dvd.c
libhb/dvdnav.c
libhb/encx264.c
libhb/fifo.c
libhb/muxcommon.c
libhb/muxmp4.c
libhb/reader.c
libhb/render.c
libhb/stream.c
libhb/sync.c

index 71f72fe81d87e8878569cb6dc537e5bf6def2193..e711a5a7fec3d12d1e3a71f23653a57bd08b9a3b 100644 (file)
@@ -525,12 +525,12 @@ static void log_chapter( hb_work_private_t *pv, int chap_num, int64_t pts )
     hb_chapter_t *c = hb_list_item( pv->job->title->list_chapter, chap_num - 1 );
     if ( c && c->title )
     {
-        hb_log( "%s: \"%s\" (%d) at frame %u time %lld",
+        hb_log( "%s: \"%s\" (%d) at frame %u time %"PRId64,
                 pv->context->codec->name, c->title, chap_num, pv->nframes, pts );
     }
     else
     {
-        hb_log( "%s: Chapter %d at frame %u time %lld",
+        hb_log( "%s: Chapter %d at frame %u time %"PRId64,
                 pv->context->codec->name, chap_num, pv->nframes, pts );
     }
 }
index df0c5b3ef7bc6c182d9be62859e6c83d224ac835..e377f8c25c95410ea0c46859f56e9d27aaa8b9dc 100644 (file)
@@ -84,7 +84,7 @@ static void decmp4metadata( hb_title_t *title )
                 chapter->minutes  = ( ( chapter->duration / 90000 ) % 3600 ) / 60;
                 chapter->seconds  = ( chapter->duration / 90000 ) % 60;
                 strcpy( chapter->title, chapter_list[i-1].title );
-                hb_deep_log( 2, "Added chapter %i, name='%s', dur=%lld, (%02i:%02i:%02i)", chapter->index, chapter->title, 
+                hb_deep_log( 2, "Added chapter %i, name='%s', dur=%"PRId64", (%02i:%02i:%02i)", chapter->index, chapter->title, 
                        chapter->duration, chapter->hours, 
                        chapter->minutes, chapter->seconds);
                 hb_list_add( title->list_chapter, chapter );
index 06522dfae9abdbd30d3663da5fb2724c51406df9..03d906dc8c3713211d8cfd067ebdf1dc1b93c39d 100644 (file)
@@ -299,7 +299,7 @@ static int hb_libmpeg2_decode( hb_libmpeg2_t * m, hb_buffer_t * buf_es,
                                                          buf->new_chap - 1 );
                         chap_name = c->title;
                     }
-                    hb_log( "mpeg2: \"%s\" (%d) at frame %u time %lld",
+                    hb_log( "mpeg2: \"%s\" (%d) at frame %u time %"PRId64,
                             chap_name, buf->new_chap, m->nframes, buf->start );
                 } else if ( m->nframes == 0 && m->job &&
                             hb_list_item( m->job->title->list_chapter,
@@ -307,7 +307,7 @@ static int hb_libmpeg2_decode( hb_libmpeg2_t * m, hb_buffer_t * buf_es,
                 {
                     hb_chapter_t * c = hb_list_item( m->job->title->list_chapter,
                                                      m->job->chapter_start - 1 );
-                    hb_log( "mpeg2: \"%s\" (%d) at frame %u time %lld", c->title,
+                    hb_log( "mpeg2: \"%s\" (%d) at frame %u time %"PRId64, c->title,
                             m->job->chapter_start, m->nframes, buf->start );
                 }
                 ++m->nframes;
index 51aaeeb906707fae49b4e28779627aee04ded96d..e5d694a3bbfbbbc54bb48073b2aa9eaf2475ee09 100644 (file)
@@ -155,7 +155,7 @@ static hb_buffer_t *srt_read( hb_work_private_t *pv )
 
                     if( !( start_time > pv->start_time && stop_time < pv->stop_time ) )
                     {
-                        hb_deep_log( 3, "Discarding SRT at time start %lld, stop %lld", start_time, stop_time);
+                        hb_deep_log( 3, "Discarding SRT at time start %"PRId64", stop %"PRId64, start_time, stop_time);
                         memset( &pv->current_entry, 0, sizeof( srt_entry_t ) );
                         ++(pv->number_of_entries);
                         pv->current_state = k_state_timecode;
@@ -259,7 +259,7 @@ static int decsrtInit( hb_work_object_t * w, hb_job_t * job )
             retval = 0;
         }
 
-        hb_deep_log( 3, "SRT Start time %lld, stop time %lld", pv->start_time, pv->stop_time);
+        hb_deep_log( 3, "SRT Start time %"PRId64", stop time %"PRId64, pv->start_time, pv->stop_time);
 
         pv->iconv_context = iconv_open( "utf8", pv->subtitle->config.src_codeset );
 
index b26725da94cff0fa18e359ee7c89d60b80822c8a..29ed04fd4c9c68bf8e80eec2eba112b705cac24f 100644 (file)
@@ -276,7 +276,7 @@ static hb_title_t * hb_dvdread_title_scan( hb_dvd_t * e, int t )
     title->hours    = title->duration / 90000 / 3600;
     title->minutes  = ( ( title->duration / 90000 ) % 3600 ) / 60;
     title->seconds  = ( title->duration / 90000 ) % 60;
-    hb_log( "scan: duration is %02d:%02d:%02d (%lld ms)",
+    hb_log( "scan: duration is %02d:%02d:%02d (%"PRId64" ms)",
             title->hours, title->minutes, title->seconds,
             title->duration / 90 );
 
@@ -597,7 +597,7 @@ static hb_title_t * hb_dvdread_title_scan( hb_dvd_t * e, int t )
         chapter->minutes   = ( seconds % 3600 ) / 60;
         chapter->seconds   = seconds % 60;
 
-        hb_log( "scan: chap %d c=%d->%d, b=%d->%d (%d), %lld ms",
+        hb_log( "scan: chap %d c=%d->%d, b=%d->%d (%d), %"PRId64" ms",
                 chapter->index, chapter->cell_start, chapter->cell_end,
                 chapter->block_start, chapter->block_end,
                 chapter->block_count, chapter->duration / 90 );
index 805e8f2bf194f492427a42a298e1eb97b725d7ac..8cc59951a61619b2e1c18865b363a012b85c75bf 100644 (file)
@@ -452,7 +452,7 @@ static hb_title_t * hb_dvdnav_title_scan( hb_dvd_t * e, int t )
     title->hours    = title->duration / 90000 / 3600;
     title->minutes  = ( ( title->duration / 90000 ) % 3600 ) / 60;
     title->seconds  = ( title->duration / 90000 ) % 60;
-    hb_log( "scan: duration is %02d:%02d:%02d (%lld ms)",
+    hb_log( "scan: duration is %02d:%02d:%02d (%"PRId64" ms)",
             title->hours, title->minutes, title->seconds,
             title->duration / 90 );
 
@@ -774,7 +774,7 @@ static hb_title_t * hb_dvdnav_title_scan( hb_dvd_t * e, int t )
         chapter->minutes   = ( seconds % 3600 ) / 60;
         chapter->seconds   = seconds % 60;
 
-        hb_log( "scan: chap %d c=%d->%d, b=%d->%d (%d), %lld ms",
+        hb_log( "scan: chap %d c=%d->%d, b=%d->%d (%d), %"PRId64" ms",
                 chapter->index, chapter->cell_start, chapter->cell_end,
                 chapter->block_start, chapter->block_end,
                 chapter->block_count, chapter->duration / 90 );
index 880ca23ed3d92ccf361b25c02ff5515662166abb..94523d35375f3de382abcb943423e91585e272a8 100644 (file)
@@ -596,7 +596,7 @@ static hb_buffer_t *x264_encode( hb_work_object_t *w, hb_buffer_t *in )
      */
     if( pv->last_stop != in->start )
     {
-        hb_log("encx264 input continuity err: last stop %lld  start %lld",
+        hb_log("encx264 input continuity err: last stop %"PRId64"  start %"PRId64,
                 pv->last_stop, in->start);
     }
     pv->last_stop = in->stop;
index 7337874bfe9673d22fea41f6e1d1b09cf9ebca97..48f6459709b269d3f60eff34ad1155f7588fe023 100644 (file)
@@ -90,8 +90,8 @@ void hb_buffer_pool_free( void )
         }
     }
 
-    hb_deep_log( 2, "Allocated %lld bytes of buffers on this pass and Freed %lld bytes, "
-           "%lld bytes leaked", buffers.allocated, freed, buffers.allocated - freed);
+    hb_deep_log( 2, "Allocated %"PRId64" bytes of buffers on this pass and Freed %"PRId64" bytes, "
+           "%"PRId64" bytes leaked", buffers.allocated, freed, buffers.allocated - freed);
     buffers.allocated = 0;
     hb_unlock(buffers.lock);
 }
index 4c2c680090abfc43619e7f92e486891334d2ecc2..1f39df11d92ab52c14ac5fa398aca98ae72dab46 100644 (file)
@@ -340,21 +340,21 @@ finished:
 
         if( !stat( job->file, &sb ) )
         {
-            hb_deep_log( 2, "mux: file size, %lld bytes", (uint64_t) sb.st_size );
+            hb_deep_log( 2, "mux: file size, %"PRId64" bytes", (uint64_t) sb.st_size );
 
             bytes_total  = 0;
             frames_total = 0;
             for( i = 0; i < mux->ntracks; ++i )
             {
                 track = mux->track[i];
-                hb_log( "mux: track %d, %lld frames, %lld bytes, %.2f kbps, fifo %d",
+                hb_log( "mux: track %d, %"PRId64" frames, %"PRId64" bytes, %.2f kbps, fifo %d",
                         i, track->frames, track->bytes,
                         90000.0 * track->bytes / mux->pts / 125,
                         track->mf.flen );
                 if( !i && ( job->vquality < 0.0 || job->vquality > 1.0 ) )
                 {
                     /* Video */
-                    hb_deep_log( 2, "mux: video bitrate error, %+lld bytes",
+                    hb_deep_log( 2, "mux: video bitrate error, %+"PRId64" bytes",
                             (int64_t)(track->bytes - mux->pts * job->vbitrate * 125 / 90000) );
                 }
                 bytes_total  += track->bytes;
index aaaa7d94b9afe19f1cff61b17c6a4a4508642668..e8e52751c282dc0cd0c5f8c5cb89bdce8069d2b6 100644 (file)
@@ -60,7 +60,7 @@ static int MP4TuneTrackDurationPerChunk( hb_mux_object_t* m, MP4TrackId trackId
         return 0;
     }
 
-    hb_deep_log( 2, "muxmp4: track %u, chunk duration %llu", MP4FindTrackIndex( m->file, trackId ), dur );
+    hb_deep_log( 2, "muxmp4: track %u, chunk duration %"PRIu64, MP4FindTrackIndex( m->file, trackId ), dur );
     return 1;
 }
 
@@ -548,8 +548,8 @@ static int MP4Mux( hb_mux_object_t * m, hb_mux_data_t * mux_data,
             offset = buf->start + m->init_delay - m->sum_dur;
             if ( offset < 0 )
             {
-                hb_log("MP4Mux: illegal render offset %lld, start %lld,"
-                       "stop %lld, sum_dur %lld",
+                hb_log("MP4Mux: illegal render offset %"PRId64", start %"PRId64","
+                       "stop %"PRId64", sum_dur %"PRId64,
                        offset, buf->start, buf->stop, m->sum_dur );
                 offset = 0;
             }
@@ -596,8 +596,8 @@ static int MP4Mux( hb_mux_object_t * m, hb_mux_data_t * mux_data,
                be possible and usually indicates a bug in the upstream code.
                Complain in the hope that someone will go find the bug but
                try to fix the error so that the file will still be playable. */
-            hb_log("MP4Mux: illegal duration %lld, start %lld,"
-                   "stop %lld, sum_dur %lld",
+            hb_log("MP4Mux: illegal duration %"PRId64", start %"PRId64","
+                   "stop %"PRId64", sum_dur %"PRId64,
                    duration, buf->start, buf->stop, m->sum_dur );
             /* we don't know when the next frame starts so we can't pick a
                valid duration for this one. we pick something "short"
@@ -708,9 +708,9 @@ static int MP4Mux( hb_mux_object_t * m, hb_mux_data_t * mux_data,
             }
 
             mux_data->sum_dur += (buf->stop - buf->start);
-            hb_deep_log(3, "MuxMP4:Sub:%fs:%lld:%lld:%lld: %s", (float)buf->start / 90000, buf->start, buf->stop, 
+            hb_deep_log(3, "MuxMP4:Sub:%fs:%"PRId64":%"PRId64":%"PRId64": %s", (float)buf->start / 90000, buf->start, buf->stop, 
                    (buf->stop - buf->start), buf->data);
-            hb_deep_log(3, "MuxMP4:Total time elapsed:%lld", mux_data->sum_dur);
+            hb_deep_log(3, "MuxMP4:Total time elapsed:%"PRId64, mux_data->sum_dur);
         }
     }
     else
index 5dc30afe9bc87bd63146fa3de39fe92f095a3f85..88617f90b63eba6aed464a896ef6ee45e07ed256 100644 (file)
@@ -343,7 +343,7 @@ static void ReaderFunc( void * _r )
                     // force a new scr offset computation
                     r->scr_changes = r->demux.scr_changes - 1;
                     r->saw_video = 1;
-                    hb_log( "reader: first SCR %lld", r->demux.last_scr );
+                    hb_log( "reader: first SCR %"PRId64, r->demux.last_scr );
                 }
                 else
                 {
index 894bdb0d05bf2974c821a0e47f91af088b596c3c..5b9ccca88a5232986cd7677daaf070c1fc9ecdcb 100644 (file)
@@ -674,10 +674,10 @@ void renderClose( hb_work_object_t * w )
     /* Preserve dropped frame count for more accurate framerates in 2nd passes. */
     interjob->render_dropped = pv->dropped_frames;
 
-    hb_log("render: lost time: %lld (%i frames)", pv->total_lost_time, pv->dropped_frames);
-    hb_log("render: gained time: %lld (%i frames) (%lld not accounted for)", pv->total_gained_time, pv->extended_frames, pv->total_lost_time - pv->total_gained_time);
+    hb_log("render: lost time: %"PRId64" (%i frames)", pv->total_lost_time, pv->dropped_frames);
+    hb_log("render: gained time: %"PRId64" (%i frames) (%"PRId64" not accounted for)", pv->total_gained_time, pv->extended_frames, pv->total_lost_time - pv->total_gained_time);
     if (pv->dropped_frames)
-        hb_log("render: average dropped frame duration: %lld", (pv->total_lost_time / pv->dropped_frames) );
+        hb_log("render: average dropped frame duration: %"PRId64, (pv->total_lost_time / pv->dropped_frames) );
 
     /* Cleanup subtitle queue */
     if( pv->subtitle_queue )
index 37682b14fae8c50ddcdde3f1fef9c02187f8895b..7f863c5086e1ce922c82b09e62fe1bd64c152ed1 100644 (file)
@@ -275,9 +275,12 @@ static void ts_warn_helper( hb_stream_t *stream, char *log, va_list args )
     }
 }
 
+static void ts_warn( hb_stream_t*, char*, ... ) HB_WPRINTF(2,3);
+static void ts_err( hb_stream_t*, int, char*, ... ) HB_WPRINTF(3,4);
+
 static void ts_warn( hb_stream_t *stream, char *log, ... )
 {
-    va_list     args;
+    va_list args;
     va_start( args, log );
     ts_warn_helper( stream, log, args );
     va_end( args );
@@ -285,7 +288,7 @@ static void ts_warn( hb_stream_t *stream, char *log, ... )
 
 static void ts_err( hb_stream_t *stream, int curstream, char *log, ... )
 {
-    va_list     args;
+    va_list args;
     va_start( args, log );
     ts_warn_helper( stream, log, args );
     va_end( args );
@@ -751,10 +754,10 @@ static const uint8_t *next_packet( hb_stream_t *stream )
         off_t pos2 = align_to_next_packet(stream);
         if ( pos2 == 0 )
         {
-            hb_log( "next_packet: eof while re-establishing sync @ %lld", pos );
+            hb_log( "next_packet: eof while re-establishing sync @ %"PRId64, pos );
             return NULL;
         }
-        ts_warn( stream, "next_packet: sync lost @ %lld, regained after %lld bytes",
+        ts_warn( stream, "next_packet: sync lost @ %"PRId64", regained after %"PRId64" bytes",
                  pos, pos2 );
     }
 }
@@ -1025,12 +1028,12 @@ static struct pts_pos hb_sample_pts(hb_stream_t *stream, uint64_t fpos)
         buf = hb_ts_stream_getPEStype( stream, stream->ts_video_pids[0] );
         if ( buf == NULL )
         {
-            hb_log("hb_sample_pts: couldn't find video packet near %llu", fpos);
+            hb_log("hb_sample_pts: couldn't find video packet near %"PRIu64, fpos);
             return pp;
         }
         if ( ( buf[7] >> 7 ) != 1 )
         {
-            hb_log("hb_sample_pts: no PTS in video packet near %llu", fpos);
+            hb_log("hb_sample_pts: no PTS in video packet near %"PRIu64, fpos);
             return pp;
         }
         pp.pts = ( ( (uint64_t)buf[9] >> 1 ) & 7 << 30 ) |
@@ -1229,7 +1232,7 @@ int hb_stream_seek_chapter( hb_stream_t * stream, int chapter_num )
 
     int64_t pos = ( ( ( sum_dur - chapter->duration ) * AV_TIME_BASE ) / 90000 );
 
-    hb_deep_log( 2, "Seeking to chapter %d: starts %lld, ends %lld, AV pos %lld",
+    hb_deep_log( 2, "Seeking to chapter %d: starts %"PRId64", ends %"PRId64", AV pos %"PRId64,
                  chapter_num, sum_dur - chapter->duration, sum_dur, pos);
 
     if ( chapter_num > 1 && pos > 0 )
@@ -2721,7 +2724,7 @@ static hb_title_t *ffmpeg_title_scan( hb_stream_t *stream )
                 chapter->minutes  = ( ( chapter->duration / 90000 ) % 3600 ) / 60;
                 chapter->seconds  = ( chapter->duration / 90000 ) % 60;
                 strcpy( chapter->title, m->title );
-                hb_deep_log( 2, "Added chapter %i, name='%s', dur=%llu, (%02i:%02i:%02i)",
+                hb_deep_log( 2, "Added chapter %i, name='%s', dur=%"PRIu64", (%02i:%02i:%02i)",
                             chapter->index, chapter->title,
                             chapter->duration, chapter->hours,
                             chapter->minutes, chapter->seconds );
@@ -2898,7 +2901,7 @@ static int ffmpeg_read( hb_stream_t *stream, hb_buffer_t *buf )
         {
             stream->chapter_end += chapter->duration;
             buf->new_chap = stream->chapter + 1;
-            hb_deep_log( 2, "ffmpeg_read starting chapter %i at %lld",
+            hb_deep_log( 2, "ffmpeg_read starting chapter %i at %"PRId64,
                          buf->new_chap, buf->start);
         } else {
             // Must have run out of chapters, stop looking.
index 14e5048dc09da382b62949a47ae4661e7dd0a6e3..1ceeee9c39e72a2d97721d6391882fc3a3c677b0 100644 (file)
@@ -377,7 +377,7 @@ static void SyncVideo( hb_work_object_t * w )
                  * as if it started at zero so that our audio timing will
                  * be in sync.
                  */
-                hb_log( "sync: first pts is %lld", cur->start );
+                hb_log( "sync: first pts is %"PRId64, cur->start );
                 cur->start = 0;
             }
         }
@@ -417,7 +417,7 @@ static void SyncVideo( hb_work_object_t * w )
         if ( pv->first_drop )
         {
             hb_log( "sync: video time didn't advance - dropped %d frames "
-                    "(delta %d ms, current %lld, next %lld, dur %d)",
+                    "(delta %d ms, current %"PRId64", next %"PRId64", dur %d)",
                     pv->drop_count, (int)( cur->start - pv->first_drop ) / 90,
                     cur->start, next->start, (int)( next->start - cur->start ) );
             pv->first_drop = 0;
@@ -714,7 +714,7 @@ static void SyncVideo( hb_work_object_t * w )
         pts_skip = 0;
         if ( duration <= 0 )
         {
-            hb_log( "sync: invalid video duration %lld, start %lld, next %lld",
+            hb_log( "sync: invalid video duration %"PRId64", start %"PRId64", next %"PRId64"",
                     duration, buf_tmp->start, next->start );
         }
 
@@ -879,7 +879,7 @@ static void SyncAudio( hb_work_object_t * w, int i )
         {
             // we were dropping old data but input buf time is now current
             hb_log( "sync: audio %d time went backwards %d ms, dropped %d frames "
-                    "(next %lld, current %lld)", i,
+                    "(next %"PRId64", current %"PRId64")", i,
                     (int)( sync->next_pts - sync->first_drop ) / 90,
                     sync->drop_count, sync->first_drop, sync->next_pts );
             sync->first_drop = 0;
@@ -894,7 +894,7 @@ static void SyncAudio( hb_work_object_t * w, int i )
                 // frame and this. assume we got a corrupted timestamp
                 // and just drop the next buf.
                 hb_log( "sync: %d minute time gap in audio %d - dropping buf"
-                        "  start %lld, next %lld",
+                        "  start %"PRId64", next %"PRId64,
                         (int)((start - sync->next_pts) / (90000*60)),
                         i, start, sync->next_pts );
                 buf = hb_fifo_get( audio->priv.fifo_raw );
@@ -910,7 +910,7 @@ static void SyncAudio( hb_work_object_t * w, int i )
             if( sync->audio->config.out.codec == HB_ACODEC_DCA )
             {
                 hb_log( "sync: audio gap %d ms. Skipping frames. Audio %d"
-                        "  start %lld, next %lld",
+                        "  start %"PRId64", next %"PRId64,
                         (int)((start - sync->next_pts) / 90),
                         i, start, sync->next_pts );
                 pv->audio_passthru_slip += (start - sync->next_pts);
@@ -918,7 +918,7 @@ static void SyncAudio( hb_work_object_t * w, int i )
                 return;
             }
             hb_log( "sync: adding %d ms of silence to audio %d"
-                    "  start %lld, next %lld",
+                    "  start %"PRId64", next %"PRId64,
                     (int)((start - sync->next_pts) / 90),
                     i, start, sync->next_pts );
             InsertSilence( w, i, start - sync->next_pts );