gdk-pixbuf: *no* save xpm patch



Hi,
here's the cleaned up version of my patch.
Can it be applied now ? May I commit it myself?

Thanks in advance,
	Hans
diff -u -r from-cvs/gtk+\gdk-pixbuf/gdk-pixbuf-io.c my-gtk/gtk+\gdk-pixbuf/gdk-pixbuf-io.c
--- from-cvs/gtk+\gdk-pixbuf/gdk-pixbuf-io.c	Sun Oct 22 20:14:16 2000
+++ my-gtk/gtk+\gdk-pixbuf/gdk-pixbuf-io.c	Tue Oct 31 23:02:58 2000
@@ -349,17 +349,18 @@
 #else

 #define mname(type,fn) gdk_pixbuf__ ## type ## _image_ ##fn
-#define m_load(type)  extern GdkPixbuf * mname(type,load) (FILE *f);
+#define m_load(type)  extern GdkPixbuf * mname(type,load) (FILE *f, GError **error);
 #define m_load_xpm_data(type)  extern GdkPixbuf * mname(type,load_xpm_data) (const char **data);
 #define m_begin_load(type)  \
    extern gpointer mname(type,begin_load) (ModulePreparedNotifyFunc prepare_func, \
 				 ModuleUpdatedNotifyFunc update_func, \
 				 ModuleFrameDoneNotifyFunc frame_done_func,\
 				 ModuleAnimationDoneNotifyFunc anim_done_func,\
-				 gpointer user_data);
+				 gpointer user_data,\
+				 GError **error);
 #define m_stop_load(type)  extern void mname(type,stop_load) (gpointer context);
-#define m_load_increment(type)  extern gboolean mname(type,load_increment) (gpointer context, const guchar *buf, guint size);
-#define m_load_animation(type)  extern GdkPixbufAnimation * mname(type,load_animation) (FILE *f);
+#define m_load_increment(type)  extern gboolean mname(type,load_increment) (gpointer context, const guchar *buf, guint size, GError **error);
+#define m_load_animation(type)  extern GdkPixbufAnimation * mname(type,load_animation) (FILE *f, GError **error);
 #define m_save(type) \
    extern gboolean mname(type,save) (FILE          *f, \
 				     GdkPixbuf     *pixbuf, \
@@ -857,7 +858,7 @@
         g_return_val_if_fail (filename != NULL, FALSE);
         g_return_val_if_fail (type != NULL, FALSE);

-        f = fopen (filename, "w");
+        f = fopen (filename, "wb");

         if (f == NULL) {
                 g_set_error (error,
diff -u -r from-cvs/gtk+\gdk-pixbuf/io-tiff.c my-gtk/gtk+\gdk-pixbuf/io-tiff.c
--- from-cvs/gtk+\gdk-pixbuf/io-tiff.c	Sat Oct 21 17:17:22 2000
+++ my-gtk/gtk+\gdk-pixbuf/io-tiff.c	Tue Oct 31 23:10:22 2000
@@ -35,10 +35,6 @@
 #include "gdk-pixbuf-private.h"
 #include "gdk-pixbuf-io.h"

-#ifdef G_OS_WIN32
-#include <fcntl.h>
-#define O_RDWR _O_RDWR
-#endif
 

 typedef struct _TiffData TiffData;
@@ -165,12 +161,7 @@
 		       tmp[strlen (tmp)] == G_DIR_SEPARATOR ? G_DIR_SEPARATOR_S : "",
 		       "gdkpixbuf-tif-tmp.XXXXXX",
 		       NULL);
-#ifdef HAVE_MKSTEMP
-	fd = mkstemp (context->tempname);
-#else
-	mktemp (context->tempname);
-	fd = open (context->tempname, O_RDWR);
-#endif
+	fd = g_mkstemp (context->tempname);
 	if (fd < 0) {
                 g_free (context->tempname);
 		g_free (context);
diff -u -r from-cvs/gtk+\gdk-pixbuf/io-xpm.c my-gtk/gtk+\gdk-pixbuf/io-xpm.c
--- from-cvs/gtk+\gdk-pixbuf/io-xpm.c	Sat Oct 21 17:17:22 2000
+++ my-gtk/gtk+\gdk-pixbuf/io-xpm.c	Tue Oct 31 23:07:56 2000
@@ -27,7 +27,9 @@
 #include <stdlib.h>
 #include <string.h>
 #include <glib.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 #include "gdk-pixbuf-private.h"
 #include "gdk-pixbuf-io.h"

@@ -1414,7 +1416,7 @@
        context->user_data = user_data;
        context->all_okay = TRUE;
        context->tempname = g_strdup ("/tmp/gdkpixbuf-xpm-tmp.XXXXXX");
-       fd = mkstemp (context->tempname);
+       fd = g_mkstemp (context->tempname);
        if (fd < 0) {
                g_free (context->tempname);
                g_free (context);
-------- Hans "at" Breuer "dot" Org -----------
Tell me what you need, and I'll tell you how to 
get along without it.                -- Dilbert


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]