summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/tkDecls.h8
-rw-r--r--generic/tkFont.c2
-rw-r--r--generic/tkImgPNG.c25
-rw-r--r--generic/tkIntDecls.h8
-rw-r--r--generic/tkIntPlatDecls.h8
-rw-r--r--generic/tkIntXlibDecls.h8
-rw-r--r--generic/tkPlatDecls.h8
-rw-r--r--generic/ttk/ttkDecls.h8
-rw-r--r--generic/ttk/ttkGenStubs.tcl8
9 files changed, 47 insertions, 36 deletions
diff --git a/generic/tkDecls.h b/generic/tkDecls.h
index 9f76a49..64c32cd 100644
--- a/generic/tkDecls.h
+++ b/generic/tkDecls.h
@@ -25,6 +25,10 @@
/* !BEGIN!: Do not edit below this line. */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* Exported function declarations:
*/
@@ -1148,10 +1152,8 @@ typedef struct TkStubs {
void (*tk_CreateOldPhotoImageFormat) (const Tk_PhotoImageFormat *formatPtr); /* 273 */
} TkStubs;
-#ifdef __cplusplus
-extern "C" {
-#endif
extern const TkStubs *tkStubsPtr;
+
#ifdef __cplusplus
}
#endif
diff --git a/generic/tkFont.c b/generic/tkFont.c
index 4485df8..ad009b9 100644
--- a/generic/tkFont.c
+++ b/generic/tkFont.c
@@ -1517,8 +1517,8 @@ FreeFontObj(
fontPtr->objRefCount--;
if ((fontPtr->resourceRefCount == 0) && (fontPtr->objRefCount == 0)) {
ckfree(fontPtr);
- objPtr->internalRep.twoPtrValue.ptr1 = NULL;
}
+ objPtr->internalRep.twoPtrValue.ptr1 = NULL;
}
}
diff --git a/generic/tkImgPNG.c b/generic/tkImgPNG.c
index f639694..8a740d2 100644
--- a/generic/tkImgPNG.c
+++ b/generic/tkImgPNG.c
@@ -2283,10 +2283,10 @@ ParseFormat(
Tcl_Obj **objv = NULL;
int objc = 0;
static const char *const fmtOptions[] = {
- "png", "-alpha", NULL
+ "-alpha", NULL
};
enum fmtOptions {
- OPT_PNG, OPT_ALPHA
+ OPT_ALPHA
};
/*
@@ -2299,33 +2299,30 @@ ParseFormat(
}
for (; objc>0 ; objc--, objv++) {
- int optIndex;
-
- if (Tcl_GetIndexFromObjStruct(interp, objv[0], fmtOptions,
- sizeof(char *), "option", 0, &optIndex) == TCL_ERROR) {
- return TCL_ERROR;
- }
+ int optIndex;
/*
* Ignore the "png" part of the format specification.
*/
- if (OPT_PNG == optIndex) {
+ if (!strcasecmp(Tcl_GetString(objv[0]), "png")) {
continue;
}
- if (objc < 2) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[0], fmtOptions,
+ sizeof(char *), "option", 0, &optIndex) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+
+ if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "value");
return TCL_ERROR;
- }
+ }
objc--;
objv++;
switch ((enum fmtOptions) optIndex) {
- case OPT_PNG:
- break;
-
case OPT_ALPHA:
if (Tcl_GetDoubleFromObj(interp, objv[0],
&pngPtr->alpha) == TCL_ERROR) {
diff --git a/generic/tkIntDecls.h b/generic/tkIntDecls.h
index 586419c..3c37922 100644
--- a/generic/tkIntDecls.h
+++ b/generic/tkIntDecls.h
@@ -35,6 +35,10 @@ struct TkSharedText;
/* !BEGIN!: Do not edit below this line. */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* Exported function declarations:
*/
@@ -765,10 +769,8 @@ typedef struct TkIntStubs {
void (*tkDrawAngledChars) (Display *display, Drawable drawable, GC gc, Tk_Font tkfont, const char *source, int numBytes, double x, double y, double angle); /* 184 */
} TkIntStubs;
-#ifdef __cplusplus
-extern "C" {
-#endif
extern const TkIntStubs *tkIntStubsPtr;
+
#ifdef __cplusplus
}
#endif
diff --git a/generic/tkIntPlatDecls.h b/generic/tkIntPlatDecls.h
index d6d136e..141f743 100644
--- a/generic/tkIntPlatDecls.h
+++ b/generic/tkIntPlatDecls.h
@@ -26,6 +26,10 @@
/* !BEGIN!: Do not edit below this line. */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* Exported function declarations:
*/
@@ -410,10 +414,8 @@ typedef struct TkIntPlatStubs {
#endif /* X11 */
} TkIntPlatStubs;
-#ifdef __cplusplus
-extern "C" {
-#endif
extern const TkIntPlatStubs *tkIntPlatStubsPtr;
+
#ifdef __cplusplus
}
#endif
diff --git a/generic/tkIntXlibDecls.h b/generic/tkIntXlibDecls.h
index 70c63d5..8abda05 100644
--- a/generic/tkIntXlibDecls.h
+++ b/generic/tkIntXlibDecls.h
@@ -36,6 +36,10 @@ typedef int (*XAfterFunction) ( /* WARNING, this type not in Xlib spec */
/* !BEGIN!: Do not edit below this line. */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* Exported function declarations:
*/
@@ -835,10 +839,8 @@ typedef struct TkIntXlibStubs {
#endif /* AQUA */
} TkIntXlibStubs;
-#ifdef __cplusplus
-extern "C" {
-#endif
extern const TkIntXlibStubs *tkIntXlibStubsPtr;
+
#ifdef __cplusplus
}
#endif
diff --git a/generic/tkPlatDecls.h b/generic/tkPlatDecls.h
index e59c014..88fa918 100644
--- a/generic/tkPlatDecls.h
+++ b/generic/tkPlatDecls.h
@@ -29,6 +29,10 @@ extern "C" {
/* !BEGIN!: Do not edit below this line. */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* Exported function declarations:
*/
@@ -107,10 +111,8 @@ typedef struct TkPlatStubs {
#endif /* AQUA */
} TkPlatStubs;
-#ifdef __cplusplus
-extern "C" {
-#endif
extern const TkPlatStubs *tkPlatStubsPtr;
+
#ifdef __cplusplus
}
#endif
diff --git a/generic/ttk/ttkDecls.h b/generic/ttk/ttkDecls.h
index 5f7cb0c..6701724 100644
--- a/generic/ttk/ttkDecls.h
+++ b/generic/ttk/ttkDecls.h
@@ -23,6 +23,10 @@ extern const char *TtkInitializeStubs(
#define TTK_STUBS_EPOCH 0
#define TTK_STUBS_REVISION 31
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* Exported function declarations:
*/
@@ -178,10 +182,8 @@ typedef struct TtkStubs {
int (*ttk_GetOrientFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, int *orient); /* 40 */
} TtkStubs;
-#ifdef __cplusplus
-extern "C" {
-#endif
extern const TtkStubs *ttkStubsPtr;
+
#ifdef __cplusplus
}
#endif
diff --git a/generic/ttk/ttkGenStubs.tcl b/generic/ttk/ttkGenStubs.tcl
index d8e9a8a..5e56951 100644
--- a/generic/ttk/ttkGenStubs.tcl
+++ b/generic/ttk/ttkGenStubs.tcl
@@ -769,6 +769,8 @@ proc genStubs::emitHeader {name} {
append text "#define ${CAPName}_STUBS_REVISION $revision\n"
}
+ append text "\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n"
+
emitDeclarations $name text
if {[info exists hooks($name)]} {
@@ -796,8 +798,7 @@ proc genStubs::emitHeader {name} {
append text "} ${capName}Stubs;\n\n"
- append text "#ifdef __cplusplus\nextern \"C\" {\n#endif\n"
- append text "extern const ${capName}Stubs *${name}StubsPtr;\n"
+ append text "extern const ${capName}Stubs *${name}StubsPtr;\n\n"
append text "#ifdef __cplusplus\n}\n#endif\n"
emitMacros $name text
@@ -821,9 +822,10 @@ proc genStubs::emitInit {name textVar} {
variable hooks
variable interfaces
variable epoch
+ variable revision
upvar $textVar text
- set root 1
+ set root 1
set capName [string toupper [string index $name 0]]
append capName [string range $name 1 end]