[Spice-devel] [Xspice PATCH 05/11] playback_dir_changed: rename variable "index" to "offset"
Uri Lublin
uril at redhat.com
Mon Jan 26 02:35:37 PST 2015
This fixes the following compiler warning.
spiceqxl_audio.c: In function ‘playback_dir_changed’:
spiceqxl_audio.c:386: warning: declaration of ‘index’ shadows a global declaration
---
src/spiceqxl_audio.c | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/spiceqxl_audio.c b/src/spiceqxl_audio.c
index 086b943..eba9b10 100644
--- a/src/spiceqxl_audio.c
+++ b/src/spiceqxl_audio.c
@@ -383,23 +383,23 @@ static void playback_dir_changed(int fd, int event, void *opaque)
{
qxl_screen_t *qxl = opaque;
static unsigned char buf[sizeof(struct inotify_event) + NAME_MAX + 1];
- static int index = 0;
+ static int offset = 0;
struct inotify_event *e;
int rc;
do {
- rc = read(fd, buf + index, sizeof(buf) - index);
+ rc = read(fd, buf + offset, sizeof(buf) - offset);
if (rc > 0) {
- index += rc;
- if (index >= sizeof(*e)) {
+ offset += rc;
+ if (offset >= sizeof(*e)) {
int len;
e = (struct inotify_event *) buf;
len = sizeof(*e) + e->len;
- if (index >= len) {
+ if (offset >= len) {
handle_one_change(qxl, e);
- if (index > len)
- memmove(buf, buf + index, index - len);
- index -= len;
+ if (offset > len)
+ memmove(buf, buf + offset, offset - len);
+ offset -= len;
}
}
}
--
1.7.1
More information about the Spice-devel
mailing list