diff --git a/ChangeLog b/ChangeLog index 7b1bd930b2dd1e019f30e23ce17d2043a42cba13..f949561fc1b070eb7a6438beffd38ed566c56317 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,112 @@ +2001-12-02 Daniel Egger + + * app/gimprc.c: Convert ugly comments into named structure fields. + Much cleaner and less errorprone though may cause troubles on + older compilers and then needs to be reverted. Please report! + + * app/base/base-types.h: Add FIXME reminder. + + * app/base/gimplut.c: Use CLAMP macro instead of if-cascade. + + * app/base/temp-buf.c: Remove duplicated calculations and simplify + checks. + + * app/base/tile-manager.c: + - (tile_manager_get_tile_num): Return success and take an additional + pointer for the tilenumber. + - Simplify logic in the rest of the file as a result. + - Remove rotten debugging cruft. + + * app/core/gimpbrushgenerated.c: Fix two stylistic nits. + + * app/app_procs.c: Include for exit () prototype. + + * app/core/gimpdrawable-blend.c: Include for abs () + prototype. + + * app/display/gimpdisplay.c: Include for memcpy () + prototype. + + * app/core/gimpimage-convert.c: (HIST_RGB): First parameter is + not const. Fixes a gcc warning for a wrong return value. + + * libgimpwidgets/gimpunitmenu.c + * app/core/gimpunit.c: Add suggested (by gcc 3.1 cvs) parentheses + to group correct logic tests together. + + * app/paint-funcs/paint-funcs-generic.h: Fix my HAS_ALPHA macro + to avoid gcc 3.1 cvs warning. + + * app/gimprc.h + * pathP.h + * base-config.h + * app/base/boundary.h + * app/base/gimplut.[ch] + * app/base/pixel-region.h + * app/base/pixel-surround.[ch] + * app/base/temp-buf.[ch] + * app/base/tile-manager-private.h + * app/base/tile-manager.c + * app/base/tile-private.h + * app/base/tile.[ch] + * app/core/gimp.h + * app/core/gimpbrushgenerated.h + * app/core/gimpbrushpipe.h + * app/core/gimpchannel.[ch] + * app/core/gimpcontainer.h + * app/core/gimpcoreconfig.h + * app/core/gimpdata.h + * app/core/gimpdatafactory.[ch] + * app/core/gimpdrawable-blend.c + * app/core/gimpdrawable.[ch] + * app/core/gimpimage.h + * app/core/gimpimagefile.h + * app/core/gimplayer.h + * app/core/gimplayermask.h + * app/core/gimpmoduleinfo.h + * app/core/gimppalette.h + * app/core/gimpundo.h + * app/display/gimpdisplay.h + * app/display/gimpdisplayshell-selection.h + * app/display/gimpdisplayshell.h + * app/gui/brush-select.h + * app/gui/gradient-editor.h + * app/gui/gradient-select.h + * app/gui/info-dialog.h + * app/gui/resize-dialog.h + * app/tools/gimpbezierselecttool.h + * app/tools/gimpcolorbalancetool.h + * app/tools/gimpcolorpickertool.h + * app/tools/gimpcurvestool.h + * app/tools/gimpdodgeburntool.c + * app/tools/gimpfreeselecttool.h + * app/tools/gimpfuzzyselecttool.h + * app/tools/gimphuesaturationtool.h + * app/tools/gimpinktool-blob.h + * app/tools/gimpinktool.h + * app/tools/gimpiscissorstool.h + * app/tools/gimpmagnifytool.h + * app/tools/gimpmeasuretool.h + * app/tools/gimppainttool.h + * app/tools/gimppathtool.h + * app/tools/gimprectselecttool.h + * app/tools/gimpthresholdtool.h + * app/tools/gimptool.h + * app/tools/gimptransformtool.h + * app/tools/path_toolP.h + * app/widgets/gimpbrushfactoryview.h + * app/widgets/gimpconstrainedhwrapbox.h + * app/widgets/gimpcontainermenu.h + * app/widgets/gimpcontainerview.h + * app/widgets/gimpdialogfactory.h + * app/widgets/gimpimagedock.h + * app/widgets/gimplistitem.h + * app/widgets/gimpmenuitem.h + * app/widgets/gimpnavigationpreview.h + * app/widgets/gimppreview.h: Unsignify lots of variables and + parameters and use bitfields in structs where possible. First + part of a huge cleanup all over the code... + 2001-12-01 Michael Natterer * app/errors.c: forgot a "return". diff --git a/app/app_procs.c b/app/app_procs.c index 5340ec2b241c60e1b15e62f31ef7e8c49584ef03..65baf42cd5dc6a06396d60d72e3e238da3db9e0c 100644 --- a/app/app_procs.c +++ b/app/app_procs.c @@ -20,6 +20,7 @@ #include #include +#include #ifdef HAVE_SYS_PARAM_H #include #endif diff --git a/app/base/base-config.h b/app/base/base-config.h index 8436aac796eb3bb8eaebd4301636e95247dca3ab..dd003385193588f84e190e31f55be67b2404bf3d 100644 --- a/app/base/base-config.h +++ b/app/base/base-config.h @@ -29,7 +29,7 @@ struct _GimpBaseConfig guint tile_cache_size; gboolean stingy_memory_use; InterpolationType interpolation_type; - gint num_processors; + guint num_processors; }; diff --git a/app/base/base-types.h b/app/base/base-types.h index 7ac46430fbbbb2873f45600fb37266dae29db259..d46700e7adddb721be62d8a95f930254b7155bbd 100644 --- a/app/base/base-types.h +++ b/app/base/base-types.h @@ -24,7 +24,7 @@ /* magic constants */ - +/* FIXME: Remove magic constants! */ #define MAX_CHANNELS 4 #define GRAY_PIX 0 diff --git a/app/base/boundary.h b/app/base/boundary.h index 5767b092b07527703c09c606d51f8b6e264cb4fc..1a69f850c9da7a36e2792314c74d34c53b851c38 100644 --- a/app/base/boundary.h +++ b/app/base/boundary.h @@ -33,8 +33,8 @@ struct _BoundSeg gint y1; gint x2; gint y2; - gboolean open; - gboolean visited; + guint open : 1; + guint visited : 1; }; diff --git a/app/base/color-balance.h b/app/base/color-balance.h index bb1a6dc2d6aa7566499f95671da2c782e3c8aef6..f75d3819b603bb8af57454499072486f189083e5 100644 --- a/app/base/color-balance.h +++ b/app/base/color-balance.h @@ -67,8 +67,8 @@ struct _ColorBalanceDialog guchar g_lookup[256]; guchar b_lookup[256]; - gboolean preserve_luminosity; - gboolean preview; + guint preserve_luminosity : 1; + guint preview : 1; GimpTransferMode application_mode; }; diff --git a/app/base/curves.h b/app/base/curves.h index 2a8d6f42a820255d320400198ffd5ed000eea870..869aa1fc6e845a9d17f09838af5a3d8787a2c626 100644 --- a/app/base/curves.h +++ b/app/base/curves.h @@ -70,7 +70,7 @@ struct _CurvesDialog gint color; gint channel; - gboolean preview; + guint preview : 1; gint grab_point; gint last; diff --git a/app/base/gimplut.c b/app/base/gimplut.c index 3e5442abc04dd132f961cfb69efe1e649666702a..2206463847a91cbb5b6efd40ea422fbe120eedff 100644 --- a/app/base/gimplut.c +++ b/app/base/gimplut.c @@ -58,9 +58,9 @@ void gimp_lut_setup (GimpLut *lut, GimpLutFunc func, void *user_data, - gint nchannels) + guint nchannels) { - gint i, v; + guint i, v; gdouble val; if (lut->luts) @@ -83,12 +83,7 @@ gimp_lut_setup (GimpLut *lut, /* to add gamma correction use func(v ^ g) ^ 1/g instead. */ val = 255.0 * func (user_data, lut->nchannels, i, v/255.0) + 0.5; - if (val < 0.0) - lut->luts[i][v] = 0; - else if (val >= 255.0) - lut->luts[i][v] = 255; - else - lut->luts[i][v] = val; + lut->luts[i][v] = CLAMP (val, 0, 255); } } } @@ -97,7 +92,7 @@ void gimp_lut_setup_exact (GimpLut *lut, GimpLutFunc func, void *user_data, - gint nchannels) + guint nchannels) { gimp_lut_setup (lut, func, user_data, nchannels); } @@ -107,7 +102,7 @@ gimp_lut_process (GimpLut *lut, PixelRegion *srcPR, PixelRegion *destPR) { - gint h, width, src_r_i, dest_r_i; + guint h, width, src_r_i, dest_r_i; guchar *src, *dest; guchar *lut0 = NULL, *lut1 = NULL, *lut2 = NULL, *lut3 = NULL; @@ -189,7 +184,7 @@ void gimp_lut_process_inline (GimpLut *lut, PixelRegion *srcPR) { - gint h, width, src_r_i; + guint h, width, src_r_i; guchar *src; guchar *lut0 = NULL, *lut1 = NULL, *lut2 = NULL, *lut3 = NULL; diff --git a/app/base/gimplut.h b/app/base/gimplut.h index f1c92da43b09bf21f5ed51ddfccc8e0c4072ce7b..8dfd77e3b8690a3f398e994b522d12c9050d7778 100644 --- a/app/base/gimplut.h +++ b/app/base/gimplut.h @@ -25,7 +25,7 @@ struct _GimpLut { guchar **luts; - gint nchannels; + guint nchannels; }; /* TODO: the GimpLutFunc should really be passed the ColorModel of the region, @@ -36,18 +36,17 @@ struct _GimpLut * and do no correction as this will be handled by gimp_lut_setup */ typedef gfloat (*GimpLutFunc) (gpointer user_data, - gint nchannels, - gint channel, + guint nchannels, + guint channel, gfloat value); - GimpLut * gimp_lut_new (void); void gimp_lut_free (GimpLut *lut); void gimp_lut_setup (GimpLut *lut, GimpLutFunc func, gpointer user_data, - gint nchannels); + guint nchannels); /* gimp_lut_setup_exact is currently identical to gimp_lut_setup. It * however is guaranteed to never perform any interpolation or gamma @@ -56,7 +55,7 @@ void gimp_lut_setup (GimpLut *lut, void gimp_lut_setup_exact (GimpLut *lut, GimpLutFunc func, gpointer user_data, - gint nchannels); + guint nchannels); void gimp_lut_process (GimpLut *lut, PixelRegion *srcPR, @@ -78,5 +77,4 @@ void gimp_lut_process_2 (PixelRegion *srcPR, PixelRegion *destPR, GimpLut *lut); - #endif /* __GIMP_LUT_H__ */ diff --git a/app/base/hue-saturation.h b/app/base/hue-saturation.h index f4fb537a8c0dbe385a78edad8fc4167aae018da2..17c5eac399d82d64e9debf09bdabd59b98270a20 100644 --- a/app/base/hue-saturation.h +++ b/app/base/hue-saturation.h @@ -77,7 +77,7 @@ struct _HueSaturationDialog gdouble saturation[7]; HueRange hue_partition; - gboolean preview; + guint preview : 1; }; diff --git a/app/base/pixel-region.h b/app/base/pixel-region.h index f66dbfd3b0571df84bfb2833a844c6ea694f79db..2c7084f5e704dfadae69e9cb785117d92dbaf874 100644 --- a/app/base/pixel-region.h +++ b/app/base/pixel-region.h @@ -27,14 +27,14 @@ struct _PixelRegion Tile *curtile; /* current tile */ gint offx; /* tile offsets */ gint offy; /* tile offsets */ - gint rowstride; /* bytes per pixel row */ + guint rowstride; /* bytes per pixel row */ gint x; /* origin */ gint y; /* origin */ - gint w; /* width of region */ - gint h; /* height of region */ - gint bytes; /* bytes per pixel */ - gboolean dirty; /* will this region be dirtied? */ - gint process_count; /* used internally */ + guint w; /* width of region */ + guint h; /* height of region */ + guint bytes; /* bytes per pixel */ + guint dirty : 1; /* will this region be dirtied? */ + guint process_count; /* used internally */ }; struct _PixelRegionHolder @@ -43,18 +43,18 @@ struct _PixelRegionHolder guchar *original_data; gint startx; gint starty; - gint count; + guint count; }; struct _PixelRegionIterator { GSList *pixel_regions; - gint dirty_tiles; - gint region_width; - gint region_height; - gint portion_width; - gint portion_height; - gint process_count; + guint dirty_tiles; + guint region_width; + guint region_height; + guint portion_width; + guint portion_height; + guint process_count; }; diff --git a/app/base/pixel-surround.c b/app/base/pixel-surround.c index 281f7591b496d6609bf519936d30eee34e1e5997..f84cbb4ee3e412b637c04ce055de389e49cc8536 100644 --- a/app/base/pixel-surround.c +++ b/app/base/pixel-surround.c @@ -31,11 +31,11 @@ void pixel_surround_init (PixelSurround *ps, TileManager *tm, - gint w, - gint h, + guint w, + guint h, guchar bg[MAX_CHANNELS]) { - gint i; + guint i; for (i = 0; i < MAX_CHANNELS; ++i) { @@ -55,10 +55,10 @@ pixel_surround_init (PixelSurround *ps, guchar * pixel_surround_lock (PixelSurround *ps, - gint x, - gint y) + guint x, + guint y) { - gint i, j; + guint i, j; guchar *k; guchar *ptr; @@ -119,7 +119,7 @@ pixel_surround_lock (PixelSurround *ps, return ps->buff; } -gint +guint pixel_surround_rowstride (PixelSurround *ps) { return ps->row_stride; diff --git a/app/base/pixel-surround.h b/app/base/pixel-surround.h index 246e9d90f8b979f9ec7b3927d0ed68fcc638c8f9..c49cbc2cc2acbf3a6b2c867626252b14acb8a585 100644 --- a/app/base/pixel-surround.h +++ b/app/base/pixel-surround.h @@ -29,19 +29,19 @@ typedef struct _PixelSurround Tile *tile; TileManager *mgr; guchar *buff; - gint buff_size; - gint bpp; - gint w; - gint h; + guint buff_size; + guint bpp; + guint w; + guint h; guchar bg[MAX_CHANNELS]; - gint row_stride; + guint row_stride; } PixelSurround; void pixel_surround_init (PixelSurround *ps, TileManager *tm, - gint w, - gint h, + guint w, + guint h, guchar bg[MAX_CHANNELS]); /* return a pointer to a buffer which contains all the surrounding pixels @@ -49,10 +49,10 @@ void pixel_surround_init (PixelSurround *ps, * otherwise just copy into our own malloced buffer and return that */ guchar * pixel_surround_lock (PixelSurround *ps, - gint x, - gint y); + guint x, + guint y); -gint pixel_surround_rowstride (PixelSurround *ps); +guint pixel_surround_rowstride (PixelSurround *ps); void pixel_surround_release (PixelSurround *ps); diff --git a/app/base/temp-buf.c b/app/base/temp-buf.c index 15128b1af6223239b75f9c75942038d3c90c4d93..8468624f01138bcec0396f0b453807ce3f6f8fbc 100644 --- a/app/base/temp-buf.c +++ b/app/base/temp-buf.c @@ -54,7 +54,7 @@ static void temp_buf_to_gray (TempBuf *src_buf, /* Memory management */ -static guchar * +static inline guchar * temp_buf_allocate (guint size) { guchar *data; @@ -73,7 +73,7 @@ temp_buf_to_color (TempBuf *src_buf, { guchar *src; guchar *dest; - glong num_bytes; + gulong num_bytes; src = temp_buf_data (src_buf); dest = temp_buf_data (dest_buf); @@ -97,7 +97,7 @@ temp_buf_to_gray (TempBuf *src_buf, { guchar *src; guchar *dest; - glong num_bytes; + gulong num_bytes; gfloat pix; src = temp_buf_data (src_buf); @@ -117,19 +117,20 @@ temp_buf_to_gray (TempBuf *src_buf, } TempBuf * -temp_buf_new (gint width, - gint height, - gint bytes, +temp_buf_new (guint width, + guint height, + guint bytes, gint x, gint y, guchar *col) { - glong i; - gint j; - guchar *data; - TempBuf *temp; + const gulong size = width * height * bytes; + glong i; + gint j; + guchar *data; + TempBuf *temp; - g_return_val_if_fail (width > 0 && height > 0, NULL); + g_return_val_if_fail (size > 0, NULL); temp = g_new (TempBuf, 1); @@ -141,7 +142,7 @@ temp_buf_new (gint width, temp->swapped = FALSE; temp->filename = NULL; - temp->data = data = temp_buf_allocate (width * height * bytes); + temp->data = data = temp_buf_allocate (size); /* initialize the data */ if (col) @@ -197,8 +198,8 @@ temp_buf_new (gint width, parameters into a newly allocated tempbuf */ TempBuf * -temp_buf_new_check (gint width, - gint height, +temp_buf_new_check (guint width, + guint height, GimpCheckType check_type, GimpCheckSize check_size) { @@ -207,7 +208,7 @@ temp_buf_new_check (gint width, guchar check_shift = 0; guchar fg_color = 0; guchar bg_color = 0; - gint i, j; + guint i, j; g_return_val_if_fail (width > 0 && height > 0, NULL); @@ -308,18 +309,16 @@ temp_buf_copy (TempBuf *src, TempBuf * temp_buf_resize (TempBuf *buf, - gint bytes, + guint bytes, gint x, gint y, - gint width, - gint height) + guint width, + guint height) { - gint size; - - g_return_val_if_fail (width > 0 && height > 0, NULL); - /* calculate the requested size */ - size = width * height * bytes; + const gulong size = width * height * bytes; + + g_return_val_if_fail (size > 0, NULL); /* First, configure the canvas buffer */ if (!buf) @@ -350,11 +349,11 @@ temp_buf_resize (TempBuf *buf, TempBuf * temp_buf_scale (TempBuf *src, - gint new_width, - gint new_height) + guint new_width, + guint new_height) { - gint loop1; - gint loop2; + guint loop1; + guint loop2; gdouble x_ratio; gdouble y_ratio; guchar *src_data; @@ -403,8 +402,8 @@ temp_buf_copy_area (TempBuf *src, TempBuf *dest, gint x, gint y, - gint width, - gint height, + guint width, + guint height, gint dest_x, gint dest_y) { @@ -508,8 +507,8 @@ temp_buf_data_clear (TempBuf *temp_buf) MaskBuf * -mask_buf_new (gint width, - gint height) +mask_buf_new (guint width, + guint height) { static guchar empty = 0; diff --git a/app/base/temp-buf.h b/app/base/temp-buf.h index db509f0aa5ae8d678416560e343e5765d06bbb58..e6470660a25e47c5ac1b542471adc282cb696e98 100644 --- a/app/base/temp-buf.h +++ b/app/base/temp-buf.h @@ -22,48 +22,48 @@ struct _TempBuf { - gint bytes; /* the necessary info */ - gint width; - gint height; - gint x, y; /* origin of data source */ + guint width; + guint height; + gint x, y; /* origin of data source */ - gboolean swapped; /* flag indicating whether buf is cached to disk */ - gchar *filename; /* filename of cached information */ + guint bytes : 4; /* the necessary info */ + guint swapped : 1; /* flag indicating whether buf is cached to disk */ + gchar *filename; /* filename of cached information */ - guchar *data; /* The data buffer. Do never access this field + guchar *data; /* The data buffer. Do never access this field directly, use temp_buf_data() instead !! */ }; /* The temp buffer functions */ -TempBuf * temp_buf_new (gint width, - gint height, - gint bytes, +TempBuf * temp_buf_new (guint width, + guint height, + guint bytes, gint x, gint y, guchar *col); -TempBuf * temp_buf_new_check (gint width, - gint height, +TempBuf * temp_buf_new_check (guint width, + guint height, GimpCheckType check_type, GimpCheckSize check_size); TempBuf * temp_buf_copy (TempBuf *src, TempBuf *dest); TempBuf * temp_buf_resize (TempBuf *buf, - gint bytes, + guint bytes, gint x, gint y, - gint width, - gint height); + guint width, + guint height); TempBuf * temp_buf_scale (TempBuf *buf, - gint width, - gint height); + guint width, + guint height); TempBuf * temp_buf_copy_area (TempBuf *src, TempBuf *dest, gint x, gint y, - gint width, - gint height, + guint width, + guint height, gint dest_x, gint dest_y); void temp_buf_free (TempBuf *buf); @@ -72,8 +72,8 @@ guchar * temp_buf_data_clear (TempBuf *buf); /* The mask buffer functions */ -MaskBuf * mask_buf_new (gint width, - gint height); +MaskBuf * mask_buf_new (guint width, + guint height); void mask_buf_free (MaskBuf *mask_buf); guchar * mask_buf_data (MaskBuf *mask_buf); guchar * mask_buf_data_clear (MaskBuf *mask_buf); diff --git a/app/base/threshold.h b/app/base/threshold.h index 2622e2e5c002b581aaa299c59bf037798c9a82c7..8b6f5e9cebdee8c2e1fdc149734f9458bead2973 100644 --- a/app/base/threshold.h +++ b/app/base/threshold.h @@ -57,14 +57,14 @@ struct _ThresholdDialog GimpHistogramView *histogram; GimpHistogram *hist; - GimpDrawable *drawable; - ImageMap *image_map; + GimpDrawable *drawable; + ImageMap *image_map; - gint color; - gint low_threshold; - gint high_threshold; + gint color; + gint low_threshold; + gint high_threshold; - gboolean preview; + guint preview : 1; }; diff --git a/app/base/tile-manager-private.h b/app/base/tile-manager-private.h index 6b65d131e011edf7c51e5cabba4cec5ceef14fea..efc432dc3edcafda3d9e8ded6037e76183b6146b 100644 --- a/app/base/tile-manager-private.h +++ b/app/base/tile-manager-private.h @@ -24,12 +24,12 @@ struct _TileManager { gint x, y; /* tile manager offsets */ - gint width; /* the width of the tiled area */ - gint height; /* the height of the tiled area */ - gint bpp; /* the bpp of each tile */ + guint width; /* the width of the tiled area */ + guint height; /* the height of the tiled area */ + guint bpp; /* the bpp of each tile */ - gint ntile_rows; /* the number of tiles in each row */ - gint ntile_cols; /* the number of tiles in each columns */ + guint ntile_rows; /* the number of tiles in each row */ + guint ntile_cols; /* the number of tiles in each columns */ Tile **tiles; /* the tiles for this level */ TileValidateProc validate_proc; /* this proc is called when an attempt @@ -45,11 +45,11 @@ struct _PixelDataHandlePrivate { PixelDataHandle public; TileManager *tm; - gint x1, x2, y1, y2; - gboolean readable; - gboolean writeable; - gboolean local_buffer; Tile *tile; + gint x1, x2, y1, y2; + guint readable : 1; + guint writeable : 1; + guint local_buffer : 1; }; diff --git a/app/base/tile-manager.c b/app/base/tile-manager.c index e933f90446aeda301f49db03761cd9f3e63ed14f..50ac78280ac82a1f9ae6574f5124fdd21a9eb4c7 100644 --- a/app/base/tile-manager.c +++ b/app/base/tile-manager.c @@ -32,15 +32,17 @@ #include "tile-swap.h" -static gint tile_manager_get_tile_num (TileManager *tm, - gint xpixel, - gint ypixel); +static inline gboolean +tile_manager_get_tile_num (TileManager *tm, + gint xpixel, + gint ypixel, + guint *tile_num); TileManager * -tile_manager_new (gint toplevel_width, - gint toplevel_height, - gint bpp) +tile_manager_new (guint toplevel_width, + guint toplevel_height, + guint bpp) { TileManager *tm; gint width; @@ -69,8 +71,8 @@ tile_manager_new (gint toplevel_width, void tile_manager_destroy (TileManager *tm) { - gint ntiles; - gint i; + guint ntiles; + guint i; g_return_if_fail (tm != NULL); @@ -105,15 +107,14 @@ Tile * tile_manager_get_tile (TileManager *tm, gint xpixel, gint ypixel, - gint wantread, - gint wantwrite) + gboolean wantread, + gboolean wantwrite) { - gint tile_num; + guint tile_num; g_return_val_if_fail (tm != NULL, NULL); - tile_num = tile_manager_get_tile_num (tm, xpixel, ypixel); - if (tile_num < 0) + if (!tile_manager_get_tile_num (tm, xpixel, ypixel, &tile_num)) return NULL; return tile_manager_get (tm, tile_num, wantread, wantwrite); @@ -121,23 +122,23 @@ tile_manager_get_tile (TileManager *tm, Tile * tile_manager_get (TileManager *tm, - gint tile_num, - gint wantread, - gint wantwrite) + guint tile_num, + gboolean wantread, + gboolean wantwrite) { Tile **tiles; Tile **tile_ptr; - gint ntiles; - gint nrows, ncols; + guint ntiles; + guint nrows, ncols; gint right_tile; gint bottom_tile; - gint i, j, k; + guint i, j, k; g_return_val_if_fail (tm != NULL, NULL); ntiles = tm->ntile_rows * tm->ntile_cols; - if ((tile_num < 0) || (tile_num >= ntiles)) + if (tile_num >= ntiles) return NULL; if (!tm->tiles) @@ -175,14 +176,6 @@ tile_manager_get (TileManager *tm, g_warning("WRITE-ONLY TILE... UNTESTED!"); } - /* - if ((*tile_ptr)->share_count && - (*tile_ptr)->write_count) - fprintf(stderr," >> MEEPITY %d,%d << ", - (*tile_ptr)->share_count, - (*tile_ptr)->write_count - ); */ - if (wantread) { TILE_MUTEX_LOCK (*tile_ptr); @@ -232,11 +225,6 @@ tile_manager_get (TileManager *tm, (*tile_ptr)->write_count++; (*tile_ptr)->dirty = TRUE; } - /* else - { - if ((*tile_ptr)->write_count) - fprintf(stderr,"STINK! r/o on r/w tile /%d\007 ",(*tile_ptr)->write_count); - } */ TILE_MUTEX_UNLOCK (*tile_ptr); tile_lock (*tile_ptr); } @@ -250,16 +238,14 @@ tile_manager_get_async (TileManager *tm, gint ypixel) { Tile *tile_ptr; - gint tile_num; + guint tile_num; g_return_if_fail (tm != NULL); - tile_num = tile_manager_get_tile_num (tm, xpixel, ypixel); - if (tile_num < 0) + if (!tile_manager_get_tile_num (tm, xpixel, ypixel, &tile_num)) return; tile_ptr = tm->tiles[tile_num]; - tile_swap_in_async (tile_ptr); } @@ -274,17 +260,6 @@ tile_manager_validate (TileManager *tm, if (tm->validate_proc) (* tm->validate_proc) (tm, tile); - -/* DEBUG STUFF -> if (tm->user_data) - { - fprintf(stderr,"V%p ",tm->user_data); - fprintf(stderr,"V"); - } - else - { - fprintf(stderr,"v"); - } */ - } void @@ -320,13 +295,12 @@ tile_invalidate_tile (Tile **tile_ptr, gint xpixel, gint ypixel) { - gint tile_num; + guint tile_num; g_return_if_fail (tile_ptr != NULL); g_return_if_fail (tm != NULL); - tile_num = tile_manager_get_tile_num (tm, xpixel, ypixel); - if (tile_num < 0) + if (!tile_manager_get_tile_num (tm, xpixel, ypixel, &tile_num)) return; tile_invalidate (tile_ptr, tm, tile_num); @@ -336,7 +310,7 @@ tile_invalidate_tile (Tile **tile_ptr, void tile_invalidate (Tile **tile_ptr, TileManager *tm, - gint tile_num) + guint tile_num) { Tile *tile = *tile_ptr; @@ -390,24 +364,13 @@ tile_manager_map_tile (TileManager *tm, gint ypixel, Tile *srctile) { - gint tile_row; - gint tile_col; - gint tile_num; + guint tile_num; - g_return_if_fail (tm != NULL); g_return_if_fail (srctile != NULL); - if ((xpixel < 0) || (xpixel >= tm->width) || - (ypixel < 0) || (ypixel >= tm->height)) - { - g_warning ("tile_manager_map_tile: tile co-ord out of range."); - return; - } - - tile_row = ypixel / TILE_HEIGHT; - tile_col = xpixel / TILE_WIDTH; - tile_num = tile_row * tm->ntile_cols + tile_col; - + if (!tile_manager_get_tile_num (tm, xpixel, ypixel, &tile_num)) + return; + tile_manager_map (tm, tile_num, srctile); } @@ -452,8 +415,6 @@ tile_manager_map (TileManager *tm, { for (j = 0; j < ncols; j++, k++) { - /* printf(",");fflush(stdout);*/ - tiles[k] = g_new (Tile, 1); tile_init (tiles[k], tm->bpp); tile_attach (tiles[k], tm, k); @@ -465,14 +426,10 @@ tile_manager_map (TileManager *tm, tiles[k]->eheight = bottom_tile; } } - - /* g_warning ("tile_manager_map: empty tile level - done.");*/ } tile_ptr = &tm->tiles[tile_num]; - /* printf(")");fflush(stdout);*/ - if (!srctile->valid) g_warning("tile_manager_map: srctile not validated yet! please report."); @@ -486,41 +443,31 @@ tile_manager_map (TileManager *tm, } tile_detach (*tile_ptr, tm, tile_num); - - /* printf(">");fflush(stdout);*/ - TILE_MUTEX_LOCK (srctile); - - /* printf(" [src:%p tm:%p tn:%d] ", srctile, tm, tile_num); fflush(stdout);*/ - tile_attach (srctile, tm, tile_num); *tile_ptr = srctile; - TILE_MUTEX_UNLOCK (srctile); - - /* printf("}");fflush(stdout);*/ } -static gint +static inline gboolean tile_manager_get_tile_num (TileManager *tm, gint xpixel, - gint ypixel) + gint ypixel, + guint *tile_num) { - gint tile_row; - gint tile_col; - gint tile_num; + guint tile_row; + guint tile_col; - g_return_val_if_fail (tm != NULL, -1); + g_return_val_if_fail (tm != NULL, FALSE); - if ((xpixel < 0) || (xpixel >= tm->width) || - (ypixel < 0) || (ypixel >= tm->height)) - return -1; + if ((xpixel < 0) || (ypixel < 0) || + (xpixel >= tm->width) || (ypixel >= tm->height)) + return FALSE; tile_row = ypixel / TILE_HEIGHT; tile_col = xpixel / TILE_WIDTH; - tile_num = tile_row * tm->ntile_cols + tile_col; - - return tile_num; + *tile_num = tile_row * tm->ntile_cols + tile_col; + return TRUE; } void @@ -662,9 +609,10 @@ request_pixel_data (TileManager *tm, pdh->public.width = w = (x2-x1)+1; pdh->public.height = h = (y2-y1)+1; - tile_num_1 = tile_manager_get_tile_num (tm, x1, y1); - tile_num_2 = tile_manager_get_tile_num (tm, x2, y2); + tile_manager_get_tile_num (tm, x1, y1, &tile_num_1); + tile_manager_get_tile_num (tm, x2, y2, &tile_num_2); + /* FIXME: What if both nums are -1 aka inavlid? */ if (tile_num_1 == tile_num_2) { pdh->tile = tile_manager_get (tm, tile_num_1, wantread, wantwrite); diff --git a/app/base/tile-manager.h b/app/base/tile-manager.h index 2d8b101d04ff3d6d6b32db6570e2ac90c862a488..6415de9cab974e84baf17715c86eda16aa7f122d 100644 --- a/app/base/tile-manager.h +++ b/app/base/tile-manager.h @@ -22,10 +22,10 @@ struct _PixelDataHandle { guchar *data; - gint width; - gint height; - gint stride; - gint bpp; + guint width; + guint height; + guint stride; + guint bpp; }; /* Creates a new tile manager with the specified @@ -38,9 +38,9 @@ struct _PixelDataHandle * hierarchy is "nlevels - 1". That level will be smaller * than TILE_WIDTH x TILE_HEIGHT */ -TileManager * tile_manager_new (gint toplevel_width, - gint toplevel_height, - gint bpp); +TileManager * tile_manager_new (guint toplevel_width, + guint toplevel_height, + guint bpp); /* Destroy a tile manager and all the tiles it contains. */ @@ -60,15 +60,15 @@ void tile_manager_set_validate_proc (TileManager *tm, Tile * tile_manager_get_tile (TileManager *tm, gint xpixel, gint ypixel, - gint wantread, - gint wantwrite); + gboolean wantread, + gboolean wantwrite); /* Get a specified tile from a tile manager. */ Tile * tile_manager_get (TileManager *tm, - gint tile_num, - gint wantread, - gint wantwrite); + guint tile_num, + gboolean wantread, + gboolean wantwrite); /* Request that (if possible) the tile at x,y be swapped * in. This is only a hint to improve performance; no guarantees. @@ -95,7 +95,7 @@ void tile_manager_validate (TileManager *tm, void tile_invalidate (Tile **tile_ptr, TileManager *tm, - gint tile_num); + guint tile_num); void tile_invalidate_tile (Tile **tile_ptr, TileManager *tm, gint xpixel, diff --git a/app/base/tile-private.h b/app/base/tile-private.h index fdb35f394f18be8360f7a8f6c6e8d2e985b5da47..5cc6a4a19df5f0d5f2cac1e80341095484b5a1e6 100644 --- a/app/base/tile-private.h +++ b/app/base/tile-private.h @@ -35,7 +35,7 @@ typedef struct _TileLink TileLink; struct _TileLink { TileLink *next; - gint tile_num; /* the number of this tile within the drawable */ + guint tile_num; /* the number of this tile within the drawable */ TileManager *tm; /* A pointer to the tile manager for this tile. * We need this in order to call the tile managers * validate proc whenever the tile is referenced @@ -45,20 +45,20 @@ struct _TileLink struct _Tile { - gshort ref_count; /* reference count. when the reference count is + gushort ref_count; /* reference count. when the reference count is * non-zero then the "data" for this tile must * be valid. when the reference count for a tile * is 0 then the "data" for this tile must be * NULL. */ - gshort write_count; /* write count: number of references that are + gushort write_count;/* write count: number of references that are for write access */ - gshort share_count; /* share count: number of tile managers that + gushort share_count;/* share count: number of tile managers that hold this tile */ guint dirty : 1; /* is the tile dirty? has it been modified? */ guint valid : 1; /* is the tile valid? */ - guchar bpp; /* the bytes per pixel (1, 2, 3 or 4) */ + guint bpp : 4; /* the bytes per pixel (1, 2, 3 or 4) */ gushort ewidth; /* the effective width of the tile */ gushort eheight; /* the effective height of the tile * a tile's effective width and height may be smaller @@ -72,7 +72,7 @@ struct _Tile * case the tile data is on disk. */ - gint swap_num; /* the index into the file table of the file to be used + guint swap_num; /* the index into the file table of the file to be used * for swapping. swap_num 1 is always the global * swap file. */ @@ -98,5 +98,4 @@ struct _Tile #define TILE_MUTEX_UNLOCK(tile) /* nothing */ #endif - #endif /* __TILE_PRIVATE_H__ */ diff --git a/app/base/tile.c b/app/base/tile.c index 3e8bc11a2120f8fde1305a59607e0bb29ce9d5f6..1d9c97f7c3f34636abce95add253ec218860f953 100644 --- a/app/base/tile.c +++ b/app/base/tile.c @@ -322,7 +322,7 @@ tile_mark_valid (Tile *tile) void tile_attach (Tile *tile, void *tm, - gint tile_num) + guint tile_num) { TileLink *tmp; @@ -351,7 +351,7 @@ tile_attach (Tile *tile, void tile_detach (Tile *tile, void *tm, - gint tile_num) + guint tile_num) { TileLink **link; TileLink *tmp; diff --git a/app/base/tile.h b/app/base/tile.h index e89236282f415490ad2dabdcbf6b813022d4d38e..9e591698d7aead4693051349fdc62c283c3b3439 100644 --- a/app/base/tile.h +++ b/app/base/tile.h @@ -101,10 +101,10 @@ void * tile_data_pointer (Tile *tile, void tile_attach (Tile *tile, void *tm, - gint tile_num); + guint tile_num); void tile_detach (Tile *tile, void *tm, - gint tile_num); + guint tile_num); #endif /* __TILE_H__ */ diff --git a/app/core/gimp.h b/app/core/gimp.h index f9e80ec65450f7baf9df25e975f1bba2ed9b0263..229be37562076694c8bd84f1e2573969a14408b7 100644 --- a/app/core/gimp.h +++ b/app/core/gimp.h @@ -48,9 +48,9 @@ struct _Gimp GimpCoreConfig *config; - gboolean be_verbose; - gboolean no_data; - gboolean no_interface; + guint be_verbose : 1; + guint no_data : 1; + guint no_interface : 1; GimpMessageHandlerType message_handler; GimpStackTraceMode stack_trace_mode; @@ -67,7 +67,7 @@ struct _Gimp guint busy_idle_id; GList *user_units; - gint n_user_units; + guint n_user_units; GimpParasiteList *parasites; @@ -105,7 +105,7 @@ struct _Gimp GList *image_base_type_names; GList *fill_type_names; GimpImageNewValues image_new_last_values; - gboolean have_current_cut_buffer; + guint have_current_cut_buffer : 1; /* the list of all contexts */ GList *context_list; diff --git a/app/core/gimpbrushgenerated-load.c b/app/core/gimpbrushgenerated-load.c index 1658866616b94c455283371e21f985f9ff6e27d7..0514f9b4db276fe8c7a47b1fc78a06310a511758 100644 --- a/app/core/gimpbrushgenerated-load.c +++ b/app/core/gimpbrushgenerated-load.c @@ -440,7 +440,7 @@ gimp_brush_generated_thaw (GimpBrushGenerated *brush) if (brush->freeze > 0) brush->freeze--; - if (brush->freeze == 0) + if (!brush->freeze) gimp_data_dirty (GIMP_DATA (brush)); } @@ -460,7 +460,7 @@ gimp_brush_generated_set_radius (GimpBrushGenerated *brush, brush->radius = radius; - if (! brush->freeze) + if (!brush->freeze) gimp_data_dirty (GIMP_DATA (brush)); return brush->radius; diff --git a/app/core/gimpbrushgenerated-save.c b/app/core/gimpbrushgenerated-save.c index 1658866616b94c455283371e21f985f9ff6e27d7..0514f9b4db276fe8c7a47b1fc78a06310a511758 100644 --- a/app/core/gimpbrushgenerated-save.c +++ b/app/core/gimpbrushgenerated-save.c @@ -440,7 +440,7 @@ gimp_brush_generated_thaw (GimpBrushGenerated *brush) if (brush->freeze > 0) brush->freeze--; - if (brush->freeze == 0) + if (!brush->freeze) gimp_data_dirty (GIMP_DATA (brush)); } @@ -460,7 +460,7 @@ gimp_brush_generated_set_radius (GimpBrushGenerated *brush, brush->radius = radius; - if (! brush->freeze) + if (!brush->freeze) gimp_data_dirty (GIMP_DATA (brush)); return brush->radius; diff --git a/app/core/gimpbrushgenerated.c b/app/core/gimpbrushgenerated.c index 1658866616b94c455283371e21f985f9ff6e27d7..0514f9b4db276fe8c7a47b1fc78a06310a511758 100644 --- a/app/core/gimpbrushgenerated.c +++ b/app/core/gimpbrushgenerated.c @@ -440,7 +440,7 @@ gimp_brush_generated_thaw (GimpBrushGenerated *brush) if (brush->freeze > 0) brush->freeze--; - if (brush->freeze == 0) + if (!brush->freeze) gimp_data_dirty (GIMP_DATA (brush)); } @@ -460,7 +460,7 @@ gimp_brush_generated_set_radius (GimpBrushGenerated *brush, brush->radius = radius; - if (! brush->freeze) + if (!brush->freeze) gimp_data_dirty (GIMP_DATA (brush)); return brush->radius; diff --git a/app/core/gimpbrushgenerated.h b/app/core/gimpbrushgenerated.h index e30d33b04d143e473b5e19a0d205be589da93c72..060eb5e5ae94a1ca053ec22a84a25ee6ebe7f903 100644 --- a/app/core/gimpbrushgenerated.h +++ b/app/core/gimpbrushgenerated.h @@ -48,7 +48,7 @@ struct _GimpBrushGenerated gfloat aspect_ratio; /* y/x */ /* private */ - gint freeze; + guint freeze; }; struct _GimpBrushGeneratedClass diff --git a/app/core/gimpbrushpipe.h b/app/core/gimpbrushpipe.h index e08d7ca4bb1fc199ace3cf01232c863fcd202de5..d678375e7e329cf8c7d2483ea2c53ebc209b810e 100644 --- a/app/core/gimpbrushpipe.h +++ b/app/core/gimpbrushpipe.h @@ -61,7 +61,7 @@ struct _GimpBrushPipe gint *index; /* Current index for incremental dimensions */ - gint nbrushes; /* Might be less than the product of the + guint nbrushes; /* Might be less than the product of the * ranks in some odd special case */ GimpBrush **brushes; GimpBrush *current; /* Currently selected brush */ diff --git a/app/core/gimpchannel-combine.c b/app/core/gimpchannel-combine.c index 7253e5c2ce58c1b53fe245b545f5b7de6202b588..effa2bb022eedcf4703266cb2baa7557ccc7ee51 100644 --- a/app/core/gimpchannel-combine.c +++ b/app/core/gimpchannel-combine.c @@ -118,7 +118,6 @@ gimp_channel_init (GimpChannel *channel) channel->y1 = 0; channel->x2 = 0; channel->y2 = 0; - } static void @@ -156,8 +155,8 @@ gimp_channel_validate (TileManager *tm, GimpChannel * gimp_channel_new (GimpImage *gimage, - gint width, - gint height, + guint width, + guint height, const gchar *name, const GimpRGB *color) { @@ -172,7 +171,6 @@ gimp_channel_new (GimpImage *gimage, /* set the channel color and opacity */ channel->color = *color; - channel->show_masked = TRUE; /* selection mask variables */ @@ -270,17 +268,17 @@ gimp_channel_get_color (const GimpChannel *channel) return &channel->color; } -gint +guint gimp_channel_get_opacity (const GimpChannel *channel) { g_return_val_if_fail (GIMP_IS_CHANNEL (channel), 0); - return (gint) (channel->color.a * 100.999); + return (guint) (channel->color.a * 100.999); } void gimp_channel_set_opacity (GimpChannel *channel, - gint opacity) + guint opacity) { g_return_if_fail (GIMP_IS_CHANNEL (channel)); @@ -291,8 +289,8 @@ gimp_channel_set_opacity (GimpChannel *channel, void gimp_channel_scale (GimpChannel *channel, - gint new_width, - gint new_height) + guint new_width, + guint new_height) { PixelRegion srcPR, destPR; TileManager *new_tiles; @@ -341,8 +339,8 @@ gimp_channel_scale (GimpChannel *channel, void gimp_channel_resize (GimpChannel *channel, - gint new_width, - gint new_height, + guint new_width, + guint new_height, gint offx, gint offy) { @@ -445,8 +443,8 @@ gimp_channel_resize (GimpChannel *channel, GimpChannel * gimp_channel_new_mask (GimpImage *gimage, - gint width, - gint height) + guint width, + guint height) { GimpRGB black = { 0.0, 0.0, 0.0, 0.5 }; GimpChannel *new_channel; @@ -536,13 +534,13 @@ gimp_channel_boundary (GimpChannel *mask, return TRUE; } -gint +guchar gimp_channel_value (GimpChannel *mask, gint x, gint y) { Tile *tile; - gint val; + guchar val; g_return_val_if_fail (GIMP_IS_CHANNEL (mask), 0); @@ -741,8 +739,8 @@ void gimp_channel_add_segment (GimpChannel *mask, gint x, gint y, - gint width, - gint value) + guint width, + guint value) { PixelRegion maskPR; guchar *data; @@ -786,8 +784,8 @@ void gimp_channel_sub_segment (GimpChannel *mask, gint x, gint y, - gint width, - gint value) + guint width, + guint value) { PixelRegion maskPR; guchar *data; @@ -831,8 +829,8 @@ gimp_channel_combine_rect (GimpChannel *mask, ChannelOps op, gint x, gint y, - gint w, - gint h) + guint w, + guint h) { gint x2, y2; PixelRegion maskPR; @@ -893,8 +891,8 @@ gimp_channel_combine_ellipse (GimpChannel *mask, ChannelOps op, gint x, gint y, - gint w, - gint h, + guint w, + guint h, gboolean antialias) { gint i, j; @@ -1343,17 +1341,14 @@ gimp_channel_all (GimpChannel *mask) void gimp_channel_border (GimpChannel *mask, - gint radius_x, - gint radius_y) + guint radius_x, + guint radius_y) { PixelRegion bPR; gint x1, y1, x2, y2; g_return_if_fail (GIMP_IS_CHANNEL (mask)); - if (radius_x < 0 || radius_y < 0) - return; - if (! gimp_channel_bounds (mask, &x1, &y1, &x2, &y2)) return; if (gimp_channel_is_empty (mask)) @@ -1390,8 +1385,8 @@ gimp_channel_border (GimpChannel *mask, void gimp_channel_grow (GimpChannel *mask, - gint radius_x, - gint radius_y) + gint radius_x, + gint radius_y) { PixelRegion bPR; gint x1, y1, x2, y2; @@ -1401,17 +1396,15 @@ gimp_channel_grow (GimpChannel *mask, if (radius_x == 0 && radius_y == 0) return; - if (radius_x <= 0 && radius_y <= 0) + if (radius_x < 0 && radius_y < 0) { gimp_channel_shrink (mask, -radius_x, -radius_y, FALSE); return; } - if (radius_x < 0 || radius_y < 0) - return; - if (! gimp_channel_bounds (mask, &x1, &y1, &x2, &y2)) return; + if (gimp_channel_is_empty (mask)) return; @@ -1458,15 +1451,12 @@ gimp_channel_shrink (GimpChannel *mask, if (radius_x == 0 && radius_y == 0) return; - if (radius_x <= 0 && radius_y <= 0) + if (radius_x < 0 && radius_y < 0) { gimp_channel_grow (mask, -radius_x, -radius_y); return; } - if (radius_x < 0 || radius_y < 0) - return; - if (! gimp_channel_bounds (mask, &x1, &y1, &x2, &y2)) return; if (gimp_channel_is_empty (mask)) diff --git a/app/core/gimpchannel-combine.h b/app/core/gimpchannel-combine.h index 33e2b28292f7fc1bb0bb66dd4dd766e91a5b2050..b026ce6c7902aad4c5cf6d4599af1854292849f1 100644 --- a/app/core/gimpchannel-combine.h +++ b/app/core/gimpchannel-combine.h @@ -42,17 +42,17 @@ struct _GimpChannel GimpDrawable parent_instance; GimpRGB color; /* Also stored the opacity */ - gboolean show_masked; /* Show masked areas--as */ + guint show_masked; /* Show masked areas--as */ /* opposed to selected areas */ /* Selection mask variables */ - gboolean boundary_known; /* is the current boundary valid */ + guint boundary_known : 1;/* is the current boundary valid */ + guint empty : 1; /* is the region empty? */ + guint bounds_known : 1; /* recalculate the bounds? */ BoundSeg *segs_in; /* outline of selected region */ BoundSeg *segs_out; /* outline of selected region */ - gint num_segs_in; /* number of lines in boundary */ - gint num_segs_out; /* number of lines in boundary */ - gboolean empty; /* is the region empty? */ - gboolean bounds_known; /* recalculate the bounds? */ + guint num_segs_in; /* number of lines in boundary */ + guint num_segs_out; /* number of lines in boundary */ gint x1, y1; /* coordinates for bounding box */ gint x2, y2; /* lower right hand coordinate */ }; @@ -87,27 +87,27 @@ struct _MaskUndo GType gimp_channel_get_type (void) G_GNUC_CONST; GimpChannel * gimp_channel_new (GimpImage *gimage, - gint width, - gint height, + guint width, + guint height, const gchar *name, const GimpRGB *color); GimpChannel * gimp_channel_copy (const GimpChannel *channel, gboolean dummy); -gint gimp_channel_get_opacity (const GimpChannel *channel); +guint gimp_channel_get_opacity (const GimpChannel *channel); void gimp_channel_set_opacity (GimpChannel *channel, - gint opacity); + guint opacity); const GimpRGB * gimp_channel_get_color (const GimpChannel *channel); void gimp_channel_set_color (GimpChannel *channel, const GimpRGB *color); void gimp_channel_scale (GimpChannel *channel, - gint new_width, - gint new_height); + guint new_width, + guint new_height); void gimp_channel_resize (GimpChannel *channel, - gint new_width, - gint new_height, + guint new_width, + guint new_height, gint offx, gint offy); @@ -115,8 +115,8 @@ void gimp_channel_resize (GimpChannel *channel, /* selection mask functions */ GimpChannel * gimp_channel_new_mask (GimpImage *gimage, - gint width, - gint height); + guint width, + guint height); gboolean gimp_channel_boundary (GimpChannel *mask, BoundSeg **segs_in, BoundSeg **segs_out, @@ -131,32 +131,32 @@ gboolean gimp_channel_bounds (GimpChannel *mask, gint *y1, gint *x2, gint *y2); -gint gimp_channel_value (GimpChannel *mask, +guchar gimp_channel_value (GimpChannel *mask, gint x, gint y); gboolean gimp_channel_is_empty (GimpChannel *mask); void gimp_channel_add_segment (GimpChannel *mask, gint x, gint y, - gint width, - gint value); + guint width, + guint value); void gimp_channel_sub_segment (GimpChannel *mask, gint x, gint y, - gint width, - gint value); + guint width, + guint value); void gimp_channel_combine_rect (GimpChannel *mask, ChannelOps op, gint x, gint y, - gint w, - gint h); + guint w, + guint h); void gimp_channel_combine_ellipse (GimpChannel *mask, ChannelOps op, gint x, gint y, - gint w, - gint h, + guint w, + guint h, gboolean antialias); void gimp_channel_combine_mask (GimpChannel *mask, GimpChannel *add_on, @@ -175,8 +175,8 @@ void gimp_channel_sharpen (GimpChannel *mask); void gimp_channel_all (GimpChannel *mask); void gimp_channel_border (GimpChannel *mask, - gint radius_x, - gint radius_y); + guint radius_x, + guint radius_y); void gimp_channel_grow (GimpChannel *mask, gint radius_x, gint radius_y); diff --git a/app/core/gimpchannel.c b/app/core/gimpchannel.c index 7253e5c2ce58c1b53fe245b545f5b7de6202b588..effa2bb022eedcf4703266cb2baa7557ccc7ee51 100644 --- a/app/core/gimpchannel.c +++ b/app/core/gimpchannel.c @@ -118,7 +118,6 @@ gimp_channel_init (GimpChannel *channel) channel->y1 = 0; channel->x2 = 0; channel->y2 = 0; - } static void @@ -156,8 +155,8 @@ gimp_channel_validate (TileManager *tm, GimpChannel * gimp_channel_new (GimpImage *gimage, - gint width, - gint height, + guint width, + guint height, const gchar *name, const GimpRGB *color) { @@ -172,7 +171,6 @@ gimp_channel_new (GimpImage *gimage, /* set the channel color and opacity */ channel->color = *color; - channel->show_masked = TRUE; /* selection mask variables */ @@ -270,17 +268,17 @@ gimp_channel_get_color (const GimpChannel *channel) return &channel->color; } -gint +guint gimp_channel_get_opacity (const GimpChannel *channel) { g_return_val_if_fail (GIMP_IS_CHANNEL (channel), 0); - return (gint) (channel->color.a * 100.999); + return (guint) (channel->color.a * 100.999); } void gimp_channel_set_opacity (GimpChannel *channel, - gint opacity) + guint opacity) { g_return_if_fail (GIMP_IS_CHANNEL (channel)); @@ -291,8 +289,8 @@ gimp_channel_set_opacity (GimpChannel *channel, void gimp_channel_scale (GimpChannel *channel, - gint new_width, - gint new_height) + guint new_width, + guint new_height) { PixelRegion srcPR, destPR; TileManager *new_tiles; @@ -341,8 +339,8 @@ gimp_channel_scale (GimpChannel *channel, void gimp_channel_resize (GimpChannel *channel, - gint new_width, - gint new_height, + guint new_width, + guint new_height, gint offx, gint offy) { @@ -445,8 +443,8 @@ gimp_channel_resize (GimpChannel *channel, GimpChannel * gimp_channel_new_mask (GimpImage *gimage, - gint width, - gint height) + guint width, + guint height) { GimpRGB black = { 0.0, 0.0, 0.0, 0.5 }; GimpChannel *new_channel; @@ -536,13 +534,13 @@ gimp_channel_boundary (GimpChannel *mask, return TRUE; } -gint +guchar gimp_channel_value (GimpChannel *mask, gint x, gint y) { Tile *tile; - gint val; + guchar val; g_return_val_if_fail (GIMP_IS_CHANNEL (mask), 0); @@ -741,8 +739,8 @@ void gimp_channel_add_segment (GimpChannel *mask, gint x, gint y, - gint width, - gint value) + guint width, + guint value) { PixelRegion maskPR; guchar *data; @@ -786,8 +784,8 @@ void gimp_channel_sub_segment (GimpChannel *mask, gint x, gint y, - gint width, - gint value) + guint width, + guint value) { PixelRegion maskPR; guchar *data; @@ -831,8 +829,8 @@ gimp_channel_combine_rect (GimpChannel *mask, ChannelOps op, gint x, gint y, - gint w, - gint h) + guint w, + guint h) { gint x2, y2; PixelRegion maskPR; @@ -893,8 +891,8 @@ gimp_channel_combine_ellipse (GimpChannel *mask, ChannelOps op, gint x, gint y, - gint w, - gint h, + guint w, + guint h, gboolean antialias) { gint i, j; @@ -1343,17 +1341,14 @@ gimp_channel_all (GimpChannel *mask) void gimp_channel_border (GimpChannel *mask, - gint radius_x, - gint radius_y) + guint radius_x, + guint radius_y) { PixelRegion bPR; gint x1, y1, x2, y2; g_return_if_fail (GIMP_IS_CHANNEL (mask)); - if (radius_x < 0 || radius_y < 0) - return; - if (! gimp_channel_bounds (mask, &x1, &y1, &x2, &y2)) return; if (gimp_channel_is_empty (mask)) @@ -1390,8 +1385,8 @@ gimp_channel_border (GimpChannel *mask, void gimp_channel_grow (GimpChannel *mask, - gint radius_x, - gint radius_y) + gint radius_x, + gint radius_y) { PixelRegion bPR; gint x1, y1, x2, y2; @@ -1401,17 +1396,15 @@ gimp_channel_grow (GimpChannel *mask, if (radius_x == 0 && radius_y == 0) return; - if (radius_x <= 0 && radius_y <= 0) + if (radius_x < 0 && radius_y < 0) { gimp_channel_shrink (mask, -radius_x, -radius_y, FALSE); return; } - if (radius_x < 0 || radius_y < 0) - return; - if (! gimp_channel_bounds (mask, &x1, &y1, &x2, &y2)) return; + if (gimp_channel_is_empty (mask)) return; @@ -1458,15 +1451,12 @@ gimp_channel_shrink (GimpChannel *mask, if (radius_x == 0 && radius_y == 0) return; - if (radius_x <= 0 && radius_y <= 0) + if (radius_x < 0 && radius_y < 0) { gimp_channel_grow (mask, -radius_x, -radius_y); return; } - if (radius_x < 0 || radius_y < 0) - return; - if (! gimp_channel_bounds (mask, &x1, &y1, &x2, &y2)) return; if (gimp_channel_is_empty (mask)) diff --git a/app/core/gimpchannel.h b/app/core/gimpchannel.h index 33e2b28292f7fc1bb0bb66dd4dd766e91a5b2050..b026ce6c7902aad4c5cf6d4599af1854292849f1 100644 --- a/app/core/gimpchannel.h +++ b/app/core/gimpchannel.h @@ -42,17 +42,17 @@ struct _GimpChannel GimpDrawable parent_instance; GimpRGB color; /* Also stored the opacity */ - gboolean show_masked; /* Show masked areas--as */ + guint show_masked; /* Show masked areas--as */ /* opposed to selected areas */ /* Selection mask variables */ - gboolean boundary_known; /* is the current boundary valid */ + guint boundary_known : 1;/* is the current boundary valid */ + guint empty : 1; /* is the region empty? */ + guint bounds_known : 1; /* recalculate the bounds? */ BoundSeg *segs_in; /* outline of selected region */ BoundSeg *segs_out; /* outline of selected region */ - gint num_segs_in; /* number of lines in boundary */ - gint num_segs_out; /* number of lines in boundary */ - gboolean empty; /* is the region empty? */ - gboolean bounds_known; /* recalculate the bounds? */ + guint num_segs_in; /* number of lines in boundary */ + guint num_segs_out; /* number of lines in boundary */ gint x1, y1; /* coordinates for bounding box */ gint x2, y2; /* lower right hand coordinate */ }; @@ -87,27 +87,27 @@ struct _MaskUndo GType gimp_channel_get_type (void) G_GNUC_CONST; GimpChannel * gimp_channel_new (GimpImage *gimage, - gint width, - gint height, + guint width, + guint height, const gchar *name, const GimpRGB *color); GimpChannel * gimp_channel_copy (const GimpChannel *channel, gboolean dummy); -gint gimp_channel_get_opacity (const GimpChannel *channel); +guint gimp_channel_get_opacity (const GimpChannel *channel); void gimp_channel_set_opacity (GimpChannel *channel, - gint opacity); + guint opacity); const GimpRGB * gimp_channel_get_color (const GimpChannel *channel); void gimp_channel_set_color (GimpChannel *channel, const GimpRGB *color); void gimp_channel_scale (GimpChannel *channel, - gint new_width, - gint new_height); + guint new_width, + guint new_height); void gimp_channel_resize (GimpChannel *channel, - gint new_width, - gint new_height, + guint new_width, + guint new_height, gint offx, gint offy); @@ -115,8 +115,8 @@ void gimp_channel_resize (GimpChannel *channel, /* selection mask functions */ GimpChannel * gimp_channel_new_mask (GimpImage *gimage, - gint width, - gint height); + guint width, + guint height); gboolean gimp_channel_boundary (GimpChannel *mask, BoundSeg **segs_in, BoundSeg **segs_out, @@ -131,32 +131,32 @@ gboolean gimp_channel_bounds (GimpChannel *mask, gint *y1, gint *x2, gint *y2); -gint gimp_channel_value (GimpChannel *mask, +guchar gimp_channel_value (GimpChannel *mask, gint x, gint y); gboolean gimp_channel_is_empty (GimpChannel *mask); void gimp_channel_add_segment (GimpChannel *mask, gint x, gint y, - gint width, - gint value); + guint width, + guint value); void gimp_channel_sub_segment (GimpChannel *mask, gint x, gint y, - gint width, - gint value); + guint width, + guint value); void gimp_channel_combine_rect (GimpChannel *mask, ChannelOps op, gint x, gint y, - gint w, - gint h); + guint w, + guint h); void gimp_channel_combine_ellipse (GimpChannel *mask, ChannelOps op, gint x, gint y, - gint w, - gint h, + guint w, + guint h, gboolean antialias); void gimp_channel_combine_mask (GimpChannel *mask, GimpChannel *add_on, @@ -175,8 +175,8 @@ void gimp_channel_sharpen (GimpChannel *mask); void gimp_channel_all (GimpChannel *mask); void gimp_channel_border (GimpChannel *mask, - gint radius_x, - gint radius_y); + guint radius_x, + guint radius_y); void gimp_channel_grow (GimpChannel *mask, gint radius_x, gint radius_y); diff --git a/app/core/gimpcontainer.h b/app/core/gimpcontainer.h index ab051913d1b7930168d8a7dead3601d9fc82f769..9ebf7784f273dcbfd886d26fe3c2674b66068b2d 100644 --- a/app/core/gimpcontainer.h +++ b/app/core/gimpcontainer.h @@ -51,11 +51,11 @@ struct _GimpContainer /* public, read-only */ GType children_type; GimpContainerPolicy policy; - gint num_children; + guint num_children; /* private */ GList *handlers; - gint freeze_count; + guint freeze_count; }; struct _GimpContainerClass diff --git a/app/core/gimpcoreconfig.h b/app/core/gimpcoreconfig.h index cc66a7cea1d903181d3980ee37edbe69809e3556..d194d2494254af40081f28622e47710f8e83f07f 100644 --- a/app/core/gimpcoreconfig.h +++ b/app/core/gimpcoreconfig.h @@ -37,17 +37,17 @@ struct _GimpCoreConfig gchar *default_comment; GimpImageBaseType default_type; - gint default_width; - gint default_height; + guint default_width; + guint default_height; GimpUnit default_units; gdouble default_xresolution; gdouble default_yresolution; GimpUnit default_resolution_units; - gint levels_of_undo; + guint levels_of_undo; gchar *pluginrc_path; gchar *module_db_load_inhibit; - gint thumbnail_mode; + guint thumbnail_mode; }; diff --git a/app/core/gimpdata.h b/app/core/gimpdata.h index 19be6f7adc3bd44c5e0d37b363fef6228494e580..ff17b74eb0d73b2d9d0daae0cb49f05653711cea 100644 --- a/app/core/gimpdata.h +++ b/app/core/gimpdata.h @@ -41,7 +41,7 @@ struct _GimpData GimpViewable parent_instance; gchar *filename; - gboolean dirty; + guint dirty : 1; }; struct _GimpDataClass diff --git a/app/core/gimpdatafactory.c b/app/core/gimpdatafactory.c index 04a072252f28a3e3b54f9e063cbaed2e85b82b1c..2549670752293f75ef50ffde5794da88daa1b5dc 100644 --- a/app/core/gimpdatafactory.c +++ b/app/core/gimpdatafactory.c @@ -117,7 +117,7 @@ GimpDataFactory * gimp_data_factory_new (GType data_type, const gchar **data_path, const GimpDataFactoryLoaderEntry *loader_entries, - gint n_loader_entries, + guint n_loader_entries, GimpDataNewFunc new_func, GimpDataGetStandardFunc standard_func) { @@ -261,7 +261,7 @@ gimp_data_factory_data_load_callback (const gchar *filename, gpointer callback_data) { GimpDataFactory *factory; - gint i; + guint i; factory = (GimpDataFactory *) callback_data; diff --git a/app/core/gimpdatafactory.h b/app/core/gimpdatafactory.h index 21815da308db1144bb9b9090fca246e651dcb174..e7a94c0e2ee31fda72509e1068b8a63a501932df 100644 --- a/app/core/gimpdatafactory.h +++ b/app/core/gimpdatafactory.h @@ -59,7 +59,7 @@ struct _GimpDataFactory const gchar **data_path; const GimpDataFactoryLoaderEntry *loader_entries; - gint n_loader_entries; + guint n_loader_entries; GimpDataNewFunc data_new_func; GimpDataGetStandardFunc data_get_standard_func; @@ -76,7 +76,7 @@ GType gimp_data_factory_get_type (void) G_GNUC_CONST; GimpDataFactory * gimp_data_factory_new (GType data_type, const gchar **data_path, const GimpDataFactoryLoaderEntry *loader_entries, - gint n_loader_entries, + guint n_loader_entries, GimpDataNewFunc new_func, GimpDataGetStandardFunc standard_func); diff --git a/app/core/gimpdrawable-blend.c b/app/core/gimpdrawable-blend.c index abe2bdc538c90d94b1edd5e64ab19453ce5aa21f..3f51ba1994038e7d9b010f7a3de5b29d6817ef84 100644 --- a/app/core/gimpdrawable-blend.c +++ b/app/core/gimpdrawable-blend.c @@ -18,6 +18,7 @@ #include "config.h" +#include #include #include "libgimpbase/gimpbase.h" @@ -60,8 +61,8 @@ typedef struct { PixelRegion *PR; guchar *row_data; - gint bytes; - gint width; + guint bytes; + guint width; } PutPixelData; diff --git a/app/core/gimpdrawable.c b/app/core/gimpdrawable.c index 20d958ce4a4c54177bb6a6bb207bb3b8083319f4..96ae6e450ea9ffcfd8c489682fe4f7fb205740e8 100644 --- a/app/core/gimpdrawable.c +++ b/app/core/gimpdrawable.c @@ -326,8 +326,8 @@ gimp_drawable_invalidate_preview (GimpViewable *viewable) void gimp_drawable_configure (GimpDrawable *drawable, GimpImage *gimage, - gint width, - gint height, + guint width, + guint height, GimpImageType type, const gchar *name) { @@ -438,8 +438,8 @@ void gimp_drawable_update (GimpDrawable *drawable, gint x, gint y, - gint w, - gint h) + guint w, + guint h) { GimpImage *gimage; gint offset_x; @@ -467,11 +467,11 @@ gimp_drawable_apply_image (GimpDrawable *drawable, gint x2, gint y2, TileManager *tiles, - gint sparse) + gboolean sparse) { g_return_if_fail (GIMP_IS_DRAWABLE (drawable)); - if (! tiles) + if (!tiles) undo_push_image (drawable->gimage, drawable, x1, y1, x2, y2); else diff --git a/app/core/gimpdrawable.h b/app/core/gimpdrawable.h index 36544b89c7dd8ebd9f38a6f64493345c52531f1d..7b818d1d4cb55926972d42a3a088373f931f6759 100644 --- a/app/core/gimpdrawable.h +++ b/app/core/gimpdrawable.h @@ -38,22 +38,22 @@ struct _GimpDrawable GimpViewable parent_instance; TileManager *tiles; /* tiles for drawable data */ - gboolean visible; /* controls visibility */ - gint width, height; /* size of drawable */ + guint visible : 1; /* controls visibility */ + guint width, height; /* size of drawable */ gint offset_x, offset_y; /* offset of layer in image */ - gint bytes; /* bytes per pixel */ + guint bytes : 4; /* bytes per pixel */ + guint has_alpha : 1; /* drawable has alpha */ gint ID; /* provides a unique ID */ guint32 tattoo; /* provides a perminant ID */ GimpImage *gimage; /* gimage owner */ GimpImageType type; /* type of drawable */ - gboolean has_alpha; /* drawable has alpha */ GimpParasiteList *parasites; /* Plug-in parasite data */ /* Preview variables */ GSList *preview_cache; /* preview caches of the channel */ - gboolean preview_valid; /* is the preview valid? */ + guint preview_valid : 1; /* is the preview valid? */ }; struct _GimpDrawableClass @@ -71,8 +71,8 @@ GType gimp_drawable_get_type (void) G_GNUC_CONST; void gimp_drawable_configure (GimpDrawable *drawable, GimpImage *gimage, - gint width, - gint height, + guint width, + guint height, GimpImageType type, const gchar *name); @@ -87,8 +87,8 @@ void gimp_drawable_set_gimage (GimpDrawable *drawable, void gimp_drawable_update (GimpDrawable *drawable, gint x, gint y, - gint w, - gint h); + guint w, + guint h); void gimp_drawable_apply_image (GimpDrawable *drawable, gint x1, @@ -96,7 +96,7 @@ void gimp_drawable_apply_image (GimpDrawable *drawable, gint x2, gint y2, TileManager *tiles, - gint sparse); + gboolean sparse); void gimp_drawable_merge_shadow (GimpDrawable *drawable, gboolean undo); diff --git a/app/core/gimpimage-convert.c b/app/core/gimpimage-convert.c index 749e41174ffb4c2474e2229f58d879ab931c896d..654a24465617c9446a9979ff72ac2725f04cd938 100644 --- a/app/core/gimpimage-convert.c +++ b/app/core/gimpimage-convert.c @@ -402,7 +402,7 @@ typedef ColorFreq *CFHistogram; #define HIST_RGB(hist_ptr,r,g,b) (&(hist_ptr)[REF_FUNC((r),(g),(b))]) */ static inline -ColorFreq * HIST_RGB(const ColorFreq *hist_ptr, +ColorFreq * HIST_RGB(ColorFreq *hist_ptr, const int r, const int g, const int b) { return (&(hist_ptr)[ diff --git a/app/core/gimpimage.h b/app/core/gimpimage.h index ebebbd2d9f03395df844a1474c0a9455275bc12a..8dfb7adb73d72b4cf0c1f893b1c0af6a1f12561b 100644 --- a/app/core/gimpimage.h +++ b/app/core/gimpimage.h @@ -32,7 +32,7 @@ struct _GimpGuide { - gint ref_count; + guint ref_count; gint position; InternalOrientationType orientation; guint32 guide_ID; @@ -59,7 +59,7 @@ struct _GimpImage PlugInProcDef *save_proc; /* last PDB save proc used */ - gint width, height; /* width and height attributes */ + guint width, height; /* width and height attributes */ gdouble xresolution; /* image x-res, in dpi */ gdouble yresolution; /* image y-res, in dpi */ GimpUnit unit; /* image unit */ @@ -68,18 +68,18 @@ struct _GimpImage guchar *cmap; /* colormap--for indexed */ gint num_cols; /* number of cols--for indexed */ - gint dirty; /* dirty flag -- # of ops */ - gboolean undo_on; /* Is undo enabled? */ + guint dirty; /* dirty flag -- # of ops */ + guint undo_on : 1; /* Is undo enabled? */ - gint instance_count; /* number of instances */ - gint disp_count; /* number of displays */ + guint instance_count; /* number of instances */ + guint disp_count; /* number of displays */ GimpTattoo tattoo_state; /* the next unique tattoo to use*/ TileManager *shadow; /* shadow buffer tiles */ /* Projection attributes */ - gboolean construct_flag; /* flag for construction */ + guint construct_flag : 1; /* flag for construction */ GimpImageType proj_type; /* type of the projection image */ gint proj_bytes; /* bpp in projection image */ gint proj_level; /* projection level */ @@ -102,19 +102,19 @@ struct _GimpImage PathList *paths; /* Paths data for this image */ - gboolean visible[MAX_CHANNELS]; /* visible channels */ - gboolean active[MAX_CHANNELS]; /* active channels */ + gboolean visible[MAX_CHANNELS]; /* visible channels */ + gboolean active[MAX_CHANNELS]; /* active channels */ - gboolean qmask_state; /* TRUE if qmask is on */ - gboolean qmask_inverted; /* TRUE if qmask is inverted */ + guint qmask_state : 1; /* TRUE if qmask is on */ + guint qmask_inverted : 1; /* TRUE if qmask is inverted */ GimpRGB qmask_color; /* rgba triplet of the color */ /* Old undo apparatus */ GSList *undo_stack; /* stack for undo operations */ GSList *redo_stack; /* stack for redo operations */ - gint undo_bytes; /* bytes in undo stack */ - gint undo_levels; /* levels in undo stack */ - gint group_count; /* nested undo groups */ + guint undo_bytes; /* bytes in undo stack */ + guint undo_levels; /* levels in undo stack */ + guint group_count; /* nested undo groups */ UndoType pushing_undo_group; /* undo group status flag */ /* New undo apparatus */ @@ -123,7 +123,7 @@ struct _GimpImage /* Composite preview */ TempBuf *comp_preview; /* the composite preview */ - gboolean comp_preview_valid; /* preview valid-1/channel */ + guint comp_preview_valid : 1;/* preview valid-1/channel */ }; struct _GimpImageClass diff --git a/app/core/gimpimagefile.h b/app/core/gimpimagefile.h index 162527c9eafa3b3dbd27ce1a636dcca879964556..65982b85545bf2d2062b478eb256782c275ba64d 100644 --- a/app/core/gimpimagefile.h +++ b/app/core/gimpimagefile.h @@ -40,9 +40,9 @@ struct _GimpImagefile { GimpViewable parent_instance; - gint width; - gint height; - gint size; + guint width; + guint height; + guint size; }; struct _GimpImagefileClass diff --git a/app/core/gimplayer.h b/app/core/gimplayer.h index 670ab6a3ecb5b6bb32e4c20c101ca62d95ee4357..5befadc7c9eab0a117e52364b4e5993a59c6027a 100644 --- a/app/core/gimplayer.h +++ b/app/core/gimplayer.h @@ -37,12 +37,11 @@ struct _GimpLayer { GimpDrawable parent_instance; - gint opacity; /* layer opacity */ + guint opacity; /* layer opacity */ LayerModeEffects mode; /* layer combination mode */ - gboolean preserve_trans; /* preserve transparency */ - - gboolean linked; /* control linkage */ - + guint preserve_trans; /* preserve transparency */ + guint linked; /* control linkage */ + GimpLayerMask *mask; /* possible layer mask */ /* Floating selections */ @@ -50,11 +49,10 @@ struct _GimpLayer { TileManager *backing_store; /* for obscured regions */ GimpDrawable *drawable; /* floating sel is attached to */ - gboolean initial; /* is fs composited yet? */ - - gboolean boundary_known; /* is the current boundary valid */ + guint initial : 1; /* is fs composited yet? */ + guint boundary_known : 1; /* is the current boundary valid */ BoundSeg *segs; /* boundary of floating sel */ - gint num_segs; /* number of segs in boundary */ + guint num_segs; /* number of segs in boundary */ } fs; }; diff --git a/app/core/gimplayermask.h b/app/core/gimplayermask.h index bcbb73c48e7f62a895e2499ac3e470b3f20e7689..3d3293b8cb75d797c9c5fb7d1dec45e5453fa7c5 100644 --- a/app/core/gimplayermask.h +++ b/app/core/gimplayermask.h @@ -39,9 +39,9 @@ struct _GimpLayerMask GimpLayer *layer; - gboolean apply_mask; /* controls mask application */ - gboolean edit_mask; /* edit mask or layer? */ - gboolean show_mask; /* show mask or layer? */ + guint apply_mask : 1; /* controls mask application */ + guint edit_mask : 1; /* edit mask or layer? */ + guint show_mask : 1; /* show mask or layer? */ }; struct _GimpLayerMaskClass diff --git a/app/core/gimpmoduleinfo.h b/app/core/gimpmoduleinfo.h index b617dde6ebabeaf246e80bf60a4feb502501b7ab..e88e6e26ef505368637c93b0a10d1ca714e764f6 100644 --- a/app/core/gimpmoduleinfo.h +++ b/app/core/gimpmoduleinfo.h @@ -54,8 +54,8 @@ struct _GimpModuleInfoObj gchar *fullpath; /* path to the module */ GimpModuleState state; /* what's happened to the module */ - gboolean on_disk; /* TRUE if file still exists */ - gboolean load_inhibit; /* user requests not to load at boot time */ + guint on_disk : 1; /* TRUE if file still exists */ + guint load_inhibit : 1; /* user requests not to load at boot time */ /* Count of times main gimp is within the module. Normally, this * will be 1, and we assume that the module won't call its @@ -64,7 +64,7 @@ struct _GimpModuleInfoObj * unload function, to stop the module attempting to unload * itself. */ - gint refs; + guint refs; /* stuff from now on may be NULL depending on the state the module is in */ GimpModuleInfo *info; /* returned values from module_init */ diff --git a/app/core/gimppalette.h b/app/core/gimppalette.h index 872f9493b56d982b60f39ba8818e5ef08c23d645..a6949d7ea29bae2719b92349a8c816d769f9d59f 100644 --- a/app/core/gimppalette.h +++ b/app/core/gimppalette.h @@ -53,9 +53,8 @@ struct _GimpPalette GimpData parent_instance; GList *colors; - gint n_colors; - - gint n_columns; + guint n_colors; + guint n_columns; }; struct _GimpPaletteClass diff --git a/app/core/gimpprojection.c b/app/core/gimpprojection.c index 7fe1d87bfda4550f5c8c3c7fdc8f2dbc03abf0a7..4b2c4740781a37d074823447c3bbedfa4e0a3a41 100644 --- a/app/core/gimpprojection.c +++ b/app/core/gimpprojection.c @@ -18,6 +18,7 @@ #include "config.h" +#include #include #include "display-types.h" diff --git a/app/core/gimpprojection.h b/app/core/gimpprojection.h index ad368b8f8833dac64cccfb1e02b80166c9b05ae9..a401cf0a5f4526af3a78c01a0343b2d9588f8b18 100644 --- a/app/core/gimpprojection.h +++ b/app/core/gimpprojection.h @@ -57,8 +57,8 @@ typedef struct _IdleRenderStruct IdleRenderStruct; struct _IdleRenderStruct { - gint width; - gint height; + guint width; + guint height; gint x; gint y; gint basex; @@ -94,9 +94,9 @@ struct _GimpDisplay GtkWidget *shell; /* shell widget for this gdisplay */ gint scale; /* scale factor from original raw image */ - gboolean dot_for_dot; /* is monitor resolution being ignored? */ - gboolean draw_guides; /* should the guides be drawn? */ - gboolean snap_to_guides; /* should the guides be snapped to? */ + guint dot_for_dot : 1; /* is monitor resolution being ignored? */ + guint draw_guides : 1; /* should the guides be drawn? */ + guint snap_to_guides : 1; /* should the guides be snapped to? */ GSList *update_areas; /* Update areas list */ diff --git a/app/core/gimpundo.h b/app/core/gimpundo.h index 282f37d8a4d56091d369f60936069fc60dd4f3e9..999013f8bd2d7cb8cea3be4cc8be134e06a362ee 100644 --- a/app/core/gimpundo.h +++ b/app/core/gimpundo.h @@ -43,7 +43,7 @@ struct _GimpUndo gpointer data; /* data to implement the undo */ glong size; /* size of undo item */ - gboolean dirties_image; /* TRUE if undo mutates image */ + guint dirties_image : 1; /* TRUE if undo mutates image */ GimpUndoPopFunc pop_func; /* function pointer to undo pop proc */ GimpUndoFreeFunc free_func; /* function pointer to free undo data */ diff --git a/app/core/gimpunit.c b/app/core/gimpunit.c index 903ed02cf87386d246230e34fa50bc7285b17769..cf5748f6dd6562f2e4515cce96e285ade3260823 100644 --- a/app/core/gimpunit.c +++ b/app/core/gimpunit.c @@ -186,8 +186,8 @@ gchar * _gimp_unit_get_identifier (Gimp *gimp, GimpUnit unit) { - g_return_val_if_fail ((unit >= GIMP_UNIT_PIXEL) && - (unit < (GIMP_UNIT_END + gimp->n_user_units)) || + g_return_val_if_fail (((unit >= GIMP_UNIT_PIXEL) && + (unit < (GIMP_UNIT_END + gimp->n_user_units))) || (unit == GIMP_UNIT_PERCENT), gimp_unit_defs[GIMP_UNIT_INCH].identifier); @@ -204,8 +204,8 @@ gchar * _gimp_unit_get_symbol (Gimp *gimp, GimpUnit unit) { - g_return_val_if_fail ((unit >= GIMP_UNIT_PIXEL) && - (unit < (GIMP_UNIT_END + gimp->n_user_units)) || + g_return_val_if_fail (((unit >= GIMP_UNIT_PIXEL) && + (unit < (GIMP_UNIT_END + gimp->n_user_units))) || (unit == GIMP_UNIT_PERCENT), gimp_unit_defs[GIMP_UNIT_INCH].symbol); @@ -222,8 +222,8 @@ gchar * _gimp_unit_get_abbreviation (Gimp *gimp, GimpUnit unit) { - g_return_val_if_fail ((unit >= GIMP_UNIT_PIXEL) && - (unit < (GIMP_UNIT_END + gimp->n_user_units)) || + g_return_val_if_fail (((unit >= GIMP_UNIT_PIXEL) && + (unit < (GIMP_UNIT_END + gimp->n_user_units))) || (unit == GIMP_UNIT_PERCENT), gimp_unit_defs[GIMP_UNIT_INCH].abbreviation); @@ -240,8 +240,8 @@ gchar * _gimp_unit_get_singular (Gimp *gimp, GimpUnit unit) { - g_return_val_if_fail ((unit >= GIMP_UNIT_PIXEL) && - (unit < (GIMP_UNIT_END + gimp->n_user_units)) || + g_return_val_if_fail (((unit >= GIMP_UNIT_PIXEL) && + (unit < (GIMP_UNIT_END + gimp->n_user_units))) || (unit == GIMP_UNIT_PERCENT), gettext (gimp_unit_defs[GIMP_UNIT_INCH].singular)); @@ -258,8 +258,8 @@ gchar * _gimp_unit_get_plural (Gimp *gimp, GimpUnit unit) { - g_return_val_if_fail ((unit >= GIMP_UNIT_PIXEL) && - (unit < (GIMP_UNIT_END + gimp->n_user_units)) || + g_return_val_if_fail (((unit >= GIMP_UNIT_PIXEL) && + (unit < (GIMP_UNIT_END + gimp->n_user_units))) || (unit == GIMP_UNIT_PERCENT), gettext (gimp_unit_defs[GIMP_UNIT_INCH].plural)); diff --git a/app/dialogs/info-dialog.h b/app/dialogs/info-dialog.h index 735dbc2b56de9702efaf5613fbc20eeec5adbecf..d69b172526d08741d82e5e34c5ab186d0bc2fa00 100644 --- a/app/dialogs/info-dialog.h +++ b/app/dialogs/info-dialog.h @@ -50,7 +50,7 @@ struct _InfoDialog GtkWidget *info_notebook; GSList *field_list; - gint nfields; + guint nfields; void *user_data; }; diff --git a/app/dialogs/resize-dialog.h b/app/dialogs/resize-dialog.h index 5442e08575f1fd192345b1604de5ef63a9d21c34..3ae00886069d2b723b289726522fac8b3cce2c90 100644 --- a/app/dialogs/resize-dialog.h +++ b/app/dialogs/resize-dialog.h @@ -42,8 +42,8 @@ struct _Resize ResizeType type; ResizeTarget target; - gint width; - gint height; + guint width; + guint height; gdouble resolution_x; gdouble resolution_y; diff --git a/app/display/gimpdisplay.c b/app/display/gimpdisplay.c index 7fe1d87bfda4550f5c8c3c7fdc8f2dbc03abf0a7..4b2c4740781a37d074823447c3bbedfa4e0a3a41 100644 --- a/app/display/gimpdisplay.c +++ b/app/display/gimpdisplay.c @@ -18,6 +18,7 @@ #include "config.h" +#include #include #include "display-types.h" diff --git a/app/display/gimpdisplay.h b/app/display/gimpdisplay.h index ad368b8f8833dac64cccfb1e02b80166c9b05ae9..a401cf0a5f4526af3a78c01a0343b2d9588f8b18 100644 --- a/app/display/gimpdisplay.h +++ b/app/display/gimpdisplay.h @@ -57,8 +57,8 @@ typedef struct _IdleRenderStruct IdleRenderStruct; struct _IdleRenderStruct { - gint width; - gint height; + guint width; + guint height; gint x; gint y; gint basex; @@ -94,9 +94,9 @@ struct _GimpDisplay GtkWidget *shell; /* shell widget for this gdisplay */ gint scale; /* scale factor from original raw image */ - gboolean dot_for_dot; /* is monitor resolution being ignored? */ - gboolean draw_guides; /* should the guides be drawn? */ - gboolean snap_to_guides; /* should the guides be snapped to? */ + guint dot_for_dot : 1; /* is monitor resolution being ignored? */ + guint draw_guides : 1; /* should the guides be drawn? */ + guint snap_to_guides : 1; /* should the guides be snapped to? */ GSList *update_areas; /* Update areas list */ diff --git a/app/display/gimpdisplayshell-draw.h b/app/display/gimpdisplayshell-draw.h index 3f66914eaf8e8f3db8c424ab904d8561ebbb75ff..12d4c5c6d9845e4b3cbe88d4ac7bde03485680c7 100644 --- a/app/display/gimpdisplayshell-draw.h +++ b/app/display/gimpdisplayshell-draw.h @@ -57,12 +57,12 @@ struct _GimpDisplayShell gint offset_x; /* offset of display image into raw image */ gint offset_y; - gint disp_width; /* width of drawing area */ - gint disp_height; /* height of drawing area */ + guint disp_width; /* width of drawing area */ + guint disp_height; /* height of drawing area */ gint disp_xoffset; gint disp_yoffset; - gboolean proximity; /* is a device in proximity */ + guint proximity : 1; /* is a device in proximity */ Selection *select; /* Selection object */ @@ -91,7 +91,7 @@ struct _GimpDisplayShell guchar *render_buf; /* buffer for rendering the image */ GdkGC *render_gc; /* GC for rendering the image */ - gint icon_size; /* size of the icon pixmap */ + guint icon_size; /* size of the icon pixmap */ guint icon_idle_id; /* ID of the idle-function */ GdkCursorType current_cursor; /* Currently installed main cursor */ @@ -99,10 +99,10 @@ struct _GimpDisplayShell GimpCursorModifier cursor_modifier; /* Cursor modifier (plus, minus, ...) */ GdkCursorType override_cursor; /* Overriding cursor */ - gboolean using_override_cursor; /* is the cursor overridden? */ + guint using_override_cursor : 1; /* is the cursor overridden? */ - gboolean draw_cursor; /* should we draw software cursor ? */ - gboolean have_cursor; /* is cursor currently drawn ? */ + guint draw_cursor : 1; /* should we draw software cursor ? */ + guint have_cursor : 1; /* is cursor currently drawn ? */ gint cursor_x; /* software cursor X value */ gint cursor_y; /* software cursor Y value */ diff --git a/app/display/gimpdisplayshell-selection.h b/app/display/gimpdisplayshell-selection.h index 838a65f9764a1bd1ee4a61b314f33ef556e26537..1bb8ac6e60abec28502e0c937f971270084747a4 100644 --- a/app/display/gimpdisplayshell-selection.h +++ b/app/display/gimpdisplayshell-selection.h @@ -42,10 +42,10 @@ struct _Selection gint index_layer; /* index of current stipple pattern */ gint state; /* internal drawing state */ gint paused; /* count of pause requests */ - gboolean recalc; /* flag to recalculate the selection */ - gint speed; /* speed of marching ants */ - gboolean hidden; /* is the selection hidden? */ - gboolean layer_hidden; /* is the layer boundary hidden? */ + guint speed; /* speed of marching ants */ + guint recalc : 1; /* flag to recalculate the selection */ + guint hidden : 1; /* is the selection hidden? */ + guint layer_hidden : 1; /* is the layer boundary hidden? */ guint timeout_id; /* timer for successive draws */ gint cycle; /* color cycling turned on */ GdkPixmap *cycle_pix; /* cycling pixmap */ diff --git a/app/display/gimpdisplayshell.h b/app/display/gimpdisplayshell.h index 3f66914eaf8e8f3db8c424ab904d8561ebbb75ff..12d4c5c6d9845e4b3cbe88d4ac7bde03485680c7 100644 --- a/app/display/gimpdisplayshell.h +++ b/app/display/gimpdisplayshell.h @@ -57,12 +57,12 @@ struct _GimpDisplayShell gint offset_x; /* offset of display image into raw image */ gint offset_y; - gint disp_width; /* width of drawing area */ - gint disp_height; /* height of drawing area */ + guint disp_width; /* width of drawing area */ + guint disp_height; /* height of drawing area */ gint disp_xoffset; gint disp_yoffset; - gboolean proximity; /* is a device in proximity */ + guint proximity : 1; /* is a device in proximity */ Selection *select; /* Selection object */ @@ -91,7 +91,7 @@ struct _GimpDisplayShell guchar *render_buf; /* buffer for rendering the image */ GdkGC *render_gc; /* GC for rendering the image */ - gint icon_size; /* size of the icon pixmap */ + guint icon_size; /* size of the icon pixmap */ guint icon_idle_id; /* ID of the idle-function */ GdkCursorType current_cursor; /* Currently installed main cursor */ @@ -99,10 +99,10 @@ struct _GimpDisplayShell GimpCursorModifier cursor_modifier; /* Cursor modifier (plus, minus, ...) */ GdkCursorType override_cursor; /* Overriding cursor */ - gboolean using_override_cursor; /* is the cursor overridden? */ + guint using_override_cursor : 1; /* is the cursor overridden? */ - gboolean draw_cursor; /* should we draw software cursor ? */ - gboolean have_cursor; /* is cursor currently drawn ? */ + guint draw_cursor : 1; /* should we draw software cursor ? */ + guint have_cursor : 1; /* is cursor currently drawn ? */ gint cursor_x; /* software cursor X value */ gint cursor_y; /* software cursor Y value */ diff --git a/app/gimprc.c b/app/gimprc.c index 90592bd7016f16ebc37e1a743e6a60f41b2edef8..6e94de679fd21b23c0cf0437e0be8dc160f65658 100644 --- a/app/gimprc.c +++ b/app/gimprc.c @@ -195,48 +195,48 @@ static gchar * open_backup_file (gchar *filename, /* global gimprc variables */ GimpRc gimprc = { - /* marching_speed */ 300, /* 300 ms */ - /* last_opened_size */ 4, - /* gamma_val */ 1.0, - /* transparency_type */ 1, /* Mid-Tone Checks */ - /* perfectmouse */ FALSE, /* off (fast and sloppy) */ - /* transparency_size */ 1, /* Medium sized */ - /* min_colors */ 144, /* 6*6*4 */ - /* install_cmap */ FALSE, - /* cycled_marching_ants */ 0, - /* default_threshold */ 15, - /* resize_windows_on_zoom */ FALSE, - /* resize_windows_on_resize */ FALSE, - /* no_cursor_updating */ FALSE, - /* preview_size */ GIMP_PREVIEW_SIZE_SMALL, - /* nav_preview_size */ GIMP_PREVIEW_SIZE_HUGE, - /* show_rulers */ TRUE, - /* show_statusbar */ TRUE, - /* auto_save */ TRUE, - /* confirm_on_close */ TRUE, - /* default_dot_for_dot */ TRUE, - /* save_session_info */ TRUE, - /* save_device_status */ FALSE, - /* always_restore_session */ TRUE, - /* show_tips */ TRUE, - /* last_tip */ -1, - /* show_tool_tips */ TRUE, - /* monitor_xres */ 72.0, - /* monitor_yres */ 72.0, - /* using_xserver_resolution */ FALSE, - /* image_title_format */ NULL, - /* global_paint_options */ FALSE, - /* show_indicators */ TRUE, - /* max_new_image_size */ 33554432, /* 32 MB */ - /* trust_dirty_flag */ FALSE, - /* use_help */ TRUE, - /* nav_window_per_display */ FALSE, - /* info_window_follows_mouse */ TRUE, - /* help_browser */ HELP_BROWSER_GIMP, - /* cursor_mode */ CURSOR_MODE_TOOL_ICON, - /* disable_tearoff_menus */ FALSE, - /* theme_path */ NULL, - /* theme */ NULL + marching_speed : 300, /* 300 ms */ + last_opened_size : 4, + gamma_val : 1.0, + transparency_type : 1, /* Mid-Tone Checks */ + perfectmouse : FALSE, /* off (fast and sloppy) */ + transparency_size : 1, /* Medium sized */ + min_colors : 144, /* 6*6*4 */ + install_cmap : FALSE, + cycled_marching_ants : 0, + default_threshold : 15, + resize_windows_on_zoom : FALSE, + resize_windows_on_resize : FALSE, + no_cursor_updating : FALSE, + preview_size : GIMP_PREVIEW_SIZE_SMALL, + nav_preview_size : GIMP_PREVIEW_SIZE_HUGE, + show_rulers : TRUE, + show_statusbar : TRUE, + auto_save : TRUE, + confirm_on_close : TRUE, + default_dot_for_dot : TRUE, + save_session_info : TRUE, + save_device_status : FALSE, + always_restore_session : TRUE, + show_tips : TRUE, + last_tip : -1, + show_tool_tips : TRUE, + monitor_xres : 72.0, + monitor_yres : 72.0, + using_xserver_resolution : FALSE, + image_title_format : NULL, + global_paint_options : FALSE, + show_indicators : TRUE, + max_new_image_size : 33554432, /* 32 MB */ + trust_dirty_flag : FALSE, + use_help : TRUE, + nav_window_per_display : FALSE, + info_window_follows_mouse : TRUE, + help_browser : HELP_BROWSER_GIMP, + cursor_mode : CURSOR_MODE_TOOL_ICON, + disable_tearoff_menus : FALSE, + theme_path : NULL, + theme : NULL }; static GHashTable *parse_func_hash = NULL; diff --git a/app/gimprc.h b/app/gimprc.h index 85abacea5a78b6dcc7f6c15499ee77f1225d8453..9d44e24436568c1954acbb7010d8777414caa00c 100644 --- a/app/gimprc.h +++ b/app/gimprc.h @@ -25,21 +25,21 @@ typedef struct _GimpRc GimpRc; /* global gimprc variables - need some comments on this stuff */ struct _GimpRc { - gint marching_speed; - gint last_opened_size; + guint marching_speed; + guint last_opened_size; gdouble gamma_val; - gint transparency_type; + guint transparency_type; gboolean perfectmouse; - gint transparency_size; - gint min_colors; + guint transparency_size; + guint min_colors; gboolean install_cmap; gboolean cycled_marching_ants; - gint default_threshold; + guint default_threshold; gboolean resize_windows_on_zoom; gboolean resize_windows_on_resize; gboolean no_cursor_updating; - gint preview_size; - gint nav_preview_size; + guint preview_size; + guint nav_preview_size; gboolean show_rulers; gboolean show_statusbar; gboolean auto_save; diff --git a/app/gui/brush-select.h b/app/gui/brush-select.h index a9765ba8166e65c179a16c65fa1afd867eb024c7..8f7cc7686044c7862b9340d8d562dc3da2fa21a1 100644 --- a/app/gui/brush-select.h +++ b/app/gui/brush-select.h @@ -37,7 +37,7 @@ struct _BrushSelect /* Context to store the current brush & paint options */ GimpContext *context; - gint spacing_value; + guint spacing_value; }; diff --git a/app/gui/gradient-editor.h b/app/gui/gradient-editor.h index abfb2aea90c3b478a2d6cf357ae872ecb54e1f42..9fdba71bf3711fc7df8d46b35a4a6627d1a2118f 100644 --- a/app/gui/gradient-editor.h +++ b/app/gui/gradient-editor.h @@ -61,12 +61,12 @@ struct _GradientEditor GtkObject *scroll_data; /* Instant update */ - gboolean instant_update; + guint instant_update : 1; /* Gradient preview */ guchar *preview_rows[2]; /* For caching redraw info */ gint preview_last_x; - gboolean preview_button_down; + guint preview_button_down : 1; /* Gradient control */ GdkPixmap *control_pixmap; @@ -75,7 +75,7 @@ struct _GradientEditor GimpGradientSegment *control_sel_r; /* Right segment of selection */ GradientEditorDragMode control_drag_mode; /* What is being dragged? */ guint32 control_click_time; /* Time when mouse was pressed */ - gboolean control_compress; /* Compressing/expanding handles */ + guint control_compress : 1; /* Compressing/expanding handles */ gint control_last_x; /* Last mouse position when dragging */ gdouble control_last_gx; /* Last position (wrt gradient) when dragging */ gdouble control_orig_pos; /* Original click position when dragging */ @@ -91,10 +91,10 @@ struct _GradientEditor /* Color dialogs */ GimpGradientSegment *left_saved_segments; - gboolean left_saved_dirty; - GimpGradientSegment *right_saved_segments; - gboolean right_saved_dirty; + + guint left_saved_dirty : 1; + guint right_saved_dirty : 1; }; diff --git a/app/gui/gradient-select.h b/app/gui/gradient-select.h index 34da20e5a5d0894c4d44af67314421d892e694ff..3b7bfc90192a84aa170b9068cb1964559770c899 100644 --- a/app/gui/gradient-select.h +++ b/app/gui/gradient-select.h @@ -30,7 +30,7 @@ struct _GradientSelect GimpContext *context; gchar *callback_name; - gint sample_size; + guint sample_size; }; diff --git a/app/gui/info-dialog.h b/app/gui/info-dialog.h index 735dbc2b56de9702efaf5613fbc20eeec5adbecf..d69b172526d08741d82e5e34c5ab186d0bc2fa00 100644 --- a/app/gui/info-dialog.h +++ b/app/gui/info-dialog.h @@ -50,7 +50,7 @@ struct _InfoDialog GtkWidget *info_notebook; GSList *field_list; - gint nfields; + guint nfields; void *user_data; }; diff --git a/app/gui/resize-dialog.h b/app/gui/resize-dialog.h index 5442e08575f1fd192345b1604de5ef63a9d21c34..3ae00886069d2b723b289726522fac8b3cce2c90 100644 --- a/app/gui/resize-dialog.h +++ b/app/gui/resize-dialog.h @@ -42,8 +42,8 @@ struct _Resize ResizeType type; ResizeTarget target; - gint width; - gint height; + guint width; + guint height; gdouble resolution_x; gdouble resolution_y; diff --git a/app/paint-funcs/paint-funcs-generic.h b/app/paint-funcs/paint-funcs-generic.h index a0924ab307e2e7aea280aa18a33a9d880f0e6352..271179ce88bbcf255bcdddff9615b2ead96c02fc 100644 --- a/app/paint-funcs/paint-funcs-generic.h +++ b/app/paint-funcs/paint-funcs-generic.h @@ -47,7 +47,7 @@ * to change if we support bigger formats. We'll do it so for now because * masking is always cheaper than passing parameters over the stack. */ /* FIXME: Move to a global place */ -#define HAS_ALPHA(bytes) (~##bytes & 1) +#define HAS_ALPHA(bytes) (~bytes & 1) /* FIXME: Move to a more global place */ struct apply_layer_mode_struct diff --git a/app/paint/gimpdodgeburn.c b/app/paint/gimpdodgeburn.c index 6aad2f85186cdf03e8edb12416f681a3d9221e27..f54b4aed1969843dbee6b625de505a883fb20ebf 100644 --- a/app/paint/gimpdodgeburn.c +++ b/app/paint/gimpdodgeburn.c @@ -106,16 +106,16 @@ static void gimp_dodgeburn_tool_motion (GimpPaintTool *paint_t GimpLut *lut); static gfloat gimp_dodgeburn_tool_highlights_lut_func (gpointer user_data, - gint nchannels, - gint channel, + guint nchannels, + guint channel, gfloat value); static gfloat gimp_dodgeburn_tool_midtones_lut_func (gpointer user_data, - gint nchannels, - gint channel, + guint nchannels, + guint channel, gfloat value); static gfloat gimp_dodgeburn_tool_shadows_lut_func (gpointer user_data, - gint nchannels, - gint channel, + guint nchannels, + guint channel, gfloat value); static GimpToolOptions * gimp_dodgeburn_tool_options_new (GimpToolInfo *tool_info); @@ -459,8 +459,8 @@ gimp_dodgeburn_tool_motion (GimpPaintTool *paint_tool, static gfloat gimp_dodgeburn_tool_highlights_lut_func (gpointer user_data, - gint nchannels, - gint channel, + guint nchannels, + guint channel, gfloat value) { gfloat *exposure_ptr = (gfloat *) user_data; @@ -476,8 +476,8 @@ gimp_dodgeburn_tool_highlights_lut_func (gpointer user_data, static gfloat gimp_dodgeburn_tool_midtones_lut_func (gpointer user_data, - gint nchannels, - gint channel, + guint nchannels, + guint channel, gfloat value) { gfloat *exposure_ptr = (gfloat *) user_data; @@ -498,8 +498,8 @@ gimp_dodgeburn_tool_midtones_lut_func (gpointer user_data, static gfloat gimp_dodgeburn_tool_shadows_lut_func (gpointer user_data, - gint nchannels, - gint channel, + guint nchannels, + guint channel, gfloat value) { gfloat *exposure_ptr = (gfloat *) user_data; diff --git a/app/paint/gimpink-blob.h b/app/paint/gimpink-blob.h index 5d49fe0b901c3fd13a6c88c6645072685ba00d36..2806a8a5f16a6fabd22cfdd8b452511564636536 100644 --- a/app/paint/gimpink-blob.h +++ b/app/paint/gimpink-blob.h @@ -45,7 +45,7 @@ struct _BlobSpan struct _Blob { gint y; - gint height; + guint height; BlobSpan data[1]; }; diff --git a/app/paint/gimpink.h b/app/paint/gimpink.h index dc58a0f38af67ae16953b50983652dd9b29475cb..b08e7849c83d1ef9f6946c4141e23e5409b054f0 100644 --- a/app/paint/gimpink.h +++ b/app/paint/gimpink.h @@ -59,7 +59,7 @@ struct _GimpInkTool gdouble last_time; /* previous time of a motion event */ gdouble lastx, lasty; /* previous position of a motion event */ - gboolean init_velocity; + guint init_velocity : 1; }; struct _GimpInkToolClass diff --git a/app/paint/gimppaintcore.h b/app/paint/gimppaintcore.h index 298eb0671f53a5b25706e01efa8076c6ba7841d0..0135a72041899c5b169c9b87e66dfe5ead5a5559 100644 --- a/app/paint/gimppaintcore.h +++ b/app/paint/gimppaintcore.h @@ -80,8 +80,8 @@ struct _GimpPaintTool GimpBrush * brush; /* current brush */ - gboolean pick_colors; /* pick color if ctrl or alt is pressed */ - gboolean pick_state; /* was ctrl or alt pressed when clicked? */ + guint pick_colors : 1; /* pick color if ctrl or alt is pressed */ + guint pick_state : 1; /* was ctrl or alt pressed when clicked? */ ToolFlags flags; /* tool flags, see ToolFlags above */ guint context_id; /* for the statusbar */ diff --git a/app/pathP.h b/app/pathP.h index a575b9f277f8bcb1780023dcb93741ada72a8839..f97e97d973f2d861f71f783369513d3190550831 100644 --- a/app/pathP.h +++ b/app/pathP.h @@ -30,7 +30,7 @@ struct _Path { GSList *path_details; gint pathtype; /* Only beziers to start with */ - gboolean closed; + guint closed : 1; guint32 state; guint32 locked; /* Only bottom bit used */ GimpTattoo tattoo; /* The tattoo for the path */ diff --git a/app/tools/gimpbezierselecttool.h b/app/tools/gimpbezierselecttool.h index dfb5f90aa2bdb5c475affdadd618cfc1afb75042..6efe99282c398c31a07be45dc90c7516b1501018 100644 --- a/app/tools/gimpbezierselecttool.h +++ b/app/tools/gimpbezierselecttool.h @@ -63,9 +63,8 @@ struct _GimpBezierSelectPoint GimpBezierSelectPoint *prev; /* prev point on curve */ GimpBezierSelectPoint *next_curve; /* Next curve segment */ - gint pointflags; /* Status of point 0 = not selected - * 1 = selected - */ + guint pointflags : 1; /* Status of point 0 = not selected + * 1 = selected */ }; struct _GimpBezierSelectTool @@ -81,7 +80,7 @@ struct _GimpBezierSelectTool GimpBezierSelectPoint *cur_control; /* the current active control point */ GimpBezierSelectPoint *last_point; /* the last point on the curve */ - gint num_points; /* number of points in the curve */ + guint num_points; /* number of points in the curve */ GimpChannel *mask; /* null if the curve is open */ GSList **scanlines; /* used in converting a curve */ }; @@ -99,7 +98,7 @@ typedef void (* GimpBezierSelectPointsFunc) (GimpBezierSelectTool *bezier_sel, typedef struct { - gint count; + guint count; } CountCurves; diff --git a/app/tools/gimpbrushtool.h b/app/tools/gimpbrushtool.h index 298eb0671f53a5b25706e01efa8076c6ba7841d0..0135a72041899c5b169c9b87e66dfe5ead5a5559 100644 --- a/app/tools/gimpbrushtool.h +++ b/app/tools/gimpbrushtool.h @@ -80,8 +80,8 @@ struct _GimpPaintTool GimpBrush * brush; /* current brush */ - gboolean pick_colors; /* pick color if ctrl or alt is pressed */ - gboolean pick_state; /* was ctrl or alt pressed when clicked? */ + guint pick_colors : 1; /* pick color if ctrl or alt is pressed */ + guint pick_state : 1; /* was ctrl or alt pressed when clicked? */ ToolFlags flags; /* tool flags, see ToolFlags above */ guint context_id; /* for the statusbar */ diff --git a/app/tools/gimpcolorbalancetool.h b/app/tools/gimpcolorbalancetool.h index bb1a6dc2d6aa7566499f95671da2c782e3c8aef6..f75d3819b603bb8af57454499072486f189083e5 100644 --- a/app/tools/gimpcolorbalancetool.h +++ b/app/tools/gimpcolorbalancetool.h @@ -67,8 +67,8 @@ struct _ColorBalanceDialog guchar g_lookup[256]; guchar b_lookup[256]; - gboolean preserve_luminosity; - gboolean preview; + guint preserve_luminosity : 1; + guint preview : 1; GimpTransferMode application_mode; }; diff --git a/app/tools/gimpcolorpickertool.h b/app/tools/gimpcolorpickertool.h index ef39879848d219d1fd9a627a49f8d09998f5d741..a261ca26fc99d3ed25abe9f17a47b8dbe2e1c166 100644 --- a/app/tools/gimpcolorpickertool.h +++ b/app/tools/gimpcolorpickertool.h @@ -40,7 +40,6 @@ struct _GimpColorPickerTool gint centerx; /* starting x coord */ gint centery; /* starting y coord */ - }; struct _GimpColorPickerToolClass diff --git a/app/tools/gimpcurvestool.h b/app/tools/gimpcurvestool.h index 2a8d6f42a820255d320400198ffd5ed000eea870..869aa1fc6e845a9d17f09838af5a3d8787a2c626 100644 --- a/app/tools/gimpcurvestool.h +++ b/app/tools/gimpcurvestool.h @@ -70,7 +70,7 @@ struct _CurvesDialog gint color; gint channel; - gboolean preview; + guint preview : 1; gint grab_point; gint last; diff --git a/app/tools/gimpdodgeburntool.c b/app/tools/gimpdodgeburntool.c index 6aad2f85186cdf03e8edb12416f681a3d9221e27..f54b4aed1969843dbee6b625de505a883fb20ebf 100644 --- a/app/tools/gimpdodgeburntool.c +++ b/app/tools/gimpdodgeburntool.c @@ -106,16 +106,16 @@ static void gimp_dodgeburn_tool_motion (GimpPaintTool *paint_t GimpLut *lut); static gfloat gimp_dodgeburn_tool_highlights_lut_func (gpointer user_data, - gint nchannels, - gint channel, + guint nchannels, + guint channel, gfloat value); static gfloat gimp_dodgeburn_tool_midtones_lut_func (gpointer user_data, - gint nchannels, - gint channel, + guint nchannels, + guint channel, gfloat value); static gfloat gimp_dodgeburn_tool_shadows_lut_func (gpointer user_data, - gint nchannels, - gint channel, + guint nchannels, + guint channel, gfloat value); static GimpToolOptions * gimp_dodgeburn_tool_options_new (GimpToolInfo *tool_info); @@ -459,8 +459,8 @@ gimp_dodgeburn_tool_motion (GimpPaintTool *paint_tool, static gfloat gimp_dodgeburn_tool_highlights_lut_func (gpointer user_data, - gint nchannels, - gint channel, + guint nchannels, + guint channel, gfloat value) { gfloat *exposure_ptr = (gfloat *) user_data; @@ -476,8 +476,8 @@ gimp_dodgeburn_tool_highlights_lut_func (gpointer user_data, static gfloat gimp_dodgeburn_tool_midtones_lut_func (gpointer user_data, - gint nchannels, - gint channel, + guint nchannels, + guint channel, gfloat value) { gfloat *exposure_ptr = (gfloat *) user_data; @@ -498,8 +498,8 @@ gimp_dodgeburn_tool_midtones_lut_func (gpointer user_data, static gfloat gimp_dodgeburn_tool_shadows_lut_func (gpointer user_data, - gint nchannels, - gint channel, + guint nchannels, + guint channel, gfloat value) { gfloat *exposure_ptr = (gfloat *) user_data; diff --git a/app/tools/gimpfreeselecttool.h b/app/tools/gimpfreeselecttool.h index aea32159a53ed41d456e2d590e2ca6b95fed79de..a4c13ad560c3f751c514cdab29cc757ea906c740 100644 --- a/app/tools/gimpfreeselecttool.h +++ b/app/tools/gimpfreeselecttool.h @@ -39,8 +39,8 @@ struct _GimpFreeSelectTool GimpSelectionTool parent_instance; GimpVector2 *points; - gint num_points; - gint max_segs; + guint num_points; + guint max_segs; }; struct _GimpFreeSelectToolClass diff --git a/app/tools/gimpfuzzyselecttool.h b/app/tools/gimpfuzzyselecttool.h index 78d14c326b52cf7eb930ba4c638ddb0a62ec8fea..7236d74f602d2edb1e6854b2428446053f93de1b 100644 --- a/app/tools/gimpfuzzyselecttool.h +++ b/app/tools/gimpfuzzyselecttool.h @@ -38,12 +38,12 @@ struct _GimpFuzzySelectTool { GimpSelectionTool parent_instance; - gint x, y; /* Point from which to execute seed fill */ - gint first_x; /* */ - gint first_y; /* variables to keep track of sensitivity */ - gdouble first_threshold; /* initial value of threshold slider */ + gint x, y; /* Point from which to execute seed fill */ + gint first_x; /* */ + gint first_y; /* variables to keep track of sensitivity */ + gdouble first_threshold; /* initial value of threshold slider */ - GimpChannel *fuzzy_mask; + GimpChannel *fuzzy_mask; }; struct _GimpFuzzySelectToolClass diff --git a/app/tools/gimphuesaturationtool.h b/app/tools/gimphuesaturationtool.h index f4fb537a8c0dbe385a78edad8fc4167aae018da2..17c5eac399d82d64e9debf09bdabd59b98270a20 100644 --- a/app/tools/gimphuesaturationtool.h +++ b/app/tools/gimphuesaturationtool.h @@ -77,7 +77,7 @@ struct _HueSaturationDialog gdouble saturation[7]; HueRange hue_partition; - gboolean preview; + guint preview : 1; }; diff --git a/app/tools/gimpinktool-blob.h b/app/tools/gimpinktool-blob.h index 5d49fe0b901c3fd13a6c88c6645072685ba00d36..2806a8a5f16a6fabd22cfdd8b452511564636536 100644 --- a/app/tools/gimpinktool-blob.h +++ b/app/tools/gimpinktool-blob.h @@ -45,7 +45,7 @@ struct _BlobSpan struct _Blob { gint y; - gint height; + guint height; BlobSpan data[1]; }; diff --git a/app/tools/gimpinktool.h b/app/tools/gimpinktool.h index dc58a0f38af67ae16953b50983652dd9b29475cb..b08e7849c83d1ef9f6946c4141e23e5409b054f0 100644 --- a/app/tools/gimpinktool.h +++ b/app/tools/gimpinktool.h @@ -59,7 +59,7 @@ struct _GimpInkTool gdouble last_time; /* previous time of a motion event */ gdouble lastx, lasty; /* previous position of a motion event */ - gboolean init_velocity; + guint init_velocity : 1; }; struct _GimpInkToolClass diff --git a/app/tools/gimpiscissorstool.h b/app/tools/gimpiscissorstool.h index e7095e3a8ea1e5d6fb34ae22a53196f12fab962e..89ebe8c094e4b43296e1fbb8daa91baff978625e 100644 --- a/app/tools/gimpiscissorstool.h +++ b/app/tools/gimpiscissorstool.h @@ -77,8 +77,8 @@ struct _GimpIscissorsTool GSList *curves; /* the list of curves */ - gboolean first_point; /* is this the first point? */ - gboolean connected; /* is the region closed? */ + guint first_point : 1; /* is this the first point? */ + guint connected : 1; /* is the region closed? */ Iscissors_state state; /* state of iscissors */ Iscissors_draw draw; /* items to draw on a draw request */ diff --git a/app/tools/gimpmagnifytool.h b/app/tools/gimpmagnifytool.h index 2d2e48bbdfa4a79cb23e6077cf5f39c361e94eeb..76e484e2ea0bca2cd7721188eff2d0f80b1eb448 100644 --- a/app/tools/gimpmagnifytool.h +++ b/app/tools/gimpmagnifytool.h @@ -39,7 +39,7 @@ struct _GimpMagnifyTool GimpDrawTool parent_instance; gint x, y; /* upper left hand coordinate */ - gint w, h; /* width and height */ + guint w, h; /* width and height */ GimpZoomType op; /* magnify operation */ }; diff --git a/app/tools/gimpmeasuretool.h b/app/tools/gimpmeasuretool.h index a80b196253361552eb9cd99e4dbb5155b24e3760..d6d760c5be8cea94ffe3b9cc68c8ac47aaee10b6 100644 --- a/app/tools/gimpmeasuretool.h +++ b/app/tools/gimpmeasuretool.h @@ -54,7 +54,7 @@ struct _GimpMeasureTool gint last_x; /* last x coordinate */ gint last_y; /* last y coordinate */ gint point; /* what are we manipulating? */ - gint num_points; /* how many points? */ + guint num_points; /* how many points? */ gint x[3]; /* three x coordinates */ gint y[3]; /* three y coordinates */ gdouble angle1; /* first angle */ diff --git a/app/tools/gimppainttool.h b/app/tools/gimppainttool.h index 298eb0671f53a5b25706e01efa8076c6ba7841d0..0135a72041899c5b169c9b87e66dfe5ead5a5559 100644 --- a/app/tools/gimppainttool.h +++ b/app/tools/gimppainttool.h @@ -80,8 +80,8 @@ struct _GimpPaintTool GimpBrush * brush; /* current brush */ - gboolean pick_colors; /* pick color if ctrl or alt is pressed */ - gboolean pick_state; /* was ctrl or alt pressed when clicked? */ + guint pick_colors : 1; /* pick color if ctrl or alt is pressed */ + guint pick_state : 1; /* was ctrl or alt pressed when clicked? */ ToolFlags flags; /* tool flags, see ToolFlags above */ guint context_id; /* for the statusbar */ diff --git a/app/tools/gimppathtool.h b/app/tools/gimppathtool.h index 3045df85d4f1dc9e7d2abd44b8d49c13c1b2cc10..1858d7285c5b440927f2575743937a856db69e17 100644 --- a/app/tools/gimppathtool.h +++ b/app/tools/gimppathtool.h @@ -50,7 +50,7 @@ struct _GimpPathTool gdouble click_position; /* The position on the segment */ gint click_handle_id; /* The handle ID of the segment */ - gint active_count; /* How many segments are active? */ + guint active_count; /* How many segments are active? */ /* * WARNING: single_active_segment may contain non NULL Values * which point to the nirvana. But they are important! diff --git a/app/tools/gimprectselecttool.h b/app/tools/gimprectselecttool.h index 747715efa477ada46315ab78cb8b8a051ad751eb..82388ebf2afd42ab6c85888acfb4a85c6ddf9ad7 100644 --- a/app/tools/gimprectselecttool.h +++ b/app/tools/gimprectselecttool.h @@ -39,7 +39,7 @@ struct _GimpRectSelectTool GimpSelectionTool parent_instance; gint x, y; /* upper left hand coordinate */ - gint w, h; /* width and height */ + guint w, h; /* width and height */ gint center; /* is the selection being created from the * center out? */ diff --git a/app/tools/gimpregionselecttool.h b/app/tools/gimpregionselecttool.h index 78d14c326b52cf7eb930ba4c638ddb0a62ec8fea..7236d74f602d2edb1e6854b2428446053f93de1b 100644 --- a/app/tools/gimpregionselecttool.h +++ b/app/tools/gimpregionselecttool.h @@ -38,12 +38,12 @@ struct _GimpFuzzySelectTool { GimpSelectionTool parent_instance; - gint x, y; /* Point from which to execute seed fill */ - gint first_x; /* */ - gint first_y; /* variables to keep track of sensitivity */ - gdouble first_threshold; /* initial value of threshold slider */ + gint x, y; /* Point from which to execute seed fill */ + gint first_x; /* */ + gint first_y; /* variables to keep track of sensitivity */ + gdouble first_threshold; /* initial value of threshold slider */ - GimpChannel *fuzzy_mask; + GimpChannel *fuzzy_mask; }; struct _GimpFuzzySelectToolClass diff --git a/app/tools/gimpthresholdtool.h b/app/tools/gimpthresholdtool.h index 2622e2e5c002b581aaa299c59bf037798c9a82c7..8b6f5e9cebdee8c2e1fdc149734f9458bead2973 100644 --- a/app/tools/gimpthresholdtool.h +++ b/app/tools/gimpthresholdtool.h @@ -57,14 +57,14 @@ struct _ThresholdDialog GimpHistogramView *histogram; GimpHistogram *hist; - GimpDrawable *drawable; - ImageMap *image_map; + GimpDrawable *drawable; + ImageMap *image_map; - gint color; - gint low_threshold; - gint high_threshold; + gint color; + gint low_threshold; + gint high_threshold; - gboolean preview; + guint preview : 1; }; diff --git a/app/tools/gimptool.h b/app/tools/gimptool.h index aa26637d34d4f628691935e7973f0e2047f0b8d0..e78fda531766a0898eb14cffd010dbb42f319a68 100644 --- a/app/tools/gimptool.h +++ b/app/tools/gimptool.h @@ -49,14 +49,16 @@ struct _GimpTool ToolState state; /* state of tool activity */ gint paused_count; /* paused control count */ - gboolean scroll_lock; /* allow scrolling or not */ - gboolean auto_snap_to; /* snap to guides automatically */ + guint scroll_lock : 1; /* allow scrolling or not */ + guint auto_snap_to : 1; /* snap to guides automatically */ - gboolean handle_empty_image; /* invoke the tool on images without - * active drawable - */ + guint handle_empty_image : 1; /* invoke the tool on images without + * active drawable */ - gboolean preserve; /* Preserve this tool across drawable changes */ + guint preserve : 1; /* Preserve this tool across drawable changes */ + guint toggled : 1; /* Bad hack to let the paint_core show the + * right toggle cursors + */ GimpDisplay *gdisp; /* pointer to currently active gdisp */ GimpDrawable *drawable; /* pointer to the tool's current drawable */ @@ -66,10 +68,6 @@ struct _GimpTool * functions are properly * virtualized */ - - gboolean toggled; /* Bad hack to let the paint_core show the - * right toggle cursors - */ }; struct _GimpToolClass diff --git a/app/tools/gimptransformtool.h b/app/tools/gimptransformtool.h index 51c166ae63baed47c9826421ea59b64b27f98da1..756f4653321999ae109e11304bdaafffcc9285e7 100644 --- a/app/tools/gimptransformtool.h +++ b/app/tools/gimptransformtool.h @@ -79,8 +79,8 @@ struct _GimpTransformTool TransformAction function; /* current tool activity */ - gboolean use_grid; /* does the tool use the grid */ - gboolean use_center; /* use the center handle */ + guint use_grid : 1; /* does the tool use the grid */ + guint use_center : 1; /* use the center handle */ gint ngx, ngy; /* number of grid lines in original * x and y directions diff --git a/app/tools/path_toolP.h b/app/tools/path_toolP.h index e48e70b040a5a0693d190052f4ca451c52371563..3e4b572e0203434dd0d845bfe2190828acfbf74f 100644 --- a/app/tools/path_toolP.h +++ b/app/tools/path_toolP.h @@ -59,7 +59,6 @@ struct _path_segment PathCurve *parent; /* the parent Curve */ PathSegment *next; /* Next Segment or NULL */ PathSegment *prev; /* Previous Segment or NULL */ - }; diff --git a/app/widgets/gimpbrushfactoryview.h b/app/widgets/gimpbrushfactoryview.h index 3c60f53bf534dc312b909d62fc48b824f87fadb8..d906c58224e66405c03055565961a7e615d6ce03 100644 --- a/app/widgets/gimpbrushfactoryview.h +++ b/app/widgets/gimpbrushfactoryview.h @@ -42,7 +42,7 @@ struct _GimpBrushFactoryView GtkWidget *spacing_scale; GtkAdjustment *spacing_adjustment; - gboolean change_brush_spacing; + guint change_brush_spacing : 1; GQuark spacing_changed_handler_id; }; diff --git a/app/widgets/gimpconstrainedhwrapbox.h b/app/widgets/gimpconstrainedhwrapbox.h index 97ed90125d35a2156738c6510b4c21d393caf37e..5d0e3fa7efd35e9deebbe4942570d26cfa61972f 100644 --- a/app/widgets/gimpconstrainedhwrapbox.h +++ b/app/widgets/gimpconstrainedhwrapbox.h @@ -41,8 +41,8 @@ struct _GimpConstrainedHWrapBox { GtkHWrapBox parent_instance; - gint rows; - gint columns; + guint rows; + guint columns; }; struct _GimpConstrainedHWrapBoxClass diff --git a/app/widgets/gimpcontainermenu.h b/app/widgets/gimpcontainermenu.h index 26e21bf599ec7c89643c69682617915f9ae60938..df6f3fed65d96c1e070aaef8fc54d7a96164afe2 100644 --- a/app/widgets/gimpcontainermenu.h +++ b/app/widgets/gimpcontainermenu.h @@ -49,7 +49,7 @@ struct _GimpContainerMenu GHashTable *hash_table; - gint preview_size; + guint preview_size; GimpItemGetNameFunc get_name_func; }; diff --git a/app/widgets/gimpcontainerview.h b/app/widgets/gimpcontainerview.h index 1751aca70718cad1c59b7c1f89d987b679780d3a..ad48a271e76b4b072bd8a17be8e4fb39ec309051 100644 --- a/app/widgets/gimpcontainerview.h +++ b/app/widgets/gimpcontainerview.h @@ -45,8 +45,8 @@ struct _GimpContainerView GHashTable *hash_table; - gint preview_size; - gboolean reorderable; + guint preview_size; + guint reorderable : 1; GimpItemGetNameFunc get_name_func; diff --git a/app/widgets/gimpdialogfactory.h b/app/widgets/gimpdialogfactory.h index cc0c603ede8a4bc6f3c19ce5a44badaa006497e4..c5d53f727d99e8364664d45e46c28f35192aab91 100644 --- a/app/widgets/gimpdialogfactory.h +++ b/app/widgets/gimpdialogfactory.h @@ -40,24 +40,24 @@ struct _GimpDialogFactoryEntry { gchar *identifier; GimpDialogNewFunc new_func; - gint preview_size; - gboolean singleton; - gboolean session_managed; - gboolean remember_size; - gboolean remember_if_open; + guint preview_size; + guint singleton : 1; + guint session_managed : 1; + guint remember_size : 1; + guint remember_if_open : 1; }; struct _GimpSessionInfo { gint x; gint y; - gint width; - gint height; + guint width; + guint height; GtkWidget *widget; /* only valid while restoring and saving the session */ - gboolean open; + guint open : 1; /* GList of gchar* of optional additional dialog specific info */ GList *aux_info; diff --git a/app/widgets/gimpgradienteditor.h b/app/widgets/gimpgradienteditor.h index abfb2aea90c3b478a2d6cf357ae872ecb54e1f42..9fdba71bf3711fc7df8d46b35a4a6627d1a2118f 100644 --- a/app/widgets/gimpgradienteditor.h +++ b/app/widgets/gimpgradienteditor.h @@ -61,12 +61,12 @@ struct _GradientEditor GtkObject *scroll_data; /* Instant update */ - gboolean instant_update; + guint instant_update : 1; /* Gradient preview */ guchar *preview_rows[2]; /* For caching redraw info */ gint preview_last_x; - gboolean preview_button_down; + guint preview_button_down : 1; /* Gradient control */ GdkPixmap *control_pixmap; @@ -75,7 +75,7 @@ struct _GradientEditor GimpGradientSegment *control_sel_r; /* Right segment of selection */ GradientEditorDragMode control_drag_mode; /* What is being dragged? */ guint32 control_click_time; /* Time when mouse was pressed */ - gboolean control_compress; /* Compressing/expanding handles */ + guint control_compress : 1; /* Compressing/expanding handles */ gint control_last_x; /* Last mouse position when dragging */ gdouble control_last_gx; /* Last position (wrt gradient) when dragging */ gdouble control_orig_pos; /* Original click position when dragging */ @@ -91,10 +91,10 @@ struct _GradientEditor /* Color dialogs */ GimpGradientSegment *left_saved_segments; - gboolean left_saved_dirty; - GimpGradientSegment *right_saved_segments; - gboolean right_saved_dirty; + + guint left_saved_dirty : 1; + guint right_saved_dirty : 1; }; diff --git a/app/widgets/gimpimagedock.h b/app/widgets/gimpimagedock.h index 6e7106ae999bf1a40bec14cc6006e96613eccedd..08c06390d90da04f28e7898bb01d56daaeddab20 100644 --- a/app/widgets/gimpimagedock.h +++ b/app/widgets/gimpimagedock.h @@ -42,7 +42,7 @@ struct _GimpImageDock GimpContainer *image_container; - gboolean show_image_menu; + guint show_image_menu : 1; gboolean auto_follow_active; GtkWidget *option_menu; diff --git a/app/widgets/gimplistitem.h b/app/widgets/gimplistitem.h index 61e89e8f6875a5f1d80996e5e763fc8260a55bd9..f624627c553776345c167cb95edf3b8df5b07522 100644 --- a/app/widgets/gimplistitem.h +++ b/app/widgets/gimplistitem.h @@ -45,10 +45,10 @@ struct _GimpListItem GtkWidget *name_label; /*< protected >*/ - gint preview_size; + guint preview_size; /*< private >*/ - gboolean reorderable; + guint reorderable : 1; GimpContainer *container; GimpDropType drop_type; GimpItemGetNameFunc get_name_func; diff --git a/app/widgets/gimpmenudock.h b/app/widgets/gimpmenudock.h index 6e7106ae999bf1a40bec14cc6006e96613eccedd..08c06390d90da04f28e7898bb01d56daaeddab20 100644 --- a/app/widgets/gimpmenudock.h +++ b/app/widgets/gimpmenudock.h @@ -42,7 +42,7 @@ struct _GimpImageDock GimpContainer *image_container; - gboolean show_image_menu; + guint show_image_menu : 1; gboolean auto_follow_active; GtkWidget *option_menu; diff --git a/app/widgets/gimpmenuitem.h b/app/widgets/gimpmenuitem.h index eb524578aa773bc907abca84ab8f1fb2a82851a8..f83c8c27a045e736f1df3be5c6c0fd6bf6c479b8 100644 --- a/app/widgets/gimpmenuitem.h +++ b/app/widgets/gimpmenuitem.h @@ -45,7 +45,7 @@ struct _GimpMenuItem GtkWidget *name_label; /*< protected >*/ - gint preview_size; + guint preview_size; /*< private >*/ GimpItemGetNameFunc get_name_func; diff --git a/app/widgets/gimpnavigationpreview.h b/app/widgets/gimpnavigationpreview.h index 1bf108294f164b2730111bba1278059179b5c86a..e762462418891a41b8faf161da45c9bf43ee54e1 100644 --- a/app/widgets/gimpnavigationpreview.h +++ b/app/widgets/gimpnavigationpreview.h @@ -42,18 +42,18 @@ struct _GimpNavigationPreview /* values in image coordinates */ gint x; gint y; - gint width; - gint height; + guint width; + guint height; /* values in preview coordinates */ gint p_x; gint p_y; - gint p_width; - gint p_height; + guint p_width; + guint p_height; gint motion_offset_x; gint motion_offset_y; - gboolean has_grab; + guint has_grab : 1; GdkGC *gc; }; diff --git a/app/widgets/gimpnavigationview.h b/app/widgets/gimpnavigationview.h index 1bf108294f164b2730111bba1278059179b5c86a..e762462418891a41b8faf161da45c9bf43ee54e1 100644 --- a/app/widgets/gimpnavigationview.h +++ b/app/widgets/gimpnavigationview.h @@ -42,18 +42,18 @@ struct _GimpNavigationPreview /* values in image coordinates */ gint x; gint y; - gint width; - gint height; + guint width; + guint height; /* values in preview coordinates */ gint p_x; gint p_y; - gint p_width; - gint p_height; + guint p_width; + guint p_height; gint motion_offset_x; gint motion_offset_y; - gboolean has_grab; + guint has_grab : 1; GdkGC *gc; }; diff --git a/app/widgets/gimppreview.h b/app/widgets/gimppreview.h index 6bf54734dfb62feab8116055c36141468db890d2..37416d11ecac188902f53947d29eecc565dd6691 100644 --- a/app/widgets/gimppreview.h +++ b/app/widgets/gimppreview.h @@ -41,20 +41,20 @@ struct _GimpPreview GimpViewable *viewable; + GimpRGB border_color; + gint width; gint height; gint border_width; - gboolean dot_for_dot; - - GimpRGB border_color; + guint dot_for_dot : 1; - gboolean is_popup; - gboolean clickable; - gboolean show_popup; + guint is_popup : 1; + guint clickable : 1; + guint show_popup : 1; /*< private >*/ - gint size; - gboolean in_button; + guint size; + guint in_button : 1; guint press_state; guint idle_id; guint popup_id; diff --git a/app/widgets/gimppreviewrenderer.h b/app/widgets/gimppreviewrenderer.h index 6bf54734dfb62feab8116055c36141468db890d2..37416d11ecac188902f53947d29eecc565dd6691 100644 --- a/app/widgets/gimppreviewrenderer.h +++ b/app/widgets/gimppreviewrenderer.h @@ -41,20 +41,20 @@ struct _GimpPreview GimpViewable *viewable; + GimpRGB border_color; + gint width; gint height; gint border_width; - gboolean dot_for_dot; - - GimpRGB border_color; + guint dot_for_dot : 1; - gboolean is_popup; - gboolean clickable; - gboolean show_popup; + guint is_popup : 1; + guint clickable : 1; + guint show_popup : 1; /*< private >*/ - gint size; - gboolean in_button; + guint size; + guint in_button : 1; guint press_state; guint idle_id; guint popup_id; diff --git a/app/widgets/gimpview.h b/app/widgets/gimpview.h index 6bf54734dfb62feab8116055c36141468db890d2..37416d11ecac188902f53947d29eecc565dd6691 100644 --- a/app/widgets/gimpview.h +++ b/app/widgets/gimpview.h @@ -41,20 +41,20 @@ struct _GimpPreview GimpViewable *viewable; + GimpRGB border_color; + gint width; gint height; gint border_width; - gboolean dot_for_dot; - - GimpRGB border_color; + guint dot_for_dot : 1; - gboolean is_popup; - gboolean clickable; - gboolean show_popup; + guint is_popup : 1; + guint clickable : 1; + guint show_popup : 1; /*< private >*/ - gint size; - gboolean in_button; + guint size; + guint in_button : 1; guint press_state; guint idle_id; guint popup_id; diff --git a/app/widgets/gimpviewrenderer.h b/app/widgets/gimpviewrenderer.h index 6bf54734dfb62feab8116055c36141468db890d2..37416d11ecac188902f53947d29eecc565dd6691 100644 --- a/app/widgets/gimpviewrenderer.h +++ b/app/widgets/gimpviewrenderer.h @@ -41,20 +41,20 @@ struct _GimpPreview GimpViewable *viewable; + GimpRGB border_color; + gint width; gint height; gint border_width; - gboolean dot_for_dot; - - GimpRGB border_color; + guint dot_for_dot : 1; - gboolean is_popup; - gboolean clickable; - gboolean show_popup; + guint is_popup : 1; + guint clickable : 1; + guint show_popup : 1; /*< private >*/ - gint size; - gboolean in_button; + guint size; + guint in_button : 1; guint press_state; guint idle_id; guint popup_id; diff --git a/libgimpmodule/gimpmodule.h b/libgimpmodule/gimpmodule.h index b617dde6ebabeaf246e80bf60a4feb502501b7ab..e88e6e26ef505368637c93b0a10d1ca714e764f6 100644 --- a/libgimpmodule/gimpmodule.h +++ b/libgimpmodule/gimpmodule.h @@ -54,8 +54,8 @@ struct _GimpModuleInfoObj gchar *fullpath; /* path to the module */ GimpModuleState state; /* what's happened to the module */ - gboolean on_disk; /* TRUE if file still exists */ - gboolean load_inhibit; /* user requests not to load at boot time */ + guint on_disk : 1; /* TRUE if file still exists */ + guint load_inhibit : 1; /* user requests not to load at boot time */ /* Count of times main gimp is within the module. Normally, this * will be 1, and we assume that the module won't call its @@ -64,7 +64,7 @@ struct _GimpModuleInfoObj * unload function, to stop the module attempting to unload * itself. */ - gint refs; + guint refs; /* stuff from now on may be NULL depending on the state the module is in */ GimpModuleInfo *info; /* returned values from module_init */ diff --git a/libgimpwidgets/gimpunitmenu.c b/libgimpwidgets/gimpunitmenu.c index 3346d881bcf4627645cfd09cbafd396a43c90ccc..4a357961f4937b34165ce049f23720db8701d2b6 100644 --- a/libgimpwidgets/gimpunitmenu.c +++ b/libgimpwidgets/gimpunitmenu.c @@ -176,9 +176,9 @@ gimp_unit_menu_new (const gchar *format, GtkWidget *menuitem; GimpUnit u; - g_return_val_if_fail ((unit >= GIMP_UNIT_PIXEL) && - (unit < gimp_unit_get_number_of_units ()) || - (unit == GIMP_UNIT_PERCENT), NULL); + g_return_val_if_fail (((unit >= GIMP_UNIT_PIXEL) && + (unit < gimp_unit_get_number_of_units ())) || + (unit == GIMP_UNIT_PERCENT), NULL); if ((unit >= gimp_unit_get_number_of_built_in_units ()) && (unit != GIMP_UNIT_PERCENT))