Author: jordi
Date: 2005-03-17 12:07:24 -0500 (Thu, 17 Mar 2005)
New Revision: 41952
Modified:
trunk/libgdiplus/src/ChangeLog
trunk/libgdiplus/src/bitmap.c
trunk/libgdiplus/src/bmpcodec.c
trunk/libgdiplus/src/font.c
trunk/libgdiplus/src/gdip.h
trunk/libgdiplus/src/gifcodec.c
trunk/libgdiplus/src/gifcodec.h
trunk/libgdiplus/src/graphics-path.c
trunk/libgdiplus/src/graphics.c
trunk/libgdiplus/src/image.c
trunk/libgdiplus/src/jpegcodec.c
trunk/libgdiplus/src/pngcodec.c
trunk/libgdiplus/src/texturebrush.c
trunk/libgdiplus/src/tiffcodec.c
Log:
2005-03-17 Jordi Mas i Hernandez <[EMAIL PROTECTED]>
* pngcodec.c: fixes warnings for GCC4
* gdip.h: fixes warnings for GCC4
* graphics.c: fixes warnings for GCC4
* font.c: fixes warnings for GCC4
* bmpcodec.c: fixes warnings for GCC4
* image.c: fixes warnings for GCC4
* jpegcodec.c: fixes warnings for GCC4
* tiffcodec.c: fixes warnings for GCC4
* gifcodec.c: fixes warnings for GCC4
* texturebrush.c: fixes warnings for GCC4
* gifcodec.h: fixes warnings for GCC4
* bitmap.c: fixes warnings for GCC4
* pngcodec.c: fixes warnings for GCC4
Modified: trunk/libgdiplus/src/ChangeLog
===================================================================
--- trunk/libgdiplus/src/ChangeLog 2005-03-17 16:54:10 UTC (rev 41951)
+++ trunk/libgdiplus/src/ChangeLog 2005-03-17 17:07:24 UTC (rev 41952)
@@ -1,3 +1,19 @@
+2005-03-17 Jordi Mas i Hernandez <[EMAIL PROTECTED]>
+
+ * pngcodec.c: fixes warnings for GCC4
+ * gdip.h: fixes warnings for GCC4
+ * graphics.c: fixes warnings for GCC4
+ * font.c: fixes warnings for GCC4
+ * bmpcodec.c: fixes warnings for GCC4
+ * image.c: fixes warnings for GCC4
+ * jpegcodec.c: fixes warnings for GCC4
+ * tiffcodec.c: fixes warnings for GCC4
+ * gifcodec.c: fixes warnings for GCC4
+ * texturebrush.c: fixes warnings for GCC4
+ * gifcodec.h: fixes warnings for GCC4
+ * bitmap.c: fixes warnings for GCC4
+ * pngcodec.c: fixes warnings for GCC4
+
2005-03-17 Peter Bartok <[EMAIL PROTECTED]>
* image.c (iGdipLoadImageFromDelegate_linux): Now calls GetHeader
Modified: trunk/libgdiplus/src/bitmap.c
===================================================================
--- trunk/libgdiplus/src/bitmap.c 2005-03-17 16:54:10 UTC (rev 41951)
+++ trunk/libgdiplus/src/bitmap.c 2005-03-17 17:07:24 UTC (rev 41952)
@@ -84,7 +84,7 @@
GpBitmap *result = (GpBitmap *) GdipAlloc (sizeof (GpBitmap));
memcpy (result, bitmap, sizeof (GpBitmap));
- result->data.Scan0 = (GpBitmap *) malloc (bitmap->data.Stride *
bitmap->data.Height);
+ result->data.Scan0 = malloc (bitmap->data.Stride * bitmap->data.Height);
memcpy (result->data.Scan0, bitmap->data.Scan0, bitmap->data.Stride *
bitmap->data.Height);
*clonedbitmap = result;
@@ -355,7 +355,7 @@
if (destData->Scan0 == NULL) {
- GpBitmap *data;
+ byte *data;
destData->Stride = (((( destRect->Width * dest_components *
dest_deph) /8) + (sizeof(pixman_bits_t)-1)) & ~(sizeof(pixman_bits_t)-1));
@@ -947,7 +947,7 @@
switch (bitmap->data.PixelFormat) {
case Format24bppRgb:
bitmap->image.surface = cairo_surface_create_for_image
- (bitmap->data.Scan0,
+ ((char *)bitmap->data.Scan0,
CAIRO_FORMAT_RGB24,
bitmap->data.Width,
bitmap->data.Height,
@@ -957,7 +957,7 @@
case Format32bppRgb:
case Format32bppPArgb:
bitmap->image.surface = cairo_surface_create_for_image
- (bitmap->data.Scan0,
+ ((char *)bitmap->data.Scan0,
CAIRO_FORMAT_ARGB32,
bitmap->data.Width,
bitmap->data.Height,
Modified: trunk/libgdiplus/src/bmpcodec.c
===================================================================
--- trunk/libgdiplus/src/bmpcodec.c 2005-03-17 16:54:10 UTC (rev 41951)
+++ trunk/libgdiplus/src/bmpcodec.c 2005-03-17 17:07:24 UTC (rev 41952)
@@ -488,7 +488,7 @@
img->data.Scan0 = pixels;
img->data.Reserved = GBD_OWN_SCAN0;
- img->image.surface = cairo_surface_create_for_image (pixels,
+ img->image.surface = cairo_surface_create_for_image ((char *)pixels,
img->cairo_format,
img->image.width,
img->image.height,
Modified: trunk/libgdiplus/src/font.c
===================================================================
--- trunk/libgdiplus/src/font.c 2005-03-17 16:54:10 UTC (rev 41951)
+++ trunk/libgdiplus/src/font.c 2005-03-17 17:07:24 UTC (rev 41952)
@@ -280,7 +280,7 @@
for (i=0; i < font_collection->fontset->nfont; gpfam++, i++){
FcResult r = FcPatternGetString (*gpfam, FC_FAMILY, 0, &str);
- if (strcmp (string, str)==0) {
+ if (strcmp ((char *)string, (const char *)str)==0) {
gdip_createFontFamily (fontFamily);
(*fontFamily)->pattern = *gpfam;
(*fontFamily)->allocated = FALSE;
@@ -645,7 +645,7 @@
if (style != cached_fonts[i].style)
continue;
- if (strcmp (str, cached_fonts[i].szFamily) != 0)
+ if (strcmp ((char *)str, (const char
*)cached_fonts[i].szFamily) != 0)
continue;
if (cached_fonts[i].font == NULL)
@@ -673,12 +673,12 @@
cairo_font_reference ((cairo_font_t *)result->cairofnt);
*font=result;
- if (strlen (str) > 127) /* Cannot cache this font */
+ if (strlen ((const char *)str) > 127) /* Cannot cache this font */
return Ok;
/* Cache entry */
if (cached_fonts_index < MAX_CACHED_FONTS) {
- strcpy (cached_fonts[cached_fonts_index].szFamily, str);
+ strcpy (cached_fonts[cached_fonts_index].szFamily, (const char
*)str);
cached_fonts[cached_fonts_index].sizeInPixels = sizeInPixels;
cached_fonts[cached_fonts_index].style = style;
cached_fonts[cached_fonts_index].font = result;
@@ -692,7 +692,7 @@
continue;
gdip_release_font (cached_fonts[i].font); /* release
previous cached font */
- strcpy (cached_fonts[i].szFamily, str);
+ strcpy (cached_fonts[i].szFamily, (const char *)str);
cached_fonts[i].sizeInPixels = sizeInPixels;
cached_fonts[i].style = style;
cached_fonts[i].font = result;
@@ -761,12 +761,12 @@
GpStatus
GdipPrivateAddMemoryFont(GpFontCollection *fontCollection, GDIPCONST void
*memory, int length)
{
- char fontfile[256];
+ FcChar8 fontfile[256];
int f;
- strcpy(fontfile, "/tmp/ffXXXXXX");
+ strcpy((char *) fontfile, "/tmp/ffXXXXXX");
- f = mkstemp(fontfile);
+ f = mkstemp((char*)fontfile);
if (f == -1) {
return(GenericError);
}
Modified: trunk/libgdiplus/src/gdip.h
===================================================================
--- trunk/libgdiplus/src/gdip.h 2005-03-17 16:54:10 UTC (rev 41951)
+++ trunk/libgdiplus/src/gdip.h 2005-03-17 17:07:24 UTC (rev 41952)
@@ -626,7 +626,7 @@
unsigned int Height;
int Stride;
int PixelFormat;
- void *Scan0;
+ byte* Scan0;
unsigned int Reserved;
/*Added to keep track of position for displaying next frame
in a gif*/
Modified: trunk/libgdiplus/src/gifcodec.c
===================================================================
--- trunk/libgdiplus/src/gifcodec.c 2005-03-17 16:54:10 UTC (rev 41951)
+++ trunk/libgdiplus/src/gifcodec.c 2005-03-17 17:07:24 UTC (rev 41952)
@@ -142,6 +142,9 @@
BitmapData data;
GifImageDesc imgDesc;
+ data.ByteCount = 0;
+ data.Bytes = NULL;
+
if (from_file)
gif = DGifOpen(stream, &gdip_gif_fileinputfunc);
else
@@ -312,7 +315,7 @@
img->data = img->image.frameDimensionList[0].frames[0];
- img->image.surface = cairo_surface_create_for_image (img->data.Scan0,
img->cairo_format,
+ img->image.surface = cairo_surface_create_for_image ((char
*)img->data.Scan0, img->cairo_format,
img->image.width,
img->image.height,
img->data.Stride);
img->image.imageFlags = ImageFlagsReadOnly | ImageFlagsHasRealPixelSize
| ImageFlagsColorSpaceRGB;
@@ -347,7 +350,7 @@
GpStatus
-gdip_save_gif_image_to_file (unsigned char *filename, GpImage *image)
+gdip_save_gif_image_to_file (char *filename, GpImage *image)
{
return gdip_save_gif_image ( (void *)filename, image, TRUE);
}
@@ -384,7 +387,7 @@
return InvalidParameter;
if (from_file)
- fp = EGifOpenFileName ((unsigned char *) stream, 0);
+ fp = EGifOpenFileName (stream, 0);
else
fp = EGifOpen (stream, gdip_gif_outputfunc);
Modified: trunk/libgdiplus/src/gifcodec.h
===================================================================
--- trunk/libgdiplus/src/gifcodec.h 2005-03-17 16:54:10 UTC (rev 41951)
+++ trunk/libgdiplus/src/gifcodec.h 2005-03-17 17:07:24 UTC (rev 41952)
@@ -21,7 +21,7 @@
GpImage **image);
GpStatus
-gdip_save_gif_image_to_file (unsigned char *filename, GpImage *image);
+gdip_save_gif_image_to_file (char *filename, GpImage *image);
GpStatus
Modified: trunk/libgdiplus/src/graphics-path.c
===================================================================
--- trunk/libgdiplus/src/graphics-path.c 2005-03-17 16:54:10 UTC (rev
41951)
+++ trunk/libgdiplus/src/graphics-path.c 2005-03-17 17:07:24 UTC (rev
41952)
@@ -87,8 +87,10 @@
append (GpPath *path, float x, float y, GpPathPointType type)
{
byte t = (byte) type;
- GpPointF pt = {x, y};
+ GpPointF pt;
+ pt.X = x; pt.Y = y;
+
if (path->start_new_fig)
t = PathPointTypeStart;
/* if we closed a subpath, then start new figure and append */
Modified: trunk/libgdiplus/src/graphics.c
===================================================================
--- trunk/libgdiplus/src/graphics.c 2005-03-17 16:54:10 UTC (rev 41951)
+++ trunk/libgdiplus/src/graphics.c 2005-03-17 17:07:24 UTC (rev 41952)
@@ -76,7 +76,7 @@
void
gdip_graphics_attach_bitmap (GpGraphics *graphics, GpBitmap *image)
{
- cairo_set_target_image (graphics->ct, image->data.Scan0,
image->cairo_format,
+ cairo_set_target_image (graphics->ct, (char *)image->data.Scan0,
image->cairo_format,
image->data.Width, image->data.Height,
image->data.Stride);
if (image->image.surface) {
cairo_surface_destroy (image->image.surface);
@@ -305,9 +305,9 @@
#ifdef CAIRO_HAS_QUARTZ_SURFACE
-// This is a dirty hack; but it gets us around header include issues for now
-// FIXME: We need to split all the X11 stuff off into its own file(s) so that
-// different backends / font backends can be easily introduced in the future.
+/* This is a dirty hack; but it gets us around header include issues for now
+ FIXME: We need to split all the X11 stuff off into its own file(s) so that
+ different backends / font backends can be easily introduced in the future. */
void
cairo_set_target_quartz_context(cairo_t *cr,
void *ctx,
@@ -1655,7 +1655,7 @@
cairo_font_current_transform(Font, matrix);
cairo_matrix_scale(matrix, gdiFont->sizeInPixels,
gdiFont->sizeInPixels);
- ucs4 = g_utf8_to_ucs4 (utf8, (glong)-1, NULL, &NumOfGlyphs, NULL);
+ ucs4 = g_utf8_to_ucs4 ((const gchar *) utf8, (glong)-1, NULL,
&NumOfGlyphs, NULL);
if ((NumOfGlyphs == 0) || (ucs4 == NULL)) {
return 0;
@@ -1861,7 +1861,7 @@
}
/* Convert string from Gdiplus format to UTF8, suitable for cairo */
- String=g_utf16_to_utf8 ((const gunichar2 *)CleanString,
(glong)StringLen, NULL, NULL, NULL);
+ String= (unsigned char *) g_utf16_to_utf8 ((const gunichar2
*)CleanString, (glong)StringLen, NULL, NULL, NULL);
if (!String) {
free (CleanString);
free (StringDetails);
@@ -2261,12 +2261,6 @@
/* Setup cairo */
/* Save the font matrix */
-#ifdef COMMENTED_OUT
- // Font already has been set at function entry
- // cairo_set_font (graphics->ct, (cairo_font_t*)
font->cairofnt); // Set at function entry
- // cairo_font_current_transform(font->cairofnt, SavedMatrix);
// No need to save again, already saved at function entry
- // cairo_scale_font (graphics->ct, font->sizeInPixels);
-#endif
if (brush) {
gdip_brush_setup (graphics, (GpBrush *)brush);
@@ -2285,7 +2279,7 @@
continue;
}
- String=g_utf16_to_utf8 ((const gunichar2
*)(CleanString+i), (glong)StringDetails[i].LineLen, NULL, NULL, NULL);
+ String= (unsigned char *) g_utf16_to_utf8
((const gunichar2 *)(CleanString+i), (glong)StringDetails[i].LineLen, NULL,
NULL, NULL);
#ifdef DRAWSTRING_DEBUG
printf("Displaying line >%s<\n", String);
#endif
@@ -2543,12 +2537,12 @@
Get font size information; how expensive is the cairo stuff here?
*/
SavedMatrix = cairo_matrix_create();
- cairo_set_font (graphics->ct, (cairo_font_t*) font->cairofnt); // Set
our font; this will also be used for later drawing
- cairo_font_current_transform(font->cairofnt, SavedMatrix); // Save
the matrix
+ cairo_set_font (graphics->ct, (cairo_font_t*) font->cairofnt); /* Set
our font; this will also be used for later drawing */
+ cairo_font_current_transform(font->cairofnt, SavedMatrix); /* Save
the matrix */
cairo_scale_font (graphics->ct, font->sizeInPixels);
- cairo_current_font_extents (graphics->ct, &FontExtent); // Get
the size we're looking for
-// cairo_font_set_transform(font->cairofnt, SavedMatrix); //
Restore the matrix
+ cairo_current_font_extents (graphics->ct, &FontExtent); /* Get
the size we're looking for */
+
if ((LineHeight=FontExtent.ascent)<1) {
LineHeight=1;
}
@@ -2638,7 +2632,7 @@
}
/* Convert string from Gdiplus format to UTF8, suitable for cairo */
- String=g_utf16_to_utf8 ((const gunichar2 *)CleanString,
(glong)StringLen, NULL, NULL, NULL);
+ String=(unsigned char *) g_utf16_to_utf8 ((const gunichar2
*)CleanString, (glong)StringLen, NULL, NULL, NULL);
if (!String) {
free (CleanString);
free (StringDetails);
@@ -3004,7 +2998,7 @@
}
}
- cairo_font_set_transform(font->cairofnt, SavedMatrix); //
Restore matrix to original values
+ cairo_font_set_transform(font->cairofnt, SavedMatrix); /*
Restore matrix to original values */
cairo_matrix_destroy(SavedMatrix);
/* Cleanup */
@@ -3326,10 +3320,13 @@
GpStatus
GdipSetClipRect (GpGraphics *graphics, float x, float y, float width, float
height, CombineMode combineMode)
{
- GDIPCONST GpRectF rect = {x, y, width, height};
+ GpRectF rect;
if (!graphics)
return InvalidParameter;
+
+ rect.X = x; rect.Y = y;
+ rect.Width = width; rect.Height = height;
GdipSetEmpty (graphics->clip);
GdipCombineRegionRect (graphics->clip, &rect, combineMode);
@@ -3340,10 +3337,13 @@
GpStatus
GdipSetClipRectI (GpGraphics *graphics, UINT x, UINT y, UINT width, UINT
height, CombineMode combineMode)
{
- GDIPCONST GpRect rect = {x, y, width, height};
+ GpRect rect;
if (!graphics)
return InvalidParameter;
+
+ rect.X = x; rect.Y = y;
+ rect.Width = width; rect.Height = height;
GdipSetEmpty (graphics->clip);
GdipCombineRegionRectI (graphics->clip, &rect, combineMode);
@@ -3421,8 +3421,11 @@
GpStatus
GdipGetClipBoundsI (GpGraphics *graphics, GpRect *rect)
{
- GpRectF rectF = {rect->X, rect->Y, rect->Width, rect->Height};
+ GpRectF rectF;
Status status;
+
+ rectF.X = rect->X; rectF.Y = rect->Y;
+ rectF.Width = rect->Width; rectF.Height = rect->Height;
status = GdipGetRegionBounds (graphics->clip, graphics, &rectF);
Modified: trunk/libgdiplus/src/image.c
===================================================================
--- trunk/libgdiplus/src/image.c 2005-03-17 16:54:10 UTC (rev 41951)
+++ trunk/libgdiplus/src/image.c 2005-03-17 17:07:24 UTC (rev 41952)
@@ -460,7 +460,7 @@
GpImage *result = 0;
GpStatus status = 0;
ImageFormat format;
- unsigned char *file_name = NULL;
+ char *file_name = NULL;
char format_peek[10];
int format_peek_sz;
@@ -469,7 +469,7 @@
if (!image || !file)
return InvalidParameter;
- file_name = (unsigned char *) g_utf16_to_utf8 ((const gunichar2 *)file,
-1, NULL, NULL, &err);
+ file_name = (char *) g_utf16_to_utf8 ((const gunichar2 *)file, -1,
NULL, NULL, &err);
if (file_name == NULL || err != NULL) {
*image = NULL;
return InvalidParameter;
@@ -567,7 +567,7 @@
{
FILE *fp = 0;
GpStatus status = 0;
- unsigned char *file_name;
+ char *file_name;
GError *err = NULL;
ImageFormat format;
@@ -581,7 +581,7 @@
if (format == INVALID)
return UnknownImageFormat;
- file_name = (unsigned char *) g_utf16_to_utf8 ((const gunichar2 *)file,
-1, NULL, NULL, &err);
+ file_name = (char *) g_utf16_to_utf8 ((const gunichar2 *)file, -1,
NULL, NULL, &err);
if (file_name == NULL || err != NULL)
return InvalidParameter;
@@ -1282,11 +1282,11 @@
GpStatus status = 0;
ImageFormat format;
- char format_peek[10];
+ byte format_peek[10];
int format_peek_sz;
format_peek_sz = getHeaderFunc (format_peek, 10);
- format = get_image_format (format_peek, format_peek_sz);
+ format = get_image_format ((char *)format_peek, format_peek_sz);
switch (format) {
case JPEG:
Modified: trunk/libgdiplus/src/jpegcodec.c
===================================================================
--- trunk/libgdiplus/src/jpegcodec.c 2005-03-17 16:54:10 UTC (rev 41951)
+++ trunk/libgdiplus/src/jpegcodec.c 2005-03-17 17:07:24 UTC (rev 41952)
@@ -473,7 +473,7 @@
img->data.Scan0 = destbuf;
img->data.Reserved = GBD_OWN_SCAN0;
- img->image.surface = cairo_surface_create_for_image (destbuf,
img->cairo_format,
+ img->image.surface = cairo_surface_create_for_image ((char *)destbuf,
img->cairo_format,
img->image.width,
img->image.height,
stride);
Modified: trunk/libgdiplus/src/pngcodec.c
===================================================================
--- trunk/libgdiplus/src/pngcodec.c 2005-03-17 16:54:10 UTC (rev 41951)
+++ trunk/libgdiplus/src/pngcodec.c 2005-03-17 17:07:24 UTC (rev 41952)
@@ -229,7 +229,7 @@
img->data.Scan0 = rawdata;
img->data.Reserved = GBD_OWN_SCAN0;
- img->image.surface = cairo_surface_create_for_image (rawdata,
+ img->image.surface = cairo_surface_create_for_image ((char *)rawdata,
img->cairo_format,
img->image.width,
img->image.height,
Modified: trunk/libgdiplus/src/texturebrush.c
===================================================================
--- trunk/libgdiplus/src/texturebrush.c 2005-03-17 16:54:10 UTC (rev 41951)
+++ trunk/libgdiplus/src/texturebrush.c 2005-03-17 17:07:24 UTC (rev 41952)
@@ -583,7 +583,7 @@
else
return NotImplemented;
- imageSurface = cairo_surface_create_for_image (bitmap->data.Scan0,
+ imageSurface = cairo_surface_create_for_image ((char
*)bitmap->data.Scan0,
bitmap->cairo_format,
bitmap->data.Width,
bitmap->data.Height,
bitmap->data.Stride);
@@ -647,7 +647,7 @@
|| (bmpWidth < (x + width)) || (bmpHeight < (y + height)))
return OutOfMemory;
- original = cairo_surface_create_for_image (bitmap->data.Scan0,
+ original = cairo_surface_create_for_image ((char *)bitmap->data.Scan0,
bitmap->cairo_format, x + width, y + height,
bitmap->data.Stride);
g_return_val_if_fail (original != NULL, OutOfMemory);
Modified: trunk/libgdiplus/src/tiffcodec.c
===================================================================
--- trunk/libgdiplus/src/tiffcodec.c 2005-03-17 16:54:10 UTC (rev 41951)
+++ trunk/libgdiplus/src/tiffcodec.c 2005-03-17 17:07:24 UTC (rev 41952)
@@ -345,7 +345,7 @@
GdipFree (onerow);
- data.Scan0 = raster;
+ data.Scan0 = (byte *)raster;
img->image.frameDimensionList
[0].frames [j] = data;
} else {
goto error;
@@ -366,7 +366,7 @@
img->data = img->image.frameDimensionList [0].frames [0];
img->image.width = img->data.Width;
img->image.height = img->data.Height;
- img->image.surface = cairo_surface_create_for_image
(img->data.Scan0,
+ img->image.surface = cairo_surface_create_for_image ((char
*)img->data.Scan0,
img->cairo_format,
img->image.width,
img->image.height,
img->data.Stride);
img->image.horizontalResolution = 0;
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches