diff --git a/ChangeLog b/ChangeLog index b0264ef660..803e52767e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2003-09-28 DindinX + + * libgimpmath/gimpmatrix.[ch]: + * libgimpmath/gimpmd5.[ch]: + * libgimpmath/gimpvector.[ch]: + * libgimpmath/test-md5.c: Removed tabs and trailing whitespaces. + 2003-09-28 Michael Natterer * app/core/gimpimage.c (gimp_image_transform_temp_buf): use a much diff --git a/devel-docs/libgimpmath/tmpl/gimpvector.sgml b/devel-docs/libgimpmath/tmpl/gimpvector.sgml index 0d9f103b1f..7b1b4056a4 100644 --- a/devel-docs/libgimpmath/tmpl/gimpvector.sgml +++ b/devel-docs/libgimpmath/tmpl/gimpvector.sgml @@ -169,16 +169,6 @@ Utilities to set up and manipulate vectors. @y: - - - - - -@x: -@y: -@Returns: - - diff --git a/libgimpmath/gimpmatrix.c b/libgimpmath/gimpmatrix.c index 6d4eb23996..a088a01322 100644 --- a/libgimpmath/gimpmatrix.c +++ b/libgimpmath/gimpmatrix.c @@ -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); diff --git a/libgimpmath/gimpmatrix.h b/libgimpmath/gimpmatrix.h index 0b9960a1b6..161a6d3ad0 100644 --- a/libgimpmath/gimpmatrix.h +++ b/libgimpmath/gimpmatrix.h @@ -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 diff --git a/libgimpmath/gimpmd5.c b/libgimpmath/gimpmd5.c index e119d0de9e..81bd9838c5 100644 --- a/libgimpmath/gimpmd5.c +++ b/libgimpmath/gimpmd5.c @@ -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<>(32-s), w += x ) + ( w += f(x, y, z) + data, w = 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; diff --git a/libgimpmath/gimpmd5.h b/libgimpmath/gimpmd5.h index 42ca59511a..43ef781b60 100644 --- a/libgimpmath/gimpmd5.h +++ b/libgimpmath/gimpmd5.h @@ -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]); diff --git a/libgimpmath/gimpvector.c b/libgimpmath/gimpvector.c index f829c53558..c9b34faf83 100644 --- a/libgimpmath/gimpvector.c +++ b/libgimpmath/gimpvector.c @@ -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 + + vector1.z * vector2.z); } /** @@ -505,12 +505,12 @@ gimp_vector3_inner_product_val (GimpVector3 vector1, * * This function can be used to compute the normal of the plan defined by * @vector1 and @vector2. - * + * * Returns: The cross product. **/ GimpVector3 gimp_vector3_cross_product (const GimpVector3 *vector1, - const GimpVector3 *vector2) + const GimpVector3 *vector2) { GimpVector3 normal; @@ -534,7 +534,7 @@ gimp_vector3_cross_product (const GimpVector3 *vector1, **/ GimpVector3 gimp_vector3_cross_product_val (GimpVector3 vector1, - GimpVector3 vector2) + GimpVector3 vector2) { GimpVector3 normal; @@ -557,8 +557,8 @@ gdouble gimp_vector3_length (const GimpVector3 *vector) { return (sqrt (vector->x * vector->x + - vector->y * vector->y + - vector->z * vector->z)); + vector->y * vector->y + + vector->z * vector->z)); } /** @@ -573,8 +573,8 @@ gdouble gimp_vector3_length_val (GimpVector3 vector) { return (sqrt (vector.x * vector.x + - vector.y * vector.y + - vector.z * vector.z)); + vector.y * vector.y + + vector.z * vector.z)); } /** @@ -608,7 +608,7 @@ gimp_vector3_normalize (GimpVector3 *vector) * gimp_vector3_normalize_val: * * @vector: a #GimpVector3 (by value) - * + * * Computes and returns the normalized vector corresponding with the one * passed in argument. * @@ -643,12 +643,12 @@ gimp_vector3_normalize_val (GimpVector3 vector) * @factor: a scalar * * Multiplies each component of the @vector by @factor. - * Note that this is equivalent to multiplied the length of @vector + * Note that this is equivalent to multiplied the length of @vector * by @factor. **/ void gimp_vector3_mul (GimpVector3 *vector, - gdouble factor) + gdouble factor) { vector->x *= factor; vector->y *= factor; @@ -665,12 +665,12 @@ gimp_vector3_mul (GimpVector3 *vector, * * Returns: the resulting #GimpVector3. **/ -GimpVector3 +GimpVector3 gimp_vector3_mul_val (GimpVector3 vector, - gdouble factor) + gdouble factor) { GimpVector3 result; - + result.x = vector.x * factor; result.y = vector.y * factor; result.z = vector.z * factor; @@ -689,8 +689,8 @@ gimp_vector3_mul_val (GimpVector3 vector, **/ void gimp_vector3_sub (GimpVector3 *result, - const GimpVector3 *vector1, - const GimpVector3 *vector2) + const GimpVector3 *vector1, + const GimpVector3 *vector2) { result->x = vector1->x - vector2->x; result->y = vector1->y - vector2->y; @@ -707,9 +707,9 @@ gimp_vector3_sub (GimpVector3 *result, * * Returns: the resulting #GimpVector3. **/ -GimpVector3 +GimpVector3 gimp_vector3_sub_val (GimpVector3 vector1, - GimpVector3 vector2) + GimpVector3 vector2) { GimpVector3 result; @@ -731,9 +731,9 @@ gimp_vector3_sub_val (GimpVector3 vector1, **/ void gimp_vector3_set (GimpVector3 *vector, - gdouble x, - gdouble y, - gdouble z) + gdouble x, + gdouble y, + gdouble z) { vector->x = x; vector->y = y; @@ -750,10 +750,10 @@ gimp_vector3_set (GimpVector3 *vector, * * Returns: the resulting GimpVector3. **/ -GimpVector3 +GimpVector3 gimp_vector3_new (gdouble x, - gdouble y, - gdouble z) + gdouble y, + gdouble z) { GimpVector3 vector; @@ -775,8 +775,8 @@ gimp_vector3_new (gdouble x, **/ void gimp_vector3_add (GimpVector3 *result, - const GimpVector3 *vector1, - const GimpVector3 *vector2) + const GimpVector3 *vector1, + const GimpVector3 *vector2) { result->x = vector1->x + vector2->x; result->y = vector1->y + vector2->y; @@ -793,16 +793,16 @@ gimp_vector3_add (GimpVector3 *result, * * Returns: the resulting #GimpVector3. **/ -GimpVector3 +GimpVector3 gimp_vector3_add_val (GimpVector3 vector1, - GimpVector3 vector2) + GimpVector3 vector2) { GimpVector3 result; result.x = vector1.x + vector2.x; result.y = vector1.y + vector2.y; result.z = vector1.z + vector2.z; - + return result; } @@ -810,7 +810,7 @@ gimp_vector3_add_val (GimpVector3 vector1, * gimp_vector3_neg: * @vector: a #GimpVector3 (by address) * - * Negates the @vector (i.e. negate all its coordinates). + * Negates the @vector (i.e. negate all its coordinates). **/ void gimp_vector3_neg (GimpVector3 *vector) @@ -828,7 +828,7 @@ gimp_vector3_neg (GimpVector3 *vector) * * Returns: the negated vector. **/ -GimpVector3 +GimpVector3 gimp_vector3_neg_val (GimpVector3 vector) { GimpVector3 result; @@ -836,7 +836,7 @@ gimp_vector3_neg_val (GimpVector3 vector) result.x = vector.x * -1.0; result.y = vector.y * -1.0; result.z = vector.z * -1.0; - + return result; } @@ -857,9 +857,9 @@ gimp_vector3_neg_val (GimpVector3 vector) **/ void gimp_vector3_rotate (GimpVector3 *vector, - gdouble alpha, - gdouble beta, - gdouble gamma) + gdouble alpha, + gdouble beta, + gdouble gamma) { GimpVector3 s, t; @@ -902,11 +902,11 @@ gimp_vector3_rotate (GimpVector3 *vector, * * Returns: the rotated vector. **/ -GimpVector3 +GimpVector3 gimp_vector3_rotate_val (GimpVector3 vector, - gdouble alpha, - gdouble beta, - gdouble gamma) + gdouble alpha, + gdouble beta, + gdouble gamma) { GimpVector3 s, t, result; @@ -943,25 +943,25 @@ gimp_vector3_rotate_val (GimpVector3 vector, * @y: the ordinate of the point in the screen rectangle to map. * @vp: position of the observer (by address). * @p: the resulting point (by address). - * + * * \"Compute screen (sx,sy)-(sx+w,sy+h) to 3D unit square mapping. * The plane to map to is given in the z field of p. The observer * is located at position vp (vp->z!=0.0).\" * * In other words, this computes the projection of the point (@x ,@y) to * the plane z = @p->z (parallel to XY), from the @vp point of view through - * the screen (@sx, @sy)->(@sx+@w, @sy+@h) + * the screen (@sx, @sy)->(@sx+@w, @sy+@h) **/ void gimp_vector_2d_to_3d (gint sx, - gint sy, - gint w, - gint h, - gint x, - gint y, - const GimpVector3 *vp, - GimpVector3 *p) + gint sy, + gint w, + gint h, + gint x, + gint y, + const GimpVector3 *vp, + GimpVector3 *p) { gdouble t = 0.0; @@ -976,7 +976,7 @@ gimp_vector_2d_to_3d (gint sx, else { p->x = (gdouble) (x - sx) / (gdouble) w; - p->y = (gdouble) (y - sy) / (gdouble) h; + p->y = (gdouble) (y - sy) / (gdouble) h; } } @@ -997,17 +997,17 @@ gimp_vector_2d_to_3d (gint sx, * * Returns: the computed #GimpVector3 point. **/ -GimpVector3 +GimpVector3 gimp_vector_2d_to_3d_val (gint sx, - gint sy, - gint w, - gint h, - gint x, - gint y, - GimpVector3 vp, - GimpVector3 p) + gint sy, + gint w, + gint h, + gint x, + gint y, + GimpVector3 vp, + GimpVector3 p) { - GimpVector3 result; + GimpVector3 result; gdouble t = 0.0; if (vp.x != 0.0) @@ -1021,9 +1021,9 @@ gimp_vector_2d_to_3d_val (gint sx, else { result.x = (gdouble) (x - sx) / (gdouble) w; - result.y = (gdouble) (y - sy) / (gdouble) h; + result.y = (gdouble) (y - sy) / (gdouble) h; } - + return result; } @@ -1047,13 +1047,13 @@ gimp_vector_2d_to_3d_val (gint sx, **/ void gimp_vector_3d_to_2d (gint sx, - gint sy, - gint w, - gint h, - gdouble *x, - gdouble *y, - const GimpVector3 *vp, - const GimpVector3 *p) + gint sy, + gint w, + gint h, + gdouble *x, + gdouble *y, + const GimpVector3 *vp, + const GimpVector3 *p) { gdouble t; GimpVector3 dir; diff --git a/libgimpmath/gimpvector.h b/libgimpmath/gimpvector.h index 1cb3b192c1..b2c6c645a2 100644 --- a/libgimpmath/gimpvector.h +++ b/libgimpmath/gimpvector.h @@ -49,111 +49,111 @@ struct _GimpVector4 /* Two dimensional vector functions */ /* ================================ */ -gdouble gimp_vector2_inner_product (const GimpVector2 *vector1, - const GimpVector2 *vector2); +gdouble gimp_vector2_inner_product (const GimpVector2 *vector1, + const GimpVector2 *vector2); gdouble gimp_vector2_inner_product_val (GimpVector2 vector1, - GimpVector2 vector2); -GimpVector2 gimp_vector2_cross_product (const GimpVector2 *vector1, - const GimpVector2 *vector2); + GimpVector2 vector2); +GimpVector2 gimp_vector2_cross_product (const GimpVector2 *vector1, + const GimpVector2 *vector2); GimpVector2 gimp_vector2_cross_product_val (GimpVector2 vector1, - GimpVector2 vector2); -gdouble gimp_vector2_length (const GimpVector2 *vector); -gdouble gimp_vector2_length_val (GimpVector2 vector); -void gimp_vector2_normalize (GimpVector2 *vector); -GimpVector2 gimp_vector2_normalize_val (GimpVector2 vector); -void gimp_vector2_mul (GimpVector2 *vector, - gdouble factor); -GimpVector2 gimp_vector2_mul_val (GimpVector2 vector, - gdouble factor); -void gimp_vector2_sub (GimpVector2 *result, - const GimpVector2 *vector1, - const GimpVector2 *vector2); -GimpVector2 gimp_vector2_sub_val (GimpVector2 vector1, - GimpVector2 vector2); -void gimp_vector2_set (GimpVector2 *vector, - gdouble x, - gdouble y); -GimpVector2 gimp_vector2_new (gdouble x, - gdouble y); -void gimp_vector2_add (GimpVector2 *result, - const GimpVector2 *vector1, - const GimpVector2 *vector2); -GimpVector2 gimp_vector2_add_val (GimpVector2 vector1, - GimpVector2 vector2); -void gimp_vector2_neg (GimpVector2 *vector); -GimpVector2 gimp_vector2_neg_val (GimpVector2 vector); -void gimp_vector2_rotate (GimpVector2 *vector, - gdouble alpha); -GimpVector2 gimp_vector2_rotate_val (GimpVector2 vector, - gdouble alpha); + GimpVector2 vector2); +gdouble gimp_vector2_length (const GimpVector2 *vector); +gdouble gimp_vector2_length_val (GimpVector2 vector); +void gimp_vector2_normalize (GimpVector2 *vector); +GimpVector2 gimp_vector2_normalize_val (GimpVector2 vector); +void gimp_vector2_mul (GimpVector2 *vector, + gdouble factor); +GimpVector2 gimp_vector2_mul_val (GimpVector2 vector, + gdouble factor); +void gimp_vector2_sub (GimpVector2 *result, + const GimpVector2 *vector1, + const GimpVector2 *vector2); +GimpVector2 gimp_vector2_sub_val (GimpVector2 vector1, + GimpVector2 vector2); +void gimp_vector2_set (GimpVector2 *vector, + gdouble x, + gdouble y); +GimpVector2 gimp_vector2_new (gdouble x, + gdouble y); +void gimp_vector2_add (GimpVector2 *result, + const GimpVector2 *vector1, + const GimpVector2 *vector2); +GimpVector2 gimp_vector2_add_val (GimpVector2 vector1, + GimpVector2 vector2); +void gimp_vector2_neg (GimpVector2 *vector); +GimpVector2 gimp_vector2_neg_val (GimpVector2 vector); +void gimp_vector2_rotate (GimpVector2 *vector, + gdouble alpha); +GimpVector2 gimp_vector2_rotate_val (GimpVector2 vector, + gdouble alpha); /* Three dimensional vector functions */ /* ================================== */ -gdouble gimp_vector3_inner_product (const GimpVector3 *vector1, - const GimpVector3 *vector2); +gdouble gimp_vector3_inner_product (const GimpVector3 *vector1, + const GimpVector3 *vector2); gdouble gimp_vector3_inner_product_val (GimpVector3 vector1, - GimpVector3 vector2); + GimpVector3 vector2); GimpVector3 gimp_vector3_cross_product (const GimpVector3 *vector1, - const GimpVector3 *vector2); + const GimpVector3 *vector2); GimpVector3 gimp_vector3_cross_product_val (GimpVector3 vector1, - GimpVector3 vector2); -gdouble gimp_vector3_length (const GimpVector3 *vector); + GimpVector3 vector2); +gdouble gimp_vector3_length (const GimpVector3 *vector); gdouble gimp_vector3_length_val (GimpVector3 vector); -void gimp_vector3_normalize (GimpVector3 *vector); -GimpVector3 gimp_vector3_normalize_val (GimpVector3 vector); -void gimp_vector3_mul (GimpVector3 *vector, - gdouble factor); -GimpVector3 gimp_vector3_mul_val (GimpVector3 vector, - gdouble factor); -void gimp_vector3_sub (GimpVector3 *result, - const GimpVector3 *vector1, - const GimpVector3 *vector2); -GimpVector3 gimp_vector3_sub_val (GimpVector3 vector1, - GimpVector3 vector2); -void gimp_vector3_set (GimpVector3 *vector, - gdouble x, - gdouble y, - gdouble z); -GimpVector3 gimp_vector3_new (gdouble x, - gdouble y, - gdouble z); -void gimp_vector3_add (GimpVector3 *result, - const GimpVector3 *vector1, - const GimpVector3 *vector2); -GimpVector3 gimp_vector3_add_val (GimpVector3 vector1, - GimpVector3 vector2); -void gimp_vector3_neg (GimpVector3 *vector); -GimpVector3 gimp_vector3_neg_val (GimpVector3 vector); -void gimp_vector3_rotate (GimpVector3 *vector, - gdouble alpha, - gdouble beta, - gdouble gamma); -GimpVector3 gimp_vector3_rotate_val (GimpVector3 vector, - gdouble alpha, - gdouble beta, - gdouble gamma); +void gimp_vector3_normalize (GimpVector3 *vector); +GimpVector3 gimp_vector3_normalize_val (GimpVector3 vector); +void gimp_vector3_mul (GimpVector3 *vector, + gdouble factor); +GimpVector3 gimp_vector3_mul_val (GimpVector3 vector, + gdouble factor); +void gimp_vector3_sub (GimpVector3 *result, + const GimpVector3 *vector1, + const GimpVector3 *vector2); +GimpVector3 gimp_vector3_sub_val (GimpVector3 vector1, + GimpVector3 vector2); +void gimp_vector3_set (GimpVector3 *vector, + gdouble x, + gdouble y, + gdouble z); +GimpVector3 gimp_vector3_new (gdouble x, + gdouble y, + gdouble z); +void gimp_vector3_add (GimpVector3 *result, + const GimpVector3 *vector1, + const GimpVector3 *vector2); +GimpVector3 gimp_vector3_add_val (GimpVector3 vector1, + GimpVector3 vector2); +void gimp_vector3_neg (GimpVector3 *vector); +GimpVector3 gimp_vector3_neg_val (GimpVector3 vector); +void gimp_vector3_rotate (GimpVector3 *vector, + gdouble alpha, + gdouble beta, + gdouble gamma); +GimpVector3 gimp_vector3_rotate_val (GimpVector3 vector, + gdouble alpha, + gdouble beta, + gdouble gamma); /* 2d <-> 3d Vector projection functions */ /* ===================================== */ -void gimp_vector_2d_to_3d (gint sx, - gint sy, - gint w, - gint h, - gint x, - gint y, - const GimpVector3 *vp, - GimpVector3 *p); +void gimp_vector_2d_to_3d (gint sx, + gint sy, + gint w, + gint h, + gint x, + gint y, + const GimpVector3 *vp, + GimpVector3 *p); -GimpVector3 gimp_vector_2d_to_3d_val (gint sx, - gint sy, - gint w, - gint h, - gint x, - gint y, - GimpVector3 vp, - GimpVector3 p); +GimpVector3 gimp_vector_2d_to_3d_val (gint sx, + gint sy, + gint w, + gint h, + gint x, + gint y, + GimpVector3 vp, + GimpVector3 p); void gimp_vector_3d_to_2d (gint sx, gint sy, diff --git a/libgimpmath/test-md5.c b/libgimpmath/test-md5.c index 1841c4c2de..4582c8f668 100644 --- a/libgimpmath/test-md5.c +++ b/libgimpmath/test-md5.c @@ -9,7 +9,7 @@ #include "gimpmd5.h" -static const gchar * test[7][2] = +static const gchar * test[7][2] = { { "", "d41d8cd98f00b204e9800998ecf8427e" }, { "a", "0cc175b9c0f1b6a831c399e269772661" }, @@ -38,7 +38,7 @@ main (void) for (j = 0; j < 16; j++) { guchar buf[4]; - + g_snprintf (buf, 3, "%02x", digest[j]); g_print (buf); if (strncmp (buf, test[i][1] + j*2, 2)) @@ -48,12 +48,12 @@ main (void) if (!correct) { - g_print + g_print ("\nWRONG digest!! Please report to http://bugzilla.gnome.org/\n"); return 1; } } - + g_print ("\nLooks good.\n\n"); return 0; } diff --git a/po/Makefile.in.in b/po/Makefile.in.in index 2befb1a04e..6d2cd50a69 100644 --- a/po/Makefile.in.in +++ b/po/Makefile.in.in @@ -75,7 +75,7 @@ INSTOBJEXT = @INSTOBJEXT@ .po.pox: $(MAKE) $(GETTEXT_PACKAGE).pot - $(MSGMERGE) $< $(srcdir)/$(GETTEXT_PACKAGE).pot -o $*.pox + $(MSGMERGE) $< $(srcdir)/$(GETTEXT_PACKAGE).pot -o $*pox .po.mo: $(MSGFMT) -o $@ $< @@ -179,6 +179,7 @@ dvi info tags TAGS ID: mostlyclean: rm -f core core.* *.pox $(GETTEXT_PACKAGE).po *.old.po cat-id-tbl.tmp rm -fr *.o + rm -f .intltool-merge-cache clean: mostlyclean @@ -207,7 +208,7 @@ update-po: Makefile cat=`basename $$cat`; \ lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ echo "$$lang:"; \ - if $(MSGMERGE) $$lang.po $(GETTEXT_PACKAGE).pot -o $$tmpdir/$$lang.new.po; then \ + if $$tmpdir/$(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist -o $$tmpdir/$$lang.new.po $$lang; then \ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ @@ -225,19 +226,6 @@ update-po: Makefile fi; \ done -.po: Makefile - $(MAKE) $(PACKAGE).pot; - PATH=`pwd`/../src:$$PATH; \ - echo; printf "$*: "; \ - if $(MSGMERGE) $*; then \ - rm -f $*.old.po; \ - else \ - echo "msgmerge for * failed!"; \ - mv $*.old.po $*.po; \ - fi; \ - msgfmt --statistics $*.po; echo; - - # POTFILES is created from POTFILES.in by stripping comments, empty lines # and Intltool tags (enclosed in square brackets), and appending a full # relative path to them