1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-20 21:08:08 +01:00

Change to the linux kernel coding style

for arq in `git ls-files *.c`; do
    echo $arq;
    indent -linux -l115 $arq;
    done

The different line break at 115 columns is because
I use a widescreen monitor :-)
This commit is contained in:
Carlos R. Mafra
2009-08-20 00:59:40 +02:00
parent 59fc927dc9
commit 688a56e8ab
209 changed files with 87034 additions and 98138 deletions

View File

@@ -25,7 +25,8 @@
#include "generic.h"
RImage *fade (int argc, char **argv, int width, int height, int relief) {
RImage *fade(int argc, char **argv, int width, int height, int relief)
{
int from[3] = { 0x00, 0x00, 0x00 };
int to[3] = { 0xff, 0xff, 0xff };
@@ -38,29 +39,28 @@ RImage *fade (int argc, char **argv, int width, int height, int relief) {
int c, done, option_index = 0;
optind = 1;
for (done=0; !done; ) {
for (done = 0; !done;) {
static struct option long_options[] = {
{"from", 1, 0, 'f'},
{"to", 1, 0, 't'},
{0, 0, 0, 0}
};
c = getopt_long (argc, argv, "f:t:",
long_options, &option_index);
c = getopt_long(argc, argv, "f:t:", long_options, &option_index);
if (c == -1) {
break;
}
switch (c) {
case 'f':
if (!parse_color (optarg, from)) {
error ("invalid color: %s\n", optarg);
if (!parse_color(optarg, from)) {
error("invalid color: %s\n", optarg);
return 0;
}
break;
case 't':
if (!parse_color (optarg, to)) {
error ("invalid color: %s\n", optarg);
if (!parse_color(optarg, to)) {
error("invalid color: %s\n", optarg);
return 0;
}
break;
@@ -73,35 +73,35 @@ RImage *fade (int argc, char **argv, int width, int height, int relief) {
argc -= optind;
argv += optind;
if (!start_image ("fade", argc, 0, 1, width, height, &image)) {
return (RImage *)0;
if (!start_image("fade", argc, 0, 1, width, height, &image)) {
return (RImage *) 0;
}
this = (int *) malloc (width * sizeof (int));
last = (int *) malloc (width * sizeof (int));
this = (int *)malloc(width * sizeof(int));
last = (int *)malloc(width * sizeof(int));
if (!this || !last) {
RReleaseImage (image);
free (this);
free (last);
return (RImage *)0;
RReleaseImage(image);
free(this);
free(last);
return (RImage *) 0;
}
for (i=0; i<width; i++) {
for (i = 0; i < width; i++) {
this[i] = 255;
}
factor = pow (0.2, 1.0 / height);
factor = pow(0.2, 1.0 / height);
delta = (factor < 0.5) ? 2.0 * factor : 2.0 * (1.0 - factor);
srand (time (0));
srand(time(0));
cptr = image->data;
for (j=0; j<height; j++) {
memcpy (last, this, width * sizeof (int));
for (i=0; i<width; i++) {
for (j = 0; j < height; j++) {
memcpy(last, this, width * sizeof(int));
for (i = 0; i < width; i++) {
int output[3];
int k = i + random_int (3) - 1;
double f = factor + random_double (delta) - delta/2.0;
int k = i + random_int(3) - 1;
double f = factor + random_double(delta) - delta / 2.0;
if (k < 0) {
k = 0;
@@ -110,19 +110,18 @@ RImage *fade (int argc, char **argv, int width, int height, int relief) {
k = width - 1;
}
this[i] = (int) (f * last[k]);
interpolate_color (output, from, to, this[i]);
this[i] = (int)(f * last[k]);
interpolate_color(output, from, to, this[i]);
*cptr++ = output[0];
*cptr++ = output[1];
*cptr++ = output[2];
if (RRGBAFormat==image->format)
if (RRGBAFormat == image->format)
cptr++;
}
}
free (this);
free (last);
free(this);
free(last);
return image;
}