aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llxml
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/llxml')
-rw-r--r--linden/indra/llxml/llcontrol.cpp75
-rw-r--r--linden/indra/llxml/llcontrol.h6
-rw-r--r--linden/indra/llxml/llxml_vc8.vcproj276
-rw-r--r--linden/indra/llxml/llxmlnode.cpp34
-rw-r--r--linden/indra/llxml/llxmlnode.h1
-rw-r--r--linden/indra/llxml/llxmlparser.cpp12
-rw-r--r--linden/indra/llxml/llxmlparser.h2
7 files changed, 344 insertions, 62 deletions
diff --git a/linden/indra/llxml/llcontrol.cpp b/linden/indra/llxml/llcontrol.cpp
index 79fd522..c365aed 100644
--- a/linden/indra/llxml/llcontrol.cpp
+++ b/linden/indra/llxml/llcontrol.cpp
@@ -132,7 +132,8 @@ void LLControlGroup::cleanup()
132 132
133LLControlBase* LLControlGroup::getControl(const LLString& name) 133LLControlBase* LLControlGroup::getControl(const LLString& name)
134{ 134{
135 return mNameTable[name]; 135 ctrl_name_table_t::iterator iter = mNameTable.find(name);
136 return iter == mNameTable.end() ? NULL : (LLControlBase*)iter->second;
136} 137}
137 138
138BOOL LLControlGroup::declareControl(const LLString& name, eControlType type, const LLSD initial_val, const LLString& comment, BOOL persist) 139BOOL LLControlGroup::declareControl(const LLString& name, eControlType type, const LLSD initial_val, const LLString& comment, BOOL persist)
@@ -143,9 +144,11 @@ BOOL LLControlGroup::declareControl(const LLString& name, eControlType type, con
143 LLControl* control = new LLControl(name, type, initial_val, comment, persist); 144 LLControl* control = new LLControl(name, type, initial_val, comment, persist);
144 mNameTable[name] = control; 145 mNameTable[name] = control;
145 return TRUE; 146 return TRUE;
146 } else 147 }
148 else
147 { 149 {
148 llwarns << "LLControlGroup::declareControl: Control named " << name << " already exists." << llendl; 150 llwarns << "LLControlGroup::declareControl: Control named " << name << " already exists." << llendl;
151 mNameTable.erase(name);
149 return FALSE; 152 return FALSE;
150 } 153 }
151} 154}
@@ -207,7 +210,7 @@ BOOL LLControlGroup::declareColor3(const LLString& name, const LLColor3 &initial
207 210
208LLSD LLControlGroup::registerListener(const LLString& name, LLSimpleListenerObservable *listener) 211LLSD LLControlGroup::registerListener(const LLString& name, LLSimpleListenerObservable *listener)
209{ 212{
210 LLControlBase *control = mNameTable[name]; 213 LLControlBase *control = getControl(name);
211 if (control) 214 if (control)
212 { 215 {
213 return control->registerListener(listener); 216 return control->registerListener(listener);
@@ -217,7 +220,7 @@ LLSD LLControlGroup::registerListener(const LLString& name, LLSimpleListenerObse
217 220
218BOOL LLControlGroup::getBOOL(const LLString& name) 221BOOL LLControlGroup::getBOOL(const LLString& name)
219{ 222{
220 LLControlBase* control = mNameTable[name]; 223 LLControlBase* control = getControl(name);
221 224
222 if (control && control->isType(TYPE_BOOLEAN)) 225 if (control && control->isType(TYPE_BOOLEAN))
223 return control->get().asBoolean(); 226 return control->get().asBoolean();
@@ -230,7 +233,7 @@ BOOL LLControlGroup::getBOOL(const LLString& name)
230 233
231S32 LLControlGroup::getS32(const LLString& name) 234S32 LLControlGroup::getS32(const LLString& name)
232{ 235{
233 LLControlBase* control = mNameTable[name]; 236 LLControlBase* control = getControl(name);
234 237
235 if (control && control->isType(TYPE_S32)) 238 if (control && control->isType(TYPE_S32))
236 return control->get().asInteger(); 239 return control->get().asInteger();
@@ -243,7 +246,7 @@ S32 LLControlGroup::getS32(const LLString& name)
243 246
244U32 LLControlGroup::getU32(const LLString& name) 247U32 LLControlGroup::getU32(const LLString& name)
245{ 248{
246 LLControlBase* control = mNameTable[name]; 249 LLControlBase* control = getControl(name);
247 250
248 if (control && control->isType(TYPE_U32)) 251 if (control && control->isType(TYPE_U32))
249 return control->get().asInteger(); 252 return control->get().asInteger();
@@ -256,7 +259,7 @@ U32 LLControlGroup::getU32(const LLString& name)
256 259
257F32 LLControlGroup::getF32(const LLString& name) 260F32 LLControlGroup::getF32(const LLString& name)
258{ 261{
259 LLControlBase* control = mNameTable[name]; 262 LLControlBase* control = getControl(name);
260 263
261 if (control && control->isType(TYPE_F32)) 264 if (control && control->isType(TYPE_F32))
262 return (F32) control->get().asReal(); 265 return (F32) control->get().asReal();
@@ -269,7 +272,7 @@ F32 LLControlGroup::getF32(const LLString& name)
269 272
270LLString LLControlGroup::findString(const LLString& name) 273LLString LLControlGroup::findString(const LLString& name)
271{ 274{
272 LLControlBase* control = mNameTable[name]; 275 LLControlBase* control = getControl(name);
273 276
274 if (control && control->isType(TYPE_STRING)) 277 if (control && control->isType(TYPE_STRING))
275 return control->get().asString(); 278 return control->get().asString();
@@ -278,7 +281,7 @@ LLString LLControlGroup::findString(const LLString& name)
278 281
279LLString LLControlGroup::getString(const LLString& name) 282LLString LLControlGroup::getString(const LLString& name)
280{ 283{
281 LLControlBase* control = mNameTable[name]; 284 LLControlBase* control = getControl(name);
282 285
283 if (control && control->isType(TYPE_STRING)) 286 if (control && control->isType(TYPE_STRING))
284 return control->get().asString(); 287 return control->get().asString();
@@ -304,7 +307,7 @@ LLString LLControlGroup::getText(const LLString& name)
304 307
305LLVector3 LLControlGroup::getVector3(const LLString& name) 308LLVector3 LLControlGroup::getVector3(const LLString& name)
306{ 309{
307 LLControlBase* control = mNameTable[name]; 310 LLControlBase* control = getControl(name);
308 311
309 if (control && control->isType(TYPE_VEC3)) 312 if (control && control->isType(TYPE_VEC3))
310 return control->get(); 313 return control->get();
@@ -317,7 +320,7 @@ LLVector3 LLControlGroup::getVector3(const LLString& name)
317 320
318LLVector3d LLControlGroup::getVector3d(const LLString& name) 321LLVector3d LLControlGroup::getVector3d(const LLString& name)
319{ 322{
320 LLControlBase* control = mNameTable[name]; 323 LLControlBase* control = getControl(name);
321 324
322 if (control && control->isType(TYPE_VEC3D)) 325 if (control && control->isType(TYPE_VEC3D))
323 return control->get(); 326 return control->get();
@@ -330,7 +333,7 @@ LLVector3d LLControlGroup::getVector3d(const LLString& name)
330 333
331LLRect LLControlGroup::getRect(const LLString& name) 334LLRect LLControlGroup::getRect(const LLString& name)
332{ 335{
333 LLControlBase* control = mNameTable[name]; 336 LLControlBase* control = getControl(name);
334 337
335 if (control && control->isType(TYPE_RECT)) 338 if (control && control->isType(TYPE_RECT))
336 return control->get(); 339 return control->get();
@@ -376,7 +379,7 @@ LLColor4 LLControlGroup::getColor(const LLString& name)
376 379
377LLColor4U LLControlGroup::getColor4U(const LLString& name) 380LLColor4U LLControlGroup::getColor4U(const LLString& name)
378{ 381{
379 LLControlBase* control = mNameTable[name]; 382 LLControlBase* control = getControl(name);
380 383
381 if (control && control->isType(TYPE_COL4U)) 384 if (control && control->isType(TYPE_COL4U))
382 return control->get(); 385 return control->get();
@@ -389,7 +392,7 @@ LLColor4U LLControlGroup::getColor4U(const LLString& name)
389 392
390LLColor4 LLControlGroup::getColor4(const LLString& name) 393LLColor4 LLControlGroup::getColor4(const LLString& name)
391{ 394{
392 LLControlBase* control = mNameTable[name]; 395 LLControlBase* control = getControl(name);
393 396
394 if (control && control->isType(TYPE_COL4)) 397 if (control && control->isType(TYPE_COL4))
395 return control->get(); 398 return control->get();
@@ -402,7 +405,7 @@ LLColor4 LLControlGroup::getColor4(const LLString& name)
402 405
403LLColor3 LLControlGroup::getColor3(const LLString& name) 406LLColor3 LLControlGroup::getColor3(const LLString& name)
404{ 407{
405 LLControlBase* control = mNameTable[name]; 408 LLControlBase* control = getControl(name);
406 409
407 if (control && control->isType(TYPE_COL3)) 410 if (control && control->isType(TYPE_COL3))
408 return control->get(); 411 return control->get();
@@ -415,9 +418,8 @@ LLColor3 LLControlGroup::getColor3(const LLString& name)
415 418
416BOOL LLControlGroup::controlExists(const LLString& name) 419BOOL LLControlGroup::controlExists(const LLString& name)
417{ 420{
418 void *control = mNameTable[name]; 421 ctrl_name_table_t::iterator iter = mNameTable.find(name);
419 422 return iter != mNameTable.end();
420 return (control != 0);
421} 423}
422 424
423//------------------------------------------------------------------- 425//-------------------------------------------------------------------
@@ -426,7 +428,7 @@ BOOL LLControlGroup::controlExists(const LLString& name)
426 428
427void LLControlGroup::setBOOL(const LLString& name, BOOL val) 429void LLControlGroup::setBOOL(const LLString& name, BOOL val)
428{ 430{
429 LLControlBase* control = mNameTable[name]; 431 LLControlBase* control = getControl(name);
430 432
431 if (control && control->isType(TYPE_BOOLEAN)) 433 if (control && control->isType(TYPE_BOOLEAN))
432 { 434 {
@@ -441,7 +443,7 @@ void LLControlGroup::setBOOL(const LLString& name, BOOL val)
441 443
442void LLControlGroup::setS32(const LLString& name, S32 val) 444void LLControlGroup::setS32(const LLString& name, S32 val)
443{ 445{
444 LLControlBase* control = mNameTable[name]; 446 LLControlBase* control = getControl(name);
445 447
446 if (control && control->isType(TYPE_S32)) 448 if (control && control->isType(TYPE_S32))
447 { 449 {
@@ -456,7 +458,7 @@ void LLControlGroup::setS32(const LLString& name, S32 val)
456 458
457void LLControlGroup::setF32(const LLString& name, F32 val) 459void LLControlGroup::setF32(const LLString& name, F32 val)
458{ 460{
459 LLControlBase* control = mNameTable[name]; 461 LLControlBase* control = getControl(name);
460 462
461 if (control && control->isType(TYPE_F32)) 463 if (control && control->isType(TYPE_F32))
462 { 464 {
@@ -471,7 +473,7 @@ void LLControlGroup::setF32(const LLString& name, F32 val)
471 473
472void LLControlGroup::setU32(const LLString& name, U32 val) 474void LLControlGroup::setU32(const LLString& name, U32 val)
473{ 475{
474 LLControlBase* control = mNameTable[name]; 476 LLControlBase* control = getControl(name);
475 477
476 if (control && control->isType(TYPE_U32)) 478 if (control && control->isType(TYPE_U32))
477 { 479 {
@@ -486,7 +488,7 @@ void LLControlGroup::setU32(const LLString& name, U32 val)
486 488
487void LLControlGroup::setString(const LLString& name, const LLString &val) 489void LLControlGroup::setString(const LLString& name, const LLString &val)
488{ 490{
489 LLControlBase* control = mNameTable[name]; 491 LLControlBase* control = getControl(name);
490 492
491 if (control && control->isType(TYPE_STRING)) 493 if (control && control->isType(TYPE_STRING))
492 { 494 {
@@ -501,7 +503,7 @@ void LLControlGroup::setString(const LLString& name, const LLString &val)
501 503
502void LLControlGroup::setVector3(const LLString& name, const LLVector3 &val) 504void LLControlGroup::setVector3(const LLString& name, const LLVector3 &val)
503{ 505{
504 LLControlBase* control = mNameTable[name]; 506 LLControlBase* control = getControl(name);
505 507
506 if (control && control->isType(TYPE_VEC3)) 508 if (control && control->isType(TYPE_VEC3))
507 { 509 {
@@ -515,7 +517,7 @@ void LLControlGroup::setVector3(const LLString& name, const LLVector3 &val)
515 517
516void LLControlGroup::setVector3d(const LLString& name, const LLVector3d &val) 518void LLControlGroup::setVector3d(const LLString& name, const LLVector3d &val)
517{ 519{
518 LLControlBase* control = mNameTable[name]; 520 LLControlBase* control = getControl(name);
519 521
520 if (control && control->isType(TYPE_VEC3D)) 522 if (control && control->isType(TYPE_VEC3D))
521 { 523 {
@@ -529,7 +531,7 @@ void LLControlGroup::setVector3d(const LLString& name, const LLVector3d &val)
529 531
530void LLControlGroup::setRect(const LLString& name, const LLRect &val) 532void LLControlGroup::setRect(const LLString& name, const LLRect &val)
531{ 533{
532 LLControlBase* control = mNameTable[name]; 534 LLControlBase* control = getControl(name);
533 535
534 if (control && control->isType(TYPE_RECT)) 536 if (control && control->isType(TYPE_RECT))
535 { 537 {
@@ -543,7 +545,7 @@ void LLControlGroup::setRect(const LLString& name, const LLRect &val)
543 545
544void LLControlGroup::setColor4U(const LLString& name, const LLColor4U &val) 546void LLControlGroup::setColor4U(const LLString& name, const LLColor4U &val)
545{ 547{
546 LLControlBase* control = mNameTable[name]; 548 LLControlBase* control = getControl(name);
547 549
548 if (control && control->isType(TYPE_COL4U)) 550 if (control && control->isType(TYPE_COL4U))
549 { 551 {
@@ -557,7 +559,7 @@ void LLControlGroup::setColor4U(const LLString& name, const LLColor4U &val)
557 559
558void LLControlGroup::setColor4(const LLString& name, const LLColor4 &val) 560void LLControlGroup::setColor4(const LLString& name, const LLColor4 &val)
559{ 561{
560 LLControlBase* control = mNameTable[name]; 562 LLControlBase* control = getControl(name);
561 563
562 if (control && control->isType(TYPE_COL4)) 564 if (control && control->isType(TYPE_COL4))
563 { 565 {
@@ -576,7 +578,7 @@ void LLControlGroup::setValue(const LLString& name, const LLSD& val)
576 return; 578 return;
577 } 579 }
578 580
579 LLControlBase* control = mNameTable[name]; 581 LLControlBase* control = getControl(name);
580 582
581 if (control) 583 if (control)
582 { 584 {
@@ -599,7 +601,7 @@ U32 LLControlGroup::loadFromFileLegacy(const LLString& filename, BOOL require_de
599 llifstream file; 601 llifstream file;
600 S32 version; 602 S32 version;
601 603
602 file.open(filename.c_str()); 604 file.open(filename.c_str()); /*Flawfinder: ignore*/
603 605
604 if (!file) 606 if (!file)
605 { 607 {
@@ -629,7 +631,7 @@ U32 LLControlGroup::loadFromFileLegacy(const LLString& filename, BOOL require_de
629 if (name.substr(0,2) == "//") 631 if (name.substr(0,2) == "//")
630 { 632 {
631 // This is a comment. 633 // This is a comment.
632 char buffer[MAX_STRING]; 634 char buffer[MAX_STRING]; /*Flawfinder: ignore*/
633 file.getline(buffer, MAX_STRING); 635 file.getline(buffer, MAX_STRING);
634 continue; 636 continue;
635 } 637 }
@@ -643,7 +645,7 @@ U32 LLControlGroup::loadFromFileLegacy(const LLString& filename, BOOL require_de
643 if (!name.empty()) 645 if (!name.empty())
644 { 646 {
645 //read in to end of line 647 //read in to end of line
646 char buffer[MAX_STRING]; 648 char buffer[MAX_STRING]; /*Flawfinder: ignore*/
647 file.getline(buffer, MAX_STRING); 649 file.getline(buffer, MAX_STRING);
648 llwarns << "LLControlGroup::loadFromFile() : Trying to set \"" << name << "\", setting doesn't exist." << llendl; 650 llwarns << "LLControlGroup::loadFromFile() : Trying to set \"" << name << "\", setting doesn't exist." << llendl;
649 } 651 }
@@ -709,7 +711,7 @@ U32 LLControlGroup::loadFromFileLegacy(const LLString& filename, BOOL require_de
709 break; 711 break;
710 case TYPE_BOOLEAN: 712 case TYPE_BOOLEAN:
711 { 713 {
712 char boolstring[256]; 714 char boolstring[256]; /*Flawfinder: ignore*/
713 BOOL valid = FALSE; 715 BOOL valid = FALSE;
714 BOOL initial = FALSE; 716 BOOL initial = FALSE;
715 717
@@ -858,7 +860,7 @@ U32 LLControlGroup::loadFromFile(const LLString& filename, BOOL require_declarat
858 { 860 {
859 name = child_nodep->getName(); 861 name = child_nodep->getName();
860 862
861 BOOL declared = (mNameTable[name].notNull()); 863 BOOL declared = controlExists(name);
862 864
863 if (require_declaration && !declared) 865 if (require_declaration && !declared)
864 { 866 {
@@ -1045,8 +1047,7 @@ U32 LLControlGroup::saveToFile(const LLString& filename, BOOL nondefault_only)
1045 break; 1047 break;
1046 } 1048 }
1047 1049
1048 LLControlBase* control = (LLControlBase *)mNameTable[name]; 1050 LLControlBase* control = (LLControlBase *)iter->second;
1049
1050 if (!control) 1051 if (!control)
1051 { 1052 {
1052 llwarns << "Tried to save invalid control: " << name << llendl; 1053 llwarns << "Tried to save invalid control: " << name << llendl;
@@ -1067,7 +1068,7 @@ U32 LLControlGroup::saveToFile(const LLString& filename, BOOL nondefault_only)
1067 } 1068 }
1068 1069
1069 llofstream file; 1070 llofstream file;
1070 file.open(filename.c_str()); 1071 file.open(filename.c_str()); /*Flawfinder: ignore*/
1071 1072
1072 if (!file.is_open()) 1073 if (!file.is_open())
1073 { 1074 {
diff --git a/linden/indra/llxml/llcontrol.h b/linden/indra/llxml/llcontrol.h
index 846a3b5..ca5f711 100644
--- a/linden/indra/llxml/llcontrol.h
+++ b/linden/indra/llxml/llcontrol.h
@@ -67,6 +67,7 @@ protected:
67 BOOL mHasRange; 67 BOOL mHasRange;
68 BOOL mPersist; 68 BOOL mPersist;
69 BOOL mIsDefault; 69 BOOL mIsDefault;
70
70 static std::set<LLControlBase*> mChangedControls; 71 static std::set<LLControlBase*> mChangedControls;
71 static std::list<S32> mFreeIDs;//These lists are used to store the ID's of registered event listeners. 72 static std::list<S32> mFreeIDs;//These lists are used to store the ID's of registered event listeners.
72 static std::list<S32> mUsedIDs; 73 static std::list<S32> mUsedIDs;
@@ -171,7 +172,10 @@ public:
171 } 172 }
172 } 173 }
173 174
174 /*virtual*/ void resetToDefault() { mCurrent = mDefault; mIsDefault = TRUE;} 175 /*virtual*/ void resetToDefault()
176 {
177 setValue(mDefault);
178 }
175 179
176 virtual ~LLControl() 180 virtual ~LLControl()
177 { 181 {
diff --git a/linden/indra/llxml/llxml_vc8.vcproj b/linden/indra/llxml/llxml_vc8.vcproj
new file mode 100644
index 0000000..0b2a2b1
--- /dev/null
+++ b/linden/indra/llxml/llxml_vc8.vcproj
@@ -0,0 +1,276 @@
1<?xml version="1.0" encoding="Windows-1252"?>
2<VisualStudioProject
3 ProjectType="Visual C++"
4 Version="8.00"
5 Name="llxml"
6 ProjectGUID="{A5470DA6-0C3A-4602-B930-43DB25511A59}"
7 Keyword="Win32Proj"
8 >
9 <Platforms>
10 <Platform
11 Name="Win32"
12 />
13 </Platforms>
14 <ToolFiles>
15 </ToolFiles>
16 <Configurations>
17 <Configuration
18 Name="Debug|Win32"
19 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
20 IntermediateDirectory="Debug"
21 ConfigurationType="4"
22 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
23 CharacterSet="1"
24 >
25 <Tool
26 Name="VCPreBuildEventTool"
27 />
28 <Tool
29 Name="VCCustomBuildTool"
30 />
31 <Tool
32 Name="VCXMLDataGeneratorTool"
33 />
34 <Tool
35 Name="VCWebServiceProxyGeneratorTool"
36 />
37 <Tool
38 Name="VCMIDLTool"
39 />
40 <Tool
41 Name="VCCLCompilerTool"
42 Optimization="0"
43 AdditionalIncludeDirectories="..\llcommon;..\llmath;..\..\libraries\i686-win32\include;..\..\libraries\include\"
44 PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_DEBUG"
45 MinimalRebuild="true"
46 BasicRuntimeChecks="3"
47 RuntimeLibrary="1"
48 StructMemberAlignment="4"
49 TreatWChar_tAsBuiltInType="false"
50 ForceConformanceInForLoopScope="true"
51 UsePrecompiledHeader="0"
52 WarningLevel="3"
53 WarnAsError="true"
54 Detect64BitPortabilityProblems="false"
55 DebugInformationFormat="4"
56 />
57 <Tool
58 Name="VCManagedResourceCompilerTool"
59 />
60 <Tool
61 Name="VCResourceCompilerTool"
62 />
63 <Tool
64 Name="VCPreLinkEventTool"
65 />
66 <Tool
67 Name="VCLibrarianTool"
68 OutputFile="$(OutDir)/llxml.lib"
69 />
70 <Tool
71 Name="VCALinkTool"
72 />
73 <Tool
74 Name="VCXDCMakeTool"
75 />
76 <Tool
77 Name="VCBscMakeTool"
78 />
79 <Tool
80 Name="VCFxCopTool"
81 />
82 <Tool
83 Name="VCPostBuildEventTool"
84 />
85 </Configuration>
86 <Configuration
87 Name="Release|Win32"
88 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
89 IntermediateDirectory="Release"
90 ConfigurationType="4"
91 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
92 CharacterSet="1"
93 >
94 <Tool
95 Name="VCPreBuildEventTool"
96 />
97 <Tool
98 Name="VCCustomBuildTool"
99 />
100 <Tool
101 Name="VCXMLDataGeneratorTool"
102 />
103 <Tool
104 Name="VCWebServiceProxyGeneratorTool"
105 />
106 <Tool
107 Name="VCMIDLTool"
108 />
109 <Tool
110 Name="VCCLCompilerTool"
111 AdditionalIncludeDirectories="..\llcommon;..\llmath;..\..\libraries\i686-win32\include;..\..\libraries\include\"
112 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE"
113 RuntimeLibrary="0"
114 StructMemberAlignment="0"
115 TreatWChar_tAsBuiltInType="false"
116 ForceConformanceInForLoopScope="true"
117 UsePrecompiledHeader="0"
118 WarningLevel="3"
119 WarnAsError="true"
120 Detect64BitPortabilityProblems="false"
121 DebugInformationFormat="3"
122 />
123 <Tool
124 Name="VCManagedResourceCompilerTool"
125 />
126 <Tool
127 Name="VCResourceCompilerTool"
128 />
129 <Tool
130 Name="VCPreLinkEventTool"
131 />
132 <Tool
133 Name="VCLibrarianTool"
134 OutputFile="$(OutDir)/llxml.lib"
135 />
136 <Tool
137 Name="VCALinkTool"
138 />
139 <Tool
140 Name="VCXDCMakeTool"
141 />
142 <Tool
143 Name="VCBscMakeTool"
144 />
145 <Tool
146 Name="VCFxCopTool"
147 />
148 <Tool
149 Name="VCPostBuildEventTool"
150 />
151 </Configuration>
152 <Configuration
153 Name="ReleaseNoOpt|Win32"
154 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
155 IntermediateDirectory="$(ConfigurationName)"
156 ConfigurationType="4"
157 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
158 CharacterSet="1"
159 >
160 <Tool
161 Name="VCPreBuildEventTool"
162 />
163 <Tool
164 Name="VCCustomBuildTool"
165 />
166 <Tool
167 Name="VCXMLDataGeneratorTool"
168 />
169 <Tool
170 Name="VCWebServiceProxyGeneratorTool"
171 />
172 <Tool
173 Name="VCMIDLTool"
174 />
175 <Tool
176 Name="VCCLCompilerTool"
177 Optimization="0"
178 AdditionalIncludeDirectories="..\llcommon;..\llmath;..\..\libraries\i686-win32\include;..\..\libraries\include\"
179 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE"
180 RuntimeLibrary="0"
181 StructMemberAlignment="0"
182 TreatWChar_tAsBuiltInType="false"
183 ForceConformanceInForLoopScope="true"
184 UsePrecompiledHeader="0"
185 WarningLevel="3"
186 WarnAsError="true"
187 Detect64BitPortabilityProblems="false"
188 DebugInformationFormat="3"
189 />
190 <Tool
191 Name="VCManagedResourceCompilerTool"
192 />
193 <Tool
194 Name="VCResourceCompilerTool"
195 />
196 <Tool
197 Name="VCPreLinkEventTool"
198 />
199 <Tool
200 Name="VCLibrarianTool"
201 OutputFile="$(OutDir)/llxml.lib"
202 />
203 <Tool
204 Name="VCALinkTool"
205 />
206 <Tool
207 Name="VCXDCMakeTool"
208 />
209 <Tool
210 Name="VCBscMakeTool"
211 />
212 <Tool
213 Name="VCFxCopTool"
214 />
215 <Tool
216 Name="VCPostBuildEventTool"
217 />
218 </Configuration>
219 </Configurations>
220 <References>
221 </References>
222 <Files>
223 <Filter
224 Name="Source Files"
225 Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
226 UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
227 >
228 <File
229 RelativePath=".\llcontrol.cpp"
230 >
231 </File>
232 <File
233 RelativePath=".\llxmlnode.cpp"
234 >
235 </File>
236 <File
237 RelativePath=".\llxmlparser.cpp"
238 >
239 </File>
240 <File
241 RelativePath=".\llxmltree.cpp"
242 >
243 </File>
244 </Filter>
245 <Filter
246 Name="Header Files"
247 Filter="h;hpp;hxx;hm;inl;inc;xsd"
248 UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
249 >
250 <File
251 RelativePath=".\llcontrol.h"
252 >
253 </File>
254 <File
255 RelativePath=".\llxmlnode.h"
256 >
257 </File>
258 <File
259 RelativePath=".\llxmlparser.h"
260 >
261 </File>
262 <File
263 RelativePath=".\llxmltree.h"
264 >
265 </File>
266 </Filter>
267 <Filter
268 Name="Resource Files"
269 Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
270 UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
271 >
272 </Filter>
273 </Files>
274 <Globals>
275 </Globals>
276</VisualStudioProject>
diff --git a/linden/indra/llxml/llxmlnode.cpp b/linden/indra/llxml/llxmlnode.cpp
index 6366519..50a08be 100644
--- a/linden/indra/llxml/llxmlnode.cpp
+++ b/linden/indra/llxml/llxmlnode.cpp
@@ -561,7 +561,7 @@ bool LLXMLNode::parseFile(
561 LLXMLNode* defaults_tree) 561 LLXMLNode* defaults_tree)
562{ 562{
563 // Read file 563 // Read file
564 FILE* fp = LLFile::fopen(filename.c_str(), "rb"); 564 FILE* fp = LLFile::fopen(filename.c_str(), "rb"); /* Flawfinder: ignore */
565 if (fp == NULL) 565 if (fp == NULL)
566 { 566 {
567 node = new LLXMLNode(); 567 node = new LLXMLNode();
@@ -1865,12 +1865,12 @@ U32 LLXMLNode::getUUIDValue(U32 expected_length, LLUUID *array)
1865 LLUUID uuid_value; 1865 LLUUID uuid_value;
1866 value_string = skipWhitespace(value_string); 1866 value_string = skipWhitespace(value_string);
1867 1867
1868 if (strlen(value_string) < (UUID_STR_LENGTH-1)) 1868 if (strlen(value_string) < (UUID_STR_LENGTH-1)) /* Flawfinder: ignore */
1869 { 1869 {
1870 break; 1870 break;
1871 } 1871 }
1872 char uuid_string[UUID_STR_LENGTH]; 1872 char uuid_string[UUID_STR_LENGTH]; /* Flawfinder: ignore */
1873 memcpy(uuid_string, value_string, (UUID_STR_LENGTH-1)); 1873 memcpy(uuid_string, value_string, (UUID_STR_LENGTH-1)); /* Flawfinder: ignore */
1874 uuid_string[(UUID_STR_LENGTH-1)] = 0; 1874 uuid_string[(UUID_STR_LENGTH-1)] = 0;
1875 1875
1876 if (!LLUUID::parseUUID(uuid_string, &uuid_value)) 1876 if (!LLUUID::parseUUID(uuid_string, &uuid_value))
@@ -2155,18 +2155,18 @@ void LLXMLNode::setFloatValue(U32 length, const F32 *array, Encoding encoding, U
2155 LLString new_value; 2155 LLString new_value;
2156 if (encoding == ENCODING_DEFAULT || encoding == ENCODING_DECIMAL) 2156 if (encoding == ENCODING_DEFAULT || encoding == ENCODING_DECIMAL)
2157 { 2157 {
2158 char format_string[10]; 2158 char format_string[10]; /* Flawfinder: ignore */
2159 if (precision > 0) 2159 if (precision > 0)
2160 { 2160 {
2161 if (precision > 25) 2161 if (precision > 25)
2162 { 2162 {
2163 precision = 25; 2163 precision = 25;
2164 } 2164 }
2165 sprintf(format_string, "%%.%dg", precision); 2165 snprintf(format_string, sizeof(format_string), "%%.%dg", precision); /* Flawfinder: ignore */
2166 } 2166 }
2167 else 2167 else
2168 { 2168 {
2169 sprintf(format_string, "%%g"); 2169 snprintf(format_string, sizeof(format_string), "%%g"); /* Flawfinder: ignore */
2170 } 2170 }
2171 2171
2172 for (U32 pos=0; pos<length; ++pos) 2172 for (U32 pos=0; pos<length; ++pos)
@@ -2206,18 +2206,18 @@ void LLXMLNode::setDoubleValue(U32 length, const F64 *array, Encoding encoding,
2206 LLString new_value; 2206 LLString new_value;
2207 if (encoding == ENCODING_DEFAULT || encoding == ENCODING_DECIMAL) 2207 if (encoding == ENCODING_DEFAULT || encoding == ENCODING_DECIMAL)
2208 { 2208 {
2209 char format_string[10]; 2209 char format_string[10]; /* Flawfinder: ignore */
2210 if (precision > 0) 2210 if (precision > 0)
2211 { 2211 {
2212 if (precision > 25) 2212 if (precision > 25)
2213 { 2213 {
2214 precision = 25; 2214 precision = 25;
2215 } 2215 }
2216 sprintf(format_string, "%%.%dg", precision); 2216 snprintf(format_string, sizeof(format_string), "%%.%dg", precision); /* Flawfinder: ignore */
2217 } 2217 }
2218 else 2218 else
2219 { 2219 {
2220 sprintf(format_string, "%%g"); 2220 snprintf(format_string, sizeof(format_string), "%%g"); /* Flawfinder: ignore */
2221 } 2221 }
2222 for (U32 pos=0; pos<length; ++pos) 2222 for (U32 pos=0; pos<length; ++pos)
2223 { 2223 {
@@ -2294,7 +2294,7 @@ void LLXMLNode::setUUIDValue(U32 length, const LLUUID *array)
2294 LLString new_value; 2294 LLString new_value;
2295 for (U32 pos=0; pos<length; ++pos) 2295 for (U32 pos=0; pos<length; ++pos)
2296 { 2296 {
2297 new_value.append(array[pos].getString()); 2297 new_value.append(array[pos].asString());
2298 if (pos < length-1) new_value.append(" "); 2298 if (pos < length-1) new_value.append(" ");
2299 } 2299 }
2300 2300
@@ -2491,7 +2491,7 @@ LLXMLNode *get_rand_node(LLXMLNode *node)
2491void LLXMLNode::createUnitTest(S32 max_num_children) 2491void LLXMLNode::createUnitTest(S32 max_num_children)
2492{ 2492{
2493 // Random ID 2493 // Random ID
2494 char rand_id[20]; 2494 char rand_id[20]; /* Flawfinder: ignore */
2495 U32 rand_id_len = get_rand(10)+5; 2495 U32 rand_id_len = get_rand(10)+5;
2496 U32 pos = 0; 2496 U32 pos = 0;
2497 for (; pos<rand_id_len; ++pos) 2497 for (; pos<rand_id_len; ++pos)
@@ -2520,7 +2520,7 @@ void LLXMLNode::createUnitTest(S32 max_num_children)
2520 for (U32 child_num=0; child_num<num_children; ++child_num) 2520 for (U32 child_num=0; child_num<num_children; ++child_num)
2521 { 2521 {
2522 // Random Name 2522 // Random Name
2523 char child_name[20]; 2523 char child_name[20]; /* Flawfinder: ignore */
2524 U32 child_name_len = get_rand(10)+5; 2524 U32 child_name_len = get_rand(10)+5;
2525 pos = 0; 2525 pos = 0;
2526 for (; pos<child_name_len; ++pos) 2526 for (; pos<child_name_len; ++pos)
@@ -2532,7 +2532,7 @@ void LLXMLNode::createUnitTest(S32 max_num_children)
2532 LLXMLNode *new_child = createChild(child_name, FALSE); 2532 LLXMLNode *new_child = createChild(child_name, FALSE);
2533 2533
2534 // Random ID 2534 // Random ID
2535 char child_id[20]; 2535 char child_id[20]; /* Flawfinder: ignore */
2536 U32 child_id_len = get_rand(10)+5; 2536 U32 child_id_len = get_rand(10)+5;
2537 pos = 0; 2537 pos = 0;
2538 for (; pos<child_id_len; ++pos) 2538 for (; pos<child_id_len; ++pos)
@@ -2653,7 +2653,7 @@ void LLXMLNode::createUnitTest(S32 max_num_children)
2653 { 2653 {
2654 random_node_array[value] = get_rand_node(root); 2654 random_node_array[value] = get_rand_node(root);
2655 const char *node_name = random_node_array[value]->mName->mString; 2655 const char *node_name = random_node_array[value]->mName->mString;
2656 for (U32 pos=0; pos<strlen(node_name); ++pos) 2656 for (U32 pos=0; pos<strlen(node_name); ++pos) /* Flawfinder: ignore */
2657 { 2657 {
2658 U32 hash_contrib = U32(node_name[pos]) << ((pos % 4) * 8); 2658 U32 hash_contrib = U32(node_name[pos]) << ((pos % 4) * 8);
2659 noderef_checksum ^= hash_contrib; 2659 noderef_checksum ^= hash_contrib;
@@ -2825,7 +2825,7 @@ BOOL LLXMLNode::performUnitTest(LLString &error_buffer)
2825 for (U32 pos=0; pos<node->mLength; ++pos) 2825 for (U32 pos=0; pos<node->mLength; ++pos)
2826 { 2826 {
2827 const char *node_name = node_array[pos]->mName->mString; 2827 const char *node_name = node_array[pos]->mName->mString;
2828 for (U32 pos2=0; pos2<strlen(node_name); ++pos2) 2828 for (U32 pos2=0; pos2<strlen(node_name); ++pos2) /* Flawfinder: ignore */
2829 { 2829 {
2830 U32 hash_contrib = U32(node_name[pos2]) << ((pos2 % 4) * 8); 2830 U32 hash_contrib = U32(node_name[pos2]) << ((pos2 % 4) * 8);
2831 noderef_checksum ^= hash_contrib; 2831 noderef_checksum ^= hash_contrib;
@@ -2896,7 +2896,7 @@ BOOL LLXMLNode::performUnitTest(LLString &error_buffer)
2896 } 2896 }
2897 if (node_uuid_checksum != uuid_checksum) 2897 if (node_uuid_checksum != uuid_checksum)
2898 { 2898 {
2899 error_buffer.append(llformat("ERROR Node %s: UUID checksum mismatch: read %s / calc %s.\n", mName->mString, node_uuid_checksum.getString().c_str(), uuid_checksum.getString().c_str())); 2899 error_buffer.append(llformat("ERROR Node %s: UUID checksum mismatch: read %s / calc %s.\n", mName->mString, node_uuid_checksum.asString().c_str(), uuid_checksum.asString().c_str()));
2900 return FALSE; 2900 return FALSE;
2901 } 2901 }
2902 } 2902 }
diff --git a/linden/indra/llxml/llxmlnode.h b/linden/indra/llxml/llxmlnode.h
index 6ecd9ce..bfe0fbe 100644
--- a/linden/indra/llxml/llxmlnode.h
+++ b/linden/indra/llxml/llxmlnode.h
@@ -34,6 +34,7 @@
34 34
35#include "indra_constants.h" 35#include "indra_constants.h"
36#include "llmemory.h" 36#include "llmemory.h"
37#include "llthread.h"
37#include "llstring.h" 38#include "llstring.h"
38#include "llstringtable.h" 39#include "llstringtable.h"
39 40
diff --git a/linden/indra/llxml/llxmlparser.cpp b/linden/indra/llxml/llxmlparser.cpp
index 57e6a30..056d850 100644
--- a/linden/indra/llxml/llxmlparser.cpp
+++ b/linden/indra/llxml/llxmlparser.cpp
@@ -41,7 +41,7 @@ LLXmlParser::LLXmlParser()
41 mParser( NULL ), 41 mParser( NULL ),
42 mDepth( 0 ) 42 mDepth( 0 )
43{ 43{
44 strcpy( mAuxErrorString, "no error" ); 44 strcpy( mAuxErrorString, "no error" ); /* Flawfinder: ignore */
45 45
46 // Override the document's declared encoding. 46 // Override the document's declared encoding.
47 mParser = XML_ParserCreate(NULL); 47 mParser = XML_ParserCreate(NULL);
@@ -73,10 +73,10 @@ BOOL LLXmlParser::parseFile(const std::string &path)
73 73
74 BOOL success = TRUE; 74 BOOL success = TRUE;
75 75
76 FILE *file = LLFile::fopen(path.c_str(), "rb"); 76 FILE* file = LLFile::fopen(path.c_str(), "rb"); /* Flawfinder: ignore */
77 if( !file ) 77 if( !file )
78 { 78 {
79 sprintf( mAuxErrorString, "Couldn't open file %s", path.c_str()); 79 snprintf( mAuxErrorString, sizeof(mAuxErrorString), "Couldn't open file %s", path.c_str()); /* Flawfinder: ignore */
80 success = FALSE; 80 success = FALSE;
81 } 81 }
82 else 82 else
@@ -90,7 +90,7 @@ BOOL LLXmlParser::parseFile(const std::string &path)
90 void* buffer = XML_GetBuffer(mParser, buffer_size); 90 void* buffer = XML_GetBuffer(mParser, buffer_size);
91 if( !buffer ) 91 if( !buffer )
92 { 92 {
93 sprintf( mAuxErrorString, "Unable to allocate XML buffer while reading file %s", path.c_str() ); 93 snprintf( mAuxErrorString, sizeof(mAuxErrorString), "Unable to allocate XML buffer while reading file %s", path.c_str() ); /* Flawfinder: ignore */
94 success = FALSE; 94 success = FALSE;
95 goto exit_label; 95 goto exit_label;
96 } 96 }
@@ -98,14 +98,14 @@ BOOL LLXmlParser::parseFile(const std::string &path)
98 bytes_read = (S32)fread(buffer, 1, buffer_size, file); 98 bytes_read = (S32)fread(buffer, 1, buffer_size, file);
99 if( bytes_read <= 0 ) 99 if( bytes_read <= 0 )
100 { 100 {
101 sprintf( mAuxErrorString, "Error while reading file %s", path.c_str() ); 101 snprintf( mAuxErrorString, sizeof(mAuxErrorString), "Error while reading file %s", path.c_str() ); /* Flawfinder: ignore */
102 success = FALSE; 102 success = FALSE;
103 goto exit_label; 103 goto exit_label;
104 } 104 }
105 105
106 if( !XML_ParseBuffer(mParser, bytes_read, TRUE ) ) 106 if( !XML_ParseBuffer(mParser, bytes_read, TRUE ) )
107 { 107 {
108 sprintf( mAuxErrorString, "Error while parsing file %s", path.c_str() ); 108 snprintf( mAuxErrorString, sizeof(mAuxErrorString), "Error while parsing file %s", path.c_str() ); /* Flawfinder: ignore */
109 success = FALSE; 109 success = FALSE;
110 } 110 }
111 111
diff --git a/linden/indra/llxml/llxmlparser.h b/linden/indra/llxml/llxmlparser.h
index 27c137a..e1bd2e2 100644
--- a/linden/indra/llxml/llxmlparser.h
+++ b/linden/indra/llxml/llxmlparser.h
@@ -122,7 +122,7 @@ public:
122protected: 122protected:
123 XML_Parser mParser; 123 XML_Parser mParser;
124 int mDepth; 124 int mDepth;
125 char mAuxErrorString[1024]; 125 char mAuxErrorString[1024]; /*Flawfinder: ignore*/
126}; 126};
127 127
128#endif // LL_LLXMLPARSER_H 128#endif // LL_LLXMLPARSER_H