Przeglądaj źródła

cmPrefs.h/c Check existsFl prior to signaling kDuplicateIdPrRC error in _cmPrefsCreateJsonNode().

master
kevin 11 lat temu
rodzic
commit
56e192c00e
2 zmienionych plików z 6 dodań i 4 usunięć
  1. 3
    2
      cmPrefs.c
  2. 3
    2
      cmPrefs.h

+ 3
- 2
cmPrefs.c Wyświetl plik

1337
     pnp->id = _cmPrefsCalcNextAvailId(p);
1337
     pnp->id = _cmPrefsCalcNextAvailId(p);
1338
   else
1338
   else
1339
   {
1339
   {
1340
-    if( _cmPrefsIdToNodePtr(p, id, false ) != NULL )
1341
-      cmErrWarnMsg(&p->err,kDuplicateIdPrRC,"The preference variable id '%i' is used by multiple preference variables including '%s'.",id,cmStringNullGuard(pathString));
1340
+    if( existsFl == false )
1341
+      if( _cmPrefsIdToNodePtr(p, id, false ) != NULL )
1342
+        cmErrWarnMsg(&p->err,kDuplicateIdPrRC,"The preference variable id '%i' is used by multiple preference variables including '%s'.",id,cmStringNullGuard(pathString));
1342
   
1343
   
1343
     pnp->id = id;
1344
     pnp->id = id;
1344
   }
1345
   }

+ 3
- 2
cmPrefs.h Wyświetl plik

144
   cmPrRC_t cmPrefsPathSetString( cmPrH_t h, const cmChar_t* pathStr, const cmChar_t* val );
144
   cmPrRC_t cmPrefsPathSetString( cmPrH_t h, const cmChar_t* pathStr, const cmChar_t* val );
145
 
145
 
146
   // Create a new preference variable and set it's value to 'val'.
146
   // Create a new preference variable and set it's value to 'val'.
147
-  // If a variable with the same path and type already exists and kForceValuePrFl is set then update it's value to 'val'.
148
-  // Note that in this case if kForceValuePrFl is not set then the function returns quietly.
147
+  // If a variable with the same path and type already exists and kForceValuePrFl
148
+  // is set then update it's value to 'val'. Note that in this case if
149
+  //  kForceValuePrFl is not set then the function returns quietly.
149
   //
150
   //
150
   // If a variable with the same path but a different type exists then an error is returned.
151
   // If a variable with the same path but a different type exists then an error is returned.
151
   // 
152
   // 

Ładowanie…
Anuluj
Zapisz