various changes from trying to build on testdrive
authorTony Cook <tony@develop=help.com>
Wed, 1 May 2002 13:53:46 +0000 (13:53 +0000)
committerTony Cook <tony@develop=help.com>
Wed, 1 May 2002 13:53:46 +0000 (13:53 +0000)
Changes
Imager.xs
datatypes.h
img16.c
tags.c

diff --git a/Changes b/Changes
index 54d454319e19ddb7f864b3fb8ba70b08a8fbb903..8887750210c2219985a79c4e99865482a382b3e8 100644 (file)
--- a/Changes
+++ b/Changes
@@ -651,8 +651,15 @@ Revision history for Perl extension Imager.
           parameter
         - support UTF8 text with Freetype 1.x 
         - second parameter to SvPV() must be of type STRLEN
-       - Doc pathces from cogent.
-       - Fixed out of bounds access on bitmap for flood fills.
+        - Doc pathces from cogent.
+        - Fixed out of bounds access on bitmap for flood fills.
+        - some char * vs unsigned char * casts missing on OSF1 v4.0
+        - some enums had , on the last item in datatypes.h, which OSF1
+          didn't like
+       - Compaq C 6.4 (OSF1) claims to be C99 but doesn't provide 
+          stdint.h, don't try to use it under OSF
+        - fix missing initialization in tags.c
+
 =================================================================
 
         For latest versions check the Imager-devel pages:
index a89349b8788795857efd99e84196c41a4b591c48..c3f6272deb823c2f79f18348303bc52af853a397 100644 (file)
--- a/Imager.xs
+++ b/Imager.xs
@@ -1142,7 +1142,7 @@ io_slurp(ig)
              data    = NULL;
               tlength = io_slurp(ig, &data);
               EXTEND(SP,1);
-              PUSHs(sv_2mortal(newSVpv(data,tlength)));
+              PUSHs(sv_2mortal(newSVpv((char *)data,tlength)));
               myfree(data);
 
 
@@ -1244,7 +1244,8 @@ i_img_getdata(im)
     Imager::ImgRaw     im
              PPCODE:
               EXTEND(SP, 1);
-               PUSHs(im->idata ? sv_2mortal(newSVpv(im->idata, im->bytes)) 
+               PUSHs(im->idata ? 
+                    sv_2mortal(newSVpv((char *)im->idata, im->bytes)) 
                     : &PL_sv_undef);
 
 
@@ -3173,7 +3174,7 @@ i_gpal(im, l, r, y)
           }
           else {
             EXTEND(SP, 1);
-            PUSHs(sv_2mortal(newSVpv(work, count * sizeof(i_palidx))));
+            PUSHs(sv_2mortal(newSVpv((char *)work, count * sizeof(i_palidx))));
           }
           myfree(work);
         }
@@ -3378,7 +3379,7 @@ i_gsamp(im, l, r, y, ...)
           }
           else {
             EXTEND(SP, 1);
-            PUSHs(sv_2mortal(newSVpv(data, count * sizeof(i_sample_t))));
+            PUSHs(sv_2mortal(newSVpv((char *)data, count * sizeof(i_sample_t))));
           }
          myfree(data);
         }
@@ -4034,7 +4035,7 @@ i_new_fill_hatch(fg, bg, combine, hatch, cust_hatch, dx, dy)
         STRLEN len;
       CODE:
         if (SvOK(ST(4))) {
-          cust_hatch = SvPV(ST(4), len);
+          cust_hatch = (unsigned char *)SvPV(ST(4), len);
         }
         else
           cust_hatch = NULL;
@@ -4055,7 +4056,7 @@ i_new_fill_hatchf(fg, bg, combine, hatch, cust_hatch, dx, dy)
         STRLEN len;
       CODE:
         if (SvOK(ST(4))) {
-          cust_hatch = SvPV(ST(4), len);
+          cust_hatch = (unsigned char *)SvPV(ST(4), len);
         }
         else
           cust_hatch = NULL;
index c97c2780d251cc63e9cc029f1adde405d7eac389..7e2ac9b34dc0365a104ace5169526d4b250a3f08 100644 (file)
@@ -49,7 +49,7 @@ typedef union {
 
 typedef enum {
   i_direct_type, /* direct colour, keeps RGB values per pixel */
-  i_palette_type, /* keeps a palette index per pixel */
+  i_palette_type /* keeps a palette index per pixel */
 } i_img_type_t;
 
 typedef enum { 
@@ -57,7 +57,7 @@ typedef enum {
   /* a paletted image might have one bit per sample */
   i_8_bits = 8,
   i_16_bits = 16,
-  i_double_bits = sizeof(double) * 8,
+  i_double_bits = sizeof(double) * 8
 } i_img_bits_t;
 
 typedef struct {
diff --git a/img16.c b/img16.c
index 53aa25a0f9bb02c173615d66fdab69885114afc0..63df6f99d8b1a156d585d2a422b2df165a39efc4 100644 (file)
--- a/img16.c
+++ b/img16.c
@@ -82,8 +82,12 @@ static i_img IIM_base_16bit_direct =
    so we check for one otherwise we work by bytes directly
 
    We do assume 8-bit char
+
+   "Compaq C V6.4-009 on Compaq Tru64 UNIX V5.1A (Rev. 1885)" says it
+   supports C99, but doesn't supply stdint.h, which is required for
+   both hosted and freestanding implementations.  So guard against it.
 */
-#if __STDC_VERSION__ >= 199901L
+#if __STDC_VERSION__ >= 199901L && !defined(OS_dec_osf)
 /* C99 should define something useful */
 #include <stdint.h>
 #ifdef UINT16_MAX
diff --git a/tags.c b/tags.c
index f53a18e381a7960a62ad24e9cb0fff2675bc7de1..f8440808bfb5840ceee84630ecd027fbd061b27b 100644 (file)
--- a/tags.c
+++ b/tags.c
@@ -338,6 +338,7 @@ static int parse_long(char *data, char **end, long *out) {
 static int parse_long_list(char *data, char **end, int maxcount, long *out) {
   int i;
 
+  i = 0;
   while (i < maxcount-1) {
     if (!parse_long(data, &data, out))
       return 0;