Commit e6cd5255 authored by David Odin's avatar David Odin

Removed tabs and trailing whitespaces.

parent 079101d6
2003-09-28 DindinX <david@dindinx.net>
* libgimpmath/gimpmatrix.[ch]:
* libgimpmath/gimpmd5.[ch]:
* libgimpmath/gimpvector.[ch]:
* libgimpmath/test-md5.c: Removed tabs and trailing whitespaces.
2003-09-28 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage.c (gimp_image_transform_temp_buf): use a much
......@@ -169,16 +169,6 @@ Utilities to set up and manipulate vectors.
@y:
<!-- ##### FUNCTION gimp_vector2_new_val ##### -->
<para>
</para>
@x:
@y:
@Returns:
<!-- ##### FUNCTION gimp_vector2_add ##### -->
<para>
......
......@@ -54,7 +54,7 @@ gimp_matrix2_identity (GimpMatrix2 *matrix)
*/
void
gimp_matrix2_mult (const GimpMatrix2 *matrix1,
GimpMatrix2 *matrix2)
GimpMatrix2 *matrix2)
{
GimpMatrix2 tmp;
......@@ -98,10 +98,10 @@ gimp_matrix3_identity (GimpMatrix3 *matrix)
*/
void
gimp_matrix3_transform_point (const GimpMatrix3 *matrix,
gdouble x,
gdouble y,
gdouble *newx,
gdouble *newy)
gdouble x,
gdouble y,
gdouble *newx,
gdouble *newy)
{
gdouble w;
......@@ -129,7 +129,7 @@ gimp_matrix3_transform_point (const GimpMatrix3 *matrix,
*/
void
gimp_matrix3_mult (const GimpMatrix3 *matrix1,
GimpMatrix3 *matrix2)
GimpMatrix3 *matrix2)
{
gint i, j;
GimpMatrix3 tmp;
......@@ -142,11 +142,11 @@ gimp_matrix3_mult (const GimpMatrix3 *matrix1,
t3 = matrix1->coeff[i][2];
for (j = 0; j < 3; j++)
{
tmp.coeff[i][j] = t1 * matrix2->coeff[0][j];
tmp.coeff[i][j] += t2 * matrix2->coeff[1][j];
tmp.coeff[i][j] += t3 * matrix2->coeff[2][j];
}
{
tmp.coeff[i][j] = t1 * matrix2->coeff[0][j];
tmp.coeff[i][j] += t2 * matrix2->coeff[1][j];
tmp.coeff[i][j] += t3 * matrix2->coeff[2][j];
}
}
*matrix2 = tmp;
......@@ -162,8 +162,8 @@ gimp_matrix3_mult (const GimpMatrix3 *matrix1,
*/
void
gimp_matrix3_translate (GimpMatrix3 *matrix,
gdouble x,
gdouble y)
gdouble x,
gdouble y)
{
gdouble g, h, i;
......@@ -189,8 +189,8 @@ gimp_matrix3_translate (GimpMatrix3 *matrix,
*/
void
gimp_matrix3_scale (GimpMatrix3 *matrix,
gdouble x,
gdouble y)
gdouble x,
gdouble y)
{
matrix->coeff[0][0] *= x;
matrix->coeff[0][1] *= x;
......@@ -210,7 +210,7 @@ gimp_matrix3_scale (GimpMatrix3 *matrix,
*/
void
gimp_matrix3_rotate (GimpMatrix3 *matrix,
gdouble theta)
gdouble theta)
{
gdouble t1, t2;
gdouble cost, sint;
......@@ -243,7 +243,7 @@ gimp_matrix3_rotate (GimpMatrix3 *matrix,
*/
void
gimp_matrix3_xshear (GimpMatrix3 *matrix,
gdouble amount)
gdouble amount)
{
matrix->coeff[0][0] += amount * matrix->coeff[1][0];
matrix->coeff[0][1] += amount * matrix->coeff[1][1];
......@@ -259,7 +259,7 @@ gimp_matrix3_xshear (GimpMatrix3 *matrix,
*/
void
gimp_matrix3_yshear (GimpMatrix3 *matrix,
gdouble amount)
gdouble amount)
{
matrix->coeff[1][0] += amount * matrix->coeff[0][0];
matrix->coeff[1][1] += amount * matrix->coeff[0][1];
......@@ -407,10 +407,10 @@ gimp_matrix3_is_diagonal (const GimpMatrix3 *matrix)
for (i = 0; i < 3; i++)
{
for (j = 0; j < 3; j++)
{
if (i != j && fabs (matrix->coeff[i][j]) > EPSILON)
return FALSE;
}
{
if (i != j && fabs (matrix->coeff[i][j]) > EPSILON)
return FALSE;
}
}
return TRUE;
......@@ -432,18 +432,18 @@ gimp_matrix3_is_identity (const GimpMatrix3 *matrix)
for (i = 0; i < 3; i++)
{
for (j = 0; j < 3; j++)
{
if (i == j)
{
if (fabs (matrix->coeff[i][j] - 1.0) > EPSILON)
return FALSE;
}
else
{
if (fabs (matrix->coeff[i][j]) > EPSILON)
return FALSE;
}
}
{
if (i == j)
{
if (fabs (matrix->coeff[i][j] - 1.0) > EPSILON)
return FALSE;
}
else
{
if (fabs (matrix->coeff[i][j]) > EPSILON)
return FALSE;
}
}
}
return TRUE;
......@@ -474,11 +474,11 @@ gimp_matrix3_is_simple (const GimpMatrix3 *matrix)
for (i = 0; i < 2; i++)
{
for (j = 0; j < 2; j++)
{
absm = fabs (matrix->coeff[i][j]);
if (absm > EPSILON && fabs (absm - 1.0) > EPSILON)
return FALSE;
}
{
absm = fabs (matrix->coeff[i][j]);
if (absm > EPSILON && fabs (absm - 1.0) > EPSILON)
return FALSE;
}
}
return TRUE;
......@@ -486,9 +486,9 @@ gimp_matrix3_is_simple (const GimpMatrix3 *matrix)
void
gimp_matrix4_to_deg (const GimpMatrix4 *matrix,
gdouble *a,
gdouble *b,
gdouble *c)
gdouble *a,
gdouble *b,
gdouble *c)
{
*a = 180 * (asin (matrix->coeff[1][0]) / G_PI_2);
*b = 180 * (asin (matrix->coeff[2][0]) / G_PI_2);
......
......@@ -45,23 +45,23 @@ struct _GimpMatrix4
void gimp_matrix2_identity (GimpMatrix2 *matrix);
void gimp_matrix2_mult (const GimpMatrix2 *matrix1,
GimpMatrix2 *matrix2);
GimpMatrix2 *matrix2);
void gimp_matrix3_identity (GimpMatrix3 *matrix);
void gimp_matrix3_mult (const GimpMatrix3 *matrix1,
GimpMatrix3 *matrix2);
GimpMatrix3 *matrix2);
void gimp_matrix3_translate (GimpMatrix3 *matrix,
gdouble x,
gdouble y);
gdouble x,
gdouble y);
void gimp_matrix3_scale (GimpMatrix3 *matrix,
gdouble x,
gdouble y);
gdouble x,
gdouble y);
void gimp_matrix3_rotate (GimpMatrix3 *matrix,
gdouble theta);
gdouble theta);
void gimp_matrix3_xshear (GimpMatrix3 *matrix,
gdouble amount);
gdouble amount);
void gimp_matrix3_yshear (GimpMatrix3 *matrix,
gdouble amount);
gdouble amount);
void gimp_matrix3_affine (GimpMatrix3 *matrix,
gdouble a,
gdouble b,
......@@ -78,15 +78,15 @@ gboolean gimp_matrix3_is_identity (const GimpMatrix3 *matrix);
gboolean gimp_matrix3_is_simple (const GimpMatrix3 *matrix);
void gimp_matrix3_transform_point (const GimpMatrix3 *matrix,
gdouble x,
gdouble y,
gdouble *newx,
gdouble *newy);
gdouble x,
gdouble y,
gdouble *newx,
gdouble *newy);
void gimp_matrix4_to_deg (const GimpMatrix4 *matrix,
gdouble *a,
gdouble *b,
gdouble *c);
gdouble *a,
gdouble *b,
gdouble *c);
G_END_DECLS
......
......@@ -40,12 +40,12 @@ struct _GimpMD5Context
static void gimp_md5_init (GimpMD5Context *ctx);
static void gimp_md5_transform (guint32 buf[4],
static void gimp_md5_transform (guint32 buf[4],
const guint32 in[16]);
static void gimp_md5_update (GimpMD5Context *ctx,
const guchar *buf,
static void gimp_md5_update (GimpMD5Context *ctx,
const guchar *buf,
guint32 len);
static void gimp_md5_final (GimpMD5Context *ctx,
static void gimp_md5_final (GimpMD5Context *ctx,
guchar digest[16]);
......@@ -54,7 +54,7 @@ static void gimp_md5_final (GimpMD5Context *ctx,
* @buffer: byte buffer
* @buffer_size: buffer size (in bytes) or -1 if @buffer is nul-terminated.
* @digest: 16 bytes buffer receiving the hash code.
*
*
* Get the md5 hash of a buffer. The result is put in the 16 bytes
* buffer @digest.
*
......@@ -74,7 +74,7 @@ gimp_md5_get_digest (const gchar *buffer,
g_return_if_fail (buffer != NULL);
g_return_if_fail (digest != NULL);
if (buffer_size < 0)
buffer_size = strlen (buffer);
......@@ -84,11 +84,11 @@ gimp_md5_get_digest (const gchar *buffer,
}
static inline void
byte_reverse (guint32 *buf,
byte_reverse (guint32 *buf,
guint32 longs)
{
#if G_BYTE_ORDER != G_LITTLE_ENDIAN
do
do
{
*buf = GINT32_TO_LE (*buf);
buf++;
......@@ -104,31 +104,31 @@ gimp_md5_init (GimpMD5Context *ctx)
ctx->buf[1] = 0xefcdab89;
ctx->buf[2] = 0x98badcfe;
ctx->buf[3] = 0x10325476;
ctx->bits[0] = 0;
ctx->bits[1] = 0;
}
static void
gimp_md5_update (GimpMD5Context *ctx,
const guchar *buf,
static void
gimp_md5_update (GimpMD5Context *ctx,
const guchar *buf,
guint32 len)
{
guint32 t;
/* Update bitcount */
t = ctx->bits[0];
if ((ctx->bits[0] = t + ((guint32) len << 3)) < t)
ctx->bits[1]++; /* Carry from low to high */
ctx->bits[1]++; /* Carry from low to high */
ctx->bits[1] += len >> 29;
t = (t >> 3) & 0x3f;
/* Handle any leading odd-sized chunks */
if (t)
if (t)
{
guchar *p = (guchar *) ctx->in + t;
t = 64 - t;
if (len < t)
{
......@@ -142,10 +142,10 @@ gimp_md5_update (GimpMD5Context *ctx,
gimp_md5_transform (ctx->buf, (guint32 *) ctx->in);
buf += t;
len -= t;
}
}
/* Process data in 64-byte chunks */
while (len >= 64)
while (len >= 64)
{
memcpy (ctx->in, buf, 64);
byte_reverse ((guint32 *) ctx->in, 16);
......@@ -153,52 +153,52 @@ gimp_md5_update (GimpMD5Context *ctx,
buf += 64;
len -= 64;
}
/* Handle any remaining bytes of data. */
memcpy (ctx->in, buf, len);
}
static void
gimp_md5_final (GimpMD5Context *ctx,
gimp_md5_final (GimpMD5Context *ctx,
guchar digest[16])
{
guint32 count;
guchar *p;
/* Compute number of bytes mod 64 */
count = (ctx->bits[0] >> 3) & 0x3F;
/* Set the first char of padding to 0x80. This is safe since there is
always at least one byte free */
p = ctx->in + count;
*p++ = 0x80;
/* Bytes of padding needed to make 64 bytes */
count = 64 - 1 - count;
/* Pad out to 56 mod 64 */
if (count < 8)
if (count < 8)
{
/* Two lots of padding: Pad the first block to 64 bytes */
memset (p, 0, count);
byte_reverse ((guint32 *) ctx->in, 16);
gimp_md5_transform (ctx->buf, (guint32 *) ctx->in);
/* Now fill the next block with 56 bytes */
memset (ctx->in, 0, 56);
}
else
}
else
{
/* Pad block to 56 bytes */
memset (p, 0, count - 8);
}
byte_reverse ((guint32 *) ctx->in, 14);
/* Append length in bits and transform */
((guint32 *) ctx->in)[14] = ctx->bits[0];
((guint32 *) ctx->in)[15] = ctx->bits[1];
gimp_md5_transform (ctx->buf, (guint32 *) ctx->in);
byte_reverse (ctx->buf, 4);
memcpy (digest, ctx->buf, 16);
......@@ -215,24 +215,24 @@ gimp_md5_final (GimpMD5Context *ctx,
/* This is the central step in the MD5 algorithm. */
#define MD5STEP(f, w, x, y, z, data, s) \
( w += f(x, y, z) + data, w = w<<s | w>>(32-s), w += x )
( w += f(x, y, z) + data, w = w<<s | w>>(32-s), w += x )
/*
* The core of the MD5 algorithm, this alters an existing MD5 hash to
* reflect the addition of 16 longwords of new data. md5_Update blocks
* the data and converts bytes into longwords for this routine.
*/
static void
gimp_md5_transform (guint32 buf[4],
static void
gimp_md5_transform (guint32 buf[4],
const guint32 in[16])
{
register guint32 a, b, c, d;
a = buf[0];
b = buf[1];
c = buf[2];
d = buf[3];
MD5STEP (F1, a, b, c, d, in[0] + 0xd76aa478, 7);
MD5STEP (F1, d, a, b, c, in[1] + 0xe8c7b756, 12);
MD5STEP (F1, c, d, a, b, in[2] + 0x242070db, 17);
......@@ -249,7 +249,7 @@ gimp_md5_transform (guint32 buf[4],
MD5STEP (F1, d, a, b, c, in[13] + 0xfd987193, 12);
MD5STEP (F1, c, d, a, b, in[14] + 0xa679438e, 17);
MD5STEP (F1, b, c, d, a, in[15] + 0x49b40821, 22);
MD5STEP (F2, a, b, c, d, in[1] + 0xf61e2562, 5);
MD5STEP (F2, d, a, b, c, in[6] + 0xc040b340, 9);
MD5STEP (F2, c, d, a, b, in[11] + 0x265e5a51, 14);
......@@ -266,7 +266,7 @@ gimp_md5_transform (guint32 buf[4],
MD5STEP (F2, d, a, b, c, in[2] + 0xfcefa3f8, 9);
MD5STEP (F2, c, d, a, b, in[7] + 0x676f02d9, 14);
MD5STEP (F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20);
MD5STEP (F3, a, b, c, d, in[5] + 0xfffa3942, 4);
MD5STEP (F3, d, a, b, c, in[8] + 0x8771f681, 11);
MD5STEP (F3, c, d, a, b, in[11] + 0x6d9d6122, 16);
......@@ -283,7 +283,7 @@ gimp_md5_transform (guint32 buf[4],
MD5STEP (F3, d, a, b, c, in[12] + 0xe6db99e5, 11);
MD5STEP (F3, c, d, a, b, in[15] + 0x1fa27cf8, 16);
MD5STEP (F3, b, c, d, a, in[2] + 0xc4ac5665, 23);
MD5STEP (F4, a, b, c, d, in[0] + 0xf4292244, 6);
MD5STEP (F4, d, a, b, c, in[7] + 0x432aff97, 10);
MD5STEP (F4, c, d, a, b, in[14] + 0xab9423a7, 15);
......@@ -300,7 +300,7 @@ gimp_md5_transform (guint32 buf[4],
MD5STEP (F4, d, a, b, c, in[11] + 0xbd3af235, 10);
MD5STEP (F4, c, d, a, b, in[2] + 0x2ad7d2bb, 15);
MD5STEP (F4, b, c, d, a, in[9] + 0xeb86d391, 21);
buf[0] += a;
buf[1] += b;
buf[2] += c;
......
......@@ -20,7 +20,7 @@
* Modified June 1993 by Colin Plumb for altered md5.c.
* Modified October 1995 by Erik Troan for RPM
*/
#ifndef __GIMP_MD5_H__
#define __GIMP_MD5_H__
......@@ -28,8 +28,8 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
void gimp_md5_get_digest (const gchar *buffer,
gint buffer_size,
void gimp_md5_get_digest (const gchar *buffer,
gint buffer_size,
guchar digest[16]);
......
......@@ -63,7 +63,7 @@ static const GimpVector3 gimp_vector3_unit_z = { 0.0, 0.0, 1.0 };
**/
gdouble
gimp_vector2_inner_product (const GimpVector2 *vector1,
const GimpVector2 *vector2)
const GimpVector2 *vector2)
{
return (vector1->x * vector2->x + vector1->y * vector2->y);
}
......@@ -80,7 +80,7 @@ gimp_vector2_inner_product (const GimpVector2 *vector1,
**/
gdouble
gimp_vector2_inner_product_val (GimpVector2 vector1,
GimpVector2 vector2)
GimpVector2 vector2)
{
return (vector1.x * vector2.x + vector1.y * vector2.y);
}
......@@ -98,12 +98,12 @@ gimp_vector2_inner_product_val (GimpVector2 vector1,
* Note that in 2D, this function is mostly useful to test if two
* vectors are parallel or not, or to compute the area spawned by two
* vectors.
*
*
* Returns: The cross product.
**/
GimpVector2
gimp_vector2_cross_product (const GimpVector2 *vector1,
const GimpVector2 *vector2)
const GimpVector2 *vector2)
{
GimpVector2 normal;
......@@ -126,7 +126,7 @@ gimp_vector2_cross_product (const GimpVector2 *vector1,
**/
GimpVector2
gimp_vector2_cross_product_val (GimpVector2 vector1,
GimpVector2 vector2)
GimpVector2 vector2)
{
GimpVector2 normal;
......@@ -179,7 +179,7 @@ gimp_vector2_normalize (GimpVector2 *vector)
len = gimp_vector2_length (vector);
if (len != 0.0)
if (len != 0.0)
{
len = 1.0 / len;
vector->x *= len;
......@@ -195,7 +195,7 @@ gimp_vector2_normalize (GimpVector2 *vector)
* gimp_vector2_normalize_val:
*
* @vector: a #GimpVector2 (by value)
*
*
* Computes and returns the normalized vector corresponding with the one
* passed in argument.
*
......@@ -210,7 +210,7 @@ gimp_vector2_normalize_val (GimpVector2 vector)
len = gimp_vector2_length_val (vector);
if (len != 0.0)
if (len != 0.0)
{
len = 1.0 / len;
normalized.x = vector.x * len;
......@@ -233,7 +233,7 @@ gimp_vector2_normalize_val (GimpVector2 vector)
**/
void
gimp_vector2_mul (GimpVector2 *vector,
gdouble factor)
gdouble factor)
{
vector->x *= factor;
vector->y *= factor;
......@@ -251,10 +251,10 @@ gimp_vector2_mul (GimpVector2 *vector,
**/
GimpVector2
gimp_vector2_mul_val (GimpVector2 vector,
gdouble factor)
gdouble factor)
{
GimpVector2 result;
result.x = vector.x * factor;
result.y = vector.y * factor;
......@@ -272,8 +272,8 @@ gimp_vector2_mul_val (GimpVector2 vector,
**/
void
gimp_vector2_add (GimpVector2 *result,
const GimpVector2 *vector1,
const GimpVector2 *vector2)
const GimpVector2 *vector1,
const GimpVector2 *vector2)
{
result->x = vector1->x + vector2->x;
result->y = vector1->y + vector2->y;
......@@ -290,13 +290,13 @@ gimp_vector2_add (GimpVector2 *result,
**/
GimpVector2
gimp_vector2_add_val (GimpVector2 vector1,
GimpVector2 vector2)
GimpVector2 vector2)
{
GimpVector2 result;
result.x = vector1.x + vector2.x;
result.y = vector1.y + vector2.y;
return result;
}
......@@ -311,8 +311,8 @@ gimp_vector2_add_val (GimpVector2 vector1,
**/
void
gimp_vector2_sub (GimpVector2 *result,
const GimpVector2 *vector1,
const GimpVector2 *vector2)
const GimpVector2 *vector1,
const GimpVector2 *vector2)
{
result->x = vector1->x - vector2->x;
result->y = vector1->y - vector2->y;
......@@ -330,13 +330,13 @@ gimp_vector2_sub (GimpVector2 *result,
**/
GimpVector2
gimp_vector2_sub_val (GimpVector2 vector1,
GimpVector2 vector2)
GimpVector2 vector2)
{
GimpVector2 result;
result.x = vector1.x - vector2.x;
result.y = vector1.y - vector2.y;
return result;
}
......@@ -350,8 +350,8 @@ gimp_vector2_sub_val (GimpVector2 vector1,
**/
void
gimp_vector2_set (GimpVector2 *vector,
gdouble x,
gdouble y)
gdouble x,
gdouble y)
{
vector->x = x;
vector->y = y;
......@@ -368,7 +368,7 @@ gimp_vector2_set (GimpVector2 *vector,
**/
GimpVector2
gimp_vector2_new (gdouble x,
gdouble y)
gdouble y)
{
GimpVector2 vector;
......@@ -382,7 +382,7 @@ gimp_vector2_new (gdouble x,
* gimp_vector2_neg:
* @vector: a #GimpVector2 (by address)
*
* Negates the @vector (i.e. negate all its coordinates).
* Negates the @vector (i.e. negate all its coordinates).
**/
void
gimp_vector2_neg (GimpVector2 *vector)
......@@ -399,11 +399,11 @@ gimp_vector2_neg (GimpVector2 *vector)
*
* Returns: the negated vector.
**/
GimpVector2
GimpVector2
gimp_vector2_neg_val (GimpVector2 vector)
{
GimpVector2 result;
result.x = vector.x * -1.0;
result.y = vector.y * -1.0;
......@@ -419,7 +419,7 @@ gimp_vector2_neg_val (GimpVector2 vector)
**/
void
gimp_vector2_rotate (GimpVector2 *vector,
gdouble alpha)
gdouble alpha)
{
GimpVector2 result;
......@@ -436,12 +436,12 @@ gimp_vector2_rotate (GimpVector2 *vector,
*
* Computes and returns the rotation of the @vector by @alpha radians,
* counterclockwize.
*
*
* Returns: the @vector rotated by @alpha radians.
**/
GimpVector2
gimp_vector2_rotate_val (GimpVector2 vector,
gdouble alpha)
gdouble alpha)
{
GimpVector2 result;
......@@ -467,11 +467,11 @@ gimp_vector2_rotate_val (GimpVector2 vector,
**/
gdouble
gimp_vector3_inner_product (const GimpVector3 *vector1,
const GimpVector3 *vector2)
const GimpVector3 *vector2)
{
return (vector1->x * vector2->x +
vector1->y * vector2->y +
vector1->z * vector2->z);
vector1->y * vector2->y +
vector1->z * vector2->z);
}
/**
......@@ -486,11 +486,11 @@ gimp_vector3_inner_product (const GimpVector3 *vector1,
**/
gdouble
gimp_vector3_inner_product_val (GimpVector3 vector1,
GimpVector3 vector2)
GimpVector3 vector2)
{
return (vector1.x * vector2.x +
vector1.y * vector2.y +
vector1.z * vector2.z);
vector1.y * vector2.y +