[Xspice PATCH 05/11] playback_dir_changed: rename variable "index" to "offset"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]