]> git.imager.perl.org - imager.git/commitdiff
- make win32.c const happy
authorTony Cook <tony@develop=help.com>
Fri, 17 Feb 2006 12:38:13 +0000 (12:38 +0000)
committerTony Cook <tony@develop=help.com>
Fri, 17 Feb 2006 12:38:13 +0000 (12:38 +0000)
- make raw.c C89 compliant

Changes
raw.c
win32.c

diff --git a/Changes b/Changes
index 58c45ee952917123ee966a7fe034a110e868285e..ddd6457575513aae6c6ab0766f34d8c1f93e230b 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1358,6 +1358,8 @@ Revision history for Perl extension Imager.
 - make TIFF detection stricter
 - more memory allocation integer overflow auditing
 - IM_DEBUG_MALLOC wasn't interacting well with the API
 - make TIFF detection stricter
 - more memory allocation integer overflow auditing
 - IM_DEBUG_MALLOC wasn't interacting well with the API
+- make win32.c const happy
+- make raw.c C89 compliant
 
 =================================================================
 
 
 =================================================================
 
diff --git a/raw.c b/raw.c
index ac799ac4a4979bad98cd0af3d21a8430d6a331de..efdf44ae6117f2692475559cbac16dbeb671e359 100644 (file)
--- a/raw.c
+++ b/raw.c
@@ -54,14 +54,14 @@ i_readraw_wiol(io_glue *ig, int x, int y, int datachannels, int storechannels, i
   i_img* im;
   int rc,k;
 
   i_img* im;
   int rc,k;
 
-  i_clear_error();
-  
   unsigned char *inbuffer;
   unsigned char *ilbuffer;
   unsigned char *exbuffer;
   
   int inbuflen,ilbuflen,exbuflen;
 
   unsigned char *inbuffer;
   unsigned char *ilbuffer;
   unsigned char *exbuffer;
   
   int inbuflen,ilbuflen,exbuflen;
 
+  i_clear_error();
+  
   io_glue_commit_types(ig);
   mm_log((1, "i_readraw(ig %p,x %d,y %d,datachannels %d,storechannels %d,intrl %d)\n",
          ig, x, y, datachannels, storechannels, intrl));
   io_glue_commit_types(ig);
   mm_log((1, "i_readraw(ig %p,x %d,y %d,datachannels %d,storechannels %d,intrl %d)\n",
          ig, x, y, datachannels, storechannels, intrl));
diff --git a/win32.c b/win32.c
index ab9b8b08ca89a38272d52f92c983c1de67b210cc..f03b9141cd1c306ecd84667b59217f3b5ca1f33f 100644 (file)
--- a/win32.c
+++ b/win32.c
@@ -28,9 +28,9 @@ An Imager interface to font output using the Win32 GDI.
 
 #define fixed(x) ((x).value + ((x).fract) / 65536.0)
 
 
 #define fixed(x) ((x).value + ((x).fract) / 65536.0)
 
-static void set_logfont(char *face, int size, LOGFONT *lf);
+static void set_logfont(const char *face, int size, LOGFONT *lf);
 
 
-static LPVOID render_text(char *face, int size, char *text, int length, int aa,
+static LPVOID render_text(const char *face, int size, const char *text, int length, int aa,
                           HBITMAP *pbm, SIZE *psz, TEXTMETRIC *tm);
 
 /*
                           HBITMAP *pbm, SIZE *psz, TEXTMETRIC *tm);
 
 /*
@@ -41,7 +41,7 @@ Calculate a bounding box for the text.
 =cut
 */
 
 =cut
 */
 
-int i_wf_bbox(char *face, int size, char *text, int length, int *bbox) {
+int i_wf_bbox(const char *face, int size, const char *text, int length, int *bbox) {
   LOGFONT lf;
   HFONT font, oldFont;
   HDC dc;
   LOGFONT lf;
   HFONT font, oldFont;
   HDC dc;
@@ -140,8 +140,8 @@ Draws the text in the given color.
 */
 
 int
 */
 
 int
-i_wf_text(char *face, i_img *im, int tx, int ty, i_color *cl, int size, 
-         char *text, int len, int align, int aa) {
+i_wf_text(const char *face, i_img *im, int tx, int ty, const i_color *cl, int size, 
+         const char *text, int len, int align, int aa) {
   unsigned char *bits;
   HBITMAP bm;
   SIZE sz;
   unsigned char *bits;
   HBITMAP bm;
   SIZE sz;
@@ -195,8 +195,8 @@ Draws the text in the given channel.
 */
 
 int
 */
 
 int
-i_wf_cp(char *face, i_img *im, int tx, int ty, int channel, int size, 
-         char *text, int len, int align, int aa) {
+i_wf_cp(const char *face, i_img *im, int tx, int ty, int channel, int size, 
+         const char *text, int len, int align, int aa) {
   unsigned char *bits;
   HBITMAP bm;
   SIZE sz;
   unsigned char *bits;
   HBITMAP bm;
   SIZE sz;
@@ -273,7 +273,7 @@ Fills in a LOGFONT structure with reasonable defaults.
 =cut
 */
 
 =cut
 */
 
-static void set_logfont(char *face, int size, LOGFONT *lf) {
+static void set_logfont(const char *face, int size, LOGFONT *lf) {
   memset(lf, 0, sizeof(LOGFONT));
 
   lf->lfHeight = -size; /* character height rather than cell height */
   memset(lf, 0, sizeof(LOGFONT));
 
   lf->lfHeight = -size; /* character height rather than cell height */
@@ -295,7 +295,7 @@ native greyscale bitmaps.
 
 =cut
 */
 
 =cut
 */
-static LPVOID render_text(char *face, int size, char *text, int length, int aa,
+static LPVOID render_text(const char *face, int size, const char *text, int length, int aa,
                   HBITMAP *pbm, SIZE *psz, TEXTMETRIC *tm) {
   BITMAPINFO bmi;
   BITMAPINFOHEADER *bmih = &bmi.bmiHeader;
                   HBITMAP *pbm, SIZE *psz, TEXTMETRIC *tm) {
   BITMAPINFO bmi;
   BITMAPINFOHEADER *bmih = &bmi.bmiHeader;