[gs-cvs] rev 7055 - trunk/gs/src
leonardo at ghostscript.com
leonardo at ghostscript.com
Tue Sep 19 02:55:27 PDT 2006
Author: leonardo
Date: 2006-09-19 02:55:25 -0700 (Tue, 19 Sep 2006)
New Revision: 7055
Modified:
trunk/gs/src/gdevpdfu.c
trunk/gs/src/gdevpdtt.c
Log:
Fix (pdfwrite) : Uninitialized variables.
DETAILS :
1. ps_encoding_index sometimes was not initialized in gdevpdtt.c .
Bug 688898 "ps2pdf segfaults in gdevpdtt.c: pdf_reserve_char_code_in_pdfont ()".
2. Cygwin/gcc reports a possibly uninitialized variable in gdevpdfu.c .
Actually the compiler is not enough clever.
3. Removed unused variables in gdevpdtt.c .
EXPECTED DIFFERENCES :
None.
Modified: trunk/gs/src/gdevpdfu.c
===================================================================
--- trunk/gs/src/gdevpdfu.c 2006-09-19 08:20:45 UTC (rev 7054)
+++ trunk/gs/src/gdevpdfu.c 2006-09-19 09:55:25 UTC (rev 7055)
@@ -236,7 +236,7 @@
if (p != NULL) {
for (;; i++) {
const byte *c = memchr(p, gp_file_name_list_separator, e - p);
- int k;
+ int k = 0; /* Initializing against a compiler warning only. */
if (c == NULL)
c = e;
Modified: trunk/gs/src/gdevpdtt.c
===================================================================
--- trunk/gs/src/gdevpdtt.c 2006-09-19 08:20:45 UTC (rev 7054)
+++ trunk/gs/src/gdevpdtt.c 2006-09-19 09:55:25 UTC (rev 7055)
@@ -1323,7 +1323,6 @@
which we believe comes from poorly designed documents.
*/
int j, ch;
- gs_const_string str;
for (j = 0; j < cgp->num_all_chars; j++)
if (cgp->s[j].glyph == glyph)
@@ -1345,7 +1344,6 @@
standard_glyph_code_for_notdef =
gs_c_name_glyph((const byte *)".notdef", 7) - gs_c_min_std_encoding_glyph;
for (ch = 0; ch < 256; ch++) {
- gs_glyph glyph1 = enc[ch];
pdf_encoding_element_t *pet = &pdfont->u.simple.Encoding[ch];
if (pet->glyph == GS_NO_GLYPH && enc[ch] == standard_glyph_code_for_notdef) {
@@ -1751,7 +1749,7 @@
byte *glyph_usage = 0;
double *real_widths = 0;
int char_cache_size = 0, width_cache_size = 0;
- int code, ps_encoding_index;
+ int code, ps_encoding_index = -1;
if (font->FontType == ft_composite) {
/* Must not happen, because we always split composite fonts into descendents. */
More information about the gs-cvs
mailing list