[gs-commits] ghostpdl branch, master, updated. jbig2dec-0.14-1906-g1759596
[email protected] (Robin Watts) Wed, 20 Nov 2019 10:08:16 +0000 (UTC)
| Newsgroups | gmane.comp.printing.ghostscript.cvs |
|---|---|
| Message-ID | <[email protected]> |
The ghostpdl branch, master has been updated
via 1759596a7499d27e3d289bbff4c45f9206ad4798 (commit)
from c5eb242fa82585aa21371919ca4a7a2d4d4effc3 (commit)
----------------------------------------------------------------------
commit 1759596a7499d27e3d289bbff4c45f9206ad4798
Author: Robin Watts <[email protected]>
Date: Tue Nov 19 19:13:40 2019 +0000
Followon to fix for bug 701877.
This changes the 'extern' definitions for
{Single,Double,Treble,Quad}GlyphList to be more correct. This
enables us to use the simple castless form in the initialisations.
This works nicely in Visual Studio, and will hopefully assuage
Coverity.
diff --git a/devices/vector/gdevpdfu.c b/devices/vector/gdevpdfu.c
index 0b2b640..05ea788 100644
--- a/devices/vector/gdevpdfu.c
+++ b/devices/vector/gdevpdfu.c
@@ -51,7 +51,7 @@
#include "gs_mgl_e.h"
#include "gs_mro_e.h"
-extern single_glyph_list_t *SingleGlyphList;
+extern single_glyph_list_t SingleGlyphList[];
/* Define the size of internal stream buffers. */
/* (This is not a limitation, it only affects performance.) */
@@ -339,7 +339,7 @@ static int write_tt_encodings(stream *s, bool HaveTrueTypes)
if (HaveTrueTypes) {
char Buffer[256];
- single_glyph_list_t *entry = (single_glyph_list_t *)&SingleGlyphList;
+ single_glyph_list_t *entry = SingleGlyphList;
gs_sprintf(Buffer, "/AdobeGlyphList mark\n");
stream_write(s, Buffer, strlen(Buffer));
diff --git a/devices/vector/gdevtxtw.c b/devices/vector/gdevtxtw.c
index 7738321..c2deb8d 100644
--- a/devices/vector/gdevtxtw.c
+++ b/devices/vector/gdevtxtw.c
@@ -37,10 +37,10 @@
/* #define TRACE_TXTWRITE 1 */
-extern single_glyph_list_t *SingleGlyphList;
-extern double_glyph_list_t *DoubleGlyphList;
-extern treble_glyph_list_t *TrebleGlyphList;
-extern quad_glyph_list_t *QuadGlyphList;
+extern single_glyph_list_t SingleGlyphList[];
+extern double_glyph_list_t DoubleGlyphList[];
+extern treble_glyph_list_t TrebleGlyphList[];
+extern quad_glyph_list_t QuadGlyphList[];
/*
* Define the structure used to return glyph width information. Note that
* there are two different sets of width information: real-number (x,y)
@@ -1710,10 +1710,10 @@ static int get_unicode(textw_text_enum_t *penum, gs_font *font, gs_glyph glyph,
}
}
if (length == 0) {
- single_glyph_list_t *sentry = (single_glyph_list_t *)&SingleGlyphList;
- double_glyph_list_t *dentry = (double_glyph_list_t *)&DoubleGlyphList;
- treble_glyph_list_t *tentry = (treble_glyph_list_t *)&TrebleGlyphList;
- quad_glyph_list_t *qentry = (quad_glyph_list_t *)&QuadGlyphList;
+ single_glyph_list_t *sentry = SingleGlyphList;
+ double_glyph_list_t *dentry = DoubleGlyphList;
+ treble_glyph_list_t *tentry = TrebleGlyphList;
+ quad_glyph_list_t *qentry = QuadGlyphList;
/* Search glyph to single Unicode value table */
while (sentry->Glyph != 0) {
Summary of changes:
devices/vector/gdevpdfu.c | 4 ++--
devices/vector/gdevtxtw.c | 16 ++++++++--------
2 files changed, 10 insertions(+), 10 deletions(-)