]> source.dussan.org Git - tigervnc.git/commitdiff
Simplify rfb::ParameterIterator - we always iterate over all enabled params.
authorAdam Tkac <atkac@redhat.com>
Thu, 14 Mar 2013 17:11:22 +0000 (17:11 +0000)
committerAdam Tkac <atkac@redhat.com>
Thu, 14 Mar 2013 17:11:22 +0000 (17:11 +0000)
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@5064 3789f03b-4d11-0410-bbf8-ca57d06f2519

common/rfb/Configuration.h
unix/xserver/hw/vnc/vncExtInit.cc
unix/xserver/hw/vnc/xf86vncModule.cc

index e3337f4469b5820563cbfc541deb66314b4f002b..4feeb7892cfbeb86cd73cc3a0b443b0a0ef5cfa1 100644 (file)
@@ -268,12 +268,12 @@ namespace rfb {
   };
 
   // -=- ParameterIterator
-  //     Iterates over all the Parameters in a Configuration group.  The
-  //     current Parameter is accessed via param, the current Configuration
-  //     via config.  The next() method moves on to the next Parameter.
+  //     Iterates over all enabled parameters (global + server/viewer).
+  //     Current Parameter is accessed via param, the current Configuration
+  //     via config. The next() method moves on to the next Parameter.
 
   struct ParameterIterator {
-    ParameterIterator(Configuration* c) : config(c), param(c ? c->head : 0) {}
+    ParameterIterator() : config(Configuration::global()), param(config->head) {}
     void next() {
       param = param->_next;
       while (!param) {
index 95c84ffe50bb252bcb5bdf3b2e40221af35b9d35..7fad77d012aae2504b4b1e94e6b05de879dcb6e6 100644 (file)
@@ -768,7 +768,7 @@ static int ProcVncExtListParams(ClientPtr client)
 
   int nParams = 0;
   int len = 0;
-  for (ParameterIterator i(Configuration::global()); i.param; i.next()) {
+  for (ParameterIterator i; i.param; i.next()) {
     int l = strlen(i.param->getName());
     if (l <= 255) {
       nParams++;
@@ -792,7 +792,7 @@ static int ProcVncExtListParams(ClientPtr client)
   WriteToClient(client, sizeof(xVncExtListParamsReply), (char *)&rep);
   rdr::U8* data = new rdr::U8[len];
   rdr::U8* ptr = data;
-  for (ParameterIterator i(Configuration::global()); i.param; i.next()) {
+  for (ParameterIterator i; i.param; i.next()) {
     int l = strlen(i.param->getName());
     if (l <= 255) {
       *ptr++ = l;
index f37600b10ac7f8cfaf6b0f567eb28ffd4f9f051b..9352c807098a60528abd3544c1461947652bc0ca 100644 (file)
@@ -97,7 +97,7 @@ static void vncExtensionInitWithParams(INITARGS)
   for (int scr = 0; scr < screenInfo.numScreens; scr++) {
     ScrnInfoPtr pScrn = xf86Screens[scr];
 
-    for (ParameterIterator i(Configuration::global()); i.param; i.next()) {
+    for (ParameterIterator i; i.param; i.next()) {
       const char *val;
 #if XORG < 112
       val = xf86FindOptionValue(pScrn->options, i.param->getName());