gegl r3000 - in trunk: . gegl gegl/buffer gegl/operation tests/buffer tests/buffer/tests
- From: martinn svn gnome org
- To: svn-commits-list gnome org
- Subject: gegl r3000 - in trunk: . gegl gegl/buffer gegl/operation tests/buffer tests/buffer/tests
- Date: Tue, 31 Mar 2009 20:18:42 +0000 (UTC)
Author: martinn
Date: Tue Mar 31 20:18:41 2009
New Revision: 3000
URL: http://svn.gnome.org/viewvc/gegl?rev=3000&view=rev
Log:
Handle variadic macros in a portable way
Apply patch from Gary V. Vaughan that adds configure time checks for
variadic macros and adapts the definitions of such macros in-code
accordingly so that babl can be compiled on more platforms.
Also do some other changes in the way the variadic macros are invoked.
Modified:
trunk/ChangeLog
trunk/acinclude.m4
trunk/configure.ac
trunk/gegl/buffer/gegl-buffer-load.c
trunk/gegl/buffer/gegl-tile-backend-file.c
trunk/gegl/buffer/gegl-tile-handler-cache.c
trunk/gegl/gegl-debug.h
trunk/gegl/operation/gegl-operation-processors.c
trunk/tests/buffer/buffer-test.c
trunk/tests/buffer/tests/sub_rect_fills_and_gets.c
Modified: trunk/acinclude.m4
==============================================================================
--- trunk/acinclude.m4 (original)
+++ trunk/acinclude.m4 Tue Mar 31 20:18:41 2009
@@ -71,3 +71,64 @@
AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)
AM_CONDITIONAL(GTK_DOC_USE_LIBTOOL, test -n "$LIBTOOL")
])
+
+
+# GEGL_VARIADIC_MACROS
+# --------------------
+# check for flavours of variadic macros
+AC_DEFUN([GEGL_VARIADIC_MACROS],
+[AC_BEFORE([AC_PROG_CXX], [$0])
+AC_REQUIRE([AC_PROG_CPP])
+AC_CACHE_CHECK([for GNUC variadic macros],
+ [gegl_cv_prog_gnuc_variadic_macros],
+ [# gcc-2.95.x supports both gnu style and ISO varargs, but if -ansi
+ # is passed ISO vararg support is turned off, and there is no work
+ # around to turn it on, so we unconditionally turn it off.
+ { echo '#if __GNUC__ == 2 && __GNUC_MINOR__ == 95'
+ echo ' yes '
+ echo '#endif'; } > conftest.c
+ if ${CPP} conftest.c | grep yes > /dev/null; then
+ gegl_cv_prog_c_variadic_macros=no
+ gegl_cv_prog_cxx_variadic_macros=no
+ fi
+ AC_TRY_COMPILE([],[int a(int p1, int p2, int p3);
+#define call_a(params...) a(1,params)
+call_a(2,3);
+ ],
+ gegl_cv_prog_gnuc_variadic_macros=yes,
+ gegl_cv_prog_gnuc_variadic_macros=no)
+])
+if test x$gegl_cv_prog_gnuc_variadic_macros = xyes; then
+ AC_DEFINE(GEGL_GNUC_VARIADIC_MACROS, 1, [Define if the C pre-processor supports GNU style variadic macros])
+fi
+
+AC_CACHE_CHECK([for ISO C99 variadic macros in C],
+ [gegl_cv_prog_c_variadic_macros],
+ [AC_TRY_COMPILE([],[int a(int p1, int p2, int p3);
+#define call_a(...) a(1,__VA_ARGS__)
+call_a(2,3);
+ ],
+ gegl_cv_prog_c_variadic_macros=yes,
+ gegl_cv_prog_c_variadic_macros=no)
+])
+if test x$gegl_cv_prog_c_variadic_macros = xyes ; then
+ AC_DEFINE(GEGL_ISO_VARIADIC_MACROS, 1, [Define if the C pre-processor supports variadic macros])
+fi
+
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [AC_CACHE_CHECK([for ISO C99 variadic macros in C++],
+ [gegl_cv_prog_cxx_variadic_macros],
+ [AC_LANG_PUSH(C++)
+ AC_TRY_COMPILE([],[int a(int p1, int p2, int p3);
+#define call_a(...) a(1,__VA_ARGS__)
+call_a(2,3);
+ ],
+ gegl_cv_prog_cxx_variadic_macros=yes,
+ gegl_cv_prog_cxx_variadic_macros=no)
+ AC_LANG_POP])],
+ [# No C++ compiler+ gegl_cv_prog_cxx_variadic_macros=no])
+if test x$gegl_cv_prog_cxx_variadic_macros = xyes ; then
+ AC_DEFINE(GEGL_ISO_CXX_VARIADIC_MACROS, 1, [Define if the C++ pre-processor supports variadic macros])
+fi
+])
+
Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Tue Mar 31 20:18:41 2009
@@ -151,6 +151,7 @@
dnl Large file support.
AC_SYS_LARGEFILE
+GEGL_VARIADIC_MACROS
AC_MSG_CHECKING([whether to turn on debugging])
AC_ARG_ENABLE(debug,
Modified: trunk/gegl/buffer/gegl-buffer-load.c
==============================================================================
--- trunk/gegl/buffer/gegl-buffer-load.c (original)
+++ trunk/gegl/buffer/gegl-buffer-load.c Tue Mar 31 20:18:41 2009
@@ -73,7 +73,7 @@
static void seekto(LoadInfo *info, gint offset)
{
info->offset = offset;
- GEGL_NOTE (BUFFER_LOAD, "seek to %i", offset);
+ GEGL_NOTE (GEGL_DEBUG_BUFFER_LOAD, "seek to %i", offset);
#if HAVE_GIO
if(!g_seekable_seek (G_SEEKABLE (info->i), info->offset, G_SEEK_SET, NULL, NULL))
#else
@@ -150,7 +150,7 @@
}
#endif
- GEGL_NOTE (BUFFER_LOAD, "read header: tile-width: %i tile-height: %i next:%i %ix%i\n",
+ GEGL_NOTE (GEGL_DEBUG_BUFFER_LOAD, "read header: tile-width: %i tile-height: %i next:%i %ix%i\n",
ret->header.tile_width,
ret->header.tile_height,
(guint)ret->block.next,
@@ -206,7 +206,7 @@
byte_read += sz_read;
}
#endif
- GEGL_NOTE (BUFFER_LOAD, "read block: length:%i next:%i",
+ GEGL_NOTE (GEGL_DEBUG_BUFFER_LOAD, "read block: length:%i next:%i",
block.length, (guint)block.next);
switch (block.flags)
@@ -222,7 +222,7 @@
if (block.length != own_size)
{
- GEGL_NOTE(BUFFER_LOAD, "read block of size %i which is different from expected %i only using available expected",
+ GEGL_NOTE(GEGL_DEBUG_BUFFER_LOAD, "read block of size %i which is different from expected %i only using available expected",
block.length, own_size);
}
@@ -293,7 +293,7 @@
for (item = read_block (i, offset); item; item = read_block (i, offset))
{
g_assert (item);
- GEGL_NOTE (BUFFER_LOAD,"loaded item: %i, %i, %i offset:%i next:%i", item->tile.x,
+ GEGL_NOTE (GEGL_DEBUG_BUFFER_LOAD,"loaded item: %i, %i, %i offset:%i next:%i", item->tile.x,
item->tile.y,
item->tile.z,
(guint)item->tile.offset,
@@ -332,14 +332,14 @@
#else
info->i = open (info->path, O_RDONLY);
#endif
- GEGL_NOTE (BUFFER_LOAD, "starting to load buffer %s", path);
+ GEGL_NOTE (GEGL_DEBUG_BUFFER_LOAD, "starting to load buffer %s", path);
#if HAVE_GIO
if (!info->i)
#else
if (info->i == -1)
#endif
{
- GEGL_NOTE (BUFFER_LOAD, "failed top open %s for reading", path);
+ GEGL_NOTE (GEGL_DEBUG_BUFFER_LOAD, "failed top open %s for reading", path);
#if HAVE_GIO
g_object_unref (info->file);
#endif
@@ -422,9 +422,9 @@
g_object_unref (G_OBJECT (tile));
i++;
}
- GEGL_NOTE (BUFFER_LOAD, "%i tiles loaded",i);
+ GEGL_NOTE (GEGL_DEBUG_BUFFER_LOAD, "%i tiles loaded",i);
}
- GEGL_NOTE (BUFFER_LOAD, "buffer loaded %s", info->path);
+ GEGL_NOTE (GEGL_DEBUG_BUFFER_LOAD, "buffer loaded %s", info->path);
load_info_destroy (info);
return ret;
Modified: trunk/gegl/buffer/gegl-tile-backend-file.c
==============================================================================
--- trunk/gegl/buffer/gegl-tile-backend-file.c (original)
+++ trunk/gegl/buffer/gegl-tile-backend-file.c Tue Mar 31 20:18:41 2009
@@ -171,7 +171,7 @@
}
- GEGL_NOTE (TILE_BACKEND, "read entry %i,%i,%i at %i", entry->x, entry->y, entry->z, (gint)offset);
+ GEGL_NOTE (GEGL_DEBUG_TILE_BACKEND, "read entry %i,%i,%i at %i", entry->x, entry->y, entry->z, (gint)offset);
}
static void inline
@@ -221,7 +221,7 @@
}
to_be_written -= wrote;
}
- GEGL_NOTE (TILE_BACKEND, "wrote entry %i,%i,%i at %i", entry->x, entry->y, entry->z, (gint)offset);
+ GEGL_NOTE (GEGL_DEBUG_TILE_BACKEND, "wrote entry %i,%i,%i at %i", entry->x, entry->y, entry->z, (gint)offset);
}
static inline GeglBufferTile *
@@ -229,7 +229,7 @@
{
GeglBufferTile *entry = gegl_tile_entry_new (0,0,0);
- GEGL_NOTE (TILE_BACKEND, "Creating new entry");
+ GEGL_NOTE (GEGL_DEBUG_TILE_BACKEND, "Creating new entry");
gegl_tile_backend_file_ensure_exist (self);
@@ -240,21 +240,21 @@
entry->offset = offset;
self->free_list = g_slist_remove (self->free_list, self->free_list->data);
- GEGL_NOTE (TILE_BACKEND, " set offset %i from free list", ((gint)entry->offset));
+ GEGL_NOTE (GEGL_DEBUG_TILE_BACKEND, " set offset %i from free list", ((gint)entry->offset));
}
else
{
gint tile_size = GEGL_TILE_BACKEND (self)->tile_size;
entry->offset = self->next_pre_alloc;
- GEGL_NOTE (TILE_BACKEND, " set offset %i (next allocation)", (gint)entry->offset);
+ GEGL_NOTE (GEGL_DEBUG_TILE_BACKEND, " set offset %i (next allocation)", (gint)entry->offset);
self->next_pre_alloc += tile_size;
if (self->next_pre_alloc >= self->total)
{
self->total = self->total + 32 * tile_size;
- GEGL_NOTE (TILE_BACKEND, "growing file to %i bytes", (gint)self->total);
+ GEGL_NOTE (GEGL_DEBUG_TILE_BACKEND, "growing file to %i bytes", (gint)self->total);
#if HAVE_GIO
g_assert (g_seekable_truncate (G_SEEKABLE (self->o),
@@ -305,7 +305,7 @@
#else
write (self->o, &(self->header), 256);
#endif
- GEGL_NOTE (TILE_BACKEND, "Wrote header, next=%i", (gint)self->header.next);
+ GEGL_NOTE (GEGL_DEBUG_TILE_BACKEND, "Wrote header, next=%i", (gint)self->header.next);
return TRUE;
}
@@ -335,7 +335,7 @@
#endif
goto fail;
- GEGL_NOTE (TILE_BACKEND, "Wrote block: length:%i flags:%i next:%i at offset %i",
+ GEGL_NOTE (GEGL_DEBUG_TILE_BACKEND, "Wrote block: length:%i flags:%i next:%i at offset %i",
self->in_holding->length,
self->in_holding->flags,
(gint)self->in_holding->next,
@@ -554,7 +554,7 @@
gegl_tile_backend_file_ensure_exist (self);
- GEGL_NOTE (TILE_BACKEND, "flushing %s", self->path);
+ GEGL_NOTE (GEGL_DEBUG_TILE_BACKEND, "flushing %s", self->path);
self->header.rev ++;
@@ -585,7 +585,7 @@
fsync (self->o);
#endif
- GEGL_NOTE (TILE_BACKEND, "flushed %s", self->path);
+ GEGL_NOTE (GEGL_DEBUG_TILE_BACKEND, "flushed %s", self->path);
return (gpointer)0xf0f;
}
@@ -684,7 +684,7 @@
if (self->exist)
{
- GEGL_NOTE (TILE_BACKEND, "finalizing buffer %s", self->path);
+ GEGL_NOTE (GEGL_DEBUG_TILE_BACKEND, "finalizing buffer %s", self->path);
#if HAVE_GIO
if (self->i)
@@ -788,13 +788,13 @@
if (new_header.rev == self->header.rev)
{
- GEGL_NOTE(TILE_BACKEND, "header not changed: %s", self->path);
+ GEGL_NOTE(GEGL_DEBUG_TILE_BACKEND, "header not changed: %s", self->path);
return;
}
else
{
self->header=new_header;
- GEGL_NOTE(TILE_BACKEND, "loading index: %s", self->path);
+ GEGL_NOTE(GEGL_DEBUG_TILE_BACKEND, "loading index: %s", self->path);
}
@@ -878,7 +878,7 @@
self = GEGL_TILE_BACKEND_FILE (object);
backend = GEGL_TILE_BACKEND (object);
- GEGL_NOTE (TILE_BACKEND, "constructing file backend: %s", self->path);
+ GEGL_NOTE (GEGL_DEBUG_TILE_BACKEND, "constructing file backend: %s", self->path);
#if HAVE_GIO
self->file = g_file_new_for_commandline_arg (self->path);
#else
@@ -971,7 +971,7 @@
self->exist = TRUE;
backend = GEGL_TILE_BACKEND (self);
- GEGL_NOTE (TILE_BACKEND, "creating swapfile %s", self->path);
+ GEGL_NOTE (GEGL_DEBUG_TILE_BACKEND, "creating swapfile %s", self->path);
#ifdef HACKED_GIO_WITH_READWRITE
self->o = G_OUTPUT_STREAM (g_file_append_to (self->file,
Modified: trunk/gegl/buffer/gegl-tile-handler-cache.c
==============================================================================
--- trunk/gegl/buffer/gegl-tile-handler-cache.c (original)
+++ trunk/gegl/buffer/gegl-tile-handler-cache.c Tue Mar 31 20:18:41 2009
@@ -441,8 +441,8 @@
while (cache_total > gegl_config()->cache_size)
{
- /*GEGL_NOTE(CACHE, "cache_total:%i > cache_size:%i", cache_total, gegl_config()->cache_size);
- GEGL_NOTE(CACHE, "%f%% hit:%i miss:%i %i]", cache_hits*100.0/(cache_hits+cache_misses), cache_hits, cache_misses, g_queue_get_length (cache_queue));*/
+ /*GEGL_NOTE(GEGL_DEBUG_CACHE, "cache_total:%i > cache_size:%i", cache_total, gegl_config()->cache_size);
+ GEGL_NOTE(GEGL_DEBUG_CACHE, "%f%% hit:%i miss:%i %i]", cache_hits*100.0/(cache_hits+cache_misses), cache_hits, cache_misses, g_queue_get_length (cache_queue));*/
gegl_tile_handler_cache_trim (cache);
}
}
Modified: trunk/gegl/gegl-debug.h
==============================================================================
--- trunk/gegl/gegl-debug.h (original)
+++ trunk/gegl/gegl-debug.h Tue Mar 31 20:18:41 2009
@@ -12,7 +12,8 @@
GEGL_DEBUG_BUFFER_SAVE = 1 << 2,
GEGL_DEBUG_TILE_BACKEND = 1 << 3,
GEGL_DEBUG_PROCESSOR = 1 << 4,
- GEGL_DEBUG_CACHE = 1 << 5
+ GEGL_DEBUG_CACHE = 1 << 5,
+ GEGL_DEBUG_MISC = 1 << 6
} GeglDebugFlag;
/* only compiled in from gegl-init.c but kept here to
@@ -36,26 +37,20 @@
};
#endif /* GEGL_ENABLE_DEBUG */
+#if defined(__cplusplus) && defined(GEGL_ISO_CXX_VARIADIC_MACROS)
+# define GEGL_ISO_VARIADIC_MACROS 1
+#endif
+
#ifdef GEGL_ENABLE_DEBUG
-#ifdef __GNUC_
-#define GEGL_NOTE(type,x,a...) G_STMT_START { \
- if (gegl_debug_flags & GEGL_DEBUG_##type) \
- { g_message ("[" #type "] " G_STRLOC ": " x, ##a); } \
- } G_STMT_END
+#if defined(GEGL_ISO_VARIADIC_MACROS)
-#define GEGL_TIMESTAMP(type,x,a...) G_STMT_START { \
- if (gegl_debug_flags & GEGL_DEBUG_##type) \
- { g_message ("[" #type "]" " %li:" G_STRLOC ": " \
- x, gegl_get_timestamp(), ##a); } \
- } G_STMT_END
-#else
-/* Try the C99 version; unfortunately, this does not allow us to pass
+/* Use the C99 version; unfortunately, this does not allow us to pass
* empty arguments to the macro, which means we have to
* do an intemediate printf.
*/
#define GEGL_NOTE(type,...) G_STMT_START { \
- if (gegl_debug_flags & GEGL_DEBUG_##type) \
+ if (gegl_debug_flags & type) \
{ \
gchar * _fmt = g_strdup_printf (__VA_ARGS__); \
g_message ("[" #type "] " G_STRLOC ": %s",_fmt); \
@@ -64,7 +59,7 @@
} G_STMT_END
#define GEGL_TIMESTAMP(type,...) G_STMT_START { \
- if (gegl_debug_flags & GEGL_DEBUG_##type) \
+ if (gegl_debug_flags & type) \
{ \
gchar * _fmt = g_strdup_printf (__VA_ARGS__); \
g_message ("[" #type "]" " %li:" G_STRLOC ": %s", \
@@ -72,17 +67,120 @@
g_free (_fmt); \
} \
} G_STMT_END
+
+#elif defined(GEGL_GNUC_VARIADIC_MACROS)
+
+#define GEGL_NOTE(type,format,a...) G_STMT_START { \
+ if (gegl_debug_flags & type) \
+ { g_message ("[" #type "] " G_STRLOC ": " \
+ format, ##a); } \
+ } G_STMT_END
+
+#define GEGL_TIMESTAMP(type,format,a...) G_STMT_START { \
+ if (gegl_debug_flags & type) \
+ { g_message ("[" #type "]" " %li:" G_STRLOC ": " \
+ format, gegl_get_timestamp(), ##a); } \
+ } G_STMT_END
+
+#else
+
+#include <stdarg.h>
+
+static const gchar *
+gegl_lookup_debug_string (guint type)
+{
+ const gchar *key = "!INVALID!";
+ guint i = 0;
+
+ if (type == GEGL_DEBUG_MISC)
+ {
+ key = "misc";
+ }
+ else
+ {
+ while (g_strcmp0 (gegl_debug_keys[i].key, "all") != 0)
+ {
+ if (gegl_debug_keys[i].value == type)
+ {
+ key = gegl_debug_keys[i].key;
+ break;
+ }
+ }
+ }
+
+ return key;
+}
+
+static inline void
+GEGL_NOTE (guint type, const char *format, ...)
+{
+ va_alist args;
+
+ if (gegl_debug_flags & type)
+ {
+ gchar *formatted;
+ va_start (args, format);
+ formatted = g_strdup_printf (format, args);
+ g_message ("[ %s ] " G_STRLOC ": %s",
+ gegl_lookup_debug_string (type), formatted);
+ g_free (formatted);
+ va_end (args);
+ }
+}
+
+static inline void
+GEGL_TIMESTAMP (guint type, const char *format, ...)
+{
+ va_alist args;
+
+ if (gegl_debug_flags & type)
+ {
+ gchar *formatted;
+ va_start (args, format);
+ formatted = g_strdup_printf (format, args);
+ g_message ("[ %s ] %li: " G_STRLOC ": %s",
+ gegl_lookup_debug_string (type), gegl_get_timestamp(),
+ formatted);
+ g_free (formatted);
+ va_end (args);
+ }
+}
+
#endif
-#define GEGL_MARK() GEGL_NOTE(MISC, "== mark ==")
+#define GEGL_MARK() GEGL_NOTE(GEGL_DEBUG_MISC, "== mark ==")
#define GEGL_DBG(x) { a }
#else /* !GEGL_ENABLE_DEBUG */
+#if defined(GEGL_ISO_VARIADIC_MACROS)
+
#define GEGL_NOTE(type,...)
+#define GEGL_TIMESTAMP(type,...)
+
+#elif defined(GEGL_GNUC_VARIADIC_MACROS)
+
+#define GEGL_NOTE(type,format,a...)
+#define GEGL_TIMESTAMP(type,format,a...)
+
+#else
+
+static inline void
+GEGL_NOTE (guint type, const char *format, ...)
+{
+ return;
+}
+
+static inline void
+GEGL_TIMESTAMP (guint type, const char *format, ...)
+{
+ return;
+}
+
+#endif
+
#define GEGL_MARK()
#define GEGL_DBG(x)
-#define GEGL_TIMESTAMP(type,...)
#endif /* GEGL_ENABLE_DEBUG */
Modified: trunk/gegl/operation/gegl-operation-processors.c
==============================================================================
--- trunk/gegl/operation/gegl-operation-processors.c (original)
+++ trunk/gegl/operation/gegl-operation-processors.c Tue Mar 31 20:18:41 2009
@@ -134,7 +134,7 @@
if (gegl_config()->quality <= 0.75 && good) choice = good;
if (gegl_config()->quality <= 0.25 && fast) choice = fast;
- GEGL_NOTE(PROCESSOR, "Using %s implementation for %s", data->string[choice], g_type_name (G_OBJECT_TYPE(object)));
+ GEGL_NOTE(GEGL_DEBUG_PROCESSOR, "Using %s implementation for %s", data->string[choice], g_type_name (G_OBJECT_TYPE(object)));
data->cached = choice;
data->cached_quality = gegl_config()->quality;
Modified: trunk/tests/buffer/buffer-test.c
==============================================================================
--- trunk/tests/buffer/buffer-test.c (original)
+++ trunk/tests/buffer/buffer-test.c Tue Mar 31 20:18:41 2009
@@ -25,8 +25,11 @@
*/
#define test_start() GString *gstring=g_string_new("");\
- print ("Test: %s\n", __FUNCTION__)
-#define print(arg...) g_string_append_printf (gstring, arg)
+ print (("Test: %s\n", __FUNCTION__))
+#define print(args) G_STMT_START { \
+ gchar *_fmt = g_strdup_printf args; \
+ g_string_append (gstring, _fmt); \
+ } G_STMT_END
#define print_buffer(buffer) print_buffer_internal (gstring, buffer)
#define print_linear_buffer_u8(w,h,b) print_linear_buffer_internal_u8 (gstring,w,h,b)
#define print_linear_buffer_float(w,h,b) print_linear_buffer_internal_float (gstring,w,h,b)
@@ -81,13 +84,13 @@
{
gchar *scale[]={" ", "â", "â", "â", "â", "â"};
gint x,y;
- print ("â");
+ print (("â"));
for (x=0;x<width;x++)
- print ("â");
- print ("â\n");
+ print (("â"));
+ print (("â\n"));
for (y=0;y<height;y++)
{
- print ("â");
+ print (("â"));
for (x=0;x<width;x++)
{
gint val = floor ( buf[y*width+x] * 4 + 0.5);
@@ -95,14 +98,14 @@
val=4;
if (val<0)
val=0;
- print ("%s", scale[val]);
+ print (("%s", scale[val]));
}
- print ("â\n");
+ print (("â\n"));
}
- print ("â");
+ print (("â"));
for (x=0;x<width;x++)
- print ("â");
- print ("â\n");
+ print (("â"));
+ print (("â\n"));
}
static void
@@ -113,21 +116,21 @@
{
gchar *scale[]={" ", "â", "â", "â", "â"};
gint x,y;
- print ("â");
+ print (("â"));
for (x=0;x<width;x++)
- print ("â");
- print ("â\n");
+ print (("â"));
+ print (("â\n"));
for (y=0;y<height;y++)
{
- print ("â");
+ print (("â"));
for (x=0;x<width;x++)
- print ("%s", scale[ (gint)floor ( buf[y*width+x]/256.0 * 4 + 0.5)]);
- print ("â\n");
+ print (("%s", scale[ (gint)floor ( buf[y*width+x]/256.0 * 4 + 0.5)]));
+ print (("â\n"));
}
- print ("â");
+ print (("â"));
for (x=0;x<width;x++)
- print ("â");
- print ("â\n");
+ print (("â"));
+ print (("â\n"));
}
Modified: trunk/tests/buffer/tests/sub_rect_fills_and_gets.c
==============================================================================
--- trunk/tests/buffer/tests/sub_rect_fills_and_gets.c (original)
+++ trunk/tests/buffer/tests/sub_rect_fills_and_gets.c Tue Mar 31 20:18:41 2009
@@ -12,17 +12,17 @@
sub3 = gegl_buffer_create_sub_buffer (buffer, &subrect3);
fill (sub1, 0.5);
- print ("root with sub1 filled in:\n");
+ print (("root with sub1 filled in:\n"));
print_buffer (buffer);
- print ("sub2 before fill:\n");
+ print (("sub2 before fill:\n"));
print_buffer (sub2);
fill (sub2, 1.0);
- print ("final root:\n");
+ print (("final root:\n"));
print_buffer (buffer);
- print ("final sub1:\n");
+ print (("final sub1:\n"));
print_buffer (sub1);
- print ("final sub3:\n");
+ print (("final sub3:\n"));
print_buffer (sub3);
gegl_buffer_destroy (sub1);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]