Tcl Source Code

Check-in [157acf6411]
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:Don't #define VOID on VxWorks, as it is already typdef'd to void. Eliminate possibly conflicting LOCAL/OFFSET
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core-8-5-branch
Files: files | file ages | folders
SHA1: 157acf6411def9acb0f0a72a9b382f248b63151d
User & Date: jan.nijtmans 2013-05-19 20:26:29
Context
2013-05-22
12:59
[3613609]: Replace strcasecmp() with UTF-8-aware version. check-in: 8cc7cdfbd6 user: dkf tags: core-8-5-branch
2013-05-21
09:27
Proposed solution for 3613609: lsort -nocase does not sort non-ASCII correctly check-in: 66c30c4369 user: jan.nijtmans tags: bug-3613609
2013-05-19
20:37
Don't #define VOID on VxWorks, as it is already typdef'd to void. Eliminate possibly conflicting LOC... check-in: 837d5a924d user: jan.nijtmans tags: trunk
20:26
Don't #define VOID on VxWorks, as it is already typdef'd to void. Eliminate possibly conflicting LOC... check-in: 157acf6411 user: jan.nijtmans tags: core-8-5-branch
19:03
Fix for FreeBSD, and remove support for older FreeBSD versions. Patch by Pietro Cerutti check-in: 970c40e701 user: jan.nijtmans tags: core-8-5-branch
14:04
Don't #define VOID on VxWorks, as it is already typdef'd to void Eliminate possibly conflicting LOCA... check-in: 4bed29cc48 user: jan.nijtmans tags: core-8-4-branch
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/regguts.h.

354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
    char flags;
#define	LONGER	01		/* prefers longer match */
#define	SHORTER	02		/* prefers shorter match */
#define	MIXED	04		/* mixed preference below */
#define	CAP	010		/* capturing parens below */
#define	BACKR	020		/* back reference below */
#define	INUSE	0100		/* in use in final tree */
#define	LOCAL	03		/* bits which may not propagate up */
#define	LMIX(f)	((f)<<2)	/* LONGER -> MIXED */
#define	SMIX(f)	((f)<<1)	/* SHORTER -> MIXED */
#define	UP(f)	(((f)&~LOCAL) | (LMIX(f) & SMIX(f) & MIXED))
#define	MESSY(f)	((f)&(MIXED|CAP|BACKR))
#define	PREF(f)	((f)&LOCAL)
#define	PREF2(f1, f2)	((PREF(f1) != 0) ? PREF(f1) : PREF(f2))
#define	COMBINE(f1, f2)	(UP((f1)|(f2)) | PREF2(f1, f2))
    short retry;		/* index into retry memory */
    int subno;			/* subexpression number (for 'b' and '(') */
    short min;			/* min repetitions, for backref only */
    short max;			/* max repetitions, for backref only */
    struct subre *left;		/* left child, if any (also freelist chain) */






|


|

|







354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
    char flags;
#define	LONGER	01		/* prefers longer match */
#define	SHORTER	02		/* prefers shorter match */
#define	MIXED	04		/* mixed preference below */
#define	CAP	010		/* capturing parens below */
#define	BACKR	020		/* back reference below */
#define	INUSE	0100		/* in use in final tree */
#define	NOPROP	03		/* bits which may not propagate up */
#define	LMIX(f)	((f)<<2)	/* LONGER -> MIXED */
#define	SMIX(f)	((f)<<1)	/* SHORTER -> MIXED */
#define	UP(f)	(((f)&~NOPROP) | (LMIX(f) & SMIX(f) & MIXED))
#define	MESSY(f)	((f)&(MIXED|CAP|BACKR))
#define	PREF(f)	((f)&NOPROP)
#define	PREF2(f1, f2)	((PREF(f1) != 0) ? PREF(f1) : PREF(f2))
#define	COMBINE(f1, f2)	(UP((f1)|(f2)) | PREF2(f1, f2))
    short retry;		/* index into retry memory */
    int subno;			/* subexpression number (for 'b' and '(') */
    short min;			/* min repetitions, for backref only */
    short max;			/* max repetitions, for backref only */
    struct subre *left;		/* left child, if any (also freelist chain) */

