summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--generic/ttk/ttkDecls.h36
-rw-r--r--generic/ttk/ttkGenStubs.tcl29
3 files changed, 49 insertions, 23 deletions
diff --git a/ChangeLog b/ChangeLog
index 71de34f..81da836 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2011-01-19 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * generic/ttk/ttkGenStubs.tcl: Make sure to use CONST/VOID in stead of
+ * generic/tclIntDecls.h const/void when appropriate. This allows to
+ * generic/tclIntPlatDecls.h use const/void in the *.decls file always,
+ * generic/tclTomMathDecls.h genStubs will do the right thing.
+
2011-01-17 Jan Nijtmans <nijtmans@users.sf.net>
* win/tcl.m4: handle --enable-64bit=ia64 for gcc. BACKPORT.
diff --git a/generic/ttk/ttkDecls.h b/generic/ttk/ttkDecls.h
index a7c28aa..b8486dc 100644
--- a/generic/ttk/ttkDecls.h
+++ b/generic/ttk/ttkDecls.h
@@ -1,5 +1,5 @@
/*
- * $Id: ttkDecls.h,v 1.6.2.2 2010/08/26 02:06:09 hobbs Exp $
+ * $Id: ttkDecls.h,v 1.6.2.3 2011/01/19 08:37:45 nijtmans Exp $
*
* This file is (mostly) automatically generated from ttk.decls.
*/
@@ -30,36 +30,36 @@ extern const char *TtkInitializeStubs(
*/
/* 0 */
-TTKAPI Ttk_Theme Ttk_GetTheme(Tcl_Interp *interp, const char *name);
+TTKAPI Ttk_Theme Ttk_GetTheme(Tcl_Interp *interp, CONST char *name);
/* 1 */
TTKAPI Ttk_Theme Ttk_GetDefaultTheme(Tcl_Interp *interp);
/* 2 */
TTKAPI Ttk_Theme Ttk_GetCurrentTheme(Tcl_Interp *interp);
/* 3 */
-TTKAPI Ttk_Theme Ttk_CreateTheme(Tcl_Interp *interp, const char *name,
+TTKAPI Ttk_Theme Ttk_CreateTheme(Tcl_Interp *interp, CONST char *name,
Ttk_Theme parent);
/* 4 */
TTKAPI void Ttk_RegisterCleanup(Tcl_Interp *interp,
- void *deleteData,
+ VOID *deleteData,
Ttk_CleanupProc *cleanupProc);
/* 5 */
TTKAPI int Ttk_RegisterElementSpec(Ttk_Theme theme,
- const char *elementName,
+ CONST char *elementName,
Ttk_ElementSpec *elementSpec,
- void *clientData);
+ VOID *clientData);
/* 6 */
TTKAPI Ttk_ElementClass * Ttk_RegisterElement(Tcl_Interp *interp,
- Ttk_Theme theme, const char *elementName,
+ Ttk_Theme theme, CONST char *elementName,
Ttk_ElementSpec *elementSpec,
- void *clientData);
+ VOID *clientData);
/* 7 */
TTKAPI int Ttk_RegisterElementFactory(Tcl_Interp *interp,
- const char *name,
+ CONST char *name,
Ttk_ElementFactory factoryProc,
- void *clientData);
+ VOID *clientData);
/* 8 */
TTKAPI void Ttk_RegisterLayout(Ttk_Theme theme,
- const char *className,
+ CONST char *className,
Ttk_LayoutSpec layoutSpec);
/* Slot 9 is reserved */
/* 10 */
@@ -137,15 +137,15 @@ typedef struct TtkStubs {
int revision;
const struct TtkStubHooks *hooks;
- Ttk_Theme (*ttk_GetTheme) (Tcl_Interp *interp, const char *name); /* 0 */
+ Ttk_Theme (*ttk_GetTheme) (Tcl_Interp *interp, CONST char *name); /* 0 */
Ttk_Theme (*ttk_GetDefaultTheme) (Tcl_Interp *interp); /* 1 */
Ttk_Theme (*ttk_GetCurrentTheme) (Tcl_Interp *interp); /* 2 */
- Ttk_Theme (*ttk_CreateTheme) (Tcl_Interp *interp, const char *name, Ttk_Theme parent); /* 3 */
- void (*ttk_RegisterCleanup) (Tcl_Interp *interp, void *deleteData, Ttk_CleanupProc *cleanupProc); /* 4 */
- int (*ttk_RegisterElementSpec) (Ttk_Theme theme, const char *elementName, Ttk_ElementSpec *elementSpec, void *clientData); /* 5 */
- Ttk_ElementClass * (*ttk_RegisterElement) (Tcl_Interp *interp, Ttk_Theme theme, const char *elementName, Ttk_ElementSpec *elementSpec, void *clientData); /* 6 */
- int (*ttk_RegisterElementFactory) (Tcl_Interp *interp, const char *name, Ttk_ElementFactory factoryProc, void *clientData); /* 7 */
- void (*ttk_RegisterLayout) (Ttk_Theme theme, const char *className, Ttk_LayoutSpec layoutSpec); /* 8 */
+ Ttk_Theme (*ttk_CreateTheme) (Tcl_Interp *interp, CONST char *name, Ttk_Theme parent); /* 3 */
+ void (*ttk_RegisterCleanup) (Tcl_Interp *interp, VOID *deleteData, Ttk_CleanupProc *cleanupProc); /* 4 */
+ int (*ttk_RegisterElementSpec) (Ttk_Theme theme, CONST char *elementName, Ttk_ElementSpec *elementSpec, VOID *clientData); /* 5 */
+ Ttk_ElementClass * (*ttk_RegisterElement) (Tcl_Interp *interp, Ttk_Theme theme, CONST char *elementName, Ttk_ElementSpec *elementSpec, VOID *clientData); /* 6 */
+ int (*ttk_RegisterElementFactory) (Tcl_Interp *interp, CONST char *name, Ttk_ElementFactory factoryProc, VOID *clientData); /* 7 */
+ void (*ttk_RegisterLayout) (Ttk_Theme theme, CONST char *className, Ttk_LayoutSpec layoutSpec); /* 8 */
void (*reserved9)(void);
int (*ttk_GetStateSpecFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, Ttk_StateSpec *spec_rtn); /* 10 */
Tcl_Obj * (*ttk_NewStateSpecObj) (unsigned int onbits, unsigned int offbits); /* 11 */
diff --git a/generic/ttk/ttkGenStubs.tcl b/generic/ttk/ttkGenStubs.tcl
index 50fe412..f906b47 100644
--- a/generic/ttk/ttkGenStubs.tcl
+++ b/generic/ttk/ttkGenStubs.tcl
@@ -8,7 +8,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# $Id: ttkGenStubs.tcl,v 1.1.4.2 2010/08/26 02:06:09 hobbs Exp $
+# $Id: ttkGenStubs.tcl,v 1.1.4.3 2011/01/19 08:37:45 nijtmans Exp $
#
# SOURCE: tcl/tools/genStubs.tcl, revision 1.20
#
@@ -32,7 +32,7 @@ namespace eval genStubs {
# libraryName --
#
# The name of the entire library. This value is used to compute
- # the USE_*_STUBS macro, the name of the init file, and others.
+ # the USE_*_STUBS macro and the name of the init file.
variable libraryName "UNKNOWN"
@@ -183,19 +183,30 @@ proc genStubs::hooks {names} {
# decl The C function declaration, or {} for an undefined
# entry.
#
-proc genStubs::declare {index status decl} {
+proc genStubs::declare {args} {
variable stubs
variable curName
variable revision
incr revision
+ if {[llength $args] == 2} {
+ lassign $args index decl
+ set status current
+ } elseif {[llength $args] == 3} {
+ lassign $args index status decl
+ } else {
+ puts stderr "wrong # args: declare $args"
+ return
+ }
+
# Check for duplicate declarations, then add the declaration and
# bump the lastNum counter if necessary.
if {[info exists stubs($curName,decl,$index)]} {
puts stderr "Duplicate entry: $index"
}
+ regsub -all const $decl CONST decl
regsub -all "\[ \t\n\]+" [string trim $decl] " " decl
set decl [parseDecl $decl]
@@ -404,6 +415,9 @@ proc genStubs::makeDecl {name decl index} {
lassign $decl rtype fname args
append text "/* $index */\n"
+ if {$rtype eq "VOID"} {
+ set rtype void
+ }
set line "$scspec $rtype"
set count [expr {2 - ([string length $line] / 8)}]
append line [string range "\t\t\t" 0 $count]
@@ -420,9 +434,10 @@ proc genStubs::makeDecl {name decl index} {
}
append line $fname
+ regsub -all void $args VOID args
set arg1 [lindex $args 0]
switch -exact $arg1 {
- void {
+ VOID {
append line "(void)"
}
TCL_VARARGS {
@@ -517,15 +532,19 @@ proc genStubs::makeSlot {name decl index} {
append lfname [string range $fname 1 end]
set text " "
+ if {$rtype eq "VOID"} {
+ set rtype void
+ }
if {$args == ""} {
append text $rtype " *" $lfname "; /* $index */\n"
return $text
}
append text $rtype " (*" $lfname ") "
+ regsub -all void $args VOID args
set arg1 [lindex $args 0]
switch -exact $arg1 {
- void {
+ VOID {
append text "(void)"
}
TCL_VARARGS {