summaryrefslogtreecommitdiff
path: root/gdk
diff options
context:
space:
mode:
authorAlexander Larsson <alla@lysator.liu.se>2001-01-31 09:18:20 +0000
committerAlexander Larsson <alexl@src.gnome.org>2001-01-31 09:18:20 +0000
commit57adee57ed6fb47141efe8a23a39c6bbe5bebb1e (patch)
treeb29c092766b69ee5ec54001c8a0571ae67f7a970 /gdk
parentf7d593c99dd69cf267aa59bc4957629f5f34b59e (diff)
downloadgdk-pixbuf-57adee57ed6fb47141efe8a23a39c6bbe5bebb1e.tar.gz
A bunch of whitespace cleanup.
2001-01-31 Alexander Larsson <alla@lysator.liu.se> * gdk/linux-fb/gdkselection-fb.c: * gdk/linux-fb/gdkcolor-fb.c: * gdk/linux-fb/gdkdrawable-fb2.c: * gdk/linux-fb/gdkfont-fb.c: * gdk/linux-fb/gdkim-fb.c: * gdk/linux-fb/gdkinput.c: * gdk/linux-fb/gdkkeyboard-fb.c: * gdk/linux-fb/gdkmain-fb.c: * gdk/linux-fb/gdkrender-fb.c: A bunch of whitespace cleanup.
Diffstat (limited to 'gdk')
-rw-r--r--gdk/linux-fb/gdkcolor-fb.c55
-rw-r--r--gdk/linux-fb/gdkdrawable-fb2.c10
-rw-r--r--gdk/linux-fb/gdkfont-fb.c4
-rw-r--r--gdk/linux-fb/gdkim-fb.c4
-rw-r--r--gdk/linux-fb/gdkinput.c4
-rw-r--r--gdk/linux-fb/gdkkeyboard-fb.c6
-rw-r--r--gdk/linux-fb/gdkmain-fb.c6
-rw-r--r--gdk/linux-fb/gdkrender-fb.c10
-rw-r--r--gdk/linux-fb/gdkselection-fb.c2
9 files changed, 51 insertions, 50 deletions
diff --git a/gdk/linux-fb/gdkcolor-fb.c b/gdk/linux-fb/gdkcolor-fb.c
index 615b5b605..b155ca92b 100644
--- a/gdk/linux-fb/gdkcolor-fb.c
+++ b/gdk/linux-fb/gdkcolor-fb.c
@@ -474,7 +474,7 @@ gdk_colormap_free_colors (GdkColormap *colormap,
(colormap->visual->type != GDK_VISUAL_GRAYSCALE))
return;
- for (i=0; i<ncolors; i++)
+ for (i = 0; i < ncolors; i++)
{
gulong pixel = colors[i].pixel;
@@ -596,7 +596,7 @@ gdk_colormap_alloc_colors_shared (GdkColormap *colormap,
private = GDK_COLORMAP_PRIVATE_DATA (colormap);
index = -1;
- for (i=0; i<ncolors; i++)
+ for (i = 0; i < ncolors; i++)
{
if (!success[i])
{
@@ -618,7 +618,7 @@ gdk_colormap_alloc_colors_shared (GdkColormap *colormap,
while (nremaining > 0)
{
- for (i=0; i<ncolors; i++)
+ for (i = 0; i < ncolors; i++)
{
if (!success[i])
{
@@ -663,7 +663,7 @@ gdk_colormap_alloc_colors_shared (GdkColormap *colormap,
/* Change back the values we flagged as permanent failures */
if (nfailed > 0)
{
- for (i=0; i<ncolors; i++)
+ for (i = 0; i < ncolors; i++)
if (success[i] == 2)
success[i] = FALSE;
nremaining = nfailed;
@@ -689,7 +689,7 @@ gdk_colormap_alloc_colors_pseudocolor (GdkColormap *colormap,
/* Check for an exact match among previously allocated colors */
- for (i=0; i<ncolors; i++)
+ for (i = 0; i < ncolors; i++)
{
if (!success[i])
{
@@ -732,7 +732,7 @@ gdk_colormap_alloc_colors (GdkColormap *colormap,
private = GDK_COLORMAP_PRIVATE_DATA (colormap);
- for (i=0; i<ncolors; i++)
+ for (i = 0; i < ncolors; i++)
success[i] = FALSE;
visual = colormap->visual;
@@ -748,7 +748,7 @@ gdk_colormap_alloc_colors (GdkColormap *colormap,
case GDK_VISUAL_DIRECT_COLOR:
case GDK_VISUAL_TRUE_COLOR:
- for (i=0; i<ncolors; i++)
+ for (i = 0; i < ncolors; i++)
{
colors[i].pixel = (((colors[i].red >> (16 - visual->red_prec)) << visual->red_shift) +
((colors[i].green >> (16 - visual->green_prec)) << visual->green_shift) +
@@ -929,24 +929,25 @@ gdk_colormap_query_color (GdkColormap *colormap,
visual = gdk_colormap_get_visual (colormap);
- switch (visual->type) {
- case GDK_VISUAL_DIRECT_COLOR:
- case GDK_VISUAL_TRUE_COLOR:
- result->red = 65535. * (double)((pixel & visual->red_mask) >> visual->red_shift) / ((1 << visual->red_prec) - 1);
- result->green = 65535. * (double)((pixel & visual->green_mask) >> visual->green_shift) / ((1 << visual->green_prec) - 1);
- result->blue = 65535. * (double)((pixel & visual->blue_mask) >> visual->blue_shift) / ((1 << visual->blue_prec) - 1);
- break;
- case GDK_VISUAL_STATIC_GRAY:
- case GDK_VISUAL_GRAYSCALE:
- result->red = result->green = result->blue = 65535. * (double)pixel/((1<<visual->depth) - 1);
- break;
- case GDK_VISUAL_PSEUDO_COLOR:
- result->red = colormap->colors[pixel].red;
- result->green = colormap->colors[pixel].green;
- result->blue = colormap->colors[pixel].blue;
- break;
- default:
- g_assert_not_reached ();
- break;
- }
+ switch (visual->type)
+ {
+ case GDK_VISUAL_DIRECT_COLOR:
+ case GDK_VISUAL_TRUE_COLOR:
+ result->red = 65535. * (gdouble) ((pixel & visual->red_mask) >> visual->red_shift) / ((1 << visual->red_prec) - 1);
+ result->green = 65535. * (gdouble) ((pixel & visual->green_mask) >> visual->green_shift) / ((1 << visual->green_prec) - 1);
+ result->blue = 65535. * (gdouble) ((pixel & visual->blue_mask) >> visual->blue_shift) / ((1 << visual->blue_prec) - 1);
+ break;
+ case GDK_VISUAL_STATIC_GRAY:
+ case GDK_VISUAL_GRAYSCALE:
+ result->red = result->green = result->blue = 65535. * (double)pixel/((1<<visual->depth) - 1);
+ break;
+ case GDK_VISUAL_PSEUDO_COLOR:
+ result->red = colormap->colors[pixel].red;
+ result->green = colormap->colors[pixel].green;
+ result->blue = colormap->colors[pixel].blue;
+ break;
+ default:
+ g_assert_not_reached ();
+ break;
+ }
}
diff --git a/gdk/linux-fb/gdkdrawable-fb2.c b/gdk/linux-fb/gdkdrawable-fb2.c
index 9c0ea77fa..a19eac803 100644
--- a/gdk/linux-fb/gdkdrawable-fb2.c
+++ b/gdk/linux-fb/gdkdrawable-fb2.c
@@ -820,7 +820,7 @@ gdk_fb_draw_text(GdkDrawable *drawable,
/* Convert latin-1 to utf8 */
p = utf8;
- for (i=0;i<text_length;i++)
+ for (i = 0; i < text_length; i++)
{
if (text[i]==0)
*p++ = 1; /* Hack to handle embedded nulls */
@@ -1387,7 +1387,7 @@ gdk_shadow_fb_draw_polygon (GdkDrawable *drawable,
minx = maxx = points[0].x;
miny = maxy = points[0].y;
- for (i=1;i<npoints;i++)
+ for (i = 1; i < npoints; i++)
{
minx = MIN(minx, points[i].x);
maxx = MAX(maxx, points[i].x);
@@ -1513,7 +1513,7 @@ gdk_shadow_fb_draw_points (GdkDrawable *drawable,
minx = maxx = points[0].x;
miny = maxy = points[0].y;
- for (i=1;i<npoints;i++)
+ for (i = 1; i < npoints; i++)
{
minx = MIN(minx, points[i].x);
maxx = MAX(maxx, points[i].x);
@@ -1546,7 +1546,7 @@ gdk_shadow_fb_draw_segments (GdkDrawable *drawable,
minx = maxx = segs[0].x1;
miny = maxy = segs[0].y1;
- for (i=0;i<nsegs;i++)
+ for (i = 0; i < nsegs; i++)
{
minx = MIN(minx, segs[i].x1);
maxx = MAX(maxx, segs[i].x1);
@@ -1592,7 +1592,7 @@ gdk_shadow_fb_draw_lines (GdkDrawable *drawable,
minx = maxx = points[0].x;
miny = maxy = points[0].y;
- for (i=1;i<npoints;i++)
+ for (i = 1; i < npoints; i++)
{
minx = MIN(minx, points[i].x);
maxx = MAX(maxx, points[i].x);
diff --git a/gdk/linux-fb/gdkfont-fb.c b/gdk/linux-fb/gdkfont-fb.c
index ed150bd58..7c095359f 100644
--- a/gdk/linux-fb/gdkfont-fb.c
+++ b/gdk/linux-fb/gdkfont-fb.c
@@ -174,7 +174,7 @@ gdk_font_load (const gchar *font_name)
desc.size = 0;
- pieces = g_strsplit(font_name, "-", 8);
+ pieces = g_strsplit (font_name, "-", 8);
do {
if (!pieces[0])
@@ -317,7 +317,7 @@ gdk_text_extents (GdkFont *font,
/* Convert latin-1 to utf8 */
p = utf8;
- for (i=0;i<text_length;i++)
+ for (i = 0; i < text_length; i++)
{
if (text[i]==0)
*p++ = 1; /* Hack to handle embedded nulls */
diff --git a/gdk/linux-fb/gdkim-fb.c b/gdk/linux-fb/gdkim-fb.c
index 50dc62da0..d2a7f2d89 100644
--- a/gdk/linux-fb/gdkim-fb.c
+++ b/gdk/linux-fb/gdkim-fb.c
@@ -202,7 +202,7 @@ gdk_wcstombs (const GdkWChar *src)
mbstr = g_new (gchar, length + 1);
- for (i=0; i<length+1; i++)
+ for (i = 0; i < length + 1; i++)
mbstr[i] = src[i];
return mbstr;
@@ -220,7 +220,7 @@ gdk_mbstowcs (GdkWChar *dest, const gchar *src, gint dest_max)
{
gint i;
- for (i=0; i<dest_max && src[i]; i++)
+ for (i = 0; i < dest_max && src[i]; i++)
dest[i] = src[i];
return i;
diff --git a/gdk/linux-fb/gdkinput.c b/gdk/linux-fb/gdkinput.c
index 82ccc845d..a3444c33b 100644
--- a/gdk/linux-fb/gdkinput.c
+++ b/gdk/linux-fb/gdkinput.c
@@ -140,7 +140,7 @@ gdk_device_free_history (GdkTimeCoord **events,
{
gint i;
- for (i=0; i<n_events; i++)
+ for (i = 0; i < n_events; i++)
g_free (events[i]);
g_free (events);
@@ -335,7 +335,7 @@ gdk_device_get_axis (GdkDevice *device, gdouble *axes, GdkAxisUse use, gdouble *
if (axes == NULL)
return FALSE;
- for (i=0; i<device->num_axes; i++)
+ for (i = 0; i < device->num_axes; i++)
if (device->axes[i].use == use)
{
if (value)
diff --git a/gdk/linux-fb/gdkkeyboard-fb.c b/gdk/linux-fb/gdkkeyboard-fb.c
index c48164c32..e6a358227 100644
--- a/gdk/linux-fb/gdkkeyboard-fb.c
+++ b/gdk/linux-fb/gdkkeyboard-fb.c
@@ -164,7 +164,7 @@ gdk_fb_keyboard_open (void)
if (!keyb_type)
keyb_type = "xlate";
- for (i=0;i<G_N_ELEMENTS(keyb_devs);i++)
+ for (i = 0; i < G_N_ELEMENTS(keyb_devs); i++)
{
if (g_strcasecmp(keyb_type, keyb_devs[i].name)==0)
break;
@@ -723,7 +723,7 @@ iscode (char *code, char *str, int str_max)
{
int i;
- for (i=0;code[i] && (i<str_max);i++)
+ for (i = 0; code[i] && (i < str_max); i++)
{
if (code[i] != str[i])
return FALSE;
@@ -748,7 +748,7 @@ xlate_io (GIOChannel *gioc,
if (n <= 0)
g_error ("Nothing from keyboard!");
- for (i=0;i<n;i++)
+ for (i = 0; i < n; i++)
{
handled = FALSE;
modifier = 0;
diff --git a/gdk/linux-fb/gdkmain-fb.c b/gdk/linux-fb/gdkmain-fb.c
index a25618ac2..14167d618 100644
--- a/gdk/linux-fb/gdkmain-fb.c
+++ b/gdk/linux-fb/gdkmain-fb.c
@@ -172,7 +172,7 @@ fb_modes_parse_mode (GScanner *scanner,
switch (GPOINTER_TO_INT (scanner->value.v_symbol))
{
case FB_GEOMETRY:
- for (i=0;i<5;i++) {
+ for (i = 0; i < 5;i++) {
token = g_scanner_get_next_token (scanner);
if (token != G_TOKEN_INT)
{
@@ -184,7 +184,7 @@ fb_modes_parse_mode (GScanner *scanner,
found_geometry = TRUE;
break;
case FB_TIMINGS:
- for (i=0;i<7;i++) {
+ for (i = 0; i < 7; i++) {
token = g_scanner_get_next_token (scanner);
if (token != G_TOKEN_INT)
{
@@ -380,7 +380,7 @@ gdk_fb_setup_mode_from_name (struct fb_var_screeninfo *modeinfo,
scanner = g_scanner_new ((GScannerConfig *) &fb_modes_scanner_config);
scanner->input_name = filename;
- for (i=0;i<sizeof(fb_modes_keywords)/sizeof(fb_modes_keywords[0]);i++)
+ for (i = 0; i < sizeof(fb_modes_keywords)/sizeof(fb_modes_keywords[0]); i++)
g_scanner_add_symbol (scanner, fb_modes_keywords[i], GINT_TO_POINTER (i));
g_scanner_input_file (scanner, fd);
diff --git a/gdk/linux-fb/gdkrender-fb.c b/gdk/linux-fb/gdkrender-fb.c
index 1535aa805..2d4c1c68f 100644
--- a/gdk/linux-fb/gdkrender-fb.c
+++ b/gdk/linux-fb/gdkrender-fb.c
@@ -1009,7 +1009,7 @@ gdk_fb_fill_rectangle_generic (GdkDrawable *drawable,
private = GDK_DRAWABLE_FBDATA (drawable);
spans = g_new (GdkSpan, rect->height);
- for (i=0;i<rect->height;i++)
+ for (i = 0; i < rect->height; i++)
{
spans[i].x = rect->x - private->abs_x;
spans[i].y = rect->y+i - private->abs_y;
@@ -1123,7 +1123,7 @@ _gdk_fb_gc_calc_state (GdkGC *gc,
gc_private->fill_span = gdk_fb_fill_span_generic;
gc_private->fill_rectangle = gdk_fb_fill_rectangle_generic;
- for (i=0;i<GDK_NUM_FB_SRCBPP;i++)
+ for (i = 0; i < GDK_NUM_FB_SRCBPP; i++)
gc_private->draw_drawable[i] = gdk_fb_draw_drawable_generic;
if (changed & _GDK_FB_GC_DEPTH)
@@ -1245,7 +1245,7 @@ gdk_shadow_fb_copy_rect_90 (gint x, gint y, gint width, gint height)
w = width;
pdst = dst;
while (w>0) {
- for (i=0;i<depth;i++)
+ for (i = 0; i < depth; i++)
*pdst++ = *src++;
pdst -= gdk_display->sinfo.line_length + depth;
w--;
@@ -1274,7 +1274,7 @@ gdk_shadow_fb_copy_rect_180 (gint x, gint y, gint width, gint height)
w = width;
pdst = dst;
while (w>0) {
- for (i=0;i<depth;i++)
+ for (i = 0; i < depth; i++)
*pdst++ = *src++;
pdst -= 2 * depth;
w--;
@@ -1303,7 +1303,7 @@ gdk_shadow_fb_copy_rect_270 (gint x, gint y, gint width, gint height)
w = width;
pdst = dst;
while (w>0) {
- for (i=0;i<depth;i++)
+ for (i = 0; i < depth; i++)
*pdst++ = *src++;
pdst += gdk_display->sinfo.line_length - depth;
w--;
diff --git a/gdk/linux-fb/gdkselection-fb.c b/gdk/linux-fb/gdkselection-fb.c
index dc7409da6..29fd65598 100644
--- a/gdk/linux-fb/gdkselection-fb.c
+++ b/gdk/linux-fb/gdkselection-fb.c
@@ -422,7 +422,7 @@ gdk_text_property_to_utf8_list (GdkAtom encoding,
if (list)
*list = g_new (gchar *, local_count + 1);
- for (i=0; i<local_count; i++)
+ for (i = 0; i < local_count; i++)
{
/* list contains stuff in our default encoding
*/