History

Avoid C99 variable declarations within for statements.

We generally do not declare variables within for statements and there are compilers that choke on such constructs.

Diego Biurrun committed 14 years ago

Commit d246c181 parent 7dc747f3 files · +7 −5Browse files

Unified · Split

3 files
  1. avplay.c +3 −3
  2. libavcodec/pthread.c +2 −1
  3. libavdevice/dv1394.h +2 −1
avplay.c+3−3
@@ -2608,13 +2608,13 @@ static void stream_cycle_channel(VideoState *is, int codec_type) · 2607 unmodified lines
26082608
26092609 static void toggle_full_screen(void)
26102610 {
2611− is_full_screen = !is_full_screen;
26122611 #if defined(__APPLE__) && SDL_VERSION_ATLEAST(1, 2, 14)
26132612 /* OS X needs to empty the picture_queue */
2614− for (int i = 0; i < VIDEO_PICTURE_QUEUE_SIZE; i++) {
2613+ int i;
2614+ for (i = 0; i < VIDEO_PICTURE_QUEUE_SIZE; i++)
26152615 cur_stream->pictq[i].reallocate = 1;
2616− }
26172616 #endif
2617+ is_full_screen = !is_full_screen;
26182618 video_open(cur_stream);
26192619 }
26202620
libavcodec/pthread.c+2−1
@@ -865,6 +865,7 @@ error: · 864 unmodified lines
865865
866866 void ff_thread_flush(AVCodecContext *avctx)
867867 {
868+ int i;
868869 FrameThreadContext *fctx = avctx->thread_opaque;
869870
870871 if (!avctx->thread_opaque) return;
@@ -880,7 +881,7 @@ void ff_thread_flush(AVCodecContext *avctx) · 9 unmodified lines
880881 fctx->next_decoding = fctx->next_finished = 0;
881882 fctx->delaying = 1;
882883 fctx->prev_thread = NULL;
883− for (int i = 0; i < avctx->thread_count; i++) {
884+ for (i = 0; i < avctx->thread_count; i++) {
884885 PerThreadContext *p = &fctx->threads[i];
885886 // Make sure decode flush calls with size=0 won't return old frames
886887 p->got_frame = 0;
libavdevice/dv1394.h+2−1
@@ -175,7 +175,8 @@ · 174 unmodified lines
175175 if(status.dropped_frames > 0) {
176176 reset_dv1394();
177177 } else {
178− for(int i = 0; i < status.n_clear_frames; i++) {
178+ int i;
179+ for (i = 0; i < status.n_clear_frames; i++) {
179180 copy_DV_frame();
180181 }
181182 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t