From: Tony Cook Date: Fri, 17 Feb 2006 12:38:13 +0000 (+0000) Subject: - make win32.c const happy X-Git-Tag: Imager-0.48^2~9 X-Git-Url: http://git.imager.perl.org/imager.git/commitdiff_plain/885e13c5a172a0f0584d9aef845c017c1cb114e7 - make win32.c const happy - make raw.c C89 compliant --- diff --git a/Changes b/Changes index 58c45ee9..ddd64575 100644 --- 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 win32.c const happy +- make raw.c C89 compliant ================================================================= diff --git a/raw.c b/raw.c index ac799ac4..efdf44ae 100644 --- 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_clear_error(); - 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)); diff --git a/win32.c b/win32.c index ab9b8b08..f03b9141 100644 --- 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) -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); /* @@ -41,7 +41,7 @@ Calculate a bounding box for the text. =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; @@ -140,8 +140,8 @@ Draws the text in the given color. */ 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; @@ -195,8 +195,8 @@ Draws the text in the given channel. */ 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; @@ -273,7 +273,7 @@ Fills in a LOGFONT structure with reasonable defaults. =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 */ @@ -295,7 +295,7 @@ native greyscale bitmaps. =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;