diff options
author | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2008-05-09 17:51:40 +0200 |
---|---|---|
committer | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2008-05-09 17:51:40 +0200 |
commit | 902d66eb8304ccffdb683b7130e9f548011b8d30 (patch) | |
tree | 9cdd73b5f68131ba2d4944d17e183b4313bdb559 /src/input/input_dvb.c | |
parent | a51427608e2f4543ae0cb0598517a1e4f6b0928b (diff) | |
download | xine-lib-902d66eb8304ccffdb683b7130e9f548011b8d30.tar.gz xine-lib-902d66eb8304ccffdb683b7130e9f548011b8d30.tar.bz2 |
Avoid loop for common memory operations (zeroing, copying, moving).
Use the proper function for common memory operations (memset() for
zeroing, memcpy() for copying, memmove() for moving), instead of
looping through arrays.
By extension, remove loops to reset arrays when they were allocated
with calloc() and thus already zeroed.
Diffstat (limited to 'src/input/input_dvb.c')
-rw-r--r-- | src/input/input_dvb.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/input/input_dvb.c b/src/input/input_dvb.c index 121e11b11..669cd1e14 100644 --- a/src/input/input_dvb.c +++ b/src/input/input_dvb.c @@ -587,8 +587,7 @@ static tuner_t *tuner_init(xine_t * xine, int adapter) xprintf(this->xine, XINE_VERBOSITY_DEBUG, "tuner_init adapter=%d\n", adapter); this->fd_frontend = -1; - for (x = 0; x < MAX_FILTERS; x++) - this->fd_pidfilter[x] = 0; + memset(this->fd_pidfilter, 0, sizeof(this->fd_pidfilter)); this->xine = xine; this->adapter_num = adapter; @@ -933,8 +932,7 @@ static channel_t *load_channels(xine_t *xine, xine_stream_t *stream, int *num_ch /* Initially there's no EPG data in the EPG structs. */ channels[num_channels].epg_count = 0; - for (i = 0; i < MAX_EPG_ENTRIES_PER_CHANNEL; ++i) - channels[num_channels].epg[i] = NULL; + memset(channels[num_channels].epg, 0, sizeof(channels[num_channels].epg)); num_channels++; } |