Commit 645f8535 authored by Sven Neumann's avatar Sven Neumann
Browse files

Indentation paranoia!


--Sven
parent 2518748a
Mon Jul 19 21:40:48 MEST 1999 Sven Neumann <sven@gimp.org>
* app/brush_select.c: update the brush title when editing a brush
* app/gimage.[ch]
* app/gimpimage.c
* app/ops_buttons.[ch]
* app/pixel_regions.c
* app/temp_buf.c
* app/undo.c: Indentation paranoia! (I was browsing the code a lot
this weekend and just couldn't resist...)
1999-07-19 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/gdisplay.c (gdisplay_set_menu_sensitivity): moved the _()
......
......@@ -68,12 +68,13 @@ static void pixel_region_configure (PixelRegionHolder *, PixelRegionIterator
/* Function definitions */
void
pixel_region_init (PR, tiles, x, y, w, h, dirty)
PixelRegion *PR;
TileManager *tiles;
int x, y;
int w, h;
int dirty;
pixel_region_init (PixelRegion *PR,
TileManager *tiles,
int x,
int y,
int w,
int h,
int dirty)
{
PR->tiles = tiles;
PR->curtile = NULL;
......@@ -89,10 +90,11 @@ pixel_region_init (PR, tiles, x, y, w, h, dirty)
void
pixel_region_resize (PR, x, y, w, h)
PixelRegion *PR;
int x, y;
int w, h;
pixel_region_resize (PixelRegion *PR,
int x,
int y,
int w,
int h)
{
/* If the data is non-null, data is contiguous--need to advance */
if (PR->data != NULL)
......@@ -107,15 +109,14 @@ pixel_region_resize (PR, x, y, w, h)
PR->h = h;
}
/* request that tiles within a region be fetched asynchronously
*/
/* request that tiles within a region be fetched asynchronously */
void
pixel_region_get_async (PR, ulx, uly, lrx, lry)
PixelRegion *PR;
int ulx;
int uly;
int lrx;
int lry;
pixel_region_get_async (PixelRegion *PR,
int ulx,
int uly,
int lrx,
int lry)
{
int x, y;
......@@ -124,13 +125,14 @@ pixel_region_get_async (PR, ulx, uly, lrx, lry)
tile_manager_get_async (PR->tiles, x, y);
}
void
pixel_region_get_row (PR, x, y, w, data, subsample)
PixelRegion *PR;
int x, y;
int w;
unsigned char *data;
int subsample;
pixel_region_get_row (PixelRegion *PR,
int x,
int y,
int w,
unsigned char *data,
int subsample)
{
Tile *tile;
unsigned char *tile_data;
......@@ -176,11 +178,11 @@ pixel_region_get_row (PR, x, y, w, data, subsample)
void
pixel_region_set_row (PR, x, y, w, data)
PixelRegion *PR;
int x, y;
int w;
unsigned char *data;
pixel_region_set_row (PixelRegion *PR,
int x,
int y,
int w,
unsigned char *data)
{
Tile *tile;
unsigned char *tile_data;
......@@ -212,12 +214,12 @@ pixel_region_set_row (PR, x, y, w, data)
void
pixel_region_get_col (PR, x, y, h, data, subsample)
PixelRegion *PR;
int x, y;
int h;
unsigned char *data;
int subsample;
pixel_region_get_col (PixelRegion *PR,
int x,
int y,
int h,
unsigned char *data,
int subsample)
{
Tile *tile;
unsigned char *tile_data;
......@@ -253,11 +255,11 @@ pixel_region_get_col (PR, x, y, h, data, subsample)
void
pixel_region_set_col (PR, x, y, h, data)
PixelRegion *PR;
int x, y;
int h;
unsigned char *data;
pixel_region_set_col (PixelRegion *PR,
int x,
int y,
int h,
unsigned char *data)
{
Tile *tile;
unsigned char *tile_data;
......@@ -292,7 +294,8 @@ pixel_region_set_col (PR, x, y, h, data)
}
void *
pixel_regions_register (int num_regions, ...)
pixel_regions_register (int num_regions,
...)
{
PixelRegion *PR;
PixelRegionHolder *PRH;
......@@ -345,8 +348,7 @@ pixel_regions_register (int num_regions, ...)
void *
pixel_regions_process (PRI_ptr)
void *PRI_ptr;
pixel_regions_process (void *PRI_ptr)
{
GSList *list;
PixelRegionHolder *PRH;
......@@ -392,8 +394,7 @@ pixel_regions_process (PRI_ptr)
}
void
pixel_regions_process_stop (PRI_ptr)
void *PRI_ptr;
pixel_regions_process_stop (void *PRI_ptr)
{
GSList *list;
PixelRegionHolder *PRH;
......@@ -445,8 +446,7 @@ pixel_regions_process_stop (PRI_ptr)
/* Static Function Definitions */
static int
get_portion_height (PRI)
PixelRegionIterator *PRI;
get_portion_height (PixelRegionIterator *PRI)
{
GSList *list;
PixelRegionHolder *PRH;
......@@ -488,8 +488,7 @@ get_portion_height (PRI)
static int
get_portion_width (PRI)
PixelRegionIterator *PRI;
get_portion_width (PixelRegionIterator *PRI)
{
GSList *list;
PixelRegionHolder *PRH;
......@@ -531,8 +530,7 @@ get_portion_width (PRI)
static void *
pixel_regions_configure (PRI)
PixelRegionIterator *PRI;
pixel_regions_configure (PixelRegionIterator *PRI)
{
PixelRegionHolder *PRH;
GSList *list;
......@@ -580,9 +578,8 @@ pixel_regions_configure (PRI)
static void
pixel_region_configure (PRH, PRI)
PixelRegionHolder *PRH;
PixelRegionIterator *PRI;
pixel_region_configure (PixelRegionHolder *PRH,
PixelRegionIterator *PRI)
{
/* Configure the rowstride and data pointer for the pixel region
* based on the current offsets into the region and whether the
......@@ -590,7 +587,8 @@ pixel_region_configure (PRH, PRI)
*/
if (PRH->PR->tiles)
{
PRH->PR->curtile = tile_manager_get_tile (PRH->PR->tiles, PRH->PR->x, PRH->PR->y, TRUE, PRH->PR->dirty);
PRH->PR->curtile =
tile_manager_get_tile (PRH->PR->tiles, PRH->PR->x, PRH->PR->y, TRUE, PRH->PR->dirty);
PRH->PR->offx = PRH->PR->x % TILE_WIDTH;
PRH->PR->offy = PRH->PR->y % TILE_HEIGHT;
......
......@@ -47,16 +47,15 @@
static unsigned char * temp_buf_allocate (unsigned int);
static void temp_buf_to_color (TempBuf *, TempBuf *);
static void temp_buf_to_gray (TempBuf *, TempBuf *);
static void temp_buf_to_gray (TempBuf *, TempBuf *);
/* Memory management */
static unsigned char *
temp_buf_allocate (size)
unsigned int size;
temp_buf_allocate (unsigned int size)
{
unsigned char * data;
unsigned char *data;
data = (unsigned char *) g_malloc (size);
......@@ -67,9 +66,8 @@ temp_buf_allocate (size)
/* The conversion routines */
static void
temp_buf_to_color (src_buf, dest_buf)
TempBuf * src_buf;
TempBuf * dest_buf;
temp_buf_to_color (TempBuf *src_buf,
TempBuf *dest_buf)
{
unsigned char *src;
unsigned char *dest;
......@@ -92,13 +90,12 @@ temp_buf_to_color (src_buf, dest_buf)
static void
temp_buf_to_gray (src_buf, dest_buf)
TempBuf * src_buf;
TempBuf * dest_buf;
temp_buf_to_gray (TempBuf *src_buf,
TempBuf *dest_buf)
{
unsigned char *src;
unsigned char *dest;
long num_bytes;
long num_bytes;
float pix;
src = temp_buf_data (src_buf);
......@@ -121,15 +118,15 @@ temp_buf_to_gray (src_buf, dest_buf)
TempBuf *
temp_buf_new (width, height, bytes, x, y, col)
int width;
int height;
int bytes;
int x, y;
unsigned char * col;
temp_buf_new (int width,
int height,
int bytes,
int x,
int y,
unsigned char *col)
{
long i;
int j;
int j;
unsigned char * data;
TempBuf * temp;
......@@ -190,9 +187,8 @@ temp_buf_new (width, height, bytes, x, y, col)
TempBuf *
temp_buf_copy (src, dest)
TempBuf * src;
TempBuf * dest;
temp_buf_copy (TempBuf *src,
TempBuf *dest)
{
TempBuf * new;
long length;
......@@ -233,11 +229,12 @@ temp_buf_copy (src, dest)
TempBuf *
temp_buf_resize (buf, bytes, x, y, w, h)
TempBuf * buf;
int bytes;
int x, y;
int w, h;
temp_buf_resize (TempBuf *buf,
int bytes,
int x,
int y,
int w,
int h)
{
int size;
......@@ -271,12 +268,13 @@ temp_buf_resize (buf, bytes, x, y, w, h)
TempBuf *
temp_buf_copy_area (src, dest, x, y, w, h, border)
TempBuf * src;
TempBuf * dest;
int x, y;
int w, h;
int border;
temp_buf_copy_area (TempBuf *src,
TempBuf *dest,
int x,
int y,
int w,
int h,
int border)
{
TempBuf * new;
PixelRegion srcR, destR;
......@@ -333,8 +331,7 @@ temp_buf_copy_area (src, dest, x, y, w, h, border)
void
temp_buf_free (temp_buf)
TempBuf * temp_buf;
temp_buf_free (TempBuf *temp_buf)
{
if (temp_buf->data)
g_free (temp_buf->data);
......@@ -347,8 +344,7 @@ temp_buf_free (temp_buf)
unsigned char *
temp_buf_data (temp_buf)
TempBuf * temp_buf;
temp_buf_data (TempBuf *temp_buf)
{
if (temp_buf->swapped)
temp_buf_unswap (temp_buf);
......@@ -363,9 +359,8 @@ temp_buf_data (temp_buf)
MaskBuf *
mask_buf_new (width, height)
int width;
int height;
mask_buf_new (int width,
int height)
{
static unsigned char empty = 0;
......@@ -374,16 +369,14 @@ mask_buf_new (width, height)
void
mask_buf_free (mask)
MaskBuf * mask;
mask_buf_free (MaskBuf *mask)
{
temp_buf_free ((TempBuf *) mask);
}
unsigned char *
mask_buf_data (mask_buf)
MaskBuf * mask_buf;
mask_buf_data (MaskBuf *mask_buf)
{
if (mask_buf->swapped)
temp_buf_unswap (mask_buf);
......@@ -411,13 +404,14 @@ mask_buf_data (mask_buf)
* from disk. In the former case, cached_in_memory is set to NULL;
* in the latter case, cached_in_memory is left unchanged.
* If temp_buf_swap_free is called, cached_in_memory must be checked
* against the temp buf being freed. If they are the same, then cached_in_memory
* must be set to NULL;
* against the temp buf being freed. If they are the same, then
* cached_in_memory must be set to NULL;
*
* In the case where memory usage is set to "stingy":
* temp bufs are not cached in memory at all, they go right to disk.
*/
/* a static counter for generating unique filenames */
static int swap_index = 0;
......@@ -436,8 +430,7 @@ generate_unique_filename (void)
void
temp_buf_swap (buf)
TempBuf * buf;
temp_buf_swap (TempBuf *buf)
{
TempBuf * swap;
char * filename;
......@@ -511,8 +504,7 @@ temp_buf_swap (buf)
void
temp_buf_unswap (buf)
TempBuf * buf;
temp_buf_unswap (TempBuf *buf)
{
struct stat stat_buf;
FILE * fp;
......@@ -563,8 +555,7 @@ temp_buf_unswap (buf)
void
temp_buf_swap_free (buf)
TempBuf * buf;
temp_buf_swap_free (TempBuf *buf)
{
struct stat stat_buf;
......
......@@ -613,6 +613,7 @@ brush_select_brush_changed (BrushSelectP bsp,
{
display_brushes (bsp);
gtk_widget_draw (bsp->preview, NULL);
update_active_brush_field (bsp);
}
}
......
......@@ -142,7 +142,8 @@ gimp_image_class_init (GimpImageClass *klass)
/* static functions */
static void gimp_image_init (GimpImage *gimage)
static void
gimp_image_init (GimpImage *gimage)
{
gimage->has_filename = 0;
gimage->num_cols = 0;
......@@ -176,15 +177,18 @@ static void gimp_image_init (GimpImage *gimage)
gimage->paths = NULL;
}
GtkType gimp_image_get_type(void){
static GtkType type;
GIMP_TYPE_INIT(type,
GimpImage,
GimpImageClass,
gimp_image_init,
gimp_image_class_init,
GIMP_TYPE_OBJECT);
return type;
GtkType
gimp_image_get_type (void)
{
static GtkType type;
GIMP_TYPE_INIT(type,
GimpImage,
GimpImageClass,
gimp_image_init,
gimp_image_class_init,
GIMP_TYPE_OBJECT);
return type;
}
......@@ -231,7 +235,10 @@ gimp_image_free_projection (GimpImage *gimage)
}
static void
gimp_image_allocate_shadow (GimpImage *gimage, int width, int height, int bpp)
gimp_image_allocate_shadow (GimpImage *gimage,
int width,
int height,
int bpp)
{
/* allocate the new projection */
gimage->shadow = tile_manager_new (width, height, bpp);
......@@ -342,7 +349,7 @@ gimp_image_get_resolution (GimpImage *gimage,
void
gimp_image_set_unit (GimpImage *gimage,
GUnit unit)
GUnit unit)
{
gimage->unit = unit;
}
......@@ -355,7 +362,8 @@ gimp_image_get_unit (GimpImage *gimage)
void
gimp_image_set_save_proc (GimpImage *gimage, PlugInProcDef *proc)
gimp_image_set_save_proc (GimpImage *gimage,
PlugInProcDef *proc)
{
gimage->save_proc = proc;
}
......@@ -414,10 +422,9 @@ gimp_image_resize (GimpImage *gimage,
while (guide_list)
{
Guide *guide;
GList *next;
guide = (Guide*) guide_list->data;
next = g_list_next (guide_list);
guide_list = g_list_next (guide_list);
switch (guide->orientation)
{
......@@ -434,7 +441,6 @@ gimp_image_resize (GimpImage *gimage,
default:
g_error("Unknown guide orientation I.\n");
}
guide_list = next;
}
/* Don't forget the selection mask! */
......@@ -469,11 +475,11 @@ gimp_image_scale (GimpImage *gimage,
int new_height)
{
Channel *channel;
Layer *layer;
Layer *floating_layer;
GSList *list;
GList *glist;
Guide *guide;
Layer *layer;
Layer *floating_layer;
GSList *list;
GList *glist;
Guide *guide;
int old_width, old_height;
int layer_width, layer_height;
......@@ -590,21 +596,22 @@ gimp_image_free_shadow (GimpImage *gimage)
static void
gimp_image_destroy (GtkObject *object)
{
GimpImage* gimage=GIMP_IMAGE(object);
gimp_image_free_projection (gimage);
gimp_image_free_shadow (gimage);
if (gimage->cmap)
g_free (gimage->cmap);
if (gimage->has_filename)
g_free (gimage->filename);
GimpImage* gimage = GIMP_IMAGE(object);
gimp_image_free_layers (gimage);
gimp_image_free_channels (gimage);
channel_delete (gimage->selection_mask);
if (gimage->parasites)
gtk_object_unref(GTK_OBJECT(gimage->parasites));
gimp_image_free_projection (gimage);
gimp_image_free_shadow (gimage);
if (gimage->cmap)
g_free (gimage->cmap);
if (gimage->has_filename)
g_free (gimage->filename);
gimp_image_free_layers (gimage);
gimp_image_free_channels (gimage);
channel_delete (gimage->selection_mask);
if (gimage->parasites)
gtk_object_unref(GTK_OBJECT(gimage->parasites));
}
void
......@@ -619,7 +626,7 @@ gimp_image_apply_image (GimpImage *gimage,
int x,
int y)
{
Channel * mask;
Channel *mask;
int x1, y1, x2, y2;
int offset_x, offset_y;
PixelRegion src1PR, destPR, maskPR;
......@@ -715,7 +722,7 @@ gimp_image_replace_image (GimpImage *gimage,
int x,
int y)
{
Channel * mask;
Channel *mask;
int x1, y1, x2, y2;
int offset_x, offset_y;
PixelRegion src1PR, destPR;
......@@ -971,8 +978,6 @@ gimp_image_transform_color (GimpImage *gimage,
Guide*
gimp_image_add_hguide (GimpImage *gimage)
{
......@@ -1061,7 +1066,7 @@ gimp_image_attach_parasite (GimpImage *gimage,
Parasite *parasite)
{
/* only set the dirty bit manually if we can be saved and the new
parasite differs from the current one and we arn't undoable */
parasite differs from the current one and we aren't undoable */
if (parasite_is_undoable(parasite))
undo_push_image_parasite (gimage, parasite);
if (parasite_is_persistent(parasite)
......@@ -1081,6 +1086,7 @@ gimp_image_detach_parasite (GimpImage *gimage,
const char *parasite)
{
Parasite *p;
if (!(p = parasite_list_find(gimage->parasites, parasite)))
return;
if (parasite_is_undoable(p))
......@@ -1223,7 +1229,7 @@ static void
gimp_image_free_layers (GimpImage *gimage)
{
GSList *list = gimage->layers;
Layer * layer;
Layer *layer;
while (list)
{
......@@ -1239,8 +1245,8 @@ gimp_image_free_layers (GimpImage *gimage)
static void