Tcl Source Code

Check-in [9ea4420be8]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:resolves some warnings by compiling with new gcc-versions (>= 7.x): - '*' in boolean context, suggest '&&' instead [-Wint-in-bool-context] - passing argument 1 of 'Tcl_CreateExitHandler' from incompatible pointer type [-Wincompatible-pointer-types]
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core-8-5-branch
Files: files | file ages | folders
SHA3-256: 9ea4420be8e80012f7dbf156e5ae4eac9c588b06e9febeb9d0a6680600e4c15e
User & Date: sebres 2018-06-08 12:50:43
Context
2018-06-09
07:41
Update to latest tzdata (backported from 8.6) check-in: 8fb0134372 user: jan.nijtmans tags: core-8-5-branch
2018-06-08
13:28
fixes [815e246806], extend Tcl_RegisterChannel/Tcl_UnregisterChannel with preserving of ref-count of... check-in: dafa1a0859 user: sebres tags: fix-815e246806-8-5
13:02
merge 8.5 (empty merge point, no functional changes, because does not affect 8.6) check-in: 9cfddbdc92 user: sebres tags: core-8-6-branch
12:50
resolves some warnings by compiling with new gcc-versions (>= 7.x): - '*' in boolean context, sugg... check-in: 9ea4420be8 user: sebres tags: core-8-5-branch
2018-06-04
13:49
fixes [92564326a9] if compiled on some x86 systems (with dirent64 but without DIR64, partially cherr... check-in: 32babd8ff2 user: sebres tags: core-8-5-branch
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/tclStringObj.c.

109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
} String;

#define STRING_MAXCHARS \
	(1 + (int)(((size_t)UINT_MAX - sizeof(String))/sizeof(Tcl_UniChar)))
#define STRING_UALLOC(numChars)	\
	((numChars) * sizeof(Tcl_UniChar))
#define STRING_SIZE(ualloc) \
    ((unsigned) ((ualloc) \
	? (sizeof(String) - sizeof(Tcl_UniChar) + (ualloc)) \
	: sizeof(String)))
#define stringCheckLimits(numChars) \
    if ((numChars) < 0 || (numChars) > STRING_MAXCHARS) { \
	Tcl_Panic("max length for a Tcl unicode value (%d chars) exceeded", \
		STRING_MAXCHARS); \
    }






|







109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
} String;

#define STRING_MAXCHARS \
	(1 + (int)(((size_t)UINT_MAX - sizeof(String))/sizeof(Tcl_UniChar)))
#define STRING_UALLOC(numChars)	\
	((numChars) * sizeof(Tcl_UniChar))
#define STRING_SIZE(ualloc) \
    ((unsigned) ((ualloc != 0) \
	? (sizeof(String) - sizeof(Tcl_UniChar) + (ualloc)) \
	: sizeof(String)))
#define stringCheckLimits(numChars) \
    if ((numChars) < 0 || (numChars) > STRING_MAXCHARS) { \
	Tcl_Panic("max length for a Tcl unicode value (%d chars) exceeded", \
		STRING_MAXCHARS); \
    }

Changes to win/tclWinFile.c.

1390
1391
1392
1393
1394
1395
1396






1397
1398
1399
1400
1401
1402
1403
....
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
		return 0;
	    }
	}
    }
    return 1;
}
 






/*
 *----------------------------------------------------------------------
 *
 * TclpGetUserHome --
 *
 *	This function takes the passed in user name and finds the
 *	corresponding home directory specified in the password file.
................................................................................
	    if (handle) {
		netApiBufferFreeProc = (NETAPIBUFFERFREEPROC *)
			GetProcAddress(handle, "NetApiBufferFree");
		netGetDCNameProc = (NETGETDCNAMEPROC *)
			GetProcAddress(handle, "NetGetDCName");
		netUserGetInfoProc = (NETUSERGETINFOPROC *)
			GetProcAddress(handle, "NetUserGetInfo");
		Tcl_CreateExitHandler(TclpUnloadFile, handle);
	    }
	    handle = LoadLibraryA("userenv.dll");
	    if (handle) {
		getProfilesDirectoryProc = (GETPROFILESDIRECTORYPROC *)
			GetProcAddress(handle, "GetProfilesDirectoryW");
		Tcl_CreateExitHandler(TclpUnloadFile, handle);
	    }
	    
	    apistubs = -1;
	    if ( (netUserGetInfoProc != NULL) && (netGetDCNameProc != NULL)
	      && (netApiBufferFreeProc != NULL) && (getProfilesDirectoryProc != NULL)
	    ) {
		apistubs = 1;






>
>
>
>
>
>







 







|





|







1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
....
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
		return 0;
	    }
	}
    }
    return 1;
}
 
static void
FreeLoadLibHandle(
    ClientData clientData)
{
    FreeLibrary((HMODULE)clientData);
}
/*
 *----------------------------------------------------------------------
 *
 * TclpGetUserHome --
 *
 *	This function takes the passed in user name and finds the
 *	corresponding home directory specified in the password file.
................................................................................
	    if (handle) {
		netApiBufferFreeProc = (NETAPIBUFFERFREEPROC *)
			GetProcAddress(handle, "NetApiBufferFree");
		netGetDCNameProc = (NETGETDCNAMEPROC *)
			GetProcAddress(handle, "NetGetDCName");
		netUserGetInfoProc = (NETUSERGETINFOPROC *)
			GetProcAddress(handle, "NetUserGetInfo");
		Tcl_CreateExitHandler(FreeLoadLibHandle, handle);
	    }
	    handle = LoadLibraryA("userenv.dll");
	    if (handle) {
		getProfilesDirectoryProc = (GETPROFILESDIRECTORYPROC *)
			GetProcAddress(handle, "GetProfilesDirectoryW");
		Tcl_CreateExitHandler(FreeLoadLibHandle, handle);
	    }
	    
	    apistubs = -1;
	    if ( (netUserGetInfoProc != NULL) && (netGetDCNameProc != NULL)
	      && (netApiBufferFreeProc != NULL) && (getProfilesDirectoryProc != NULL)
	    ) {
		apistubs = 1;