diff options
author | fvogel <fvogelnew1@free.fr> | 2016-11-05 12:04:26 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2016-11-05 12:04:26 (GMT) |
commit | f58782e964943a3a977716bf65ee3b6cedafde06 (patch) | |
tree | d07a21bbd6bd79fea3cdcf68e03c74b63f29d59d /unix | |
parent | f82b718e135c44bb8bb4865ac5cbb0272502de66 (diff) | |
parent | 2da9e225ec7604a5ad4e4dc46e76d090d733b87c (diff) | |
download | tk-f58782e964943a3a977716bf65ee3b6cedafde06.zip tk-f58782e964943a3a977716bf65ee3b6cedafde06.tar.gz tk-f58782e964943a3a977716bf65ee3b6cedafde06.tar.bz2 |
Close unintended fork
Diffstat (limited to 'unix')
-rw-r--r-- | unix/tkUnixFont.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/unix/tkUnixFont.c b/unix/tkUnixFont.c index e694573..c96e562 100644 --- a/unix/tkUnixFont.c +++ b/unix/tkUnixFont.c @@ -19,8 +19,8 @@ * The preferred font encodings. */ -static const char *const encodingList[] = { - "iso8859-1", "jis0208", "jis0212", NULL +static const char encodingList[][10] = { + "iso8859-1", "jis0208", "jis0212" }; /* @@ -42,7 +42,7 @@ static const char *const encodingList[] = { typedef struct FontFamily { struct FontFamily *nextPtr; /* Next in list of all known font families. */ - int refCount; /* How many SubFonts are referring to this + size_t refCount; /* How many SubFonts are referring to this * FontFamily. When the refCount drops to * zero, this FontFamily may be freed. */ /* @@ -1916,8 +1916,7 @@ FreeFontFamily( if (familyPtr == NULL) { return; } - familyPtr->refCount--; - if (familyPtr->refCount > 0) { + if (familyPtr->refCount-- > 1) { return; } Tcl_FreeEncoding(familyPtr->encoding); @@ -2686,7 +2685,7 @@ RankAttributes( penalty += 150 * diff; } if (gotPtr->xa.charset != wantPtr->xa.charset) { - int i; + size_t i; const char *gotAlias, *wantAlias; penalty += 65000; @@ -2694,7 +2693,7 @@ RankAttributes( wantAlias = GetEncodingAlias(wantPtr->xa.charset); if (strcmp(gotAlias, wantAlias) != 0) { penalty += 30000; - for (i = 0; encodingList[i] != NULL; i++) { + for (i = 0; i < sizeof(encodingList)/sizeof(encodingList[0]); i++) { if (strcmp(gotAlias, encodingList[i]) == 0) { penalty -= 30000; break; @@ -3012,7 +3011,7 @@ static const char * GetEncodingAlias( const char *name) /* The name to look up. */ { - EncodingAlias *aliasPtr; + const EncodingAlias *aliasPtr; for (aliasPtr = encodingAliases; aliasPtr->aliasPattern != NULL; ) { if (Tcl_StringMatch(name, aliasPtr->aliasPattern)) { |