From 04c7f4864c25ecdce85ae2e51c7eb4f52b174a03 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 2 Mar 2023 11:21:38 +0000 Subject: Reduce the number of ttk C warnings --- generic/ttk/ttkButton.c | 2 ++ generic/ttk/ttkClamTheme.c | 1 + generic/ttk/ttkClassicTheme.c | 2 ++ generic/ttk/ttkDefaultTheme.c | 2 ++ generic/ttk/ttkElements.c | 3 +++ generic/ttk/ttkEntry.c | 3 +++ generic/ttk/ttkFrame.c | 3 +++ generic/ttk/ttkImage.c | 3 +++ generic/ttk/ttkInit.c | 34 +++++++++++++++++----------------- generic/ttk/ttkLabel.c | 3 +++ generic/ttk/ttkNotebook.c | 3 +++ generic/ttk/ttkPanedwindow.c | 3 +++ generic/ttk/ttkProgress.c | 3 +++ generic/ttk/ttkScale.c | 3 +++ generic/ttk/ttkScrollbar.c | 3 +++ generic/ttk/ttkSeparator.c | 3 +++ generic/ttk/ttkSquare.c | 3 +++ generic/ttk/ttkTreeview.c | 3 +++ 18 files changed, 63 insertions(+), 17 deletions(-) diff --git a/generic/ttk/ttkButton.c b/generic/ttk/ttkButton.c index 9cd8fd9..856f867 100644 --- a/generic/ttk/ttkButton.c +++ b/generic/ttk/ttkButton.c @@ -870,6 +870,8 @@ TTK_END_LAYOUT * +++ Initialization. */ +MODULE_SCOPE void TtkButton_Init(Tcl_Interp *); + MODULE_SCOPE void TtkButton_Init(Tcl_Interp *interp) { diff --git a/generic/ttk/ttkClamTheme.c b/generic/ttk/ttkClamTheme.c index 16330c2..dccefc2 100644 --- a/generic/ttk/ttkClamTheme.c +++ b/generic/ttk/ttkClamTheme.c @@ -1113,6 +1113,7 @@ TTK_END_LAYOUT_TABLE /*------------------------------------------------------------------------ * +++ Initialization. */ +MODULE_SCOPE int TtkClamTheme_Init(Tcl_Interp *); MODULE_SCOPE int TtkClamTheme_Init(Tcl_Interp *interp) diff --git a/generic/ttk/ttkClassicTheme.c b/generic/ttk/ttkClassicTheme.c index c3aaee8..4169a87 100644 --- a/generic/ttk/ttkClassicTheme.c +++ b/generic/ttk/ttkClassicTheme.c @@ -479,6 +479,8 @@ TTK_END_LAYOUT_TABLE * Install classic theme. */ +MODULE_SCOPE int TtkClassicTheme_Init(Tcl_Interp *interp); + MODULE_SCOPE int TtkClassicTheme_Init(Tcl_Interp *interp) { Ttk_Theme theme = Ttk_CreateTheme(interp, "classic", NULL); diff --git a/generic/ttk/ttkDefaultTheme.c b/generic/ttk/ttkDefaultTheme.c index 5d62fb7..aad519e 100644 --- a/generic/ttk/ttkDefaultTheme.c +++ b/generic/ttk/ttkDefaultTheme.c @@ -1196,6 +1196,8 @@ static const Ttk_ElementSpec TreeitemIndicatorElementSpec = { * TtkAltTheme_Init -- * Install alternate theme. */ +MODULE_SCOPE int TtkAltTheme_Init(Tcl_Interp *interp); + MODULE_SCOPE int TtkAltTheme_Init(Tcl_Interp *interp) { Ttk_Theme theme = Ttk_CreateTheme(interp, "alt", NULL); diff --git a/generic/ttk/ttkElements.c b/generic/ttk/ttkElements.c index a09c4f5..2939003 100644 --- a/generic/ttk/ttkElements.c +++ b/generic/ttk/ttkElements.c @@ -1327,6 +1327,9 @@ static const Ttk_ElementSpec ClientElementSpec = { */ MODULE_SCOPE +void TtkElements_Init(Tcl_Interp *interp); + +MODULE_SCOPE void TtkElements_Init(Tcl_Interp *interp) { Ttk_Theme theme = Ttk_GetDefaultTheme(interp); diff --git a/generic/ttk/ttkEntry.c b/generic/ttk/ttkEntry.c index 66b83a2..0d7e57d 100644 --- a/generic/ttk/ttkEntry.c +++ b/generic/ttk/ttkEntry.c @@ -2135,6 +2135,9 @@ TTK_END_LAYOUT * +++ Initialization. */ MODULE_SCOPE +void TtkEntry_Init(Tcl_Interp *interp); + +MODULE_SCOPE void TtkEntry_Init(Tcl_Interp *interp) { Ttk_Theme themePtr = Ttk_GetDefaultTheme(interp); diff --git a/generic/ttk/ttkFrame.c b/generic/ttk/ttkFrame.c index 8863924..adb8ba9 100644 --- a/generic/ttk/ttkFrame.c +++ b/generic/ttk/ttkFrame.c @@ -655,6 +655,9 @@ TTK_END_LAYOUT */ MODULE_SCOPE +void TtkFrame_Init(Tcl_Interp *interp); + +MODULE_SCOPE void TtkFrame_Init(Tcl_Interp *interp) { Ttk_Theme theme = Ttk_GetDefaultTheme(interp); diff --git a/generic/ttk/ttkImage.c b/generic/ttk/ttkImage.c index 44c2752..ec815e2 100644 --- a/generic/ttk/ttkImage.c +++ b/generic/ttk/ttkImage.c @@ -456,6 +456,9 @@ error: } MODULE_SCOPE +void TtkImage_Init(Tcl_Interp *interp); + +MODULE_SCOPE void TtkImage_Init(Tcl_Interp *interp) { Ttk_RegisterElementFactory(interp, "image", Ttk_CreateImageElement, NULL); diff --git a/generic/ttk/ttkInit.c b/generic/ttk/ttkInit.c index 3829f09..716c477 100644 --- a/generic/ttk/ttkInit.c +++ b/generic/ttk/ttkInit.c @@ -187,9 +187,9 @@ const Tk_OptionSpec ttkCoreOptionSpecs[] = * +++ Initialization: elements and element factories. */ -extern void TtkElements_Init(Tcl_Interp *); -extern void TtkLabel_Init(Tcl_Interp *); -extern void TtkImage_Init(Tcl_Interp *); +MODULE_SCOPE void TtkElements_Init(Tcl_Interp *); +MODULE_SCOPE void TtkLabel_Init(Tcl_Interp *); +MODULE_SCOPE void TtkImage_Init(Tcl_Interp *); static void RegisterElements(Tcl_Interp *interp) { @@ -202,19 +202,19 @@ static void RegisterElements(Tcl_Interp *interp) * +++ Initialization: Widget definitions. */ -extern void TtkButton_Init(Tcl_Interp *); -extern void TtkEntry_Init(Tcl_Interp *); -extern void TtkFrame_Init(Tcl_Interp *); -extern void TtkNotebook_Init(Tcl_Interp *); -extern void TtkPanedwindow_Init(Tcl_Interp *); -extern void TtkProgressbar_Init(Tcl_Interp *); -extern void TtkScale_Init(Tcl_Interp *); -extern void TtkScrollbar_Init(Tcl_Interp *); -extern void TtkSeparator_Init(Tcl_Interp *); -extern void TtkTreeview_Init(Tcl_Interp *); +MODULE_SCOPE void TtkButton_Init(Tcl_Interp *); +MODULE_SCOPE void TtkEntry_Init(Tcl_Interp *); +MODULE_SCOPE void TtkFrame_Init(Tcl_Interp *); +MODULE_SCOPE void TtkNotebook_Init(Tcl_Interp *); +MODULE_SCOPE void TtkPanedwindow_Init(Tcl_Interp *); +MODULE_SCOPE void TtkProgressbar_Init(Tcl_Interp *); +MODULE_SCOPE void TtkScale_Init(Tcl_Interp *); +MODULE_SCOPE void TtkScrollbar_Init(Tcl_Interp *); +MODULE_SCOPE void TtkSeparator_Init(Tcl_Interp *); +MODULE_SCOPE void TtkTreeview_Init(Tcl_Interp *); #ifdef TTK_SQUARE_WIDGET -extern int TtkSquareWidget_Init(Tcl_Interp *); +MODULE_SCOPE int TtkSquareWidget_Init(Tcl_Interp *); #endif static void RegisterWidgets(Tcl_Interp *interp) @@ -238,9 +238,9 @@ static void RegisterWidgets(Tcl_Interp *interp) * +++ Initialization: Built-in themes. */ -extern int TtkAltTheme_Init(Tcl_Interp *); -extern int TtkClassicTheme_Init(Tcl_Interp *); -extern int TtkClamTheme_Init(Tcl_Interp *); +MODULE_SCOPE int TtkAltTheme_Init(Tcl_Interp *); +MODULE_SCOPE int TtkClassicTheme_Init(Tcl_Interp *); +MODULE_SCOPE int TtkClamTheme_Init(Tcl_Interp *); static void RegisterThemes(Tcl_Interp *interp) { diff --git a/generic/ttk/ttkLabel.c b/generic/ttk/ttkLabel.c index fe98af7..46c4017 100644 --- a/generic/ttk/ttkLabel.c +++ b/generic/ttk/ttkLabel.c @@ -758,6 +758,9 @@ static const Ttk_ElementSpec LabelElementSpec = { */ MODULE_SCOPE +void TtkLabel_Init(Tcl_Interp *interp); + +MODULE_SCOPE void TtkLabel_Init(Tcl_Interp *interp) { Ttk_Theme theme = Ttk_GetDefaultTheme(interp); diff --git a/generic/ttk/ttkNotebook.c b/generic/ttk/ttkNotebook.c index 5e7c16b..5a0445a 100644 --- a/generic/ttk/ttkNotebook.c +++ b/generic/ttk/ttkNotebook.c @@ -1418,6 +1418,9 @@ TTK_END_LAYOUT */ MODULE_SCOPE +void TtkNotebook_Init(Tcl_Interp *interp); + +MODULE_SCOPE void TtkNotebook_Init(Tcl_Interp *interp) { Ttk_Theme themePtr = Ttk_GetDefaultTheme(interp); diff --git a/generic/ttk/ttkPanedwindow.c b/generic/ttk/ttkPanedwindow.c index 0955210..2a9bb69 100644 --- a/generic/ttk/ttkPanedwindow.c +++ b/generic/ttk/ttkPanedwindow.c @@ -971,6 +971,9 @@ TTK_END_LAYOUT * +++ Registration routine. */ MODULE_SCOPE +void TtkPanedwindow_Init(Tcl_Interp *interp); + +MODULE_SCOPE void TtkPanedwindow_Init(Tcl_Interp *interp) { Ttk_Theme themePtr = Ttk_GetDefaultTheme(interp); diff --git a/generic/ttk/ttkProgress.c b/generic/ttk/ttkProgress.c index 177cc69..32a1996 100644 --- a/generic/ttk/ttkProgress.c +++ b/generic/ttk/ttkProgress.c @@ -569,6 +569,9 @@ TTK_END_LAYOUT */ MODULE_SCOPE +void TtkProgressbar_Init(Tcl_Interp *interp); + +MODULE_SCOPE void TtkProgressbar_Init(Tcl_Interp *interp) { Ttk_Theme themePtr = Ttk_GetDefaultTheme(interp); diff --git a/generic/ttk/ttkScale.c b/generic/ttk/ttkScale.c index fd1777d..f59ec25 100644 --- a/generic/ttk/ttkScale.c +++ b/generic/ttk/ttkScale.c @@ -524,6 +524,9 @@ TTK_END_LAYOUT * Initialization. */ MODULE_SCOPE +void TtkScale_Init(Tcl_Interp *interp); + +MODULE_SCOPE void TtkScale_Init(Tcl_Interp *interp) { Ttk_Theme theme = Ttk_GetDefaultTheme(interp); diff --git a/generic/ttk/ttkScrollbar.c b/generic/ttk/ttkScrollbar.c index 6ea44b9..581849e 100644 --- a/generic/ttk/ttkScrollbar.c +++ b/generic/ttk/ttkScrollbar.c @@ -333,6 +333,9 @@ TTK_END_LAYOUT */ MODULE_SCOPE +void TtkScrollbar_Init(Tcl_Interp *interp); + +MODULE_SCOPE void TtkScrollbar_Init(Tcl_Interp *interp) { Ttk_Theme theme = Ttk_GetDefaultTheme(interp); diff --git a/generic/ttk/ttkSeparator.c b/generic/ttk/ttkSeparator.c index a847093..bc26bd3 100644 --- a/generic/ttk/ttkSeparator.c +++ b/generic/ttk/ttkSeparator.c @@ -123,6 +123,9 @@ TTK_END_LAYOUT */ MODULE_SCOPE +void TtkSeparator_Init(Tcl_Interp *interp); + +MODULE_SCOPE void TtkSeparator_Init(Tcl_Interp *interp) { Ttk_Theme theme = Ttk_GetDefaultTheme(interp); diff --git a/generic/ttk/ttkSquare.c b/generic/ttk/ttkSquare.c index fac12bc..d1295a1 100644 --- a/generic/ttk/ttkSquare.c +++ b/generic/ttk/ttkSquare.c @@ -289,6 +289,9 @@ TTK_END_LAYOUT * free to specify a new style using completely different elements. */ +MODULE_SCOPE int +TtkSquareWidget_Init(Tcl_Interp *interp); + /* public */ MODULE_SCOPE int TtkSquareWidget_Init(Tcl_Interp *interp) { diff --git a/generic/ttk/ttkTreeview.c b/generic/ttk/ttkTreeview.c index 5ff8e94..a5b645e 100644 --- a/generic/ttk/ttkTreeview.c +++ b/generic/ttk/ttkTreeview.c @@ -4549,6 +4549,9 @@ static const Ttk_ElementSpec RowElementSpec = { */ MODULE_SCOPE +void TtkTreeview_Init(Tcl_Interp *interp); + +MODULE_SCOPE void TtkTreeview_Init(Tcl_Interp *interp) { Ttk_Theme theme = Ttk_GetDefaultTheme(interp); -- cgit v0.12