Skip to content

Commit dd07e30

Browse files
committed
- Change the connect_xtrace variable to from int to set
modified: storage/connect/inihandl.cpp
1 parent 5abdd20 commit dd07e30

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed

storage/connect/inihandl.cpp

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ static PROFILESECTION *PROFILE_Load( FILE *file )
293293
next_key = &section->key;
294294
prev_key = NULL;
295295

296-
if (trace > 1)
296+
if (trace(2))
297297
htrc("New section: '%s'\n",section->name);
298298

299299
continue;
@@ -336,7 +336,7 @@ static PROFILESECTION *PROFILE_Load( FILE *file )
336336
next_key = &key->next;
337337
prev_key = key;
338338

339-
if (trace > 1)
339+
if (trace(2))
340340
htrc("New key: name='%s', value='%s'\n",
341341
key->name,key->value?key->value:"(none)");
342342

@@ -359,7 +359,7 @@ static BOOL PROFILE_FlushFile(void)
359359
FILE *file = NULL;
360360
struct stat buf;
361361

362-
if (trace > 1)
362+
if (trace(2))
363363
htrc("PROFILE_FlushFile: CurProfile=%p\n", CurProfile);
364364

365365
if (!CurProfile) {
@@ -398,7 +398,7 @@ static BOOL PROFILE_FlushFile(void)
398398
return FALSE;
399399
} // endif !file
400400

401-
if (trace > 1)
401+
if (trace(2))
402402
htrc("Saving '%s'\n", CurProfile->filename);
403403

404404
PROFILE_Save(file, CurProfile->section);
@@ -447,7 +447,7 @@ static BOOL PROFILE_Open(LPCSTR filename)
447447
struct stat buf;
448448
PROFILE *tempProfile;
449449

450-
if (trace > 1)
450+
if (trace(2))
451451
htrc("PROFILE_Open: CurProfile=%p N=%d\n", CurProfile, N_CACHED_PROFILES);
452452

453453
/* First time around */
@@ -468,7 +468,7 @@ static BOOL PROFILE_Open(LPCSTR filename)
468468

