"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "gegl/buffer/gegl-tile-backend-file-async.c" between
gegl-0.4.18.tar.xz and gegl-0.4.20.tar.xz

About: GEGL (Generic Graphics Library) is a graph based image processing framework (mainly developed for GIMP).

gegl-tile-backend-file-async.c  (gegl-0.4.18.tar.xz):gegl-tile-backend-file-async.c  (gegl-0.4.20.tar.xz)
skipping to change at line 65 skipping to change at line 65
#include "gegl-buffer-config.h" #include "gegl-buffer-config.h"
#ifndef HAVE_FSYNC #ifndef HAVE_FSYNC
#ifdef G_OS_WIN32 #ifdef G_OS_WIN32
#define fsync _commit #define fsync _commit
#endif #endif
#endif #endif
#ifdef G_OS_WIN32
#define BINARY_FLAG O_BINARY
#else
#define BINARY_FLAG 0
#endif
struct _GeglTileBackendFile struct _GeglTileBackendFile
{ {
GeglTileBackend parent_instance; GeglTileBackend parent_instance;
/* the path to our buffer */ /* the path to our buffer */
gchar *path; gchar *path;
/* the file exist (and we've thus been able to initialize i and o, /* the file exist (and we've thus been able to initialize i and o,
* the utility call ensure_exist() should be called before any code * the utility call ensure_exist() should be called before any code
* using i and o) * using i and o)
skipping to change at line 1165 skipping to change at line 1171
/* Install a monitor for changes to the file in case other applications /* Install a monitor for changes to the file in case other applications
* might be writing to the buffer * might be writing to the buffer
*/ */
self->monitor = g_file_monitor_file (self->file, G_FILE_MONITOR_NONE, self->monitor = g_file_monitor_file (self->file, G_FILE_MONITOR_NONE,
NULL, NULL); NULL, NULL);
g_signal_connect (self->monitor, "changed", g_signal_connect (self->monitor, "changed",
G_CALLBACK (gegl_tile_backend_file_file_changed), G_CALLBACK (gegl_tile_backend_file_file_changed),
self); self);
self->o = g_open (self->path, O_RDWR|O_CREAT, 0770); self->o = g_open (self->path, O_RDWR|O_CREAT|BINARY_FLAG, 0770);
if (self->o == -1) if (self->o == -1)
{ {
/* Try again but this time with only read access. This is /* Try again but this time with only read access. This is
* a quick-fix for make distcheck, where img_cmp fails * a quick-fix for make distcheck, where img_cmp fails
* when it opens a GeglBuffer file in the source tree * when it opens a GeglBuffer file in the source tree
* (which is read-only). * (which is read-only).
*/ */
self->o = g_open (self->path, O_RDONLY, 0770); self->o = g_open (self->path, O_RDONLY|BINARY_FLAG, 0770);
if (self->o == -1) if (self->o == -1)
g_warning ("%s: Could not open '%s': %s", G_STRFUNC, self->path, g_s trerror (errno)); g_warning ("%s: Could not open '%s': %s", G_STRFUNC, self->path, g_s trerror (errno));
} }
self->i = g_open (self->path, O_RDONLY, 0); self->i = g_open (self->path, O_RDONLY|BINARY_FLAG, 0);
self->header = gegl_buffer_read_header (self->i, &offset)->header; self->header = gegl_buffer_read_header (self->i, &offset)->header;
self->header.rev = self->header.rev -1; self->header.rev = self->header.rev -1;
/* we are overriding all of the work of the actual constructor here, /* we are overriding all of the work of the actual constructor here,
* a really evil hack :d * a really evil hack :d
*/ */
backend->priv->tile_width = self->header.tile_width; backend->priv->tile_width = self->header.tile_width;
backend->priv->tile_height = self->header.tile_height; backend->priv->tile_height = self->header.tile_height;
backend->priv->format = babl_format (self->header.description); backend->priv->format = babl_format (self->header.description);
skipping to change at line 1231 skipping to change at line 1237
{ {
if (!self->exist) if (!self->exist)
{ {
GeglTileBackend *backend; GeglTileBackend *backend;
self->exist = TRUE; self->exist = TRUE;
backend = GEGL_TILE_BACKEND (self); backend = GEGL_TILE_BACKEND (self);
GEGL_NOTE (GEGL_DEBUG_TILE_BACKEND, "creating swapfile %s", self->path); GEGL_NOTE (GEGL_DEBUG_TILE_BACKEND, "creating swapfile %s", self->path);
self->o = g_open (self->path, O_RDWR|O_CREAT, 0770); self->o = g_open (self->path, O_RDWR|O_CREAT|BINARY_FLAG, 0770);
if (self->o == -1) if (self->o == -1)
g_warning ("%s: Could not open '%s': %s", G_STRFUNC, self->path, g_strer ror (errno)); g_warning ("%s: Could not open '%s': %s", G_STRFUNC, self->path, g_strer ror (errno));
self->next_pre_alloc = 256; /* reserved space for header */ self->next_pre_alloc = 256; /* reserved space for header */
self->total = 256; /* reserved space for header */ self->total = 256; /* reserved space for header */
self->in_offset = self->out_offset = 0; self->in_offset = self->out_offset = 0;
self->pending_ops = 0; self->pending_ops = 0;
gegl_buffer_header_init (&self->header, gegl_buffer_header_init (&self->header,
backend->priv->tile_width, backend->priv->tile_width,
backend->priv->tile_height, backend->priv->tile_height,
backend->priv->px_size, backend->priv->px_size,
backend->priv->format); backend->priv->format);
gegl_tile_backend_file_write_header (self); gegl_tile_backend_file_write_header (self);
self->i = g_open (self->path, O_RDONLY, 0); self->i = g_open (self->path, O_RDONLY|BINARY_FLAG, 0);
g_assert (self->i != -1); g_assert (self->i != -1);
g_assert (self->o != -1); g_assert (self->o != -1);
} }
} }
static void static void
gegl_tile_backend_file_class_init (GeglTileBackendFileClass *klass) gegl_tile_backend_file_class_init (GeglTileBackendFileClass *klass)
{ {
GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
 End of changes. 6 change blocks. 
5 lines changed or deleted 11 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)