summaryrefslogtreecommitdiff
path: root/pxl
diff options
context:
space:
mode:
authorHenry Stiles <henry.stiles@artifex.com>2008-03-06 18:58:19 +0000
committerHenry Stiles <henry.stiles@artifex.com>2008-03-06 18:58:19 +0000
commit0cee5ad46dd26a09370e26cf94cf35f15c6353ea (patch)
tree28481811f6107ff4a4e9eb203154dc3ac015455f /pxl
parent5c629eaa81df04cd377dd6b73e379bba6ca86359 (diff)
cosmetic change, use int32_t from stdint_.h instead of a definition
private to pxl. git-svn-id: http://svn.ghostscript.com/ghostpcl/trunk/ghostpcl@3043 06663e23-700e-0410-b217-a244a6096597
Diffstat (limited to 'pxl')
-rw-r--r--pxl/pximage.c4
-rw-r--r--pxl/pxink.c4
-rw-r--r--pxl/pxpaint.c4
-rw-r--r--pxl/pxsessio.c4
-rw-r--r--pxl/pxvalue.c12
-rw-r--r--pxl/pxvalue.h16
6 files changed, 19 insertions, 25 deletions
diff --git a/pxl/pximage.c b/pxl/pximage.c
index 1d69b586b..b854a0b45 100644
--- a/pxl/pximage.c
+++ b/pxl/pximage.c
@@ -677,7 +677,7 @@ typedef struct px_pattern_enum_s px_pattern_enum_t;
#endif
struct px_pattern_enum_s {
px_bitmap_enum_t benum;
- integer pattern_id;
+ int32_t pattern_id;
pxePatternPersistence_t persistence;
px_pattern_t *pattern;
};
@@ -785,7 +785,7 @@ pxEndRastPattern(px_args_t *par, px_state_t *pxs)
/* We extract the key and value from the pattern_enum structure */
/* and then free the structure, to encourage LIFO allocation. */
px_pattern_t *pattern = pxenum->pattern;
- integer id = pxenum->pattern_id;
+ int32_t id = pxenum->pattern_id;
px_value_t key;
px_dict_t *pdict;
diff --git a/pxl/pxink.c b/pxl/pxink.c
index ca1ab3d9e..1d23beecb 100644
--- a/pxl/pxink.c
+++ b/pxl/pxink.c
@@ -469,7 +469,7 @@ set_source(const px_args_t *par, px_state_t *pxs, px_paint_t *ppt)
return_error(errorIllegalAttributeCombination);
key.type = pxd_array | pxd_ubyte;
key.value.array.data = (byte *)&par->pv[aPatternSelectID]->value.i;
- key.value.array.size = sizeof(integer);
+ key.value.array.size = sizeof(int32_t);
if ( !(px_dict_find(&pxgs->temp_pattern_dict, &key, &value) ||
px_dict_find(&pxs->page_pattern_dict, &key, &value) ||
px_dict_find(&pxs->session_pattern_dict, &key, &value))
@@ -511,7 +511,7 @@ set_source(const px_args_t *par, px_state_t *pxs, px_paint_t *ppt)
if ( prgb->type & pxd_any_real )
ppt->value.rgb[i] = real_elt(prgb, i);
else {
- integer v = integer_elt(prgb, i);
+ int32_t v = integer_elt(prgb, i);
ppt->value.rgb[i] = (v < 0 ? 0 : (real)v / int_type_max(prgb->type));
}
} else if ( par->pv[aGrayLevel] ) /* pxaGrayLevel */ {
diff --git a/pxl/pxpaint.c b/pxl/pxpaint.c
index 56ee48b3f..8a739d39c 100644
--- a/pxl/pxpaint.c
+++ b/pxl/pxpaint.c
@@ -83,7 +83,7 @@ add_lines(px_args_t *par, px_state_t *pxs,
/* Multiple segments, specified in source data. */
if ( !(par->pv[1] && par->pv[2]) )
return_error(errorMissingAttribute);
- { integer num_points = par->pv[1]->value.i;
+ { int32_t num_points = par->pv[1]->value.i;
pxeDataType_t type = (pxeDataType_t)par->pv[2]->value.i;
int point_size = (type == eUByte || type == eSByte ? 2 : 4);
@@ -153,7 +153,7 @@ add_curves(px_args_t *par, px_state_t *pxs,
}
else
return_error(errorMissingAttribute);
- { integer num_points = par->pv[0]->value.i;
+ { int32_t num_points = par->pv[0]->value.i;
pxeDataType_t type = (pxeDataType_t)par->pv[1]->value.i;
int point_size = (type == eUByte || type == eSByte ? 2 : 4);
int segment_size = point_size * 3;
diff --git a/pxl/pxsessio.c b/pxl/pxsessio.c
index 555837b82..fb131c861 100644
--- a/pxl/pxsessio.c
+++ b/pxl/pxsessio.c
@@ -331,7 +331,7 @@ pxBeginPage(px_args_t *par, px_state_t *pxs)
}
if ( have_params == false ) {
if (par->pv[0]) {
- integer orientation = par->pv[0]->value.i;
+ int32_t orientation = par->pv[0]->value.i;
if ( orientation < 0 || orientation >= pxeOrientation_next )
{ px_record_warning("IllegalOrientation", true, pxs);
orientation = ePortraitOrientation;
@@ -367,7 +367,7 @@ pxBeginPage(px_args_t *par, px_state_t *pxs)
/* Copy parameters to the PCL XL state. */
/* For some reason, invalid Orientations only produces a warning. */
if ( par->pv[0] ) {
- integer orientation = par->pv[0]->value.i;
+ int32_t orientation = par->pv[0]->value.i;
if ( orientation < 0 || orientation >= pxeOrientation_next ) {
px_record_warning("IllegalOrientation", true, pxs);
orientation = ePortraitOrientation;
diff --git a/pxl/pxvalue.c b/pxl/pxvalue.c
index 8431e78e0..77f743d15 100644
--- a/pxl/pxvalue.c
+++ b/pxl/pxvalue.c
@@ -27,14 +27,14 @@ int
sint16at(const byte *p, bool big_endian)
{ return ((int)uint16at(p, big_endian) ^ 0x8000) - 0x8000;
}
-integer
+int32_t
uint32at(const byte *p, bool big_endian)
{ return
(big_endian ?
- ((integer)((p[0] << 8) + p[1]) << 16) + (p[2] << 8) + p[3] :
- ((integer)((p[3] << 8) + p[2]) << 16) + (p[1] << 8) + p[0]);
+ ((int32_t)((p[0] << 8) + p[1]) << 16) + (p[2] << 8) + p[3] :
+ ((int32_t)((p[3] << 8) + p[2]) << 16) + (p[1] << 8) + p[0]);
}
-integer
+int32_t
sint32at(const byte *p, bool big_endian)
{ return (uint32at(p, big_endian) ^ 0x80000000) - 0x80000000;
}
@@ -43,7 +43,7 @@ real32at(const byte *p, bool big_endian)
{
union {
float f;
- integer d;
+ int32_t d;
} df;
df.d = uint32at(p, big_endian);
@@ -52,7 +52,7 @@ real32at(const byte *p, bool big_endian)
/* Get an element from an array. */
/* The caller does all index and type checking. */
-integer
+int32_t
integer_elt(const px_value_t *pav, uint index)
{ px_data_type_t type = pav->type;
const byte *base = pav->value.array.data;
diff --git a/pxl/pxvalue.h b/pxl/pxvalue.h
index e2a379c5c..8db75e0df 100644
--- a/pxl/pxvalue.h
+++ b/pxl/pxvalue.h
@@ -46,12 +46,6 @@ typedef enum {
pxd_on_heap = 0x800
} px_data_type_t;
-/* Define a type for a 32-bit integer. */
-#if arch_ints_are_short
-typedef long integer;
-#else
-typedef int integer;
-#endif
typedef float real;
/* Define a type for values on the stack. */
@@ -63,8 +57,8 @@ typedef struct {
px_data_type_t type;
px_attribute_t attribute;
union v_ {
- integer i;
- integer ia[4]; /* ia[0] aliases i */
+ int32_t i;
+ int32_t ia[4]; /* ia[0] aliases i */
real r;
real ra[4]; /* ra[0] aliases r */
px_array_t array;
@@ -96,13 +90,13 @@ typedef struct {
/* Get numeric values from the input or an array. */
uint uint16at(const byte *p, bool big_endian);
int sint16at(const byte *p, bool big_endian);
-integer uint32at(const byte *p, bool big_endian);
-integer sint32at(const byte *p, bool big_endian);
+int32_t uint32at(const byte *p, bool big_endian);
+int32_t sint32at(const byte *p, bool big_endian);
real real32at(const byte *p, bool big_endian);
/* Get an element from an array. */
/* The caller does all index and type checking. */
-integer integer_elt(const px_value_t *pav, uint index);
+int32_t integer_elt(const px_value_t *pav, uint index);
real real_elt(const px_value_t *pav, uint index);
#endif /* pxvalue_INCLUDED */