Skip to content

Commit

Permalink
Make revised_text build when TK_CHECK_ALLOCS is defined.
Browse files Browse the repository at this point in the history
  • Loading branch information
fvogelnew1 committed Dec 5, 2024
1 parent 311fe4e commit a54d54a
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
2 changes: 2 additions & 0 deletions generic/tkBitField.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
#ifndef _TKBITFIELD
#define _TKBITFIELD

/* #define TK_CHECK_ALLOCS */

#include "tkInt.h" /* needed for inline support and 64 bit support */

#if (UINTPTR_MAX >= 0xffffffffffffffffu)
Expand Down
2 changes: 2 additions & 0 deletions generic/tkIntSet.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
#ifndef _TKINTSET
#define _TKINTSET

/* #define TK_CHECK_ALLOCS */

#include "tkInt.h" /* required for inline support */

#if defined(__GNUC__) || defined(__clang__)
Expand Down
2 changes: 2 additions & 0 deletions generic/tkRangeList.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
#ifndef _TKRANGELIST
#define _TKRANGELIST

/* #define TK_CHECK_ALLOCS */

#include "tkInt.h" /* required for inline support */

#if defined(__GNUC__) || defined(__clang__)
Expand Down
4 changes: 2 additions & 2 deletions generic/tkText.c
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ static unsigned widgetNumber = 0;
static WatchShared *watchShared;

static void
AllocStatistic()
AllocStatistic(void)
{
const WatchShared *wShared;

Expand All @@ -639,7 +639,7 @@ AllocStatistic()
const TkText *peer;

for (peer = wShared->sharedTextPtr->peers; peer; peer = peer->next) {
fprintf(stderr, "Unreleased text widget %d\n", peer->widgetNumber);
fprintf(stderr, "Unreleased text widget %zd\n", peer->widgetNumber);
}
}

Expand Down
2 changes: 2 additions & 0 deletions generic/tkText.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#ifndef _TKTEXT
#define _TKTEXT

/* #define TK_CHECK_ALLOCS */

#ifndef _TKINT
# include "tkInt.h"
#endif
Expand Down
6 changes: 2 additions & 4 deletions generic/tkTextDisp.c
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,7 @@ typedef struct Statistic {
static Statistic stats;

static void
PerfStatistic()
PerfStatistic(void)
{
if (!tkBTreeDebug) {
return;
Expand Down Expand Up @@ -903,7 +903,7 @@ extern unsigned tkRangeListCountDestroy;
static int hookStatFunc = 1;

static void
AllocStatistic()
AllocStatistic(void)
{
if (!tkBTreeDebug) {
return;
Expand Down Expand Up @@ -1662,9 +1662,7 @@ TkTextCreateDInfo(
#endif
#ifndef NDEBUG
if (!stats.perfFuncIsHooked) {
#ifndef _MSC_VER /* MSVC erroneously triggers warning warning C4113 */
atexit(PerfStatistic);
#endif
stats.perfFuncIsHooked = 1;
}
#endif
Expand Down

0 comments on commit a54d54a

Please sign in to comment.