diff options
author | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2007-04-14 18:44:01 +0200 |
---|---|---|
committer | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2007-04-14 18:44:01 +0200 |
commit | 2cfbc00f7a0212f4df2bf4cfadf940213e1d4ae0 (patch) | |
tree | 0e22a3591df8fe2582673851fabe458d4c7bab17 /src | |
parent | 52f0b652d94463e622fbfcdde5b4f6bf01eed681 (diff) | |
download | xine-lib-2cfbc00f7a0212f4df2bf4cfadf940213e1d4ae0.tar.gz xine-lib-2cfbc00f7a0212f4df2bf4cfadf940213e1d4ae0.tar.bz2 |
Use memset instead of loops to initialise arrays to zero.
Diffstat (limited to 'src')
-rw-r--r-- | src/demuxers/demux_ts.c | 4 | ||||
-rw-r--r-- | src/video_out/video_out_xxmc.c | 12 | ||||
-rw-r--r-- | src/xine-utils/monitor.c | 11 |
3 files changed, 9 insertions, 18 deletions
diff --git a/src/demuxers/demux_ts.c b/src/demuxers/demux_ts.c index aea0c8ca1..83b2d982c 100644 --- a/src/demuxers/demux_ts.c +++ b/src/demuxers/demux_ts.c @@ -2227,9 +2227,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, this->status = DEMUX_FINISHED; #ifdef TS_READ_STATS - for (i=0; i<=NPKT_PER_READ; i++) { - this->rstat[i] = 0; - } + memset(this-rstat, 0, sizeof(*this->rstat)*NPKT_PER_READ); #endif /* DVBSUB */ diff --git a/src/video_out/video_out_xxmc.c b/src/video_out/video_out_xxmc.c index fd19f391b..8ba60f6c7 100644 --- a/src/video_out/video_out_xxmc.c +++ b/src/video_out/video_out_xxmc.c @@ -165,14 +165,10 @@ static void xxmc_xvmc_surface_handler_construct(xxmc_driver_t *this) xvmc_surface_handler_t *handler = &this->xvmc_surf_handler; pthread_mutex_init(&handler->mutex,NULL); - for (i=0; i<XVMC_MAX_SURFACES; ++i) { - handler->surfInUse[i] = 0; - handler->surfValid[i] = 0; - } - for (i=0; i<XVMC_MAX_SUBPICTURES; ++i) { - handler->subInUse[i] = 0; - handler->subValid[i] = 0; - } + memset(handler->surfInUse, 0, sizeof(*handler->surfInUse)*XVMC_MAX_SURFACES); + memset(handler->surfValid, 0, sizeof(*handler->surfValid)*XVMC_MAX_SURFACES); + memset(handler->subInUse, 0, sizeof(*handler->subInUse)*XVMC_MAX_SUBPICTURES); + memset(handler->subValid, 0, sizeof(*handler->subValid)*XVMC_MAX_SUBPICTURES); } static void xxmc_xvmc_destroy_surfaces(xxmc_driver_t *this) diff --git a/src/xine-utils/monitor.c b/src/xine-utils/monitor.c index 1a348087c..19a9dc977 100644 --- a/src/xine-utils/monitor.c +++ b/src/xine-utils/monitor.c @@ -41,13 +41,10 @@ static long profiler_calls[MAX_ID] ; static const char *profiler_label[MAX_ID] ; void xine_profiler_init () { - int i; - for (i=0; i<MAX_ID; i++) { - profiler_times[i] = 0; - profiler_start[i] = 0; - profiler_calls[i] = 0; - profiler_label[i] = NULL; - } + memset(profiler_times, 0, sizeof(profiler_times)); + memset(profiler_start, 0, sizeof(profiler_start)); + memset(profiler_calls, 0, sizeof(profiler_calls)); + memset(profiler_label, 0, sizeof(profiler_label)); } int xine_profiler_allocate_slot (const char *label) { |