Changes to generic/tcl.h.

289
290
291
292
293
294
295

296
297
298
299

300
301
302
303
304
305
306
#endif /* __WIN32__ && !HAVE_WINNT_IGNORE_VOID */

/*
 * Macro to use instead of "void" for arguments that must have type "void *"
 * in ANSI C; maps them to type "char *" in non-ANSI systems.
 */


#ifndef NO_VOID
#define VOID	void
#else
#define VOID	char

#endif

/*
 * Miscellaneous declarations.
 */

#ifndef _CLIENTDATA






>
|
|
|
|
>







289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
#endif /* __WIN32__ && !HAVE_WINNT_IGNORE_VOID */

/*
 * Macro to use instead of "void" for arguments that must have type "void *"
 * in ANSI C; maps them to type "char *" in non-ANSI systems.
 */

#ifndef __VXWORKS__
#   ifndef NO_VOID
#	define VOID void
#   else
#	define VOID char
#   endif
#endif

/*
 * Miscellaneous declarations.
 */

#ifndef _CLIENTDATA

Changes to generic/tclExecute.c.

832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
...
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
 * multiple of the wordsize 'sizeof(Tcl_Obj *)'. 
 */

#define WALLOCALIGN \
    (TCL_ALLOCALIGN/sizeof(Tcl_Obj *))

/*
 * OFFSET computes how many words have to be skipped until the next aligned
 * word. Note that we are only interested in the low order bits of ptr, so
 * that any possible information loss in PTR2INT is of no consequence.
 */

static inline int
OFFSET(
    void *ptr)
{
    int mask = TCL_ALLOCALIGN-1;
    int base = PTR2INT(ptr) & mask;
    return (TCL_ALLOCALIGN - base)/sizeof(Tcl_Obj *);
}

/*
 * Given a marker, compute where the following aligned memory starts. 
 */

#define MEMSTART(markerPtr)			\
    ((markerPtr) + OFFSET(markerPtr))


/*
 *----------------------------------------------------------------------
 *
 * GrowEvaluationStack --
 *
................................................................................
	    Tcl_Panic("STACK: Reallocating with no previous alloc");
	}
	if (needed <= 0) {
	    return MEMSTART(markerPtr);
	}
    } else {
	Tcl_Obj **tmpMarkerPtr = esPtr->tosPtr + 1;
	int offset = OFFSET(tmpMarkerPtr);

	if (needed + offset < 0) {
	    /*
	     * Put a marker pointing to the previous marker in this stack, and 
	     * store it in esPtr as the current marker. Return a pointer to
	     * the start of aligned memory.
	     */






|





|












|







 







|







832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
...
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
 * multiple of the wordsize 'sizeof(Tcl_Obj *)'. 
 */

#define WALLOCALIGN \
    (TCL_ALLOCALIGN/sizeof(Tcl_Obj *))

/*
 * wordSkip computes how many words have to be skipped until the next aligned
 * word. Note that we are only interested in the low order bits of ptr, so
 * that any possible information loss in PTR2INT is of no consequence.
 */

static inline int
wordSkip(
    void *ptr)
{
    int mask = TCL_ALLOCALIGN-1;
    int base = PTR2INT(ptr) & mask;
    return (TCL_ALLOCALIGN - base)/sizeof(Tcl_Obj *);
}

/*
 * Given a marker, compute where the following aligned memory starts. 
 */

#define MEMSTART(markerPtr)			\
    ((markerPtr) + wordSkip(markerPtr))


/*
 *----------------------------------------------------------------------
 *
 * GrowEvaluationStack --
 *
................................................................................
	    Tcl_Panic("STACK: Reallocating with no previous alloc");
	}
	if (needed <= 0) {
	    return MEMSTART(markerPtr);
	}
    } else {
	Tcl_Obj **tmpMarkerPtr = esPtr->tosPtr + 1;
	int offset = wordSkip(tmpMarkerPtr);

	if (needed + offset < 0) {
	    /*
	     * Put a marker pointing to the previous marker in this stack, and 
	     * store it in esPtr as the current marker. Return a pointer to
	     * the start of aligned memory.
	     */