469469
/* Check for a match */
470470
for (i = 0; i < N_CACHED_PROFILES; i++) {
471-
if (trace > 1)
471+
if (trace(2))
472472
htrc("MRU=%s i=%d\n", SVP(MRUProfile[i]->filename), i);
473473

474474
if (MRUProfile[i]->filename && !strcmp(filename, MRUProfile[i]->filename)) {
@@ -483,11 +483,11 @@ static BOOL PROFILE_Open(LPCSTR filename)
483483
} // endif i
484484

485485
if (!stat(CurProfile->filename, &buf) && CurProfile->mtime == buf.st_mtime) {
486-
if (trace > 1)
486+
if (trace(2))
487487
htrc("(%s): already opened (mru=%d)\n", filename, i);
488488

489489
} else {
490-
if (trace > 1)
490+
if (trace(2))
491491
htrc("(%s): already opened, needs refreshing (mru=%d)\n", filename, i);
492492

493493
} // endif stat
@@ -535,11 +535,11 @@ static BOOL PROFILE_Open(LPCSTR filename)
535535
// strcpy(p, filename);
536536
// _strlwr(p);
537537

538-
if (trace > 1)
538+
if (trace(2))
539539
htrc("Opening %s\n", filename);
540540

541541
if ((file = fopen(filename, "r"))) {
542-
if (trace > 1)
542+
if (trace(2))
543543
htrc("(%s): found it\n", filename);
544544

545545
// CurProfile->unix_name = malloc(strlen(buffer)+1);
@@ -574,12 +574,12 @@ void PROFILE_Close(LPCSTR filename)
574574
struct stat buf;
575575
PROFILE *tempProfile;
576576

577-
if (trace > 1)
577+
if (trace(2))
578578
htrc("PROFILE_Close: CurProfile=%p N=%d\n", CurProfile, N_CACHED_PROFILES);
579579

580580
/* Check for a match */
581581
for (i = 0; i < N_CACHED_PROFILES; i++) {
582-
if (trace > 1)
582+
if (trace(2))
583583
htrc("MRU=%s i=%d\n", SVP(MRUProfile[i]->filename), i);
584584

585585
if (MRUProfile[i]->filename && !strcmp(filename, MRUProfile[i]->filename)) {
@@ -591,7 +591,7 @@ void PROFILE_Close(LPCSTR filename)
591591
CurProfile=tempProfile;
592592
} // endif i
593593

594-
if (trace > 1) {
594+
if (trace(2)) {
595595
if (!stat(CurProfile->filename, &buf) && CurProfile->mtime == buf.st_mtime)
596596
htrc("(%s): already opened (mru=%d)\n", filename, i);
597597
else
@@ -620,15 +620,15 @@ void PROFILE_End(void)
620620
{
621621
int i;
622622

623-
if (trace)
623+
if (trace(3))
624624
htrc("PROFILE_End: CurProfile=%p N=%d\n", CurProfile, N_CACHED_PROFILES);
625625

626626
if (!CurProfile) // Sergey Vojtovich
627627
return;
628628

629629
/* Close all opened files and free the cache structure */
630630
for (i = 0; i < N_CACHED_PROFILES; i++) {
631-
if (trace)
631+
if (trace(3))
632632
htrc("MRU=%s i=%d\n", SVP(MRUProfile[i]->filename), i);
633633

634634
// CurProfile = MRUProfile[i]; Sergey Vojtovich
@@ -894,7 +894,7 @@ static int PROFILE_GetSectionNames(LPSTR buffer, uint len)
894894
uint f,l;
895895
PROFILESECTION *section;
896896

897-
if (trace > 1)
897+
if (trace(2))
898898
htrc("GetSectionNames: buffer=%p len=%u\n", buffer, len);
899899

900900
if (!buffer || !len)
@@ -909,17 +909,17 @@ static int PROFILE_GetSectionNames(LPSTR buffer, uint len)
909909
buf = buffer;
910910
section = CurProfile->section;
911911

912-
if (trace > 1)
912+
if (trace(2))
913913
htrc("GetSectionNames: section=%p\n", section);
914914

915915
while (section != NULL) {
916-
if (trace > 1)
916+
if (trace(2))
917917
htrc("section=%s\n", section->name);
918918

919919
if (section->name[0]) {
920920
l = strlen(section->name) + 1;
921921

922-
if (trace > 1)
922+
if (trace(2))
923923
htrc("l=%u f=%u\n", l, f);
924924

925925
if (l > f) {
@@ -982,7 +982,7 @@ static int PROFILE_GetString(LPCSTR section, LPCSTR key_name,
982982
key = PROFILE_Find(&CurProfile->section, section, key_name, FALSE, FALSE);
983983
PROFILE_CopyEntry(buffer, (key && key->value) ? key->value : def_val, len, FALSE);
984984

985-
if (trace > 1)
985+
if (trace(2))
986986
htrc("('%s','%s','%s'): returning '%s'\n",
987987
section, key_name, def_val, buffer );
988988

@@ -1010,15 +1010,15 @@ static BOOL PROFILE_SetString(LPCSTR section_name, LPCSTR key_name,
10101010
LPCSTR value, BOOL create_always)
10111011
{
10121012
if (!key_name) { /* Delete a whole section */
1013-
if (trace > 1)
1013+
if (trace(2))
10141014
htrc("Deleting('%s')\n", section_name);
10151015

10161016
CurProfile->changed |= PROFILE_DeleteSection(&CurProfile->section,
10171017
section_name);
10181018
return TRUE; /* Even if PROFILE_DeleteSection() has failed,
10191019
this is not an error on application's level.*/
10201020
} else if (!value) { /* Delete a key */
1021-
if (trace > 1)
1021+
if (trace(2))
10221022
htrc("Deleting('%s','%s')\n", section_name, key_name);
10231023

10241024
CurProfile->changed |= PROFILE_DeleteKey(&CurProfile->section,
@@ -1027,7 +1027,7 @@ static BOOL PROFILE_SetString(LPCSTR section_name, LPCSTR key_name,
10271027
} else { /* Set the key value */
10281028
PROFILEKEY *key = PROFILE_Find(&CurProfile->section, section_name,
10291029
key_name, TRUE, create_always);
1030-
if (trace > 1)
1030+
if (trace(2))
10311031
htrc("Setting('%s','%s','%s')\n", section_name, key_name, value);
10321032

10331033
if (!key)
@@ -1040,17 +1040,17 @@ static BOOL PROFILE_SetString(LPCSTR section_name, LPCSTR key_name,
10401040
value++;
10411041

10421042
if (!strcmp(key->value, value)) {
1043-
if (trace > 1)
1043+
if (trace(2))
10441044
htrc(" no change needed\n" );
10451045

10461046
return TRUE; /* No change needed */
10471047
} // endif value
10481048

1049-
if (trace > 1)
1049+
if (trace(2))
10501050
htrc(" replacing '%s'\n", key->value);
10511051

10521052
free(key->value);
1053-
} else if (trace > 1)
1053+
} else if (trace(2))
10541054
htrc(" creating key\n" );
10551055

10561056
key->value = (char*)malloc(strlen(value) + 1);
@@ -1345,7 +1345,7 @@ GetPrivateProfileSectionNames(LPSTR buffer, DWORD size, LPCSTR filename)
13451345
{
13461346
DWORD ret = 0;
13471347

1348-
if (trace > 1)
1348+
if (trace(2))
13491349
htrc("GPPSN: filename=%s\n", filename);
13501350

13511351
EnterCriticalSection(&PROFILE_CritSect);

0 commit comments

Comments
 (0)